Skip to content

Releases: lyy0709/ContextWeaver

v1.0.6

09 Feb 06:24

Choose a tag to compare

What's Changed

Prompt Enhancer: Ghostwriter Style Rewrite

Replaced the planning-oriented prompt enhancement template with a ghostwriter/optimizer approach:

  • Before: Enhanced prompts would expand into detailed task plans with acceptance criteria, step breakdowns, and boundary conditions
  • After: Enhanced prompts stay concise — disambiguates wording, leverages conversation history and codebase context to fill in concrete references, without inventing new requirements

Key changes

  • Bilingual templates (EN/ZH) auto-selected by detected input language
  • System prompt identity changed from "enhancement assistant" to "prompt ghostwriter and optimizer"
  • First-person voice ("I") for rewritten prompts
  • Removed {{language_instruction}} placeholder (language is now determined by template selection)

Full Changelog: v1.0.5...v1.0.6

v1.0.5

08 Feb 22:14

Choose a tag to compare

Prompt Enhancer Hardening & Optimization

New Features

  • Retry with backoff: All LLM adapters now have timeout (90s), exponential backoff retry for 429/5xx errors
  • Configurable Web UI timeout: PROMPT_ENHANCER_WEBUI_TIMEOUT_MS env var (default 8min, clamped 30s–60min)
  • Smart technical terms extraction: Heuristic extraction of identifiers/paths from prompt for better codebase retrieval

Improvements

  • Strict parser fallback: Returns original prompt instead of raw LLM output on parse failure
  • Markdown fence stripping: Handles models that wrap output in ```xml fences
  • Stronger system prompt: Format-locked with <cw-end/> sentinel stop sequences across all endpoints
  • Lower temperature: 0.7 → 0.3 for more deterministic output
  • Conditional template blocks: Empty conversation_history/codebase_context sections are fully omitted (saves tokens)
  • Context budget: Retrieval budget tightened from 48k to 12k chars for enhancer use case
  • Config DRY: Default endpoint URLs/models consolidated into single ENHANCER_DEFAULTS constant
  • Robust error parsing: Adapters handle non-JSON error responses gracefully
  • Response body cleanup: Socket resources released before retry

Testing

  • 101 tests passing (up from 75)
  • New test suites: fetchWithRetry, extractTechnicalTerms, expanded parser/template/ui tests

v1.0.4

08 Feb 20:54

Choose a tag to compare

What's Changed

MCP enhance-prompt Web UI 模式

  • 新增 webui 参数:MCP enhance-prompt 工具新增可选布尔参数 webui(默认 true
    • webui=true(默认):自动打开浏览器 Web UI,用户可交互式审阅、编辑、重新增强 prompt 后返回结果
    • webui=false:保持原有行为,直接通过 API 返回增强结果
  • 完整上下文透传startEnhanceServer() 现在正确传递 conversationHistoryprojectRootPath 到 LLM 调用

Full Changelog: v1.0.3...v1.0.4

v1.0.3

08 Feb 20:31

Choose a tag to compare

What's New

Prompt Enhancer Web UI

  • 黑白配色 — 全新纯黑白色系设计
  • 中文界面 — 所有 UI 文本改为中文
  • 8 分钟倒计时 — 可视化倒计时,超时自动采用增强版结果
  • 响应式布局优化 — flex 弹性 textarea,适配各种屏幕尺寸

Bug Fixes

  • 修复 DTS 构建报错(src/mcp/main.ts 缺少 export {}

Docs

  • 新增 README.en.md 英文文档
  • README 添加 Prompt Enhancer Web UI 截图

Install

npm install -g @lyy0709/contextweaver

Full Changelog: v1.0.0...v1.0.3

v1.0.0 — Prompt Enhancer

08 Feb 19:11

Choose a tag to compare

🚀 ContextWeaver v1.0.0 — Prompt Enhancer

基于 hsingjui/ContextWeaver 的增强版本,新增 Prompt Enhancer(提示词增强) 功能。

✨ 新增功能

Prompt Enhancer — 多 LLM 提示词增强

  • MCP 工具 enhance-prompt:AI 助手可直接调用,增强用户提示词
  • CLI 命令 cw enhance "prompt":支持 --no-browser 直接输出模式
  • Web UI 交互:本地浏览器编辑界面,支持重新增强、使用原始文本、手动编辑
  • 多 API 端点:支持 OpenAI / Claude / Gemini,通过环境变量一键切换
  • 自动语言检测:中文输入自动用中文回复
  • 可自定义模板:支持自定义增强提示词模板

📦 安装

# npm
npm install -g @lyy0709/contextweaver

# pnpm
pnpm add -g @lyy0709/contextweaver

⚙️ 配置 Prompt Enhancer

编辑 ~/.contextweaver/.env,添加:

PROMPT_ENHANCER_ENDPOINT=openai        # openai / claude / gemini
PROMPT_ENHANCER_TOKEN=your-api-key     # 必填
# PROMPT_ENHANCER_MODEL=               # 可选,覆盖默认模型

🧪 测试

新增 Vitest 测试框架,79 个单元测试覆盖所有 enhancer 模块。

pnpm test     # 运行测试

📝 完整变更

  • 新增 src/enhancer/ 模块(11 个文件)
  • 新增 src/mcp/tools/enhancePrompt.ts MCP 工具
  • 更新 src/config.ts 增加 EnhancerConfig
  • 更新 src/index.ts 增加 enhance CLI 命令
  • 更新 src/mcp/server.ts 注册 enhance-prompt 工具
  • 新增 tests/ 目录(10 个测试文件,79 个用例)
  • 新增 vitest.config.ts