Initial TrueGrowth source import
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
# Change: Add Prompt History Tool
|
||||
|
||||
## Why
|
||||
Users need a local way to manage prompts across generated tasks, including the original prompt, the prompt sent to generation, and a quick result preview.
|
||||
|
||||
## What Changes
|
||||
- Add a built-in toolbox tool named "提示词历史".
|
||||
- Derive prompt history from existing task records instead of creating a separate history entity.
|
||||
- Store lightweight prompt lineage metadata on newly created generation tasks.
|
||||
- Extend reusable prompt list items to show title, sent prompt, tags, and result preview on hover.
|
||||
|
||||
## Impact
|
||||
- Affected specs: `toolbox`, `prompt-history`
|
||||
- Affected code: toolbox built-in registry, task summary reader, prompt history aggregation service, prompt list UI, AI input workflow task metadata.
|
||||
@@ -0,0 +1,27 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Prompt Lineage History
|
||||
The system SHALL derive prompt history records from task queue data and connect initial prompt, sent prompt, tags, and generated result preview.
|
||||
|
||||
#### Scenario: New task has prompt metadata
|
||||
- **WHEN** a generation task is created from AI input
|
||||
- **THEN** the task stores lightweight prompt metadata with initial prompt, sent prompt, category, and optional Skill identifiers
|
||||
|
||||
#### Scenario: Old task has no prompt metadata
|
||||
- **WHEN** an older task is shown in prompt history
|
||||
- **THEN** the initial prompt falls back to `sourcePrompt`, then `rawInput`, then `prompt`
|
||||
- **AND** the sent prompt falls back to `prompt`
|
||||
|
||||
### Requirement: Prompt History Filtering
|
||||
The prompt history tool SHALL support filtering by image, video, audio, text, and Agent categories, with optional Skill tag filtering.
|
||||
|
||||
#### Scenario: User filters prompt records
|
||||
- **WHEN** the user selects a category, Skill tag, or search query
|
||||
- **THEN** the tool shows only matching prompt history records in reverse chronological order
|
||||
|
||||
### Requirement: Prompt Hover Details
|
||||
Prompt list items SHALL optionally show prompt titles in the list while keeping sent prompt as the selectable content.
|
||||
|
||||
#### Scenario: User hovers a prompt history item
|
||||
- **WHEN** the prompt history item has sent prompt, tags, or result preview data
|
||||
- **THEN** the hover tip shows the sent prompt, tags, and a lightweight result preview
|
||||
@@ -0,0 +1,17 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Prompt History Toolbox Tool
|
||||
The system SHALL provide a built-in toolbox tool named "提示词历史" that opens as an internal React tool.
|
||||
|
||||
#### Scenario: User opens prompt history from toolbox
|
||||
- **WHEN** the user opens the toolbox
|
||||
- **THEN** the "提示词历史" tool is available as a content tool
|
||||
- **AND** opening it shows local prompt history records derived from generation tasks
|
||||
|
||||
### Requirement: Prompt History Tool Uses Lightweight Records
|
||||
The prompt history tool SHALL read only lightweight task summaries for list rendering and result previews.
|
||||
|
||||
#### Scenario: Large media tasks exist
|
||||
- **WHEN** prompt history records are loaded
|
||||
- **THEN** the list data excludes large uploaded media, analysis payloads, tool call arrays, and full generated media blobs
|
||||
- **AND** media previews reference existing URLs or thumbnails
|
||||
@@ -0,0 +1,11 @@
|
||||
## 1. Implementation
|
||||
- [x] 1.1 Add prompt lineage metadata to task parameters.
|
||||
- [x] 1.2 Add lightweight task summary reading for prompt history.
|
||||
- [x] 1.3 Add prompt history aggregation and preview mapping.
|
||||
- [x] 1.4 Add built-in toolbox prompt history tool.
|
||||
- [x] 1.5 Extend prompt list hover details without changing existing select behavior.
|
||||
- [x] 1.6 Propagate prompt lineage metadata from AI input workflow steps.
|
||||
|
||||
## 2. Verification
|
||||
- [x] 2.1 Add focused unit tests for title/category/preview compatibility.
|
||||
- [x] 2.2 Run targeted tests and type checks.
|
||||
Reference in New Issue
Block a user