feat(cli-executor): add streaming option and enhance output handling

- Introduced a `stream` parameter to control output streaming vs. caching.
- Enhanced status determination logic to prioritize valid output over exit codes.
- Updated output structure to include full stdout and stderr when not streaming.

feat(cli-history-store): extend conversation turn schema and migration

- Added `cached`, `stdout_full`, and `stderr_full` fields to the conversation turn schema.
- Implemented database migration to add new columns if they do not exist.
- Updated upsert logic to handle new fields.

feat(codex-lens): implement global symbol index for fast lookups

- Created `GlobalSymbolIndex` class to manage project-wide symbol indexing.
- Added methods for adding, updating, and deleting symbols in the global index.
- Integrated global index updates into directory indexing processes.

feat(codex-lens): optimize search functionality with global index

- Enhanced `ChainSearchEngine` to utilize the global symbol index for faster searches.
- Added configuration option to enable/disable global symbol indexing.
- Updated tests to validate global index functionality and performance.
This commit is contained in:
catlog22
2025-12-25 22:22:31 +08:00
parent 673e1d117a
commit 3b842ed290
13 changed files with 1032 additions and 37 deletions

View File

@@ -65,13 +65,13 @@ RULES: $(cat ~/.claude/workflows/cli-templates/protocols/[mode]-protocol.md) $(c
ccw cli -p "<PROMPT>" --tool <gemini|qwen|codex> --mode <analysis|write>
```
**⚠️ CRITICAL**: `--mode` parameter is **MANDATORY** for all CLI executions. No defaults are assumed.
**Note**: `--mode` defaults to `analysis` if not specified. Explicitly specify `--mode write` for file operations.
### Core Principles
- **Use tools early and often** - Tools are faster and more thorough
- **Unified CLI** - Always use `ccw cli -p` for consistent parameter handling
- **Mode is MANDATORY** - ALWAYS explicitly specify `--mode analysis|write` (no implicit defaults)
- **Default mode is analysis** - Omit `--mode` for read-only operations, explicitly use `--mode write` for file modifications
- **One template required** - ALWAYS reference exactly ONE template in RULES (use universal fallback if no specific match)
- **Write protection** - Require EXPLICIT `--mode write` for file operations
- **Use double quotes for shell expansion** - Always wrap prompts in double quotes `"..."` to enable `$(cat ...)` command substitution; NEVER use single quotes or escape characters (`\$`, `\"`, `\'`)
@@ -183,6 +183,33 @@ ASSISTANT RESPONSE: [Previous output]
**Tool Behavior**: Codex uses native `codex resume`; Gemini/Qwen assembles context as single prompt
### Streaming vs Caching
**Default behavior**: Non-streaming with full output caching (can retrieve later via `output` subcommand)
```bash
ccw cli -p "..." --tool gemini # Default: output cached, no streaming
ccw cli -p "..." --tool gemini --stream # Streaming: real-time output, no caching
```
| Mode | Flag | Output | Cached |
|------|------|--------|--------|
| Non-streaming (default) | (none) | After completion | ✅ Yes |
| Streaming | `--stream` | Real-time | ❌ No |
### Output Viewing
View cached execution output with pagination:
```bash
ccw cli output <execution-id> # View full output
ccw cli output <id> --offset 0 --limit 10000 # Paginated view
ccw cli output <id> --output-type stdout # Stdout only
ccw cli output <id> --raw # Raw content (for piping)
```
**Note**: `output` subcommand views execution results. `--cache` parameter injects context into prompt - different concepts.
---
## Prompt Template