feat: add manual export provider and ReviewRequest pattern

Implement Task 8.0 — Manual Export Provider with full provider abstraction:

Source files:
- src/providers/manual-export.js (104 lines) — new provider that wraps
  pre-built prompts in copy-ready format for ChatGPT Web/Business use
- src/providers/factory.js — register 'manual' provider in whitelist
- src/providers/openai.js — update JSDoc for ProviderRequest parameter

All 5 handlers updated with ReviewRequest pattern:
- src/tools/ask-chatgpt.js
- src/tools/debug-issue.js
- src/tools/review-code.js
- src/tools/review-plan.js
- src/tools/architecture-review.js
Each handler now packages shared data as { prompt, input } between step 5
and 6 of the orchestration flow.

Tests:
- test/providers/manual-export.test.js (56 tests) — covers structure,
  copy-ready box formatting, tool name detection, long prompts, Unicode,
  edge cases, provider contract compliance, idempotency
- test/providers/factory.test.js (+9 tests) — manual provider whitelist,
  factory routing, send delegation

Docs:
- ARCHITECTURE.md — provider selection table with openai/manual values
- README.md — provider comparison table and manual workflow description
This commit is contained in:
2026-06-15 10:35:45 +01:00
parent 732d6edd38
commit f38b988a8f
12 changed files with 736 additions and 17 deletions
+10 -1
View File
@@ -61,7 +61,16 @@ OpenAI Provider → OpenAI Responses API
Advisory Response
```
The provider layer is configurable via `CHATGPT_MCP_PROVIDER` env var. Currently only `"openai"` is supported, but the factory pattern enables future providers without touching tool handlers.
The provider layer is configurable via `CHATGPT_MCP_PROVIDER` env var. Two providers are available:
| Value | Description | Use case |
| -------- | -------------------------------------------------------------- | ------------------------------------------- |
| `openai` | Default — calls ChatGPT via OpenAI API | Automated second-opinion queries |
| `manual` | Copy-paste — wraps prompts in a ready-to-copy format | Manual ChatGPT Web/Business as advisor |
For the **manual** provider, set `CHATGPT_MCP_PROVIDER=manual`. Each tool call returns a copy-ready prompt block you can paste into ChatGPT Web or ChatGPT Business. This turns Claude Code into an orchestrator: it builds the perfect prompt and formats it for you to hand off to ChatGPT as a second-opinion advisor — all without API calls, quotas, or cost.
The factory pattern enables future providers (Ollama, Anthropic, custom) without touching tool handlers.
All responses are advisory only.