gameforge-cli 0.1.0 → 0.2.1
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 +117 -44
- package/dist/agents/base/BaseAgent.d.ts +31 -0
- package/dist/agents/base/BaseAgent.d.ts.map +1 -1
- package/dist/agents/base/BaseAgent.js +57 -0
- package/dist/agents/base/BaseAgent.js.map +1 -1
- package/dist/agents/core/Architect.d.ts +21 -5
- package/dist/agents/core/Architect.d.ts.map +1 -1
- package/dist/agents/core/Architect.js +413 -150
- package/dist/agents/core/Architect.js.map +1 -1
- package/dist/agents/core/Chaos.d.ts +4 -0
- package/dist/agents/core/Chaos.d.ts.map +1 -1
- package/dist/agents/core/Chaos.js +46 -11
- package/dist/agents/core/Chaos.js.map +1 -1
- package/dist/agents/core/Consistency.d.ts +1 -0
- package/dist/agents/core/Consistency.d.ts.map +1 -1
- package/dist/agents/core/Consistency.js +86 -11
- package/dist/agents/core/Consistency.js.map +1 -1
- package/dist/agents/core/DocumentUpdater.d.ts +13 -0
- package/dist/agents/core/DocumentUpdater.d.ts.map +1 -0
- package/dist/agents/core/DocumentUpdater.js +165 -0
- package/dist/agents/core/DocumentUpdater.js.map +1 -0
- package/dist/agents/core/Modifier.d.ts +13 -0
- package/dist/agents/core/Modifier.d.ts.map +1 -0
- package/dist/agents/core/Modifier.js +141 -0
- package/dist/agents/core/Modifier.js.map +1 -0
- package/dist/agents/core/Remediation.d.ts +3 -1
- package/dist/agents/core/Remediation.d.ts.map +1 -1
- package/dist/agents/core/Remediation.js +63 -3
- package/dist/agents/core/Remediation.js.map +1 -1
- package/dist/agents/specialists/CreativeSpecialist.d.ts.map +1 -1
- package/dist/agents/specialists/CreativeSpecialist.js +162 -25
- package/dist/agents/specialists/CreativeSpecialist.js.map +1 -1
- package/dist/agents/specialists/EntitySpecialist.d.ts.map +1 -1
- package/dist/agents/specialists/EntitySpecialist.js +79 -25
- package/dist/agents/specialists/EntitySpecialist.js.map +1 -1
- package/dist/agents/specialists/FeatureSpecialist.d.ts +4 -0
- package/dist/agents/specialists/FeatureSpecialist.d.ts.map +1 -1
- package/dist/agents/specialists/FeatureSpecialist.js +114 -39
- package/dist/agents/specialists/FeatureSpecialist.js.map +1 -1
- package/dist/agents/specialists/TechSpecialist.d.ts.map +1 -1
- package/dist/agents/specialists/TechSpecialist.js +169 -32
- package/dist/agents/specialists/TechSpecialist.js.map +1 -1
- package/dist/config/schema.d.ts +1319 -709
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +142 -52
- package/dist/config/schema.js.map +1 -1
- package/dist/config/templates.d.ts.map +1 -1
- package/dist/config/templates.js +6 -66
- package/dist/config/templates.js.map +1 -1
- package/dist/core/Orchestrator.d.ts +17 -3
- package/dist/core/Orchestrator.d.ts.map +1 -1
- package/dist/core/Orchestrator.js +46 -16
- package/dist/core/Orchestrator.js.map +1 -1
- package/dist/index.js +544 -226
- package/dist/index.js.map +1 -1
- package/dist/types/issueReview.d.ts +19 -0
- package/dist/types/issueReview.d.ts.map +1 -0
- package/dist/types/issueReview.js +3 -0
- package/dist/types/issueReview.js.map +1 -0
- package/dist/utils/costTracker.d.ts +28 -0
- package/dist/utils/costTracker.d.ts.map +1 -1
- package/dist/utils/costTracker.js +71 -1
- package/dist/utils/costTracker.js.map +1 -1
- package/dist/utils/disambiguationHelper.d.ts +54 -0
- package/dist/utils/disambiguationHelper.d.ts.map +1 -0
- package/dist/utils/disambiguationHelper.js +262 -0
- package/dist/utils/disambiguationHelper.js.map +1 -0
- package/dist/utils/fileManager.d.ts +7 -0
- package/dist/utils/fileManager.d.ts.map +1 -1
- package/dist/utils/fileManager.js +47 -0
- package/dist/utils/fileManager.js.map +1 -1
- package/dist/utils/issueReviewer.d.ts +10 -0
- package/dist/utils/issueReviewer.d.ts.map +1 -0
- package/dist/utils/issueReviewer.js +206 -0
- package/dist/utils/issueReviewer.js.map +1 -0
- package/dist/utils/issueSelector.d.ts +26 -0
- package/dist/utils/issueSelector.d.ts.map +1 -0
- package/dist/utils/issueSelector.js +132 -0
- package/dist/utils/issueSelector.js.map +1 -0
- package/dist/utils/pdfGenerator.d.ts +12 -0
- package/dist/utils/pdfGenerator.d.ts.map +1 -0
- package/dist/utils/pdfGenerator.js +341 -0
- package/dist/utils/pdfGenerator.js.map +1 -0
- package/package.json +20 -15
- package/dist/core/CheckpointManager.d.ts +0 -16
- package/dist/core/CheckpointManager.d.ts.map +0 -1
- package/dist/core/CheckpointManager.js +0 -52
- package/dist/core/CheckpointManager.js.map +0 -1
package/README.md
CHANGED
|
@@ -7,13 +7,15 @@ GameForge CLI is a terminal-based AI pipeline that turns raw game ideas into com
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
9
9
|
- 🤖 **AI-Powered Interview**: Hybrid question system with smart defaults
|
|
10
|
+
- ❓ **Disambiguation**: Agents ask clarifying questions when needed
|
|
10
11
|
- 📊 **Structured Output**: Valid JSON + readable Markdown
|
|
11
12
|
- 💰 **Cost Tracking**: Real-time budget monitoring and warnings
|
|
12
13
|
- 💾 **Checkpoint System**: Save and resume at any phase
|
|
13
14
|
- 📚 **Genre Templates**: Quick-start templates for common game types
|
|
14
|
-
- ✅ **Validation**: Consistency checking + adversarial gap analysis
|
|
15
|
+
- ✅ **Validation**: Consistency checking + adversarial gap analysis + interactive issue review
|
|
15
16
|
- 🎯 **Technical Specs**: Math formulas, data structures, user stories
|
|
16
17
|
- 🎨 **Multi-Agent System**: Specialized agents for features, entities, creative, and technical specs
|
|
18
|
+
- 🔧 **Modifier Agent**: Edit existing GDDs with natural language requests
|
|
17
19
|
|
|
18
20
|
## Installation
|
|
19
21
|
|
|
@@ -132,22 +134,62 @@ The **Architect Agent** transforms your answers into a validated `GameBible` JSO
|
|
|
132
134
|
- Technical requirements (engine, tools, localization)
|
|
133
135
|
|
|
134
136
|
### Phase 3: Production
|
|
135
|
-
Four specialist agents run in
|
|
137
|
+
Four specialist agents run in sequence to generate detailed Markdown docs:
|
|
136
138
|
1. **Creative Specialist** - Art style, asset lists, pipeline
|
|
137
139
|
2. **Feature Specialist** - Mermaid diagrams, math formulas, data structures
|
|
138
140
|
3. **Entity Specialist** - NPC/Item/Monster stat tables
|
|
139
141
|
4. **Tech Specialist** - Engine setup, tools, directory structure
|
|
140
142
|
|
|
141
143
|
### Phase 4: Validation & Remediation
|
|
142
|
-
Three-layer validation with
|
|
144
|
+
Three-layer validation with interactive issue review:
|
|
143
145
|
1. **Consistency Agent** - Checks dependencies, naming conventions, circular refs
|
|
144
146
|
2. **Chaos Agent** - Adversarial critic finding gameplay gaps and scope issues
|
|
145
|
-
3. **
|
|
147
|
+
3. **Interactive Issue Review** - Review each issue one-by-one and select which to fix
|
|
148
|
+
4. **Remediation Agent** - Automatically fixes selected issues (up to 3 attempts per issue)
|
|
149
|
+
|
|
150
|
+
At the review gate, you can:
|
|
151
|
+
- Review issues individually with context and descriptions
|
|
152
|
+
- Select which issues to fix and which to keep
|
|
153
|
+
- Run the Remediation Agent on selected issues only
|
|
154
|
+
- Export the final GDD with gap analysis showing any unfixable issues
|
|
155
|
+
|
|
156
|
+
### Disambiguation System
|
|
157
|
+
|
|
158
|
+
Throughout the pipeline, agents can ask clarifying questions when they encounter ambiguity. This ensures the final GDD accurately reflects your vision.
|
|
159
|
+
|
|
160
|
+
**When Disambiguation Triggers:**
|
|
161
|
+
- **Architect**: Vague scope, unclear monetization, minimal art direction
|
|
162
|
+
- **Chaos**: Critical issues with vague recommendations
|
|
163
|
+
- **Feature Specialist**: Features marked as "Very High" complexity
|
|
164
|
+
- **Entity Specialist**: Entity count exceeds reasonable scope
|
|
165
|
+
- **Creative Specialist**: Asset requirements seem unrealistic for scope
|
|
166
|
+
- **Tech Specialist**: Multi-platform targeting in early projects
|
|
167
|
+
|
|
168
|
+
**Question Format:**
|
|
169
|
+
Each disambiguation question provides:
|
|
170
|
+
1. **2 AI-generated suggestions** - Context-aware options based on your game
|
|
171
|
+
2. **✨ AI Decide** - Let AI choose with reasoning
|
|
172
|
+
3. **✏️ Custom Answer** - Use your system editor for detailed input
|
|
173
|
+
|
|
174
|
+
**Example:**
|
|
175
|
+
```
|
|
176
|
+
❓ The feature "Multiplayer Networking" is marked as "Very High" complexity.
|
|
177
|
+
|
|
178
|
+
Select an option:
|
|
179
|
+
› Keep it as-is and proceed
|
|
180
|
+
Simplify to peer-to-peer only
|
|
181
|
+
✨ AI Decide (Smart Default)
|
|
182
|
+
✏️ Custom Answer
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
The AI Decide option provides reasoning:
|
|
186
|
+
```
|
|
187
|
+
🤖 AI Suggests: Simplify to peer-to-peer only
|
|
188
|
+
Reasoning: For a Prototype scope, full client-server architecture
|
|
189
|
+
would significantly increase complexity. P2P is faster to implement.
|
|
146
190
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
- **Fix** - Run the Remediation Agent to automatically resolve issues
|
|
150
|
-
- **Exit** - Quit without saving
|
|
191
|
+
Accept this suggestion? (Y/n)
|
|
192
|
+
```
|
|
151
193
|
|
|
152
194
|
### Output Structure
|
|
153
195
|
|
|
@@ -158,7 +200,7 @@ At the review gate, you can choose to:
|
|
|
158
200
|
├── Feature_Specifications.md # All features with diagrams
|
|
159
201
|
├── Entity_Specifications.md # NPCs, items, monsters
|
|
160
202
|
├── Technical_Specifications.md # Engine, tools, build
|
|
161
|
-
├── 99_Gap_Analysis.md #
|
|
203
|
+
├── 99_Gap_Analysis.md # Unfixable validation issues (if any)
|
|
162
204
|
├── game_bible.json # Complete structured data
|
|
163
205
|
└── Game_Design_Document.md # Combined GDD with table of contents
|
|
164
206
|
```
|
|
@@ -266,12 +308,22 @@ npm run build
|
|
|
266
308
|
npm run dev
|
|
267
309
|
```
|
|
268
310
|
|
|
269
|
-
### Run Tests
|
|
311
|
+
### Run Tests
|
|
270
312
|
|
|
271
313
|
```bash
|
|
314
|
+
# Run all tests (18 unit tests + integration tests)
|
|
272
315
|
npm test
|
|
316
|
+
|
|
317
|
+
# Run specific test suites
|
|
318
|
+
npm test tests/unit
|
|
319
|
+
npm test tests/integration
|
|
320
|
+
|
|
321
|
+
# Watch mode
|
|
322
|
+
npm test -- --watch
|
|
273
323
|
```
|
|
274
324
|
|
|
325
|
+
See [tests/README.md](tests/README.md) for detailed testing documentation.
|
|
326
|
+
|
|
275
327
|
### Lint
|
|
276
328
|
|
|
277
329
|
```bash
|
|
@@ -300,6 +352,22 @@ gameforge resume <session-id>
|
|
|
300
352
|
gameforge resume <checkpoint-id>
|
|
301
353
|
```
|
|
302
354
|
|
|
355
|
+
### Modify Existing GDD
|
|
356
|
+
|
|
357
|
+
```bash
|
|
358
|
+
# Modify an existing Game Design Document
|
|
359
|
+
gameforge modify <session-id>
|
|
360
|
+
|
|
361
|
+
# Enable debug logging
|
|
362
|
+
gameforge modify <session-id> --debug
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
The modify command allows you to make changes to previously generated GDDs using natural language. The Modifier agent will:
|
|
366
|
+
- Understand your requested changes
|
|
367
|
+
- Update the GameBible while preserving design intent
|
|
368
|
+
- Maintain ID naming conventions and dependency integrity
|
|
369
|
+
- Regenerate affected documentation sections
|
|
370
|
+
|
|
303
371
|
## Limitations & Known Issues
|
|
304
372
|
|
|
305
373
|
- PDF export not yet available (Markdown only)
|
|
@@ -309,43 +377,48 @@ gameforge resume <checkpoint-id>
|
|
|
309
377
|
|
|
310
378
|
## Roadmap
|
|
311
379
|
|
|
312
|
-
|
|
380
|
+
GameForge aims to be a complete **Game Idea → Production-Ready Tasks** pipeline:
|
|
381
|
+
|
|
382
|
+
### ✅ Phase 1: Game Design Document (Complete)
|
|
383
|
+
- [x] Interactive discovery interview
|
|
384
|
+
- [x] Multi-agent GDD generation
|
|
385
|
+
- [x] Validation & remediation system
|
|
386
|
+
- [x] Interactive issue review system
|
|
387
|
+
- [x] Interactive editing mode (Modifier agent)
|
|
388
|
+
- [x] Genre templates
|
|
389
|
+
|
|
390
|
+
### 🎨 Phase 2: Art Design Document
|
|
391
|
+
Transform the GDD into a comprehensive Art Design Document (ADD):
|
|
392
|
+
- [ ] UI/UX specifications with AI-generated mockups
|
|
393
|
+
- [ ] AI-generated concept art for characters, environments, items
|
|
394
|
+
- [ ] Branding guidelines (logo concepts, color palettes, typography)
|
|
395
|
+
- [ ] Sound design specifications
|
|
396
|
+
- [ ] Music direction and composition guidelines
|
|
397
|
+
- [ ] Asset pipeline and naming conventions
|
|
398
|
+
|
|
399
|
+
### 🔧 Phase 3: Technical Design Document
|
|
400
|
+
Generate a detailed Technical Design Document (TDD) from the GDD:
|
|
401
|
+
- [ ] Comprehensive codebase architecture breakdown
|
|
402
|
+
- [ ] Major systems design (rendering, physics, networking, AI, etc.)
|
|
403
|
+
- [ ] AI-generated flow charts as Mermaid diagrams
|
|
404
|
+
- [ ] API specifications and data models
|
|
405
|
+
- [ ] Performance budgets and optimization strategies
|
|
406
|
+
- [ ] Platform-specific implementation notes
|
|
407
|
+
|
|
408
|
+
### 📋 Phase 4: Task Management Integration
|
|
409
|
+
Populate a task management system with implementation tasks using [Beads](https://github.com/steveyegge/beads):
|
|
410
|
+
- [ ] Auto-generate tasks from TDD and ADD specifications
|
|
411
|
+
- [ ] Dependency mapping between tasks
|
|
412
|
+
- [ ] Priority and complexity estimation
|
|
413
|
+
- [ ] Sprint/milestone organization
|
|
414
|
+
- [ ] Integration with existing project management tools
|
|
415
|
+
|
|
416
|
+
### 🔮 Future Enhancements
|
|
417
|
+
- [ ] PDF export
|
|
313
418
|
- [ ] Notion/Confluence integration
|
|
314
|
-
- [ ] Interactive editing mode (iterative refinement)
|
|
315
419
|
- [ ] Team collaboration features
|
|
316
|
-
- [ ] Asset generation integration (DALL-E, Midjourney)
|
|
317
|
-
- [ ] More genre templates
|
|
318
420
|
- [ ] 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
|
-
```
|
|
421
|
+
- [ ] Real-time asset generation previews
|
|
349
422
|
|
|
350
423
|
## Contributing
|
|
351
424
|
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import Anthropic from '@anthropic-ai/sdk';
|
|
2
2
|
import { CostTracker } from '../../utils/costTracker';
|
|
3
3
|
import { TaskComplexity, ModelSelector } from '../../utils/modelSelector';
|
|
4
|
+
import { DisambiguationHelper, DisambiguationResult } from '../../utils/disambiguationHelper';
|
|
5
|
+
import { GameBible } from '../../config/schema';
|
|
6
|
+
import { SpinnerControl } from '../../core/Orchestrator';
|
|
7
|
+
type TranscriptEntry = {
|
|
8
|
+
question: string;
|
|
9
|
+
answer: string;
|
|
10
|
+
autoGenerated?: boolean;
|
|
11
|
+
};
|
|
4
12
|
export interface AgentConfig {
|
|
5
13
|
systemPrompt: string;
|
|
6
14
|
temperature?: number;
|
|
@@ -11,8 +19,30 @@ export declare abstract class BaseAgent {
|
|
|
11
19
|
protected config: AgentConfig;
|
|
12
20
|
protected costTracker: CostTracker;
|
|
13
21
|
protected modelSelector: ModelSelector;
|
|
22
|
+
protected disambiguationHelper: DisambiguationHelper;
|
|
23
|
+
protected skipDisambiguation: boolean;
|
|
24
|
+
protected spinnerControl: SpinnerControl | null;
|
|
14
25
|
constructor(apiKey: string, config: AgentConfig, costTracker: CostTracker, modelSelector: ModelSelector);
|
|
15
26
|
protected getAgentName(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Set whether to skip disambiguation prompts.
|
|
29
|
+
* When true, askClarification will return an auto-generated answer instead of prompting the user.
|
|
30
|
+
*/
|
|
31
|
+
setSkipDisambiguation(skip: boolean): void;
|
|
32
|
+
/**
|
|
33
|
+
* Set the spinner control for auto-pausing during user interactions.
|
|
34
|
+
*/
|
|
35
|
+
setSpinnerControl(control: SpinnerControl | null): void;
|
|
36
|
+
/**
|
|
37
|
+
* Ask the user a clarifying question when the agent encounters ambiguity.
|
|
38
|
+
* This provides a consistent UX across all agents for disambiguation.
|
|
39
|
+
*
|
|
40
|
+
* @param question The question to ask
|
|
41
|
+
* @param context The game context (can be GameBible, transcript, or formatted string)
|
|
42
|
+
* @param category Optional category for logging/debugging
|
|
43
|
+
* @returns The user's answer and whether it was AI-generated
|
|
44
|
+
*/
|
|
45
|
+
protected askClarification(question: string, context: GameBible | TranscriptEntry[] | string, category?: string): Promise<DisambiguationResult>;
|
|
16
46
|
protected callLLM(prompt: string, complexity: TaskComplexity, options?: {
|
|
17
47
|
maxTokens?: number;
|
|
18
48
|
temperature?: number;
|
|
@@ -42,4 +72,5 @@ export declare abstract class BaseAgent {
|
|
|
42
72
|
protected sleep(ms: number): Promise<void>;
|
|
43
73
|
abstract execute(...args: any[]): Promise<any>;
|
|
44
74
|
}
|
|
75
|
+
export {};
|
|
45
76
|
//# sourceMappingURL=BaseAgent.d.ts.map
|
|
@@ -1 +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,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,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IAiFvF,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1C,QAAQ,CAAC,OAAO,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;CAC/C"}
|
|
@@ -6,21 +6,78 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.BaseAgent = void 0;
|
|
7
7
|
const sdk_1 = __importDefault(require("@anthropic-ai/sdk"));
|
|
8
8
|
const debugLogger_1 = require("../../utils/debugLogger");
|
|
9
|
+
const disambiguationHelper_1 = require("../../utils/disambiguationHelper");
|
|
9
10
|
class BaseAgent {
|
|
10
11
|
client;
|
|
11
12
|
config;
|
|
12
13
|
costTracker;
|
|
13
14
|
modelSelector;
|
|
15
|
+
disambiguationHelper;
|
|
16
|
+
skipDisambiguation = false;
|
|
17
|
+
spinnerControl = null;
|
|
14
18
|
constructor(apiKey, config, costTracker, modelSelector) {
|
|
15
19
|
this.client = new sdk_1.default({ apiKey });
|
|
16
20
|
this.config = config;
|
|
17
21
|
this.costTracker = costTracker;
|
|
18
22
|
this.modelSelector = modelSelector;
|
|
23
|
+
this.disambiguationHelper = new disambiguationHelper_1.DisambiguationHelper(apiKey);
|
|
19
24
|
}
|
|
20
25
|
// Get agent name for logging
|
|
21
26
|
getAgentName() {
|
|
22
27
|
return this.constructor.name;
|
|
23
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Set whether to skip disambiguation prompts.
|
|
31
|
+
* When true, askClarification will return an auto-generated answer instead of prompting the user.
|
|
32
|
+
*/
|
|
33
|
+
setSkipDisambiguation(skip) {
|
|
34
|
+
this.skipDisambiguation = skip;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Set the spinner control for auto-pausing during user interactions.
|
|
38
|
+
*/
|
|
39
|
+
setSpinnerControl(control) {
|
|
40
|
+
this.spinnerControl = control;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Ask the user a clarifying question when the agent encounters ambiguity.
|
|
44
|
+
* This provides a consistent UX across all agents for disambiguation.
|
|
45
|
+
*
|
|
46
|
+
* @param question The question to ask
|
|
47
|
+
* @param context The game context (can be GameBible, transcript, or formatted string)
|
|
48
|
+
* @param category Optional category for logging/debugging
|
|
49
|
+
* @returns The user's answer and whether it was AI-generated
|
|
50
|
+
*/
|
|
51
|
+
async askClarification(question, context, category) {
|
|
52
|
+
// Format context appropriately
|
|
53
|
+
let contextStr;
|
|
54
|
+
if (typeof context === 'string') {
|
|
55
|
+
contextStr = context;
|
|
56
|
+
}
|
|
57
|
+
else if (Array.isArray(context)) {
|
|
58
|
+
// It's likely a transcript
|
|
59
|
+
contextStr = disambiguationHelper_1.DisambiguationHelper.formatTranscriptContext(context);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
// It's likely a GameBible or similar object
|
|
63
|
+
contextStr = disambiguationHelper_1.DisambiguationHelper.formatGameContext(context);
|
|
64
|
+
}
|
|
65
|
+
const disambiguationQuestion = {
|
|
66
|
+
question,
|
|
67
|
+
context: contextStr,
|
|
68
|
+
category: category || this.getAgentName()
|
|
69
|
+
};
|
|
70
|
+
// If skipDisambiguation is set, return a default answer without prompting
|
|
71
|
+
if (this.skipDisambiguation) {
|
|
72
|
+
return { answer: 'Skipped (post-remediation regeneration)', wasAIGenerated: true };
|
|
73
|
+
}
|
|
74
|
+
// Auto-pause spinner before prompting user
|
|
75
|
+
this.spinnerControl?.pause();
|
|
76
|
+
const result = await this.disambiguationHelper.ask(disambiguationQuestion);
|
|
77
|
+
// Auto-resume spinner after user responds
|
|
78
|
+
this.spinnerControl?.resume();
|
|
79
|
+
return result;
|
|
80
|
+
}
|
|
24
81
|
async callLLM(prompt, complexity, options = {}) {
|
|
25
82
|
const budgetReport = this.costTracker.getReport();
|
|
26
83
|
const model = this.modelSelector.selectModel(complexity, budgetReport.remaining);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseAgent.js","sourceRoot":"","sources":["../../../src/agents/base/BaseAgent.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA0C;AAG1C,yDAAsD;
|
|
1
|
+
{"version":3,"file":"BaseAgent.js","sourceRoot":"","sources":["../../../src/agents/base/BaseAgent.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA0C;AAG1C,yDAAsD;AACtD,2EAAsH;AAatH,MAAsB,SAAS;IACnB,MAAM,CAAY;IAClB,MAAM,CAAc;IACpB,WAAW,CAAc;IACzB,aAAa,CAAgB;IAC7B,oBAAoB,CAAuB;IAC3C,kBAAkB,GAAY,KAAK,CAAC;IACpC,cAAc,GAA0B,IAAI,CAAC;IAEvD,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;QACnC,IAAI,CAAC,oBAAoB,GAAG,IAAI,2CAAoB,CAAC,MAAM,CAAC,CAAC;IAC/D,CAAC;IAED,6BAA6B;IACnB,YAAY;QACpB,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACH,qBAAqB,CAAC,IAAa;QACjC,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,iBAAiB,CAAC,OAA8B;QAC9C,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;IAChC,CAAC;IAED;;;;;;;;OAQG;IACO,KAAK,CAAC,gBAAgB,CAC9B,QAAgB,EAChB,OAA+C,EAC/C,QAAiB;QAEjB,+BAA+B;QAC/B,IAAI,UAAkB,CAAC;QACvB,IAAI,OAAO,OA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AAC;IAES,KAAK,CAAC,EAAU;QACxB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IACzD,CAAC;CAGF;AArSD,8BAqSC"}
|
|
@@ -1,16 +1,32 @@
|
|
|
1
1
|
import { BaseAgent } from '../base/BaseAgent';
|
|
2
2
|
import { GameBible } from '../../config/schema';
|
|
3
|
+
type TranscriptEntry = {
|
|
4
|
+
question: string;
|
|
5
|
+
answer: string;
|
|
6
|
+
autoGenerated: boolean;
|
|
7
|
+
};
|
|
3
8
|
export declare class Architect extends BaseAgent {
|
|
4
9
|
constructor(apiKey: string, costTracker: any, modelSelector: any);
|
|
5
|
-
execute(transcript:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
execute(transcript: TranscriptEntry[], onProgress?: (message: string) => void): Promise<GameBible>;
|
|
11
|
+
/**
|
|
12
|
+
* Normalize/coerce common LLM output issues before schema validation.
|
|
13
|
+
* Fixes issues like strings-instead-of-arrays, missing defaults, etc.
|
|
14
|
+
*/
|
|
15
|
+
private normalizeGameBible;
|
|
16
|
+
/**
|
|
17
|
+
* Check the transcript for potential ambiguities and ask clarifying questions
|
|
18
|
+
* Returns additional transcript entries with clarifications
|
|
19
|
+
*/
|
|
20
|
+
private checkForAmbiguities;
|
|
21
|
+
/**
|
|
22
|
+
* Check the generated GameBible for structural issues and ask clarifying questions
|
|
23
|
+
*/
|
|
24
|
+
private checkPostGenerationAmbiguities;
|
|
10
25
|
private generateMetaAndFeatures;
|
|
11
26
|
private generateGameObjects;
|
|
12
27
|
private generateCreativeAndTech;
|
|
13
28
|
private parseJSON;
|
|
14
29
|
private getSchemaDescription;
|
|
15
30
|
}
|
|
31
|
+
export {};
|
|
16
32
|
//# sourceMappingURL=Architect.d.ts.map
|
|
@@ -1 +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;
|
|
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;AAKjE,KAAK,eAAe,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,OAAO,CAAA;CAAE,CAAC;AAEpF,qBAAa,SAAU,SAAQ,SAAS;gBAC1B,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG;IAmB1D,OAAO,CACX,UAAU,EAAE,eAAe,EAAE,EAC7B,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GACrC,OAAO,CAAC,SAAS,CAAC;IAyFrB;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAsG1B;;;OAGG;YACW,mBAAmB;IAiHjC;;OAEG;YACW,8BAA8B;YA0J9B,uBAAuB;YA2EvB,mBAAmB;YA+EnB,uBAAuB;IA6ErC,OAAO,CAAC,SAAS;IAoGjB,OAAO,CAAC,oBAAoB;CA8C7B"}
|