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 -3
View File
@@ -439,10 +439,17 @@ src/openai/responses.js — sendOpenAIResponse(client, params) API call wra
Configured via `CHATGPT_MCP_PROVIDER` env var (defaults to `"openai"`):
```env
CHATGPT_MCP_PROVIDER=openai # current default; accepts any string but factory validates at runtime
CHATGPT_MCP_PROVIDER=openai # or "manual" for copy-paste workflow
```
The factory whitelists `"openai"`. Any unrecognized value throws at provider creation time (not config load time). Null/NaN/falsy values default to `"openai"` for safe fallback.
Supported provider values:
| Value | Description | Requires API key? |
| -------- | -------------------------------------------------------------- | ----------------- |
| `openai` | Default — calls ChatGPT via OpenAI API | Yes |
| `manual` | Copy-paste — wraps prompts in a ready-to-copy format | No |
The factory whitelists `"openai"` and `"manual"`. Any unrecognized value throws at provider creation time (not config load time). Null/NaN/falsy values default to `"openai"` for safe fallback.
### OpenAI-specific Environment Variables
@@ -453,7 +460,7 @@ OPENAI_TEMPERATURE=0.2
OPENAI_MAX_OUTPUT_TOKENS=2000
```
The provider pattern makes it straightforward to add other providers (Ollama, Anthropic) — implement the `send(input, config)` interface and register it in the factory's whitelist.
The provider pattern makes it straightforward to add other providers (Ollama, Anthropic, custom) — implement the `send(request, config)` interface and register it in the factory's whitelist.
---