Add ink integration UI and media playback

This commit is contained in:
2026-05-15 21:23:46 +02:00
parent 44dc64f830
commit f2e786d5bc
89 changed files with 6561 additions and 556 deletions
+12 -7
View File
@@ -4,9 +4,10 @@
import * as path from 'path';
import * as dotenv from 'dotenv';
import { GameRunner } from './cli/game-runner';
// Import the server module and the startServer function for the web interface
import { startServer } from './server';
import { GameRunner } from './cli/game-runner';
// Import the server module and the startServer function for the web interface
import { startServer } from './server';
import { loadGameConfig, projectPath } from './config/game-config';
// Load environment variables
console.log('Loading environment variables...');
@@ -27,8 +28,12 @@ async function main(): Promise<void> {
console.log('A modern take on classic text adventures with LLM-powered interactions');
console.log('');
// Get the world file path from environment variables or use default
const worldFile = process.env.DEFAULT_WORLD_FILE || './data/worlds/example_world.yml';
// Get the world file path from the YAML engine config, with environment override.
const engineConfig = loadGameConfig(
process.env.YAML_CONFIG_FILE || './config/engines/yaml.json',
'yaml',
);
const worldFile = projectPath(process.env.DEFAULT_WORLD_FILE || engineConfig.paths.mainGameFile);
console.log(`Using world file: ${worldFile}`);
console.log(`OpenRouter API Key: ${process.env.OPENROUTER_API_KEY ? '✓ Found' : '✗ Missing'}`);
console.log(`OpenRouter Model: ${process.env.OPENROUTER_MODEL || '✗ Not specified'}`);
@@ -58,7 +63,7 @@ async function main(): Promise<void> {
// Get port configuration
const DEFAULT_PORT = 3000;
const PORT = process.env.PORT ? parseInt(process.env.PORT) : DEFAULT_PORT;
const PORT_RANGE = 10;
const PORT_RANGE = 300;
// Start the web server with port fallback
console.log('Starting web server...');
@@ -80,4 +85,4 @@ console.log('Starting application...');
main().catch(error => {
console.error('Unhandled error in main:', error);
process.exit(1);
});
});