gameforge-cli 0.1.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/LICENSE +21 -0
- package/README.md +366 -0
- package/dist/agents/base/BaseAgent.d.ts +45 -0
- package/dist/agents/base/BaseAgent.d.ts.map +1 -0
- package/dist/agents/base/BaseAgent.js +179 -0
- package/dist/agents/base/BaseAgent.js.map +1 -0
- package/dist/agents/core/Architect.d.ts +16 -0
- package/dist/agents/core/Architect.d.ts.map +1 -0
- package/dist/agents/core/Architect.js +487 -0
- package/dist/agents/core/Architect.js.map +1 -0
- package/dist/agents/core/Chaos.d.ts +14 -0
- package/dist/agents/core/Chaos.d.ts.map +1 -0
- package/dist/agents/core/Chaos.js +67 -0
- package/dist/agents/core/Chaos.js.map +1 -0
- package/dist/agents/core/Consistency.d.ts +16 -0
- package/dist/agents/core/Consistency.d.ts.map +1 -0
- package/dist/agents/core/Consistency.js +132 -0
- package/dist/agents/core/Consistency.js.map +1 -0
- package/dist/agents/core/Inquisitor.d.ts +20 -0
- package/dist/agents/core/Inquisitor.d.ts.map +1 -0
- package/dist/agents/core/Inquisitor.js +159 -0
- package/dist/agents/core/Inquisitor.js.map +1 -0
- package/dist/agents/core/Remediation.d.ts +16 -0
- package/dist/agents/core/Remediation.d.ts.map +1 -0
- package/dist/agents/core/Remediation.js +151 -0
- package/dist/agents/core/Remediation.js.map +1 -0
- package/dist/agents/specialists/CreativeSpecialist.d.ts +7 -0
- package/dist/agents/specialists/CreativeSpecialist.d.ts.map +1 -0
- package/dist/agents/specialists/CreativeSpecialist.js +70 -0
- package/dist/agents/specialists/CreativeSpecialist.js.map +1 -0
- package/dist/agents/specialists/EntitySpecialist.d.ts +8 -0
- package/dist/agents/specialists/EntitySpecialist.d.ts.map +1 -0
- package/dist/agents/specialists/EntitySpecialist.js +74 -0
- package/dist/agents/specialists/EntitySpecialist.js.map +1 -0
- package/dist/agents/specialists/FeatureSpecialist.d.ts +8 -0
- package/dist/agents/specialists/FeatureSpecialist.d.ts.map +1 -0
- package/dist/agents/specialists/FeatureSpecialist.js +83 -0
- package/dist/agents/specialists/FeatureSpecialist.js.map +1 -0
- package/dist/agents/specialists/TechSpecialist.d.ts +7 -0
- package/dist/agents/specialists/TechSpecialist.d.ts.map +1 -0
- package/dist/agents/specialists/TechSpecialist.js +62 -0
- package/dist/agents/specialists/TechSpecialist.js.map +1 -0
- package/dist/config/budget.d.ts +36 -0
- package/dist/config/budget.d.ts.map +1 -0
- package/dist/config/budget.js +37 -0
- package/dist/config/budget.js.map +1 -0
- package/dist/config/schema.d.ts +1336 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +134 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/config/templates.d.ts +10 -0
- package/dist/config/templates.d.ts.map +1 -0
- package/dist/config/templates.js +202 -0
- package/dist/config/templates.js.map +1 -0
- package/dist/core/CheckpointManager.d.ts +16 -0
- package/dist/core/CheckpointManager.d.ts.map +1 -0
- package/dist/core/CheckpointManager.js +52 -0
- package/dist/core/CheckpointManager.js.map +1 -0
- package/dist/core/Orchestrator.d.ts +11 -0
- package/dist/core/Orchestrator.d.ts.map +1 -0
- package/dist/core/Orchestrator.js +46 -0
- package/dist/core/Orchestrator.js.map +1 -0
- package/dist/core/SessionManager.d.ts +68 -0
- package/dist/core/SessionManager.d.ts.map +1 -0
- package/dist/core/SessionManager.js +162 -0
- package/dist/core/SessionManager.js.map +1 -0
- package/dist/core/StateMachine.d.ts +46 -0
- package/dist/core/StateMachine.d.ts.map +1 -0
- package/dist/core/StateMachine.js +82 -0
- package/dist/core/StateMachine.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +830 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/costTracker.d.ts +30 -0
- package/dist/utils/costTracker.d.ts.map +1 -0
- package/dist/utils/costTracker.js +64 -0
- package/dist/utils/costTracker.js.map +1 -0
- package/dist/utils/debugLogger.d.ts +48 -0
- package/dist/utils/debugLogger.d.ts.map +1 -0
- package/dist/utils/debugLogger.js +179 -0
- package/dist/utils/debugLogger.js.map +1 -0
- package/dist/utils/fileManager.d.ts +14 -0
- package/dist/utils/fileManager.d.ts.map +1 -0
- package/dist/utils/fileManager.js +135 -0
- package/dist/utils/fileManager.js.map +1 -0
- package/dist/utils/modelSelector.d.ts +11 -0
- package/dist/utils/modelSelector.d.ts.map +1 -0
- package/dist/utils/modelSelector.js +38 -0
- package/dist/utils/modelSelector.js.map +1 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 GameForge CLI Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
# GameForge CLI
|
|
2
|
+
|
|
3
|
+
> Transform game ideas into production-ready Game Design Documents using AI
|
|
4
|
+
|
|
5
|
+
GameForge CLI is a terminal-based AI pipeline that turns raw game ideas into comprehensive, structured Game Design Documents (GDDs). It features an interactive interview process, strict validation, multi-agent generation, and outputs both JSON and Markdown documentation.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- 🤖 **AI-Powered Interview**: Hybrid question system with smart defaults
|
|
10
|
+
- 📊 **Structured Output**: Valid JSON + readable Markdown
|
|
11
|
+
- 💰 **Cost Tracking**: Real-time budget monitoring and warnings
|
|
12
|
+
- 💾 **Checkpoint System**: Save and resume at any phase
|
|
13
|
+
- 📚 **Genre Templates**: Quick-start templates for common game types
|
|
14
|
+
- ✅ **Validation**: Consistency checking + adversarial gap analysis
|
|
15
|
+
- 🎯 **Technical Specs**: Math formulas, data structures, user stories
|
|
16
|
+
- 🎨 **Multi-Agent System**: Specialized agents for features, entities, creative, and technical specs
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
### Prerequisites
|
|
21
|
+
|
|
22
|
+
- Node.js 18+ installed
|
|
23
|
+
- Anthropic API key ([get one here](https://console.anthropic.com/))
|
|
24
|
+
|
|
25
|
+
### Install via NPM (when published)
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install -g gameforge-cli
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Local Development Setup
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Clone the repository
|
|
35
|
+
git clone <repository-url>
|
|
36
|
+
cd GameForgeCLI
|
|
37
|
+
|
|
38
|
+
# Install dependencies
|
|
39
|
+
npm install
|
|
40
|
+
|
|
41
|
+
# Create .env file from template
|
|
42
|
+
cp .env.example .env
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Edit the `.env` file and add your Anthropic API key:
|
|
46
|
+
|
|
47
|
+
```env
|
|
48
|
+
ANTHROPIC_API_KEY=sk-ant-xxxxx # Required: Your Anthropic API key
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Then build and link the CLI:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Build the project
|
|
55
|
+
npm run build
|
|
56
|
+
|
|
57
|
+
# Link the CLI globally (makes 'gameforge' command available)
|
|
58
|
+
npm link
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Verify Installation
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Check available commands
|
|
65
|
+
gameforge --help
|
|
66
|
+
|
|
67
|
+
# List available templates
|
|
68
|
+
gameforge templates
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Development Mode
|
|
72
|
+
|
|
73
|
+
For active development with auto-rebuilding:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
npm run dev
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Note: When using `npm run dev`, you'll need to run commands via `node dist/index.js` or keep `npm link` active after each rebuild.
|
|
80
|
+
|
|
81
|
+
## Quick Start
|
|
82
|
+
|
|
83
|
+
### Basic Usage
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# Create a new GDD with standard budget
|
|
87
|
+
gameforge create
|
|
88
|
+
|
|
89
|
+
# Use quick budget (cheaper, less detail)
|
|
90
|
+
gameforge create --budget quick
|
|
91
|
+
|
|
92
|
+
# Use deep budget (more comprehensive)
|
|
93
|
+
gameforge create --budget deep
|
|
94
|
+
|
|
95
|
+
# Start from a template
|
|
96
|
+
gameforge create --template roguelike
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Budget Tiers
|
|
100
|
+
|
|
101
|
+
| Tier | Cost Limit | Model | Description |
|
|
102
|
+
|------|-----------|-------|-------------|
|
|
103
|
+
| `quick` | $2.00 | Haiku | Fast draft with minimal detail |
|
|
104
|
+
| `standard` | $10.00 | Sonnet 4.5 | Balanced quality and cost (recommended) |
|
|
105
|
+
| `deep` | $25.00 | Sonnet 4.5 | Maximum detail and depth |
|
|
106
|
+
|
|
107
|
+
### Available Templates
|
|
108
|
+
|
|
109
|
+
- `roguelike` - Procedural dungeons, permadeath, run-based progression
|
|
110
|
+
- `farming-sim` - Resource management, crop cycles, NPC relationships
|
|
111
|
+
- `fps` - Fast-paced combat, weapon variety, multiplayer
|
|
112
|
+
- `soulslike` - Stamina combat, difficult bosses, bonfire checkpoints
|
|
113
|
+
- `metroidvania` - Interconnected world, ability-gated progression
|
|
114
|
+
|
|
115
|
+
## How It Works
|
|
116
|
+
|
|
117
|
+
GameForge CLI follows a structured pipeline with user review gates:
|
|
118
|
+
|
|
119
|
+
### Phase 1: Discovery
|
|
120
|
+
Interactive interview with 10 carefully designed questions. Features:
|
|
121
|
+
- Multiple choice with suggested answers
|
|
122
|
+
- ✨ **AI Decide**: Let the AI suggest smart defaults based on your answers
|
|
123
|
+
- ✏️ **Custom Answer**: Enter free-form text
|
|
124
|
+
- Real-time cost tracking
|
|
125
|
+
|
|
126
|
+
### Phase 2: Architecture
|
|
127
|
+
The **Architect Agent** transforms your answers into a validated `GameBible` JSON structure containing:
|
|
128
|
+
- Metadata (title, genre, scope, platforms)
|
|
129
|
+
- Features with technical specs, user stories, and dependencies
|
|
130
|
+
- Game objects (NPCs, items, monsters)
|
|
131
|
+
- Creative direction (art style, audio, assets)
|
|
132
|
+
- Technical requirements (engine, tools, localization)
|
|
133
|
+
|
|
134
|
+
### Phase 3: Production
|
|
135
|
+
Four specialist agents run in parallel to generate detailed Markdown docs:
|
|
136
|
+
1. **Creative Specialist** - Art style, asset lists, pipeline
|
|
137
|
+
2. **Feature Specialist** - Mermaid diagrams, math formulas, data structures
|
|
138
|
+
3. **Entity Specialist** - NPC/Item/Monster stat tables
|
|
139
|
+
4. **Tech Specialist** - Engine setup, tools, directory structure
|
|
140
|
+
|
|
141
|
+
### Phase 4: Validation & Remediation
|
|
142
|
+
Three-layer validation with optional auto-fix:
|
|
143
|
+
1. **Consistency Agent** - Checks dependencies, naming conventions, circular refs
|
|
144
|
+
2. **Chaos Agent** - Adversarial critic finding gameplay gaps and scope issues
|
|
145
|
+
3. **Remediation Agent** - Automatically fixes identified issues (up to 3 attempts)
|
|
146
|
+
|
|
147
|
+
At the review gate, you can choose to:
|
|
148
|
+
- **Save** - Export the GDD as-is
|
|
149
|
+
- **Fix** - Run the Remediation Agent to automatically resolve issues
|
|
150
|
+
- **Exit** - Quit without saving
|
|
151
|
+
|
|
152
|
+
### Output Structure
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
.gameforge/output/<session-id>/
|
|
156
|
+
├── 00_Cover.md # Title page with concept
|
|
157
|
+
├── Creative_Direction.md # Art, audio, assets
|
|
158
|
+
├── Feature_Specifications.md # All features with diagrams
|
|
159
|
+
├── Entity_Specifications.md # NPCs, items, monsters
|
|
160
|
+
├── Technical_Specifications.md # Engine, tools, build
|
|
161
|
+
├── 99_Gap_Analysis.md # Validation issues
|
|
162
|
+
├── game_bible.json # Complete structured data
|
|
163
|
+
└── Game_Design_Document.md # Combined GDD with table of contents
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Example Output
|
|
167
|
+
|
|
168
|
+
### Feature Specification
|
|
169
|
+
|
|
170
|
+
```markdown
|
|
171
|
+
## Weapon Crafting
|
|
172
|
+
|
|
173
|
+
**Epic**: EPIC-005: Core Crafting Loop
|
|
174
|
+
|
|
175
|
+
### Intent
|
|
176
|
+
Create long-term resource loops and player investment
|
|
177
|
+
|
|
178
|
+
### Gameplay Loop
|
|
179
|
+
```mermaid
|
|
180
|
+
sequenceDiagram
|
|
181
|
+
participant Step0 as Collect Resources
|
|
182
|
+
participant Step1 as Open Crafting Menu
|
|
183
|
+
participant Step2 as Select Recipe
|
|
184
|
+
participant Step3 as Confirm Craft
|
|
185
|
+
participant Step4 as Receive Item
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Technical Specification
|
|
189
|
+
**Data Structure**:
|
|
190
|
+
```cpp
|
|
191
|
+
struct CraftingRecipe {
|
|
192
|
+
List<ItemRequirement> inputs;
|
|
193
|
+
Item output;
|
|
194
|
+
float craftTime;
|
|
195
|
+
int skillRequired;
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**Math Formulas**:
|
|
200
|
+
- `CraftTime = BaseTime * (1.0 - SkillLevel * 0.1)`
|
|
201
|
+
- Variables: BaseTime (float), SkillLevel (int 0-10)
|
|
202
|
+
|
|
203
|
+
**File Location**: `Source/Game/Crafting/`
|
|
204
|
+
**Complexity**: High
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Configuration
|
|
208
|
+
|
|
209
|
+
### Environment Variables
|
|
210
|
+
|
|
211
|
+
Create a `.env` file in the project root:
|
|
212
|
+
|
|
213
|
+
```env
|
|
214
|
+
ANTHROPIC_API_KEY=your_api_key_here
|
|
215
|
+
DEFAULT_MODEL=claude-sonnet-4-5-20250929
|
|
216
|
+
FALLBACK_MODEL=claude-haiku-4-5-20251001
|
|
217
|
+
MAX_BUDGET_USD=10.00
|
|
218
|
+
CHECKPOINT_DIR=.gameforge/checkpoints
|
|
219
|
+
OUTPUT_DIR=.gameforge/output
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Architecture
|
|
223
|
+
|
|
224
|
+
### Core Components
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
src/
|
|
228
|
+
├── agents/ # AI-powered agents
|
|
229
|
+
│ ├── base/ # BaseAgent with Anthropic SDK integration
|
|
230
|
+
│ ├── core/ # Inquisitor, Architect, Consistency, Chaos, Remediation
|
|
231
|
+
│ └── specialists/ # Feature, Entity, Tech, Creative specialists
|
|
232
|
+
├── config/ # Schemas, budgets, templates
|
|
233
|
+
│ ├── schema.ts # Zod schemas (Game Bible SSOT)
|
|
234
|
+
│ ├── budget.ts # Cost tiers and model pricing
|
|
235
|
+
│ └── templates.ts # Genre templates
|
|
236
|
+
├── core/ # Infrastructure
|
|
237
|
+
│ ├── StateMachine.ts # Phase flow control
|
|
238
|
+
│ ├── SessionManager.ts # Save/resume & session tracking
|
|
239
|
+
│ └── Orchestrator.ts # Parallel specialist execution
|
|
240
|
+
├── utils/ # Utilities
|
|
241
|
+
│ ├── costTracker.ts # Budget monitoring
|
|
242
|
+
│ ├── modelSelector.ts # Intelligent model selection
|
|
243
|
+
│ └── fileManager.ts # File I/O
|
|
244
|
+
└── index.ts # CLI entry point
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Key Design Patterns
|
|
248
|
+
|
|
249
|
+
1. **Single Source of Truth**: All data flows through the `GameBible` schema
|
|
250
|
+
2. **Multi-Agent System**: Specialized agents for different domains
|
|
251
|
+
3. **Progressive Enhancement**: Start simple, AI fills in details
|
|
252
|
+
4. **Validation Layers**: Structural (Zod) + Logical (Consistency) + Design (Chaos)
|
|
253
|
+
5. **Cost Awareness**: Model selection based on complexity + budget
|
|
254
|
+
|
|
255
|
+
## Development
|
|
256
|
+
|
|
257
|
+
### Build
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
npm run build
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### Run in Development Mode
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
npm run dev
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Run Tests (when implemented)
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
npm test
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Lint
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
npm run lint
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## Advanced Usage
|
|
282
|
+
|
|
283
|
+
### Session Management
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
# List all saved sessions
|
|
287
|
+
gameforge sessions
|
|
288
|
+
|
|
289
|
+
# View details for a specific session
|
|
290
|
+
gameforge session <session-id>
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Resume from Checkpoint
|
|
294
|
+
|
|
295
|
+
```bash
|
|
296
|
+
# Resume from the latest checkpoint of a session
|
|
297
|
+
gameforge resume <session-id>
|
|
298
|
+
|
|
299
|
+
# Resume from a specific checkpoint
|
|
300
|
+
gameforge resume <checkpoint-id>
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
## Limitations & Known Issues
|
|
304
|
+
|
|
305
|
+
- PDF export not yet available (Markdown only)
|
|
306
|
+
- Limited to 10 discovery questions (can extend in code)
|
|
307
|
+
- English only (no i18n support)
|
|
308
|
+
- Requires stable internet connection for API calls
|
|
309
|
+
|
|
310
|
+
## Roadmap
|
|
311
|
+
|
|
312
|
+
- [ ] PDF export using Puppeteer
|
|
313
|
+
- [ ] Notion/Confluence integration
|
|
314
|
+
- [ ] Interactive editing mode (iterative refinement)
|
|
315
|
+
- [ ] Team collaboration features
|
|
316
|
+
- [ ] Asset generation integration (DALL-E, Midjourney)
|
|
317
|
+
- [ ] More genre templates
|
|
318
|
+
- [ ] Multi-language support
|
|
319
|
+
|
|
320
|
+
## Publishing to NPM
|
|
321
|
+
|
|
322
|
+
### First-time Setup
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
# Login to NPM (create account at npmjs.com if needed)
|
|
326
|
+
npm login
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Publish a Release
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
# Make sure everything builds cleanly
|
|
333
|
+
npm run build
|
|
334
|
+
|
|
335
|
+
# Bump version (choose patch, minor, or major)
|
|
336
|
+
npm version patch # 0.1.0 -> 0.1.1
|
|
337
|
+
npm version minor # 0.1.0 -> 0.2.0
|
|
338
|
+
npm version major # 0.1.0 -> 1.0.0
|
|
339
|
+
|
|
340
|
+
# Publish to NPM
|
|
341
|
+
npm publish
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
After publishing, users can install globally with:
|
|
345
|
+
|
|
346
|
+
```bash
|
|
347
|
+
npm install -g gameforge-cli
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
## Contributing
|
|
351
|
+
|
|
352
|
+
Contributions welcome! Please open an issue or PR.
|
|
353
|
+
|
|
354
|
+
## License
|
|
355
|
+
|
|
356
|
+
MIT License - see LICENSE file for details
|
|
357
|
+
|
|
358
|
+
## Acknowledgments
|
|
359
|
+
|
|
360
|
+
- Built with [Anthropic Claude](https://anthropic.com/claude) (Sonnet 4.5 & Haiku)
|
|
361
|
+
- Powered by [Zod](https://github.com/colinhacks/zod) for schema validation
|
|
362
|
+
- CLI built with [Commander](https://github.com/tj/commander.js) and [Enquirer](https://github.com/enquirer/enquirer)
|
|
363
|
+
|
|
364
|
+
---
|
|
365
|
+
|
|
366
|
+
**Made with ❤️ for game developers**
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import Anthropic from '@anthropic-ai/sdk';
|
|
2
|
+
import { CostTracker } from '../../utils/costTracker';
|
|
3
|
+
import { TaskComplexity, ModelSelector } from '../../utils/modelSelector';
|
|
4
|
+
export interface AgentConfig {
|
|
5
|
+
systemPrompt: string;
|
|
6
|
+
temperature?: number;
|
|
7
|
+
maxRetries?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare abstract class BaseAgent {
|
|
10
|
+
protected client: Anthropic;
|
|
11
|
+
protected config: AgentConfig;
|
|
12
|
+
protected costTracker: CostTracker;
|
|
13
|
+
protected modelSelector: ModelSelector;
|
|
14
|
+
constructor(apiKey: string, config: AgentConfig, costTracker: CostTracker, modelSelector: ModelSelector);
|
|
15
|
+
protected getAgentName(): string;
|
|
16
|
+
protected callLLM(prompt: string, complexity: TaskComplexity, options?: {
|
|
17
|
+
maxTokens?: number;
|
|
18
|
+
temperature?: number;
|
|
19
|
+
onProgress?: (message: string) => void;
|
|
20
|
+
}): Promise<{
|
|
21
|
+
content: string;
|
|
22
|
+
usage: {
|
|
23
|
+
input_tokens: number;
|
|
24
|
+
output_tokens: number;
|
|
25
|
+
};
|
|
26
|
+
stop_reason: 'end_turn' | 'max_tokens' | 'stop_sequence';
|
|
27
|
+
}>;
|
|
28
|
+
private estimateInputTokens;
|
|
29
|
+
protected retry<T>(operation: () => Promise<T>, maxAttempts?: number): Promise<T>;
|
|
30
|
+
protected callLLMWithAutoRetry(prompt: string, complexity: TaskComplexity, options?: {
|
|
31
|
+
initialMaxTokens?: number;
|
|
32
|
+
maxRetries?: number;
|
|
33
|
+
temperature?: number;
|
|
34
|
+
onProgress?: (message: string) => void;
|
|
35
|
+
}): Promise<{
|
|
36
|
+
content: string;
|
|
37
|
+
usage: {
|
|
38
|
+
input_tokens: number;
|
|
39
|
+
output_tokens: number;
|
|
40
|
+
};
|
|
41
|
+
}>;
|
|
42
|
+
protected sleep(ms: number): Promise<void>;
|
|
43
|
+
abstract execute(...args: any[]): Promise<any>;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=BaseAgent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseAgent.d.ts","sourceRoot":"","sources":["../../../src/agents/base/BaseAgent.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG1E,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,8BAAsB,SAAS;IAC7B,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC;IAC5B,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC;IAC9B,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC;IACnC,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;gBAGrC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,WAAW,EACn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AAO,CAAC,GAAG,CAAC;CAC/C"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BaseAgent = void 0;
|
|
7
|
+
const sdk_1 = __importDefault(require("@anthropic-ai/sdk"));
|
|
8
|
+
const debugLogger_1 = require("../../utils/debugLogger");
|
|
9
|
+
class BaseAgent {
|
|
10
|
+
client;
|
|
11
|
+
config;
|
|
12
|
+
costTracker;
|
|
13
|
+
modelSelector;
|
|
14
|
+
constructor(apiKey, config, costTracker, modelSelector) {
|
|
15
|
+
this.client = new sdk_1.default({ apiKey });
|
|
16
|
+
this.config = config;
|
|
17
|
+
this.costTracker = costTracker;
|
|
18
|
+
this.modelSelector = modelSelector;
|
|
19
|
+
}
|
|
20
|
+
// Get agent name for logging
|
|
21
|
+
getAgentName() {
|
|
22
|
+
return this.constructor.name;
|
|
23
|
+
}
|
|
24
|
+
async callLLM(prompt, complexity, options = {}) {
|
|
25
|
+
const budgetReport = this.costTracker.getReport();
|
|
26
|
+
const model = this.modelSelector.selectModel(complexity, budgetReport.remaining);
|
|
27
|
+
const maxTokens = options.maxTokens || this.modelSelector.getTokenLimit(model);
|
|
28
|
+
// Estimate cost before calling
|
|
29
|
+
options.onProgress?.('Estimating cost...');
|
|
30
|
+
const estimatedInputTokens = this.estimateInputTokens(prompt);
|
|
31
|
+
const estimatedCost = this.costTracker.estimateCost(estimatedInputTokens, maxTokens, model);
|
|
32
|
+
if (!this.costTracker.canAfford({ input: estimatedInputTokens, output: maxTokens }, model)) {
|
|
33
|
+
throw new Error(`Insufficient budget. Estimated cost: $${estimatedCost.toFixed(2)}, Remaining: $${budgetReport.remaining.toFixed(2)}`);
|
|
34
|
+
}
|
|
35
|
+
const modelName = model.includes('haiku') ? 'Haiku' : 'Sonnet 4.5';
|
|
36
|
+
options.onProgress?.(`Calling ${modelName} (est. ${estimatedInputTokens} input tokens, max ${maxTokens} output)...`);
|
|
37
|
+
const temperature = options.temperature ?? this.config.temperature ?? 0.7;
|
|
38
|
+
// Debug logging: Log request
|
|
39
|
+
if (debugLogger_1.debugLogger.isEnabled()) {
|
|
40
|
+
debugLogger_1.debugLogger.logLLMRequest({
|
|
41
|
+
agent: this.getAgentName(),
|
|
42
|
+
model: modelName,
|
|
43
|
+
maxTokens,
|
|
44
|
+
temperature,
|
|
45
|
+
promptPreview: prompt
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
const startTime = Date.now();
|
|
49
|
+
const response = await this.client.messages.create({
|
|
50
|
+
model,
|
|
51
|
+
max_tokens: maxTokens,
|
|
52
|
+
temperature,
|
|
53
|
+
system: this.config.systemPrompt,
|
|
54
|
+
messages: [{ role: 'user', content: prompt }]
|
|
55
|
+
});
|
|
56
|
+
const durationMs = Date.now() - startTime;
|
|
57
|
+
const usage = {
|
|
58
|
+
input: response.usage.input_tokens,
|
|
59
|
+
output: response.usage.output_tokens
|
|
60
|
+
};
|
|
61
|
+
this.costTracker.recordUsage(usage, model);
|
|
62
|
+
const content = response.content[0].type === 'text'
|
|
63
|
+
? response.content[0].text
|
|
64
|
+
: '';
|
|
65
|
+
options.onProgress?.(`Received ${usage.output} tokens`);
|
|
66
|
+
// Debug logging: Log response (always log full content in debug mode)
|
|
67
|
+
if (debugLogger_1.debugLogger.isEnabled()) {
|
|
68
|
+
debugLogger_1.debugLogger.logLLMResponse({
|
|
69
|
+
agent: this.getAgentName(),
|
|
70
|
+
stopReason: response.stop_reason || 'unknown',
|
|
71
|
+
inputTokens: usage.input,
|
|
72
|
+
outputTokens: usage.output,
|
|
73
|
+
durationMs,
|
|
74
|
+
contentPreview: content,
|
|
75
|
+
fullContent: content // Always provide full content for debug logs
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
content,
|
|
80
|
+
usage: { input_tokens: usage.input, output_tokens: usage.output },
|
|
81
|
+
stop_reason: response.stop_reason
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
estimateInputTokens(text) {
|
|
85
|
+
// Rough estimate: ~4 characters per token
|
|
86
|
+
return Math.ceil(text.length / 4);
|
|
87
|
+
}
|
|
88
|
+
async retry(operation, maxAttempts = 3) {
|
|
89
|
+
let lastError = null;
|
|
90
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
91
|
+
try {
|
|
92
|
+
return await operation();
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
lastError = error;
|
|
96
|
+
if (attempt < maxAttempts) {
|
|
97
|
+
await this.sleep(1000 * attempt); // Exponential backoff
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
throw lastError;
|
|
102
|
+
}
|
|
103
|
+
async callLLMWithAutoRetry(prompt, complexity, options = {}) {
|
|
104
|
+
const budgetReport = this.costTracker.getReport();
|
|
105
|
+
const model = this.modelSelector.selectModel(complexity, budgetReport.remaining);
|
|
106
|
+
let maxTokens = options.initialMaxTokens || this.modelSelector.getTokenLimit(model);
|
|
107
|
+
let attempt = 0;
|
|
108
|
+
const maxRetries = options.maxRetries || 3;
|
|
109
|
+
let hasWaitedForRateLimit = false; // Track if we've already waited once
|
|
110
|
+
while (attempt < maxRetries) {
|
|
111
|
+
attempt++;
|
|
112
|
+
if (attempt > 1) {
|
|
113
|
+
options.onProgress?.(`Retry ${attempt}/${maxRetries} with ${maxTokens} tokens (previous response was truncated)...`);
|
|
114
|
+
}
|
|
115
|
+
try {
|
|
116
|
+
const response = await this.callLLM(prompt, complexity, {
|
|
117
|
+
maxTokens,
|
|
118
|
+
temperature: options.temperature,
|
|
119
|
+
onProgress: options.onProgress
|
|
120
|
+
});
|
|
121
|
+
// Check if response completed naturally
|
|
122
|
+
if (response.stop_reason === 'end_turn') {
|
|
123
|
+
options.onProgress?.(`Response complete (${response.usage.output_tokens} tokens)`);
|
|
124
|
+
return { content: response.content, usage: response.usage };
|
|
125
|
+
}
|
|
126
|
+
// Response was truncated
|
|
127
|
+
if (response.stop_reason === 'max_tokens') {
|
|
128
|
+
if (attempt < maxRetries) {
|
|
129
|
+
options.onProgress?.(`Response truncated at ${maxTokens} tokens, doubling limit...`);
|
|
130
|
+
maxTokens = maxTokens * 2; // Double the token limit
|
|
131
|
+
continue; // Retry with higher limit
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
throw new Error(`Response still truncated after ${maxRetries} attempts with ${maxTokens} tokens. Consider simplifying the request.`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
// Unexpected stop reason
|
|
138
|
+
return { content: response.content, usage: response.usage };
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
// Handle rate limit errors
|
|
142
|
+
if (error.status === 429 && error.type === 'rate_limit_error') {
|
|
143
|
+
// First rate limit hit: auto-wait
|
|
144
|
+
if (!hasWaitedForRateLimit) {
|
|
145
|
+
hasWaitedForRateLimit = true;
|
|
146
|
+
const resetTime = error.headers?.['anthropic-ratelimit-output-tokens-reset'];
|
|
147
|
+
const waitSeconds = resetTime ? Math.ceil((new Date(resetTime).getTime() - Date.now()) / 1000) : 60;
|
|
148
|
+
options.onProgress?.(`Rate limit hit. Waiting ${waitSeconds}s for reset...`);
|
|
149
|
+
// Countdown for better UX
|
|
150
|
+
for (let i = waitSeconds; i > 0; i -= 10) {
|
|
151
|
+
await this.sleep(Math.min(10000, i * 1000));
|
|
152
|
+
if (i > 10) {
|
|
153
|
+
options.onProgress?.(`Rate limit: ${i}s remaining...`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
options.onProgress?.(`Rate limit reset. Retrying...`);
|
|
157
|
+
continue; // Retry after waiting
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
// Second rate limit hit: fail with actionable error
|
|
161
|
+
throw new Error(`Rate limit exceeded again (8000 output tokens/min). Your game design is very complex. Options:
|
|
162
|
+
1. Simplify your interview responses
|
|
163
|
+
2. Split into smaller sections manually
|
|
164
|
+
3. Upgrade your API tier for higher limits
|
|
165
|
+
4. Wait another minute and try again`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
// Other errors: re-throw
|
|
169
|
+
throw error;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
throw new Error(`Failed after ${maxRetries} attempts`);
|
|
173
|
+
}
|
|
174
|
+
sleep(ms) {
|
|
175
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
exports.BaseAgent = BaseAgent;
|
|
179
|
+
//# sourceMappingURL=BaseAgent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseAgent.js","sourceRoot":"","sources":["../../../src/agents/base/BaseAgent.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA0C;AAG1C,yDAAsD;AAQtD,MAAsB,SAAS;IACnB,MAAM,CAAY;IAClB,MAAM,CAAc;IACpB,WAAW,CAAc;IACzB,aAAa,CAAgB;IAEvC,YACE,MAAc,EACd,MAAmB,EACnB,WAAwB,EACxB,aAA4B;QAE5B,IAAI,CAAC,MAAM,GAAG,IAAI,aAAS,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QACxC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAED,6BAA6B;IACnB,YAAY;QACpB,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IAC/B,CAAC;IAES,KAAK,CAAC,OAAO,CACrB,MAAc,EACd,UAA0B,EAC1B,UAAgG,EAAE;QAElG,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC;QAClD,MAAM,KAAK,GAAG,IAAI,CAA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AM,IAAI,KAAK,CAAC;;;;qCAIS,CAAC,CAAC;oBAC7B,CAAC;gBACH,CAAC;gBAED,yBAAyB;gBACzB,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,gBAAgB,UAAU,WAAW,CAAC,CAAC;IACzD,CAAC;IAES,KAAK,CAAC,EAAU;QACxB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IACzD,CAAC;CAGF;AAlOD,8BAkOC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseAgent } from '../base/BaseAgent';
|
|
2
|
+
import { GameBible } from '../../config/schema';
|
|
3
|
+
export declare class Architect extends BaseAgent {
|
|
4
|
+
constructor(apiKey: string, costTracker: any, modelSelector: any);
|
|
5
|
+
execute(transcript: Array<{
|
|
6
|
+
question: string;
|
|
7
|
+
answer: string;
|
|
8
|
+
autoGenerated: boolean;
|
|
9
|
+
}>, onProgress?: (message: string) => void): Promise<GameBible>;
|
|
10
|
+
private generateMetaAndFeatures;
|
|
11
|
+
private generateGameObjects;
|
|
12
|
+
private generateCreativeAndTech;
|
|
13
|
+
private parseJSON;
|
|
14
|
+
private getSchemaDescription;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=Architect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Architect.d.ts","sourceRoot":"","sources":["../../../src/agents/core/Architect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAe,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAmB,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIjE,qBAAa,SAAU,SAAQ,SAAS;gBAC1B,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG;IAmB1D,OAAO,CACX,UAAU,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,OAAO,CAAA;KAAE,CAAC,EAC/E,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GACrC,OAAO,CAAC,SAAS,CAAC;YAuEP,uBAAuB;YAiFvB,mBAAmB;YA0GnB,uBAAuB;IAiFrC,OAAO,CAAC,SAAS;IAoGjB,OAAO,CAAC,oBAAoB;CA8D7B"}
|