agentic-flow 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -12
- package/dist/agents/claudeAgent.js +96 -67
- package/dist/cli/claude-code-wrapper.js +23 -1
- package/dist/cli-proxy.js +71 -5
- package/dist/mcp/standalone-stdio.js +251 -2
- package/dist/proxy/anthropic-to-requesty.js +707 -0
- package/dist/utils/cli.js +6 -0
- package/dist/utils/modelCapabilities.js +22 -0
- package/docs/plans/agent-booster/00-INDEX.md +230 -0
- package/docs/plans/agent-booster/00-OVERVIEW.md +454 -0
- package/docs/plans/agent-booster/01-ARCHITECTURE.md +699 -0
- package/docs/plans/agent-booster/02-INTEGRATION.md +771 -0
- package/docs/plans/agent-booster/03-BENCHMARKS.md +616 -0
- package/docs/plans/agent-booster/04-NPM-SDK.md +673 -0
- package/docs/plans/agent-booster/GITHUB-ISSUE.md +523 -0
- package/docs/plans/agent-booster/README.md +576 -0
- package/docs/plans/requesty/00-overview.md +176 -0
- package/docs/plans/requesty/01-api-research.md +573 -0
- package/docs/plans/requesty/02-architecture.md +1076 -0
- package/docs/plans/requesty/03-implementation-phases.md +1129 -0
- package/docs/plans/requesty/04-testing-strategy.md +905 -0
- package/docs/plans/requesty/05-migration-guide.md +576 -0
- package/docs/plans/requesty/README.md +290 -0
- package/package.json +1 -1
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
# Requesty.ai Integration - Planning Documentation
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
This directory contains comprehensive planning documentation for integrating Requesty.ai as a new provider in the agentic-flow project.
|
|
6
|
+
|
|
7
|
+
**Status:** Planning Complete ✅
|
|
8
|
+
**Implementation Status:** Not Started
|
|
9
|
+
**Estimated Effort:** 13 hours
|
|
10
|
+
**Risk Level:** LOW
|
|
11
|
+
|
|
12
|
+
## What is Requesty.ai?
|
|
13
|
+
|
|
14
|
+
Requesty.ai is a unified AI gateway providing:
|
|
15
|
+
- Access to 300+ AI models from OpenAI, Anthropic, Google, Meta, DeepSeek, and more
|
|
16
|
+
- OpenAI-compatible API (drop-in replacement)
|
|
17
|
+
- 80% cost savings vs direct Anthropic API
|
|
18
|
+
- Built-in analytics, caching, and auto-routing
|
|
19
|
+
- Enterprise features (zero downtime, failover, load balancing)
|
|
20
|
+
|
|
21
|
+
## Documentation Structure
|
|
22
|
+
|
|
23
|
+
Read the documents in this order:
|
|
24
|
+
|
|
25
|
+
### 1. [00-overview.md](./00-overview.md) - Start Here
|
|
26
|
+
**Read this first!**
|
|
27
|
+
|
|
28
|
+
- Executive summary
|
|
29
|
+
- Integration goals
|
|
30
|
+
- Key differentiators vs OpenRouter
|
|
31
|
+
- Strategic benefits
|
|
32
|
+
- Success criteria
|
|
33
|
+
- Risk assessment
|
|
34
|
+
|
|
35
|
+
**Time to read:** 5 minutes
|
|
36
|
+
|
|
37
|
+
### 2. [01-api-research.md](./01-api-research.md) - Technical Details
|
|
38
|
+
**For developers implementing the integration**
|
|
39
|
+
|
|
40
|
+
- Complete API specification
|
|
41
|
+
- Authentication methods
|
|
42
|
+
- Request/response schemas
|
|
43
|
+
- Tool calling format
|
|
44
|
+
- Model naming conventions
|
|
45
|
+
- Rate limits and pricing
|
|
46
|
+
- Error handling
|
|
47
|
+
- Comparison with OpenRouter and Anthropic
|
|
48
|
+
|
|
49
|
+
**Time to read:** 15 minutes
|
|
50
|
+
|
|
51
|
+
### 3. [02-architecture.md](./02-architecture.md) - System Design
|
|
52
|
+
**For architects and lead developers**
|
|
53
|
+
|
|
54
|
+
- High-level architecture diagrams
|
|
55
|
+
- Component breakdown
|
|
56
|
+
- Data flow diagrams
|
|
57
|
+
- File structure
|
|
58
|
+
- Configuration management
|
|
59
|
+
- Error handling strategy
|
|
60
|
+
- Performance considerations
|
|
61
|
+
- Security architecture
|
|
62
|
+
|
|
63
|
+
**Time to read:** 20 minutes
|
|
64
|
+
|
|
65
|
+
### 4. [03-implementation-phases.md](./03-implementation-phases.md) - Action Plan
|
|
66
|
+
**For developers ready to implement**
|
|
67
|
+
|
|
68
|
+
- Step-by-step implementation guide
|
|
69
|
+
- 5 phases with clear deliverables
|
|
70
|
+
- Code examples
|
|
71
|
+
- Acceptance criteria
|
|
72
|
+
- Timeline estimates
|
|
73
|
+
- Post-implementation checklist
|
|
74
|
+
|
|
75
|
+
**Time to read:** 25 minutes
|
|
76
|
+
**Implementation time:** 13 hours
|
|
77
|
+
|
|
78
|
+
### 5. [04-testing-strategy.md](./04-testing-strategy.md) - Quality Assurance
|
|
79
|
+
**For QA engineers and testers**
|
|
80
|
+
|
|
81
|
+
- Unit test specifications
|
|
82
|
+
- Integration test scenarios
|
|
83
|
+
- E2E user workflows
|
|
84
|
+
- Model-specific tests
|
|
85
|
+
- Performance benchmarks
|
|
86
|
+
- Security tests
|
|
87
|
+
- Acceptance criteria
|
|
88
|
+
|
|
89
|
+
**Time to read:** 15 minutes
|
|
90
|
+
**Testing time:** 3 hours
|
|
91
|
+
|
|
92
|
+
### 6. [05-migration-guide.md](./05-migration-guide.md) - User Documentation
|
|
93
|
+
**For end users**
|
|
94
|
+
|
|
95
|
+
- Quick start guide (3 steps)
|
|
96
|
+
- Usage examples
|
|
97
|
+
- Model recommendations
|
|
98
|
+
- Configuration options
|
|
99
|
+
- Migration from other providers
|
|
100
|
+
- Troubleshooting
|
|
101
|
+
- FAQ
|
|
102
|
+
|
|
103
|
+
**Time to read:** 10 minutes
|
|
104
|
+
|
|
105
|
+
## Key Findings
|
|
106
|
+
|
|
107
|
+
### High Compatibility with OpenRouter
|
|
108
|
+
|
|
109
|
+
The research revealed that Requesty.ai uses **almost identical API format** to OpenRouter:
|
|
110
|
+
|
|
111
|
+
| Aspect | OpenRouter | Requesty | Compatibility |
|
|
112
|
+
|--------|-----------|----------|---------------|
|
|
113
|
+
| API Format | OpenAI `/chat/completions` | OpenAI `/chat/completions` | 100% |
|
|
114
|
+
| Tool Calling | OpenAI functions | OpenAI functions | 100% |
|
|
115
|
+
| Streaming | SSE (OpenAI) | SSE (OpenAI) | 100% |
|
|
116
|
+
| Auth Method | Bearer token | Bearer token | 100% |
|
|
117
|
+
| Request Schema | OpenAI | OpenAI | 100% |
|
|
118
|
+
| Response Schema | OpenAI | OpenAI | 100% |
|
|
119
|
+
|
|
120
|
+
**Implication:** We can clone the OpenRouter proxy with minimal changes (~95% code reuse).
|
|
121
|
+
|
|
122
|
+
### Implementation Approach
|
|
123
|
+
|
|
124
|
+
**Strategy:** Clone and adapt the existing OpenRouter proxy
|
|
125
|
+
|
|
126
|
+
**Effort Breakdown:**
|
|
127
|
+
- **Phase 1:** Core Proxy (4 hours) - Clone OpenRouter proxy
|
|
128
|
+
- **Phase 2:** CLI Integration (2 hours) - Add provider detection
|
|
129
|
+
- **Phase 3:** Model Support (2 hours) - Add model definitions
|
|
130
|
+
- **Phase 4:** Testing (3 hours) - Comprehensive validation
|
|
131
|
+
- **Phase 5:** Documentation (2 hours) - User guides
|
|
132
|
+
|
|
133
|
+
**Total:** 13 hours
|
|
134
|
+
|
|
135
|
+
### Major Benefits
|
|
136
|
+
|
|
137
|
+
1. **300+ Models** (vs OpenRouter's 100+)
|
|
138
|
+
2. **Built-in Analytics** (OpenRouter lacks this)
|
|
139
|
+
3. **Auto-Routing** (intelligent model selection)
|
|
140
|
+
4. **Caching** (reduce API costs further)
|
|
141
|
+
5. **80% Cost Savings** (vs direct Anthropic API)
|
|
142
|
+
|
|
143
|
+
### Risks
|
|
144
|
+
|
|
145
|
+
**Technical Risks:** LOW
|
|
146
|
+
- API format is well-documented (OpenAI-compatible)
|
|
147
|
+
- Pattern is proven (OpenRouter already works)
|
|
148
|
+
- 95% code reuse minimizes bugs
|
|
149
|
+
|
|
150
|
+
**Business Risks:** LOW
|
|
151
|
+
- Multi-provider architecture already supports fallbacks
|
|
152
|
+
- Users can easily switch providers
|
|
153
|
+
- No vendor lock-in
|
|
154
|
+
|
|
155
|
+
## Quick Reference
|
|
156
|
+
|
|
157
|
+
### Files to Create
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
agentic-flow/
|
|
161
|
+
└── src/
|
|
162
|
+
└── proxy/
|
|
163
|
+
└── anthropic-to-requesty.ts (~750 lines, 95% from OpenRouter)
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Files to Modify
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
agentic-flow/
|
|
170
|
+
├── src/
|
|
171
|
+
│ ├── cli-proxy.ts (+ ~80 lines)
|
|
172
|
+
│ ├── agents/claudeAgent.ts (+ ~15 lines)
|
|
173
|
+
│ └── utils/
|
|
174
|
+
│ ├── modelCapabilities.ts (+ ~50 lines)
|
|
175
|
+
│ └── modelOptimizer.ts (+ ~100 lines)
|
|
176
|
+
└── README.md (+ Requesty section)
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Total Code Impact
|
|
180
|
+
|
|
181
|
+
| Metric | Count |
|
|
182
|
+
|--------|-------|
|
|
183
|
+
| New files | 1 |
|
|
184
|
+
| Modified files | 4 |
|
|
185
|
+
| New lines of code | ~1,000 |
|
|
186
|
+
| Reused lines | ~750 (95% from OpenRouter) |
|
|
187
|
+
| Original code | ~250 |
|
|
188
|
+
|
|
189
|
+
## Success Criteria
|
|
190
|
+
|
|
191
|
+
### Must Have (MVP)
|
|
192
|
+
- [ ] Users can use `--provider requesty` flag
|
|
193
|
+
- [ ] Requesty API key via `REQUESTY_API_KEY` environment variable
|
|
194
|
+
- [ ] Chat completions work with at least 10 tested models
|
|
195
|
+
- [ ] Native tool calling support (MCP tools work)
|
|
196
|
+
- [ ] Streaming responses supported
|
|
197
|
+
- [ ] Error handling and logging
|
|
198
|
+
- [ ] Model override via `--model` flag
|
|
199
|
+
|
|
200
|
+
### Should Have (V1)
|
|
201
|
+
- [ ] Tool emulation for models without native support
|
|
202
|
+
- [ ] Model capability detection for Requesty models
|
|
203
|
+
- [ ] Integration with model optimizer (`--optimize`)
|
|
204
|
+
- [ ] Analytics and usage tracking
|
|
205
|
+
- [ ] Proxy mode for Claude Code/Cursor
|
|
206
|
+
- [ ] Cost estimation and reporting
|
|
207
|
+
|
|
208
|
+
## Implementation Checklist
|
|
209
|
+
|
|
210
|
+
Use this checklist when implementing:
|
|
211
|
+
|
|
212
|
+
### Phase 1: Core Proxy ✅ Planned
|
|
213
|
+
- [ ] Clone `anthropic-to-openrouter.ts` to `anthropic-to-requesty.ts`
|
|
214
|
+
- [ ] Update class name, base URL, API key variable
|
|
215
|
+
- [ ] Update logging messages
|
|
216
|
+
- [ ] Test compilation
|
|
217
|
+
|
|
218
|
+
### Phase 2: CLI Integration ✅ Planned
|
|
219
|
+
- [ ] Add `shouldUseRequesty()` method
|
|
220
|
+
- [ ] Add `startRequestyProxy()` method
|
|
221
|
+
- [ ] Integrate into start flow
|
|
222
|
+
- [ ] Update runAgent method
|
|
223
|
+
- [ ] Test CLI detection
|
|
224
|
+
|
|
225
|
+
### Phase 3: Model Support ✅ Planned
|
|
226
|
+
- [ ] Add 15+ models to `modelCapabilities.ts`
|
|
227
|
+
- [ ] Update `claudeAgent.ts` provider detection
|
|
228
|
+
- [ ] Add 10+ models to model optimizer
|
|
229
|
+
- [ ] Test model detection
|
|
230
|
+
|
|
231
|
+
### Phase 4: Testing ✅ Planned
|
|
232
|
+
- [ ] Write unit tests (>90% coverage)
|
|
233
|
+
- [ ] Run integration tests (5+ models)
|
|
234
|
+
- [ ] Test tool calling
|
|
235
|
+
- [ ] Test streaming
|
|
236
|
+
- [ ] Validate error handling
|
|
237
|
+
|
|
238
|
+
### Phase 5: Documentation ✅ Planned
|
|
239
|
+
- [ ] Update README.md
|
|
240
|
+
- [ ] Create migration guide
|
|
241
|
+
- [ ] Update help text
|
|
242
|
+
- [ ] Update .env.example
|
|
243
|
+
|
|
244
|
+
## Next Steps
|
|
245
|
+
|
|
246
|
+
1. **Review Planning Docs** - Read 00-overview.md through 05-migration-guide.md
|
|
247
|
+
2. **Get Stakeholder Approval** - Present plan to team/maintainers
|
|
248
|
+
3. **Set Up Test Account** - Get Requesty.ai API key for testing
|
|
249
|
+
4. **Begin Implementation** - Follow 03-implementation-phases.md
|
|
250
|
+
5. **Test Thoroughly** - Use 04-testing-strategy.md
|
|
251
|
+
6. **Ship to Users** - Deploy with 05-migration-guide.md
|
|
252
|
+
|
|
253
|
+
## Questions?
|
|
254
|
+
|
|
255
|
+
If you have questions about the implementation plan:
|
|
256
|
+
|
|
257
|
+
1. Check the FAQ in `05-migration-guide.md`
|
|
258
|
+
2. Review the specific planning document
|
|
259
|
+
3. Open a GitHub issue with questions
|
|
260
|
+
4. Tag the planning document author
|
|
261
|
+
|
|
262
|
+
## Contributing
|
|
263
|
+
|
|
264
|
+
If you find gaps in the planning documentation:
|
|
265
|
+
|
|
266
|
+
1. Open an issue describing the gap
|
|
267
|
+
2. Submit a PR with improvements
|
|
268
|
+
3. Update this README with new findings
|
|
269
|
+
|
|
270
|
+
## Changelog
|
|
271
|
+
|
|
272
|
+
- **2025-01-07** - Initial planning documentation created
|
|
273
|
+
- Research completed on Requesty.ai API
|
|
274
|
+
- All 6 planning documents written
|
|
275
|
+
- Ready for implementation
|
|
276
|
+
|
|
277
|
+
## Credits
|
|
278
|
+
|
|
279
|
+
**Planning Author:** Claude Code
|
|
280
|
+
**Project:** agentic-flow
|
|
281
|
+
**Based On:** OpenRouter integration pattern
|
|
282
|
+
**Documentation Standard:** SPARC methodology
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
**Ready to implement?** Start with [03-implementation-phases.md](./03-implementation-phases.md)
|
|
287
|
+
|
|
288
|
+
**Need user docs?** Jump to [05-migration-guide.md](./05-migration-guide.md)
|
|
289
|
+
|
|
290
|
+
**Want technical details?** Read [02-architecture.md](./02-architecture.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentic-flow",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Production-ready AI agent orchestration platform with 66 specialized agents, 213 MCP tools, and autonomous multi-agent swarms. Built by @ruvnet with Claude Agent SDK, neural networks, memory persistence, GitHub integration, and distributed consensus protocols.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|