commit 39c1b6ff0a488fd03223e6b836ed4fe49a581c51 Author: Georg Tomitsch Date: Tue Apr 1 08:37:41 2025 +0200 Initial commit diff --git a/.env b/.env new file mode 100644 index 0000000..53ca590 --- /dev/null +++ b/.env @@ -0,0 +1,10 @@ +# OpenRouter API Configuration +OPENROUTER_API_KEY=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 +OPENROUTER_MODEL=anthropic/claude-3-opus-20240229 + +# Application Configuration +PORT=3000 +NODE_ENV=development + +# Game Configuration +DEFAULT_WORLD_FILE=./data/worlds/example_world.yml \ No newline at end of file diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..64cb74e --- /dev/null +++ b/.env.example @@ -0,0 +1,10 @@ +# OpenRouter API Configuration +OPENROUTER_API_KEY=your_openrouter_api_key_here +OPENROUTER_MODEL=your_selected_model_here + +# Application Configuration +PORT=3000 +NODE_ENV=development + +# Game Configuration +DEFAULT_WORLD_FILE=./data/worlds/example_world.yml \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..8333a84 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,23 @@ +{ + "parser": "@typescript-eslint/parser", + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended" + ], + "parserOptions": { + "ecmaVersion": 2020, + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ], + "rules": { + "@typescript-eslint/no-explicit-any": "warn", + "@typescript-eslint/explicit-module-boundary-types": "off", + "no-console": "off" + }, + "env": { + "node": true, + "jest": true + } +} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/README.md b/README.md new file mode 100644 index 0000000..32e90c6 --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +# AI Interactive Fiction + +A modern take on classic text adventures that combines traditional world modeling with Large Language Models (LLMs) to create natural language interactive fiction experiences. + +## Project Overview + +This application reimagines the classic text adventure game genre by replacing the traditional parser with an LLM. The system consists of: + +1. **World Model**: A traditional game engine that manages rooms, objects, actions, and game state - similar to old-school Infocom games. + +2. **LLM Interface**: An AI layer that processes natural language input from players and translates it into actions the game engine can understand. + +3. **Narrative Generation**: The LLM converts the world state changes into rich, contextual prose for the player. + +## Key Features + +- **Natural Language Understanding**: Players can express their intent in plain language without worrying about specific command syntax. +- **Rich Narrative**: Dynamic descriptions that adapt to the current game state and player history. +- **Consistent World Model**: The underlying game engine enforces world rules to prevent hallucinations or inconsistencies. +- **Modular Design**: Easily swap between different world models, including YAML-based custom worlds or integrations with classic Z-machine games. + +## How It Works + +1. Player enters natural language input +2. LLM analyzes input and translates it into game actions +3. Game engine processes valid actions and updates the game state +4. LLM receives the state change information and generates narrative prose +5. Player receives the beautifully written response + +## Technical Structure + +- YAML-based world definition (rooms, objects, actions) +- OpenRouter API integration for accessing suitable LLMs +- Modular design allowing for Z-machine integration in the future + +## Getting Started + +[Installation and running instructions will be added here] \ No newline at end of file diff --git a/Screenshot 2025-04-01 080304.png b/Screenshot 2025-04-01 080304.png new file mode 100644 index 0000000..6efdb94 Binary files /dev/null and b/Screenshot 2025-04-01 080304.png differ diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..87900aa --- /dev/null +++ b/TODO.md @@ -0,0 +1,99 @@ +# Project Implementation Plan + +## Phase 1: Project Setup and Basic Structure +- [x] Define project goals and specifications +- [x] Set up project structure + - [x] Create core directories (src, data, tests) + - [x] Initialize Node.js/npm project + - [x] Set up TypeScript configuration + - [ ] Configure ESLint and Prettier for code quality +- [ ] Choose and set up testing framework +- [x] Create basic documentation structure + +## Phase 2: World Model Implementation +- [ ] Define YAML schema for world elements + - [ ] Room schema (description, exits, objects, characters) + - [ ] Object schema (description, properties, allowed actions) + - [ ] NPC schema (description, dialogue, behavior) + - [ ] Action schema (conditions, effects) +- [x] Implement YAML parser and validator +- [ ] Create the world model core + - [ ] Game state management + - [ ] Room navigation + - [ ] Object interaction + - [ ] NPC interaction + - [ ] Action processing logic +- [x] Create a simple test world in YAML format +- [ ] Implement unit tests for world model + +## Phase 3: LLM Integration +- [x] Research and select appropriate OpenRouter model +- [x] Implement OpenRouter API client + - [x] Configuration and authentication + - [x] API request/response handling + - [ ] Rate limiting and error handling +- [ ] Design LLM prompting strategy + - [ ] System prompts for action translation + - [ ] System prompts for narrative generation + - [ ] Context management for conversation history +- [ ] Create adapter between LLM and world model + - [ ] Define the interface for action translation + - [ ] Define the interface for narrative generation + +## Phase 4: Game Engine Core +- [x] Implement the game loop + - [x] Input handling + - [ ] Action processing via LLM + - [ ] World model updating + - [ ] Response generation via LLM + - [ ] Output formatting +- [ ] Implement saving/loading game state +- [ ] Add game configuration options +- [ ] Implement logging for debugging + +## Phase 5: User Interface +- [x] Create a command-line interface + - [x] Input handling + - [x] Text output formatting + - [ ] Command history +- [x] Implement a simple web interface + - [x] Basic HTML/CSS structure + - [x] JavaScript for interaction + - [x] Responsive design +- [x] Text processing utilities + - [x] Implement smartypants.js for typographical improvements + - [ ] Add hyphenation support + +## Phase 6: Advanced Features +- [ ] Implement integration layer for Z-machine + - [ ] Research Z-machine libraries + - [ ] Create adapter for Z-machine to world model interface + - [ ] Test with classic Infocom games +- [ ] Add advanced LLM features + - [ ] Character styles and narrative tones + - [ ] Memory and reference to past events + - [ ] Player character personality modeling +- [ ] Create plugin system for extending world model capabilities + +## Phase 7: Testing and Refinement +- [ ] Comprehensive testing + - [ ] Unit tests for core components + - [ ] Integration tests for LLM integration + - [ ] End-to-end game flow tests + - [ ] User testing and feedback +- [ ] Performance optimization + - [ ] Minimize LLM token usage + - [ ] Optimize world model for larger games +- [ ] Refine prompting strategies based on testing + +## Phase 8: Documentation and Release +- [x] Complete user documentation + - [x] Installation guide + - [ ] World creation guide + - [ ] Configuration reference +- [ ] Complete developer documentation + - [ ] Architecture overview + - [ ] API reference + - [ ] Extension guide +- [ ] Create example worlds and games +- [ ] Prepare for initial release \ No newline at end of file diff --git a/ai.interactive.fiction.code-workspace b/ai.interactive.fiction.code-workspace new file mode 100644 index 0000000..ee2b798 --- /dev/null +++ b/ai.interactive.fiction.code-workspace @@ -0,0 +1,10 @@ +{ + "folders": [ + { + "path": "." + }, + { + "path": "../ink.js" + } + ] +} \ No newline at end of file diff --git a/copy-assets.js b/copy-assets.js new file mode 100644 index 0000000..3e7ba0e --- /dev/null +++ b/copy-assets.js @@ -0,0 +1,46 @@ +/** + * Script to copy required assets from ink.js project to AI Interactive Fiction + */ + +const fs = require('fs'); +const path = require('path'); + +// Define asset directories +const sourceDir = 'e:/Georg/vhosts/ink.js'; +const targetDir = 'e:/Georg/vhosts/ai.interactive.fiction/public'; + +// Assets to copy +const assets = [ + { src: 'book-3057904.png', dest: 'images/book-3057904.png' }, + { src: 'brown-wooden-flooring.jpg', dest: 'images/brown-wooden-flooring.jpg' }, + { src: 'EBGaramond12-Regular.otf', dest: 'fonts/EBGaramond12-Regular.otf' }, + { src: 'EBGaramond12-Italic.otf', dest: 'fonts/EBGaramond12-Italic.otf' } +]; + +// Create necessary directories +const directories = ['images', 'fonts', 'js', 'css'].map(dir => path.join(targetDir, dir)); +directories.forEach(dir => { + if (!fs.existsSync(dir)) { + console.log(`Creating directory: ${dir}`); + fs.mkdirSync(dir, { recursive: true }); + } +}); + +// Copy each asset +assets.forEach(asset => { + const source = path.join(sourceDir, asset.src); + const destination = path.join(targetDir, asset.dest); + + try { + if (fs.existsSync(source)) { + fs.copyFileSync(source, destination); + console.log(`Successfully copied ${source} to ${destination}`); + } else { + console.error(`Source file does not exist: ${source}`); + } + } catch (error) { + console.error(`Error copying ${source}:`, error.message); + } +}); + +console.log('Asset copying completed.'); \ No newline at end of file diff --git a/data/worlds/example_world.yml b/data/worlds/example_world.yml new file mode 100644 index 0000000..fb8439f --- /dev/null +++ b/data/worlds/example_world.yml @@ -0,0 +1,681 @@ +title: The Mysterious Mansion +author: AI Interactive Fiction +version: 1.0.0 +introduction: | + You find yourself standing outside an old, abandoned mansion on a hill. + Rain patters gently on the gravel path leading to the front door. + A strange letter in your pocket invited you here, but you can't remember who sent it. + Perhaps the answers lie within... + +# Room definitions +rooms: + # Starting area + front_yard: + name: Front Yard + description: | + You stand on a gravel path leading to an imposing Victorian mansion. + The rain has softened to a drizzle, and moonlight peeks through gaps in the clouds. + Ancient oak trees frame the property, their branches swaying in the gentle breeze. + exits: + - direction: north + targetRoomId: entrance_hall + description: large wooden doors lead into the mansion + - direction: south + targetRoomId: street + description: wrought iron gates lead back to the street + objects: + - strange_letter + - garden_statue + characters: [] + + # Main entrance + entrance_hall: + name: Entrance Hall + description: | + Grand chandeliers hang from the high ceiling, their crystals covered in cobwebs. + A wide staircase curves up to the second floor, and paintings of stern-faced + individuals watch you from ornate frames on the walls. + The floor is polished marble, though dusty from neglect. + exits: + - direction: south + targetRoomId: front_yard + description: the main entrance doors + - direction: north + targetRoomId: grand_staircase + description: the grand staircase + - direction: east + targetRoomId: dining_room + description: an archway leads to what appears to be a dining room + - direction: west + targetRoomId: library + description: a door marked 'Library' + objects: + - dusty_key + - umbrella_stand + characters: + - butler_ghost + + # Library + library: + name: Library + description: | + Bookshelves line every wall, reaching from floor to ceiling. + A reading desk sits in the center of the room, a leather-bound book + open upon it. A gentle fire crackles in the fireplace, casting + dancing shadows across the room. + exits: + - direction: east + targetRoomId: entrance_hall + description: the door back to the entrance hall + - direction: north + targetRoomId: secret_study + description: a hidden door in the bookshelf + isLocked: true + keyId: old_brass_key + objects: + - leather_book + - reading_glasses + - old_brass_key + characters: [] + + # Dining Room + dining_room: + name: Dining Room + description: | + A long table dominates this room, set for a dinner party that never happened. + Fine china and silverware rest atop an elegant tablecloth, now gray with dust. + A chandelier hangs above, and a sideboard against the wall holds various serving dishes. + exits: + - direction: west + targetRoomId: entrance_hall + description: the archway back to the entrance hall + - direction: north + targetRoomId: kitchen + description: a swinging door to what must be the kitchen + objects: + - silver_candlestick + - dusty_plate + characters: + - dining_ghost + + # Kitchen + kitchen: + name: Kitchen + description: | + This once-busy kitchen now stands silent. Copper pots and pans hang from hooks, + and an old cast-iron stove sits cold against the wall. A large preparation table + occupies the center of the room, and a pantry door stands ajar. + exits: + - direction: south + targetRoomId: dining_room + description: the swinging door back to the dining room + - direction: east + targetRoomId: pantry + description: the pantry door + objects: + - rusty_knife + - cookbook + characters: [] + + # Pantry + pantry: + name: Pantry + description: | + Shelves line the walls of this small room, holding preserves in dusty jars + and sacks of long-expired ingredients. A small window provides minimal light, + and a musty smell permeates the air. + exits: + - direction: west + targetRoomId: kitchen + description: the door back to the kitchen + objects: + - dusty_jar + - strange_bottle + characters: [] + + # Grand Staircase + grand_staircase: + name: Grand Staircase + description: | + The staircase curves gracefully upward, its wooden railings polished to a soft glow + despite the overall neglect of the mansion. Family portraits line the walls, + following your movement with their painted eyes. + exits: + - direction: south + targetRoomId: entrance_hall + description: back down to the entrance hall + - direction: north + targetRoomId: upper_landing + description: up to the second floor + objects: + - family_portrait + characters: [] + + # Upper Landing + upper_landing: + name: Upper Landing + description: | + The upper landing connects several rooms on the second floor. A faded + carpet runs down the center of the hallway, and doors line both sides. + A large window at the end of the hall shows the rainy night outside. + exits: + - direction: south + targetRoomId: grand_staircase + description: down the grand staircase + - direction: east + targetRoomId: master_bedroom + description: a door marked 'Master Bedroom' + - direction: west + targetRoomId: study + description: a door marked 'Study' + objects: [] + characters: [] + + # Master Bedroom + master_bedroom: + name: Master Bedroom + description: | + A large four-poster bed dominates this room, its once-luxurious hangings + now faded and torn. A vanity sits in the corner, its mirror clouded with age, + and a wardrobe stands against the far wall. + exits: + - direction: west + targetRoomId: upper_landing + description: the door back to the upper landing + objects: + - jewelry_box + - old_diary + characters: + - lady_ghost + + # Study + study: + name: Study + description: | + This cozy room contains a large desk covered in papers, a comfortable + armchair, and a globe that seems to rotate slowly on its own. Bookshelves + line the walls, filled with volumes on various esoteric subjects. + exits: + - direction: east + targetRoomId: upper_landing + description: the door back to the upper landing + objects: + - strange_device + - important_letter + characters: [] + + # Secret Study (hidden room) + secret_study: + name: Secret Study + description: | + Hidden behind the library bookshelf, this small room appears to be a + private study. A desk with a locked drawer sits against one wall, and + shelves hold unusual artifacts and rare books. A single candle provides + dim illumination. + exits: + - direction: south + targetRoomId: library + description: the hidden door back to the library + objects: + - ancient_tome + - crystal_key + characters: [] + + # Street (exit area) + street: + name: Street + description: | + The quiet street outside the mansion is shrouded in fog. Streetlamps cast + pools of yellow light that barely penetrate the mist. The mansion's gates + loom behind you, while the way back to town lies ahead. + exits: + - direction: north + targetRoomId: front_yard + description: the mansion gates + objects: [] + characters: [] + +# Object definitions +objects: + strange_letter: + name: Strange Letter + description: | + A weathered envelope containing an invitation to visit the mansion. + The handwriting is elegant but unfamiliar, and the letter is signed + simply with the initial "M". + traits: + - takeable + - readable + states: {} + allowedActions: + - take + - read + - examine + + garden_statue: + name: Garden Statue + description: | + A weathered stone statue of a weeping angel. Its face is covered by its hands, + and detailed wings spread out from its back. Something about it makes you uneasy. + traits: + - fixed + states: {} + allowedActions: + - examine + + dusty_key: + name: Dusty Key + description: | + An old iron key, covered in dust. It looks like it might fit an old door somewhere. + traits: + - takeable + - key + states: {} + allowedActions: + - take + - examine + - use + + umbrella_stand: + name: Umbrella Stand + description: | + A brass stand holding several antique umbrellas, all in various states of decay. + traits: + - fixed + - container + states: + open: true + containedObjects: [] + allowedActions: + - examine + + leather_book: + name: Leather Book + description: | + A thick tome bound in dark leather. The pages are filled with strange symbols + and diagrams that seem to shift slightly when you're not looking directly at them. + traits: + - takeable + - readable + states: {} + allowedActions: + - take + - read + - examine + + reading_glasses: + name: Reading Glasses + description: | + A pair of wire-rimmed spectacles. The lenses have a slight blue tint to them. + traits: + - takeable + - wearable + states: + worn: false + allowedActions: + - take + - wear + - examine + + old_brass_key: + name: Brass Key + description: | + A small brass key with intricate engravings. It seems to be quite old but well-maintained. + traits: + - takeable + - key + states: {} + allowedActions: + - take + - examine + - use + + silver_candlestick: + name: Silver Candlestick + description: | + A tarnished silver candlestick with an unlit candle. It feels heavy in your hand. + traits: + - takeable + - light_source + states: + lit: false + allowedActions: + - take + - light + - examine + + dusty_plate: + name: Dusty Plate + description: | + A fine china plate covered in a layer of dust. Despite its age, the painted pattern is still vivid. + traits: + - takeable + states: {} + allowedActions: + - take + - examine + + rusty_knife: + name: Rusty Knife + description: | + An old kitchen knife with a rusted blade. It's dull, but still might be useful. + traits: + - takeable + - sharp + states: {} + allowedActions: + - take + - examine + - use + + cookbook: + name: Cookbook + description: | + A yellowed cookbook filled with strange recipes. Some ingredients are unusual, and + the instructions sometimes reference phases of the moon or specific star alignments. + traits: + - takeable + - readable + states: {} + allowedActions: + - take + - read + - examine + + dusty_jar: + name: Dusty Jar + description: | + A glass jar containing what might once have been fruit preserves, now unidentifiable. + Best not to open it. + traits: + - takeable + - container + states: + open: false + allowedActions: + - take + - examine + + strange_bottle: + name: Strange Bottle + description: | + A small bottle containing a glowing blue liquid. The label is written in a language you don't recognize. + traits: + - takeable + - drinkable + states: {} + allowedActions: + - take + - drink + - examine + + family_portrait: + name: Family Portrait + description: | + A large painting of a stern-looking family - a husband, wife, and three children. + The father's eyes seem to follow you, and there's something oddly familiar about his face. + traits: + - fixed + states: {} + allowedActions: + - examine + + jewelry_box: + name: Jewelry Box + description: | + An ornate wooden box inlaid with mother-of-pearl. Inside are several pieces of + antique jewelry, including a ruby necklace that catches the light strangely. + traits: + - takeable + - container + states: + open: true + containedObjects: + - ruby_necklace + allowedActions: + - take + - open + - close + - examine + + ruby_necklace: + name: Ruby Necklace + description: | + A delicate gold chain with a large ruby pendant. The gem seems to glow with an inner light, + and it feels warm to the touch. + traits: + - takeable + - wearable + states: + worn: false + allowedActions: + - take + - wear + - examine + + old_diary: + name: Old Diary + description: | + A leather-bound diary with yellowed pages. The entries detail the daily life of + the mansion's former mistress, and hint at a growing fear of something in the house. + traits: + - takeable + - readable + states: {} + allowedActions: + - take + - read + - examine + + strange_device: + name: Strange Device + description: | + A brass contraption with gears, dials, and a glass dome. It's purpose isn't clear, + but it occasionally ticks and whirs on its own. + traits: + - takeable + states: + active: false + allowedActions: + - take + - use + - examine + + important_letter: + name: Important Letter + description: | + A sealed envelope addressed to "The Heir." The wax seal bears the same crest + that you've seen throughout the mansion. + traits: + - takeable + - readable + states: {} + allowedActions: + - take + - read + - examine + + ancient_tome: + name: Ancient Tome + description: | + A massive book bound in what appears to be human skin. The title, "Liber Umbrarum," + is embossed in gold on the spine. The pages contain rituals and incantations. + traits: + - takeable + - readable + states: {} + allowedActions: + - take + - read + - examine + + crystal_key: + name: Crystal Key + description: | + A key made of clear crystal that catches the light in mesmerizing ways. Despite + its appearance, it feels as solid as metal and cool to the touch. + traits: + - takeable + - key + states: {} + allowedActions: + - take + - use + - examine + +# Character definitions +characters: + butler_ghost: + name: Ghostly Butler + description: | + The translucent figure of an elderly butler, dressed in formal attire from a bygone era. + He stands with perfect posture, hands clasped behind his back. + dialogue: + greeting: "Welcome to the mansion, sir/madam. We've been expecting you." + mansion: "This estate has belonged to the Montgomery family for generations. Such a shame what happened to them." + family: "The Montgomerys? All gone now, I'm afraid. The master, his wife, and their children. A tragedy." + tragedy: "I'm not at liberty to discuss the details, but the answers you seek may be found in the study." + yourself: "Me? I've served this house for longer than I care to remember. Even death couldn't release me from my duties." + defaultResponse: "I'm afraid I cannot help you with that particular inquiry." + inventory: [] + mood: formal + + dining_ghost: + name: Dining Guest + description: | + A spectral figure in elegant dinner attire, seated at the table. She appears to be + a young woman, and she plays absently with a spectral fork. + dialogue: + greeting: "Oh, a new guest! How delightful. Will you join us for dinner? It's been so long since we had fresh company." + dinner: "We've been waiting for the main course for... goodness, how long has it been now? Years, I suppose." + herself: "My name? It's... it's strange, I can't quite recall. I remember coming here for a dinner party, but then..." + party: "It was supposed to be a celebration. The master of the house had made some sort of discovery. Something important." + discovery: "In the secret study, I believe. Behind the library. The master was very excited about it." + defaultResponse: "I'm sorry, my mind isn't what it used to be. The years blur together when you're like this." + inventory: [] + mood: wistful + + lady_ghost: + name: Ghostly Lady + description: | + The elegant apparition of a woman in Victorian dress, her face partly obscured by a veil. + She sits at the vanity, brushing her long hair with a ghostly brush. + dialogue: + greeting: "A visitor? How unusual. Are you lost, or are you here for a purpose?" + purpose: "Everyone who comes to this house has a purpose, whether they know it or not." + herself: "I was the lady of this house once. Now I am bound to it, as are we all." + family: "My husband was obsessed with his research. My children... I tried to protect them. I failed." + research: "The barriers between worlds, the nature of reality itself. He found something, in the end. Something that should have remained hidden." + hidden: "In his secret study. The key is... well, I suppose you'll have to find that yourself. Some secrets reveal themselves only to those who seek them." + defaultResponse: "There are some things I cannot speak of. The house has its rules, even for the dead." + inventory: [] + mood: melancholy + +# Action definitions +actions: + look: + patterns: + - "look around" + - "look at [object]" + - "examine [object]" + - "check [object]" + - "inspect [object]" + - "observe [object]" + - "view [object]" + handler: "look" + + go: + patterns: + - "go [direction]" + - "move [direction]" + - "walk [direction]" + - "head [direction]" + - "travel [direction]" + - "enter [direction]" + requiresObject: true + handler: "go" + + take: + patterns: + - "take [object]" + - "get [object]" + - "pick up [object]" + - "grab [object]" + - "collect [object]" + requiresObject: true + handler: "take" + + drop: + patterns: + - "drop [object]" + - "put down [object]" + - "discard [object]" + - "leave [object]" + requiresObject: true + handler: "drop" + + inventory: + patterns: + - "inventory" + - "check inventory" + - "show inventory" + - "what am I carrying" + - "what do I have" + handler: "inventory" + + use: + patterns: + - "use [object]" + - "use [object] on [target]" + - "use [object] with [target]" + - "apply [object] to [target]" + requiresObject: true + requiresTarget: false + handler: "use" + + talk: + patterns: + - "talk to [object]" + - "speak to [object]" + - "ask [object] about [topic]" + - "tell [object] about [topic]" + - "converse with [object]" + requiresObject: true + handler: "talk" + + read: + patterns: + - "read [object]" + - "read from [object]" + - "examine [object]" + - "look at [object]" + requiresObject: true + handler: "look" + + help: + patterns: + - "help" + - "commands" + - "what can I do" + - "show help" + handler: "help" + + wear: + patterns: + - "wear [object]" + - "put on [object]" + - "don [object]" + requiresObject: true + handler: "use" + +# Initial game state +initialState: + currentRoomId: front_yard + inventory: + - strange_letter + visitedRooms: [] + flags: + hasMetButler: false + hasFoundSecret: false + counters: + moveCount: 0 \ No newline at end of file diff --git a/dist/cli/game-runner.d.ts b/dist/cli/game-runner.d.ts new file mode 100644 index 0000000..cd529b2 --- /dev/null +++ b/dist/cli/game-runner.d.ts @@ -0,0 +1,64 @@ +/** + * Command-line interface for running the interactive fiction game + */ +export declare class GameRunner { + private engine; + private llmProvider; + private rl; + private gameContext; + private gameHistory; + private suggestedCommands; + constructor(); + /** + * Initialize the game + */ + initialize(worldPath: string): Promise; + /** + * Start the game in CLI mode + */ + start(): Promise; + /** + * The main game loop for CLI mode + */ + private gameLoop; + /** + * Process a player command and return the narrative response + * Used by both CLI and web interfaces + */ + processCommand(input: string): Promise; + /** + * End the game + */ + end(): void; + /** + * Update the game context with new narrative + */ + private updateGameContext; + /** + * Get the current game state + * Used by web interface + */ + getGameState(): { + world: import("../interfaces/world-model").WorldModel; + currentRoomId: string; + inventory: string[]; + visitedRooms: string[]; + flags: Record; + counters: Record; + }; + /** + * Get the current room description + * Used by web interface + */ + getCurrentRoomDescription(): string; + /** + * Get suggested actions for the current game state + * Used by web interface + */ + getSuggestions(): string[]; + /** + * Load a saved game state + * Used by web interface + */ + loadGameState(savedState: any): void; +} diff --git a/dist/cli/game-runner.js b/dist/cli/game-runner.js new file mode 100644 index 0000000..6a86286 --- /dev/null +++ b/dist/cli/game-runner.js @@ -0,0 +1,262 @@ +"use strict"; +/** + * Command-line interface for running the interactive fiction game + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GameRunner = void 0; +const readline = __importStar(require("readline")); +const path = __importStar(require("path")); +const dotenv = __importStar(require("dotenv")); +const game_engine_1 = require("../engine/game-engine"); +const openrouter_provider_1 = require("../llm/openrouter-provider"); +// Load environment variables +dotenv.config(); +class GameRunner { + constructor() { + this.rl = null; + this.gameContext = ''; + this.gameHistory = []; + this.suggestedCommands = []; + this.engine = new game_engine_1.TextAdventureEngine(); + this.llmProvider = new openrouter_provider_1.OpenRouterProvider(); + } + /** + * Initialize the game + */ + async initialize(worldPath) { + console.log('Initializing game...'); + // Initialize LLM provider + const apiKey = process.env.OPENROUTER_API_KEY; + const model = process.env.OPENROUTER_MODEL; + if (!apiKey || !model) { + throw new Error('Missing required environment variables: OPENROUTER_API_KEY and/or OPENROUTER_MODEL'); + } + await this.llmProvider.initialize({ + apiKey, + model, + temperature: 0.7, + maxTokens: 800 + }); + // Load the world + const resolvedPath = path.resolve(worldPath); + console.log(`Loading world from ${resolvedPath}...`); + await this.engine.loadWorld(resolvedPath); + console.log('Game initialized successfully!'); + } + /** + * Start the game in CLI mode + */ + async start() { + // Create readline interface for CLI mode + this.rl = readline.createInterface({ + input: process.stdin, + output: process.stdout + }); + try { + // Display introduction + const introText = await this.engine.start(); + console.log('\n' + introText + '\n'); + // Look at initial room + const initialLook = this.engine.processAction({ action: 'look', confidence: 1 }); + // Generate narrative description + const narrativeRequest = { + action: 'look', + result: initialLook.message, + roomDescription: this.engine.getCurrentRoomDescription(), + visibleObjects: this.engine.getVisibleObjects(), + visibleCharacters: this.engine.getVisibleCharacters(), + tone: 'descriptive' + }; + const narrative = await this.llmProvider.generateNarrative(narrativeRequest); + console.log('\n' + narrative.text + '\n'); + // Store suggestions if available + if (narrative.suggestions && narrative.suggestions.length > 0) { + this.suggestedCommands = narrative.suggestions; + } + // Update game context + this.updateGameContext(narrative.text); + // Start the game loop + this.gameLoop(); + } + catch (error) { + console.error('Error starting game:', error); + this.end(); + } + } + /** + * The main game loop for CLI mode + */ + gameLoop() { + if (!this.rl) + return; + this.rl.question('> ', async (input) => { + if (input.toLowerCase() === 'quit' || input.toLowerCase() === 'exit') { + this.end(); + return; + } + const response = await this.processCommand(input); + console.log('\n' + response + '\n'); + // Continue the game loop + this.gameLoop(); + }); + } + /** + * Process a player command and return the narrative response + * Used by both CLI and web interfaces + */ + async processCommand(input) { + try { + // Process player input + const actionRequest = { + playerInput: input, + currentRoom: this.engine.getWorldModel().rooms[this.engine.getCurrentState().currentRoomId].name, + visibleObjects: this.engine.getVisibleObjects().map(id => this.engine.getWorldModel().objects[id].name), + visibleCharacters: this.engine.getVisibleCharacters().map(id => this.engine.getWorldModel().characters[id].name), + possibleActions: this.engine.getAvailableActions(), + inventory: this.engine.getCurrentState().inventory.map(id => this.engine.getWorldModel().objects[id].name), + gameContext: this.gameContext + }; + if (this.rl) { + console.log('Thinking...'); + } + // Translate player input to action + const action = await this.llmProvider.translateAction(actionRequest); + // Process the action in the game engine + const actionResult = this.engine.processAction(action); + // If state changed, update it + if (actionResult.stateChanged && actionResult.newState) { + this.engine.getCurrentState().currentRoomId = actionResult.newState.currentRoomId; + this.engine.getCurrentState().inventory = actionResult.newState.inventory; + this.engine.getCurrentState().visitedRooms = actionResult.newState.visitedRooms; + this.engine.getCurrentState().flags = actionResult.newState.flags; + this.engine.getCurrentState().counters = actionResult.newState.counters; + } + // Generate narrative description + const narrativeRequest = { + action: `${action.action}${action.object ? ' ' + action.object : ''}${action.target ? ' on ' + action.target : ''}`, + result: actionResult.message, + roomDescription: this.engine.getCurrentRoomDescription(), + visibleObjects: this.engine.getVisibleObjects().map(id => this.engine.getWorldModel().objects[id].name), + visibleCharacters: this.engine.getVisibleCharacters().map(id => this.engine.getWorldModel().characters[id].name), + previousContext: this.gameHistory.slice(-3).join('\n'), + tone: 'descriptive' + }; + const narrative = await this.llmProvider.generateNarrative(narrativeRequest); + // Store suggestions if available + if (narrative.suggestions && narrative.suggestions.length > 0) { + this.suggestedCommands = narrative.suggestions; + } + // Update game context with the new narrative + this.updateGameContext(narrative.text); + // Return the narrative text + return narrative.text; + } + catch (error) { + console.error('Error processing input:', error); + return 'Something went wrong. Please try again.'; + } + } + /** + * End the game + */ + end() { + console.log('\nThanks for playing!'); + if (this.rl) { + this.rl.close(); + this.rl = null; + } + this.engine.end(); + if (process.env.NODE_ENV !== 'production') { + process.exit(0); + } + } + /** + * Update the game context with new narrative + */ + updateGameContext(narrative) { + // Add to history + this.gameHistory.push(narrative); + // Keep history limited to last 10 entries + if (this.gameHistory.length > 10) { + this.gameHistory.shift(); + } + // Update current context (last 5 entries) + this.gameContext = this.gameHistory.slice(-5).join('\n'); + } + /** + * Get the current game state + * Used by web interface + */ + getGameState() { + return { + world: this.engine.getWorldModel(), + currentRoomId: this.engine.getCurrentState().currentRoomId, + inventory: this.engine.getCurrentState().inventory, + visitedRooms: this.engine.getCurrentState().visitedRooms, + flags: this.engine.getCurrentState().flags, + counters: this.engine.getCurrentState().counters + }; + } + /** + * Get the current room description + * Used by web interface + */ + getCurrentRoomDescription() { + const roomId = this.engine.getCurrentState().currentRoomId; + return this.engine.getWorldModel().rooms[roomId].description; + } + /** + * Get suggested actions for the current game state + * Used by web interface + */ + getSuggestions() { + return this.suggestedCommands; + } + /** + * Load a saved game state + * Used by web interface + */ + loadGameState(savedState) { + // Set the current state to match the saved state + this.engine.getCurrentState().currentRoomId = savedState.currentRoomId; + this.engine.getCurrentState().inventory = savedState.inventory; + this.engine.getCurrentState().visitedRooms = savedState.visitedRooms; + this.engine.getCurrentState().flags = savedState.flags; + this.engine.getCurrentState().counters = savedState.counters; + } +} +exports.GameRunner = GameRunner; +//# sourceMappingURL=game-runner.js.map \ No newline at end of file diff --git a/dist/cli/game-runner.js.map b/dist/cli/game-runner.js.map new file mode 100644 index 0000000..a212908 --- /dev/null +++ b/dist/cli/game-runner.js.map @@ -0,0 +1 @@ +{"version":3,"file":"game-runner.js","sourceRoot":"","sources":["../../src/cli/game-runner.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAqC;AACrC,2CAA6B;AAC7B,+CAAiC;AACjC,uDAA4D;AAC5D,oEAAgE;AAGhE,6BAA6B;AAC7B,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MAAa,UAAU;IAQrB;QALQ,OAAE,GAA8B,IAAI,CAAC;QACrC,gBAAW,GAAW,EAAE,CAAC;QACzB,gBAAW,GAAa,EAAE,CAAC;QAC3B,sBAAiB,GAAa,EAAE,CAAC;QAGvC,IAAI,CAAC,MAAM,GAAG,IAAI,iCAAmB,EAAE,CAAC;QACxC,IAAI,CAAC,WAAW,GAAG,IAAI,wCAAkB,EAAE,CAAC;IAC9C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,UAAU,CAAC,SAAiB;QACvC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;QAEpC,0BAA0B;QAC1B,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;QAC9C,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;QAE3C,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,oFAAoF,CAAC,CAAC;QACxG,CAAC;QAED,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU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CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QAC/D,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;QACrE,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QACvD,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;IAC/D,CAAC;CACF;AA1PD,gCA0PC"} \ No newline at end of file diff --git a/dist/engine/game-engine.d.ts b/dist/engine/game-engine.d.ts new file mode 100644 index 0000000..44a14ee --- /dev/null +++ b/dist/engine/game-engine.d.ts @@ -0,0 +1,77 @@ +/** + * Core Game Engine + * Manages game state and processes actions + */ +import { GameEngine, ActionResult } from '../interfaces/engine'; +import { WorldModel, GameState } from '../interfaces/world-model'; +import { ActionResponse } from '../interfaces/llm'; +export declare class TextAdventureEngine implements GameEngine { + private worldModel; + private gameState; + private actionHandlers; + constructor(); + /** + * Load a world model from a file + */ + loadWorld(worldModelPath: string): Promise; + /** + * Get the current game state + */ + getCurrentState(): GameState; + /** + * Get the world model + */ + getWorldModel(): WorldModel; + /** + * Process an action from the player + */ + processAction(action: ActionResponse): ActionResult; + /** + * Save the current game state to a file + */ + saveGame(filename: string): Promise; + /** + * Load a game state from a save file + */ + loadGame(filename: string): Promise; + /** + * Get a list of available actions in the current context + */ + getAvailableActions(): string[]; + /** + * Get a list of visible objects in the current room + */ + getVisibleObjects(): string[]; + /** + * Get a list of visible characters in the current room + */ + getVisibleCharacters(): string[]; + /** + * Get the description of the current room + */ + getCurrentRoomDescription(): string; + /** + * Start the game and return the introduction text + */ + start(): Promise; + /** + * End the game (cleanup resources if needed) + */ + end(): void; + /** + * Get the current room object + */ + private getCurrentRoom; + /** + * Register default action handlers + */ + private registerDefaultActionHandlers; + /** + * Find an object by name in a list of object IDs + */ + private findObjectByName; + /** + * Find a character by name in a list of character IDs + */ + private findCharacterByName; +} diff --git a/dist/engine/game-engine.js b/dist/engine/game-engine.js new file mode 100644 index 0000000..6b15bae --- /dev/null +++ b/dist/engine/game-engine.js @@ -0,0 +1,607 @@ +"use strict"; +/** + * Core Game Engine + * Manages game state and processes actions + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TextAdventureEngine = void 0; +const fs = __importStar(require("fs/promises")); +const yaml_parser_1 = require("../world-model/yaml-parser"); +class TextAdventureEngine { + constructor() { + this.worldModel = null; + this.gameState = null; + this.actionHandlers = {}; + this.registerDefaultActionHandlers(); + } + /** + * Load a world model from a file + */ + async loadWorld(worldModelPath) { + try { + this.worldModel = await yaml_parser_1.YamlWorldParser.loadFromFile(worldModelPath); + this.gameState = { ...this.worldModel.initialState }; + // Mark the initial room as visited + if (!this.gameState.visitedRooms.includes(this.gameState.currentRoomId)) { + this.gameState.visitedRooms.push(this.gameState.currentRoomId); + } + } + catch (error) { + console.error(`Failed to load world from ${worldModelPath}:`, error); + throw new Error(`Could not load world: ${error instanceof Error ? error.message : String(error)}`); + } + } + /** + * Get the current game state + */ + getCurrentState() { + if (!this.gameState) { + throw new Error('Game state not initialized. Please load a world first.'); + } + return { ...this.gameState }; + } + /** + * Get the world model + */ + getWorldModel() { + if (!this.worldModel) { + throw new Error('World model not initialized. Please load a world first.'); + } + return this.worldModel; + } + /** + * Process an action from the player + */ + processAction(action) { + if (!this.worldModel || !this.gameState) { + return { + success: false, + message: 'Game not initialized', + stateChanged: false + }; + } + const handler = this.actionHandlers[action.action.toLowerCase()]; + if (!handler) { + return { + success: false, + message: `I don't know how to "${action.action}"`, + stateChanged: false + }; + } + return handler(this.gameState, this.worldModel, action); + } + /** + * Save the current game state to a file + */ + async saveGame(filename) { + if (!this.gameState || !this.worldModel) { + throw new Error('Cannot save: game not initialized'); + } + const saveData = { + worldModelName: this.worldModel.title, + worldModelVersion: this.worldModel.version, + timestamp: new Date().toISOString(), + gameState: this.gameState + }; + try { + await fs.writeFile(filename, JSON.stringify(saveData, null, 2), 'utf8'); + } + catch (error) { + console.error(`Failed to save game to ${filename}:`, error); + throw new Error(`Could not save game: ${error instanceof Error ? error.message : String(error)}`); + } + } + /** + * Load a game state from a save file + */ + async loadGame(filename) { + try { + const fileContents = await fs.readFile(filename, 'utf8'); + const saveData = JSON.parse(fileContents); + // Check if the save file matches the current world model + if (!this.worldModel) { + throw new Error('World model not loaded'); + } + if (saveData.worldModelName !== this.worldModel.title || + saveData.worldModelVersion !== this.worldModel.version) { + throw new Error('Save file is for a different world or version'); + } + // Load the game state + this.gameState = saveData.gameState; + } + catch (error) { + console.error(`Failed to load game from ${filename}:`, error); + throw new Error(`Could not load save file: ${error instanceof Error ? error.message : String(error)}`); + } + } + /** + * Get a list of available actions in the current context + */ + getAvailableActions() { + if (!this.worldModel) + return []; + // Common actions always available + const availableActions = ['look', 'inventory', 'help']; + // Add movement actions based on current room exits + const currentRoom = this.getCurrentRoom(); + if (currentRoom) { + currentRoom.exits.forEach(exit => { + availableActions.push(`go ${exit.direction.toLowerCase()}`); + }); + } + // Add object interactions based on visible objects + const visibleObjects = this.getVisibleObjects(); + const objects = this.worldModel.objects; + visibleObjects.forEach(objId => { + const obj = objects[objId]; + if (obj) { + obj.allowedActions.forEach(action => { + availableActions.push(`${action} ${obj.name.toLowerCase()}`); + }); + } + }); + // Add character interactions + const visibleCharacters = this.getVisibleCharacters(); + visibleCharacters.forEach(charId => { + availableActions.push(`talk to ${this.worldModel.characters[charId].name.toLowerCase()}`); + }); + // Add inventory object actions + this.gameState.inventory.forEach(objId => { + const obj = objects[objId]; + if (obj) { + obj.allowedActions.forEach(action => { + availableActions.push(`${action} ${obj.name.toLowerCase()}`); + }); + } + }); + return Array.from(new Set(availableActions)); // Remove duplicates + } + /** + * Get a list of visible objects in the current room + */ + getVisibleObjects() { + if (!this.worldModel || !this.gameState) + return []; + const currentRoom = this.getCurrentRoom(); + if (!currentRoom) + return []; + const visibleObjects = [...currentRoom.objects]; + // Add objects from open containers + currentRoom.objects.forEach(objId => { + const obj = this.worldModel.objects[objId]; + if (obj && obj.traits.includes('container') && obj.states?.open && obj.containedObjects) { + visibleObjects.push(...obj.containedObjects); + } + }); + return visibleObjects; + } + /** + * Get a list of visible characters in the current room + */ + getVisibleCharacters() { + if (!this.worldModel || !this.gameState) + return []; + const currentRoom = this.getCurrentRoom(); + return currentRoom ? currentRoom.characters : []; + } + /** + * Get the description of the current room + */ + getCurrentRoomDescription() { + const currentRoom = this.getCurrentRoom(); + if (!currentRoom) + return 'You are in a void. Something has gone wrong.'; + return currentRoom.description; + } + /** + * Start the game and return the introduction text + */ + async start() { + if (!this.worldModel) { + throw new Error('World not loaded. Please load a world before starting.'); + } + // Reset game state to initial state + this.gameState = { ...this.worldModel.initialState }; + return this.worldModel.introduction; + } + /** + * End the game (cleanup resources if needed) + */ + end() { + // Cleanup could happen here if needed + console.log('Game ended'); + } + /** + * Get the current room object + */ + getCurrentRoom() { + if (!this.worldModel || !this.gameState) + return null; + const roomId = this.gameState.currentRoomId; + return this.worldModel.rooms[roomId] || null; + } + /** + * Register default action handlers + */ + registerDefaultActionHandlers() { + // Look action + this.actionHandlers['look'] = (state, world, action) => { + const room = world.rooms[state.currentRoomId]; + // If an object is specified, look at that object + if (action.object) { + // Try to find the object in the room or inventory + const visibleObjects = this.getVisibleObjects(); + const objId = this.findObjectByName(action.object, [...visibleObjects, ...state.inventory]); + if (!objId) { + return { + success: false, + message: `You don't see any ${action.object} here.`, + stateChanged: false + }; + } + const obj = world.objects[objId]; + return { + success: true, + message: obj.description, + stateChanged: false + }; + } + // Look at the room + const objectDescriptions = room.objects + .map(id => world.objects[id]) + .map(obj => `You can see ${obj.name.toLowerCase()} here.`); + const characterDescriptions = room.characters + .map(id => world.characters[id]) + .map(char => `${char.name} is here.`); + const exitDescriptions = room.exits + .map(exit => `There is an exit ${exit.direction.toLowerCase()}${exit.description ? ` (${exit.description})` : ''}.`); + const fullDescription = [ + room.description, + ...objectDescriptions, + ...characterDescriptions, + ...exitDescriptions + ].join('\n'); + return { + success: true, + message: fullDescription, + stateChanged: false + }; + }; + // Go action + this.actionHandlers['go'] = (state, world, action) => { + const room = world.rooms[state.currentRoomId]; + if (!action.object) { + return { + success: false, + message: 'Go where?', + stateChanged: false + }; + } + // Find the exit that matches the direction + const direction = action.object.toLowerCase(); + const exit = room.exits.find(e => e.direction.toLowerCase() === direction); + if (!exit) { + return { + success: false, + message: `You can't go ${direction} from here.`, + stateChanged: false + }; + } + if (exit.isLocked) { + if (!exit.keyId) { + return { + success: false, + message: `The way ${direction} is locked.`, + stateChanged: false + }; + } + if (!state.inventory.includes(exit.keyId)) { + return { + success: false, + message: `The way ${direction} is locked and you don't have the key.`, + stateChanged: false + }; + } + // Player has the key, unlock the exit + exit.isLocked = false; + return { + success: true, + message: `You unlock the way ${direction} and proceed.`, + stateChanged: true, + newState: { + ...state, + currentRoomId: exit.targetRoomId, + visitedRooms: state.visitedRooms.includes(exit.targetRoomId) + ? state.visitedRooms + : [...state.visitedRooms, exit.targetRoomId] + } + }; + } + // Exit is not locked, just move + return { + success: true, + message: `You go ${direction}.`, + stateChanged: true, + newState: { + ...state, + currentRoomId: exit.targetRoomId, + visitedRooms: state.visitedRooms.includes(exit.targetRoomId) + ? state.visitedRooms + : [...state.visitedRooms, exit.targetRoomId] + } + }; + }; + // Take action + this.actionHandlers['take'] = (state, world, action) => { + if (!action.object) { + return { + success: false, + message: 'Take what?', + stateChanged: false + }; + } + // Find the object in the current room + const visibleObjects = this.getVisibleObjects(); + const objId = this.findObjectByName(action.object, visibleObjects); + if (!objId) { + return { + success: false, + message: `You don't see any ${action.object} here.`, + stateChanged: false + }; + } + const obj = world.objects[objId]; + // Check if the object can be taken + if (!obj.traits.includes('takeable')) { + return { + success: false, + message: `You can't take the ${obj.name.toLowerCase()}.`, + stateChanged: false + }; + } + // Remove object from room and add to inventory + const room = world.rooms[state.currentRoomId]; + const newRoomObjects = room.objects.filter(id => id !== objId); + room.objects = newRoomObjects; + // Update state + return { + success: true, + message: `You take the ${obj.name.toLowerCase()}.`, + stateChanged: true, + newState: { + ...state, + inventory: [...state.inventory, objId] + } + }; + }; + // Inventory action + this.actionHandlers['inventory'] = (state, world) => { + if (state.inventory.length === 0) { + return { + success: true, + message: 'Your inventory is empty.', + stateChanged: false + }; + } + const items = state.inventory + .map(id => world.objects[id]) + .map(obj => obj.name) + .join(', '); + return { + success: true, + message: `You are carrying: ${items}.`, + stateChanged: false + }; + }; + // Drop action + this.actionHandlers['drop'] = (state, world, action) => { + if (!action.object) { + return { + success: false, + message: 'Drop what?', + stateChanged: false + }; + } + // Find the object in the inventory + const objId = this.findObjectByName(action.object, state.inventory); + if (!objId) { + return { + success: false, + message: `You don't have any ${action.object}.`, + stateChanged: false + }; + } + const obj = world.objects[objId]; + // Remove object from inventory and add to room + const room = world.rooms[state.currentRoomId]; + room.objects.push(objId); + // Update state + return { + success: true, + message: `You drop the ${obj.name.toLowerCase()}.`, + stateChanged: true, + newState: { + ...state, + inventory: state.inventory.filter(id => id !== objId) + } + }; + }; + // Use action + this.actionHandlers['use'] = (state, world, action) => { + if (!action.object) { + return { + success: false, + message: 'Use what?', + stateChanged: false + }; + } + // Find the object in inventory or visible objects + const visibleObjects = this.getVisibleObjects(); + const objId = this.findObjectByName(action.object, [...state.inventory, ...visibleObjects]); + if (!objId) { + return { + success: false, + message: `You don't see any ${action.object} here.`, + stateChanged: false + }; + } + const obj = world.objects[objId]; + // Check if the object can be used + if (!obj.allowedActions.includes('use')) { + return { + success: false, + message: `You can't use the ${obj.name.toLowerCase()}.`, + stateChanged: false + }; + } + // Check if there's a target + if (action.target) { + const targetId = this.findObjectByName(action.target, [...state.inventory, ...visibleObjects]); + if (!targetId) { + return { + success: false, + message: `You don't see any ${action.target} here.`, + stateChanged: false + }; + } + const target = world.objects[targetId]; + // TODO: Implement object-specific use logic (could be extended with a more sophisticated system) + return { + success: true, + message: `You use the ${obj.name.toLowerCase()} on the ${target.name.toLowerCase()}.`, + stateChanged: false + }; + } + // Simple use without target + return { + success: true, + message: `You use the ${obj.name.toLowerCase()}.`, + stateChanged: false + }; + }; + // Talk action + this.actionHandlers['talk'] = (state, world, action) => { + if (!action.object) { + return { + success: false, + message: 'Talk to whom?', + stateChanged: false + }; + } + // Find the character in the room + const visibleCharacters = this.getVisibleCharacters(); + const charId = this.findCharacterByName(action.object, visibleCharacters); + if (!charId) { + return { + success: false, + message: `You don't see anyone called ${action.object} here.`, + stateChanged: false + }; + } + const character = world.characters[charId]; + // If a topic is provided + if (action.parameters?.topic) { + const topic = action.parameters.topic.toLowerCase(); + const response = character.dialogue[topic] || character.defaultResponse; + return { + success: true, + message: `${character.name}: "${response}"`, + stateChanged: false + }; + } + // No specific topic + return { + success: true, + message: `${character.name} looks ready to talk. You could ask about: ${Object.keys(character.dialogue).join(', ')}.`, + stateChanged: false + }; + }; + // Help action + this.actionHandlers['help'] = () => { + return { + success: true, + message: [ + 'Available commands:', + '- look: Examine your surroundings or a specific object', + '- go [direction]: Move in a direction', + '- take [object]: Pick up an object', + '- drop [object]: Put down an object', + '- inventory: Check what you\'re carrying', + '- use [object] (on [target]): Use an object, optionally on another object', + '- talk to [character] (about [topic]): Speak with a character', + '- help: Show this help text', + '', + 'You can type commands in natural language. The AI will interpret your intent.' + ].join('\n'), + stateChanged: false + }; + }; + // Examine action (alias for look) + this.actionHandlers['examine'] = this.actionHandlers['look']; + } + /** + * Find an object by name in a list of object IDs + */ + findObjectByName(name, objectIds) { + if (!this.worldModel) + return null; + const normalizedName = name.toLowerCase(); + for (const id of objectIds) { + const obj = this.worldModel.objects[id]; + if (obj && obj.name.toLowerCase() === normalizedName) { + return id; + } + } + return null; + } + /** + * Find a character by name in a list of character IDs + */ + findCharacterByName(name, characterIds) { + if (!this.worldModel) + return null; + const normalizedName = name.toLowerCase(); + for (const id of characterIds) { + const character = this.worldModel.characters[id]; + if (character && character.name.toLowerCase() === normalizedName) { + return id; + } + } + return null; + } +} +exports.TextAdventureEngine = TextAdventureEngine; +//# sourceMappingURL=game-engine.js.map \ No newline at end of file diff --git a/dist/engine/game-engine.js.map b/dist/engine/game-engine.js.map new file mode 100644 index 0000000..82ea354 --- /dev/null +++ b/dist/engine/game-engine.js.map @@ -0,0 +1 @@ +{"version":3,"file":"game-engine.js","sourceRoot":"","sources":["../../src/engine/game-engine.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,gDAAkC;AAIlC,4DAA6D;AAE7D,MAAa,mBAAmB;IAK9B;QAJQ,eAAU,GAAsB,IAAI,CAAC;QACrC,cAAS,GAAqB,IAAI,CAAC;QACnC,mBAAc,GAAkG,EAAE,CAAC;QAGzH,IAAI,CAAC,6BAA6B,EAAE,CAAC;IACvC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,SAAS,CAAC,cAAsB;QAC3C,IAAI,CAAC;YACH,I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IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;YACjD,IAAI,SAAS,IAAI,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,cAAc,EAAE,CAAC;gBACjE,OAAO,EAAE,CAAC;YACZ,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAzoBD,kDAyoBC"} \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..32af2d4 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,4 @@ +/** + * Main entry point for the AI Interactive Fiction application + */ +export {}; diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..a47a471 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,110 @@ +"use strict"; +/** + * Main entry point for the AI Interactive Fiction application + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const dotenv = __importStar(require("dotenv")); +const game_runner_1 = require("./cli/game-runner"); +// Import the server module and the startServer function for the web interface +const server_1 = require("./server"); +// Load environment variables +console.log('Loading environment variables...'); +try { + const result = dotenv.config(); + if (result.error) { + console.error('Error loading .env file:', result.error); + } + else { + console.log('Environment variables loaded successfully'); + } +} +catch (error) { + console.error('Exception when loading env:', error); +} +async function main() { + try { + console.log('=== AI Interactive Fiction ==='); + 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'; + 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'}`); + // Check if we should run in CLI mode + const args = process.argv.slice(2); + const cliMode = args.includes('--cli') || args.includes('-c'); + if (cliMode) { + // CLI mode + console.log('Starting in CLI mode...'); + // Create game runner and initialize + console.log('Creating game runner...'); + const gameRunner = new game_runner_1.GameRunner(); + console.log('Initializing game...'); + await gameRunner.initialize(worldFile); + // Start the CLI game + console.log('Starting CLI game...'); + await gameRunner.start(); + } + else { + // Web interface mode - explicitly start the server with port fallback + console.log('Starting in web interface mode...'); + // Get port configuration + const DEFAULT_PORT = 3000; + const PORT = process.env.PORT ? parseInt(process.env.PORT) : DEFAULT_PORT; + const PORT_RANGE = 10; + // Start the web server with port fallback + console.log('Starting web server...'); + await (0, server_1.startServer)(PORT, PORT_RANGE); + } + } + catch (error) { + console.error('Failed to start:', error); + if (error instanceof Error) { + console.error('Error name:', error.name); + console.error('Error message:', error.message); + console.error('Error stack:', error.stack); + } + process.exit(1); + } +} +// Start the application +console.log('Starting application...'); +main().catch(error => { + console.error('Unhandled error in main:', error); + process.exit(1); +}); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map new file mode 100644 index 0000000..7b4a50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zC,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YAC3B,OAAO,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;YACzC,OAAO,CAAC,KAAK,CAAC,gBAAgB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YAC/C,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,wBAAwB;AACxB,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;AACvC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;IACjD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/dist/interfaces/engine.d.ts b/dist/interfaces/engine.d.ts new file mode 100644 index 0000000..ecdde6d --- /dev/null +++ b/dist/interfaces/engine.d.ts @@ -0,0 +1,39 @@ +/** + * Interfaces for the game engine + */ +import { WorldModel, GameState } from './world-model'; +import { ActionResponse, NarrativeResponse } from './llm'; +export interface ActionResult { + success: boolean; + message: string; + stateChanged: boolean; + newState?: GameState; +} +export interface GameEngine { + loadWorld(worldModelPath: string): Promise; + getCurrentState(): GameState; + getWorldModel(): WorldModel; + processAction(action: ActionResponse): ActionResult; + saveGame(filename: string): Promise; + loadGame(filename: string): Promise; + getAvailableActions(): string[]; + getVisibleObjects(): string[]; + getVisibleCharacters(): string[]; + getCurrentRoomDescription(): string; + start(): Promise; + end(): void; +} +export interface GameSession { + engine: GameEngine; + history: { + playerInput: string; + actionResponse: ActionResponse; + actionResult: ActionResult; + narrativeResponse: NarrativeResponse; + }[]; + startTime: Date; + lastInteractionTime: Date; +} +export interface ActionHandler { + execute(gameState: GameState, worldModel: WorldModel, action: ActionResponse): ActionResult; +} diff --git a/dist/interfaces/engine.js b/dist/interfaces/engine.js new file mode 100644 index 0000000..2892d4b --- /dev/null +++ b/dist/interfaces/engine.js @@ -0,0 +1,6 @@ +"use strict"; +/** + * Interfaces for the game engine + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=engine.js.map \ No newline at end of file diff --git a/dist/interfaces/engine.js.map b/dist/interfaces/engine.js.map new file mode 100644 index 0000000..0a23924 --- /dev/null +++ b/dist/interfaces/engine.js.map @@ -0,0 +1 @@ +{"version":3,"file":"engine.js","sourceRoot":"","sources":["../../src/interfaces/engine.ts"],"names":[],"mappings":";AAAA;;GAEG"} \ No newline at end of file diff --git a/dist/interfaces/llm.d.ts b/dist/interfaces/llm.d.ts new file mode 100644 index 0000000..740da5a --- /dev/null +++ b/dist/interfaces/llm.d.ts @@ -0,0 +1,46 @@ +/** + * Interfaces for LLM integration + */ +export interface LlmConfig { + apiKey: string; + model: string; + temperature?: number; + maxTokens?: number; + topP?: number; + frequencyPenalty?: number; + presencePenalty?: number; +} +export interface ActionRequest { + playerInput: string; + currentRoom: string; + visibleObjects: string[]; + visibleCharacters: string[]; + possibleActions: string[]; + inventory: string[]; + gameContext: string; +} +export interface ActionResponse { + action: string; + object?: string; + target?: string; + parameters?: Record; + confidence: number; +} +export interface NarrativeRequest { + action: string; + result: string; + roomDescription: string; + visibleObjects: string[]; + visibleCharacters: string[]; + previousContext?: string; + tone?: string; +} +export interface NarrativeResponse { + text: string; + suggestions?: string[]; +} +export interface LlmProvider { + initialize(config: LlmConfig): Promise; + translateAction(request: ActionRequest): Promise; + generateNarrative(request: NarrativeRequest): Promise; +} diff --git a/dist/interfaces/llm.js b/dist/interfaces/llm.js new file mode 100644 index 0000000..1aa0d45 --- /dev/null +++ b/dist/interfaces/llm.js @@ -0,0 +1,6 @@ +"use strict"; +/** + * Interfaces for LLM integration + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=llm.js.map \ No newline at end of file diff --git a/dist/interfaces/llm.js.map b/dist/interfaces/llm.js.map new file mode 100644 index 0000000..957cb4b --- /dev/null +++ b/dist/interfaces/llm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"llm.js","sourceRoot":"","sources":["../../src/interfaces/llm.ts"],"names":[],"mappings":";AAAA;;GAEG"} \ No newline at end of file diff --git a/dist/interfaces/world-model.d.ts b/dist/interfaces/world-model.d.ts new file mode 100644 index 0000000..b6b5895 --- /dev/null +++ b/dist/interfaces/world-model.d.ts @@ -0,0 +1,61 @@ +/** + * Core interfaces for the interactive fiction world model + */ +export interface Room { + id: string; + name: string; + description: string; + exits: Exit[]; + objects: string[]; + characters: string[]; +} +export interface Exit { + direction: string; + targetRoomId: string; + description?: string; + isLocked?: boolean; + keyId?: string; +} +export interface GameObject { + id: string; + name: string; + description: string; + traits: string[]; + states: Record; + containedObjects?: string[]; + allowedActions: string[]; +} +export interface Character { + id: string; + name: string; + description: string; + dialogue: Record; + inventory: string[]; + defaultResponse: string; + mood?: string; +} +export interface Action { + name: string; + patterns: string[]; + requiresObject?: boolean; + requiresTarget?: boolean; + handler: string; +} +export interface GameState { + currentRoomId: string; + inventory: string[]; + visitedRooms: string[]; + flags: Record; + counters: Record; +} +export interface WorldModel { + title: string; + author: string; + version: string; + introduction: string; + rooms: Record; + objects: Record; + characters: Record; + actions: Record; + initialState: GameState; +} diff --git a/dist/interfaces/world-model.js b/dist/interfaces/world-model.js new file mode 100644 index 0000000..314a13f --- /dev/null +++ b/dist/interfaces/world-model.js @@ -0,0 +1,6 @@ +"use strict"; +/** + * Core interfaces for the interactive fiction world model + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=world-model.js.map \ No newline at end of file diff --git a/dist/interfaces/world-model.js.map b/dist/interfaces/world-model.js.map new file mode 100644 index 0000000..ff8ecab --- /dev/null +++ b/dist/interfaces/world-model.js.map @@ -0,0 +1 @@ +{"version":3,"file":"world-model.js","sourceRoot":"","sources":["../../src/interfaces/world-model.ts"],"names":[],"mappings":";AAAA;;GAEG"} \ No newline at end of file diff --git a/dist/llm/openrouter-provider.d.ts b/dist/llm/openrouter-provider.d.ts new file mode 100644 index 0000000..54387ce --- /dev/null +++ b/dist/llm/openrouter-provider.d.ts @@ -0,0 +1,36 @@ +/** + * OpenRouter LLM Provider + * Handles communication with OpenRouter API for LLM interactions + */ +import { LlmProvider, LlmConfig, ActionRequest, ActionResponse, NarrativeRequest, NarrativeResponse } from '../interfaces/llm'; +export declare class OpenRouterProvider implements LlmProvider { + private apiKey; + private model; + private client; + private temperature; + private maxTokens; + /** + * Initialize the OpenRouter provider with configuration + */ + initialize(config: LlmConfig): Promise; + /** + * Translate player input into a structured action for the game engine + */ + translateAction(request: ActionRequest): Promise; + /** + * Generate narrative prose based on game events + */ + generateNarrative(request: NarrativeRequest): Promise; + /** + * Build the system and user prompts for action translation + */ + private buildActionPrompt; + /** + * Build the system and user prompts for narrative generation + */ + private buildNarrativePrompt; + /** + * Validate and normalize the action response + */ + private validateActionResponse; +} diff --git a/dist/llm/openrouter-provider.js b/dist/llm/openrouter-provider.js new file mode 100644 index 0000000..7a0d88b --- /dev/null +++ b/dist/llm/openrouter-provider.js @@ -0,0 +1,192 @@ +"use strict"; +/** + * OpenRouter LLM Provider + * Handles communication with OpenRouter API for LLM interactions + */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OpenRouterProvider = void 0; +const axios_1 = __importDefault(require("axios")); +class OpenRouterProvider { + constructor() { + this.apiKey = ''; + this.model = ''; + this.temperature = 0.7; + this.maxTokens = 800; + } + /** + * Initialize the OpenRouter provider with configuration + */ + async initialize(config) { + this.apiKey = config.apiKey; + this.model = config.model; + this.temperature = config.temperature ?? 0.7; + this.maxTokens = config.maxTokens ?? 800; + this.client = axios_1.default.create({ + baseURL: 'https://openrouter.ai/api/v1', + headers: { + 'Authorization': `Bearer ${this.apiKey}`, + 'Content-Type': 'application/json' + } + }); + } + /** + * Translate player input into a structured action for the game engine + */ + async translateAction(request) { + try { + const prompt = this.buildActionPrompt(request); + const response = await this.client.post('/chat/completions', { + model: this.model, + messages: [ + { + role: 'system', + content: prompt.system + }, + { + role: 'user', + content: prompt.user + } + ], + temperature: 0.2, // Lower temperature for more deterministic outputs + max_tokens: 150, + response_format: { type: 'json_object' } + }); + const content = response.data.choices[0].message.content; + const parsedResponse = JSON.parse(content); + return this.validateActionResponse(parsedResponse); + } + catch (error) { + console.error('Error translating action:', error); + // Fallback to a simple "look" action when errors occur + return { + action: 'look', + confidence: 0.5 + }; + } + } + /** + * Generate narrative prose based on game events + */ + async generateNarrative(request) { + try { + const prompt = this.buildNarrativePrompt(request); + const response = await this.client.post('/chat/completions', { + model: this.model, + messages: [ + { + role: 'system', + content: prompt.system + }, + { + role: 'user', + content: prompt.user + } + ], + temperature: this.temperature, + max_tokens: this.maxTokens + }); + const content = response.data.choices[0].message.content; + // Check if response is JSON format or plain text + try { + const parsedResponse = JSON.parse(content); + return { + text: parsedResponse.text, + suggestions: parsedResponse.suggestions || [] + }; + } + catch { + // Plain text response, just use the content directly + return { + text: content + }; + } + } + catch (error) { + console.error('Error generating narrative:', error); + return { + text: `Something happened, but the narrator is at a loss for words. (Error: ${error instanceof Error ? error.message : String(error)})` + }; + } + } + /** + * Build the system and user prompts for action translation + */ + buildActionPrompt(request) { + const systemPrompt = `You are an AI assistant that translates natural language input into structured action commands for an interactive fiction game. +Your task is to convert player input into a JSON object representing an action that can be understood by the game engine. + +The player is currently in the "${request.currentRoom}" room. +Visible objects: ${request.visibleObjects.join(', ')} +Visible characters: ${request.visibleCharacters.join(', ')} +Inventory: ${request.inventory.join(', ')} +Available actions: ${request.possibleActions.join(', ')} + +Game context: ${request.gameContext} + +Respond ONLY with a JSON object that follows this structure: +{ + "action": "string", // Name of the action (e.g., "take", "examine", "go", "talk", etc.) + "object": "string", // Optional: Primary object of the action + "target": "string", // Optional: Secondary object/target of the action + "parameters": {}, // Optional: Additional parameters as key-value pairs + "confidence": number // How confident you are in this interpretation (0.0-1.0) +} + +Choose the action from the list of available actions. If the player's input is ambiguous or doesn't map well to an available action, choose the closest match and set a lower confidence score.`; + const userPrompt = request.playerInput; + return { + system: systemPrompt, + user: userPrompt + }; + } + /** + * Build the system and user prompts for narrative generation + */ + buildNarrativePrompt(request) { + const tone = request.tone || 'descriptive'; + const systemPrompt = `You are an AI assistant that generates engaging narrative prose for an interactive fiction game. +Your task is to describe what happens when a player performs an action in the game world. + +Craft a vivid, ${tone} description that tells the player what happened as a result of their action. Make your prose engaging and atmospheric. + +Current room description: "${request.roomDescription}" +Visible objects: ${request.visibleObjects.join(', ')} +Visible characters: ${request.visibleCharacters.join(', ')} + +${request.previousContext ? `Previous context: ${request.previousContext}` : ''} + +Respond with engaging prose that describes the outcome of the player's action. +You can optionally include 1-3 subtle hints about interesting things to try next.`; + const userPrompt = `The player has performed this action: "${request.action}". +The result of the action is: "${request.result}". +Please describe what happens in an engaging, narrative way.`; + return { + system: systemPrompt, + user: userPrompt + }; + } + /** + * Validate and normalize the action response + */ + validateActionResponse(response) { + const validatedResponse = { + action: typeof response.action === 'string' ? response.action : 'look', + confidence: typeof response.confidence === 'number' ? response.confidence : 0.5 + }; + if (typeof response.object === 'string') { + validatedResponse.object = response.object; + } + if (typeof response.target === 'string') { + validatedResponse.target = response.target; + } + if (response.parameters && typeof response.parameters === 'object') { + validatedResponse.parameters = response.parameters; + } + return validatedResponse; + } +} +exports.OpenRouterProvider = OpenRouterProvider; +//# sourceMappingURL=openrouter-provider.js.map \ No newline at end of file diff --git a/dist/llm/openrouter-provider.js.map b/dist/llm/openrouter-provider.js.map new file mode 100644 index 0000000..6ea9069 --- /dev/null +++ b/dist/llm/openrouter-provider.js.map @@ -0,0 +1 @@ +{"version":3,"file":"openrouter-provider.js","sourceRoot":"","sources":["../../src/llm/openrouter-provider.ts"],"names":[],"mappings":";AAAA;;;GAG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AAI,CAAC;;EAExD,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,qBAAqB,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE;;;kFAGG,CAAC;QAE/E,MAAM,UAAU,GAAG,0CAA0C,OAAO,CAAC,MAAM;gCAC/C,OAAO,CAAC,MAAM;4DACc,CAAC;QAEzD,OAAO;YACL,MAAM,EAAE,YAAY;YACpB,IAAI,EAAE,UAAU;SACjB,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,sBAAsB,CAAC,QAAiC;QAC9D,MAAM,iBAAiB,GAAmB;YACxC,MAAM,EAAE,OAAO,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;YACtE,UAAU,EAAE,OAAO,QAAQ,CAAC,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG;SAChF,CAAC;QAEF,IAAI,OAAO,QAAQ,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YACxC,iBAAiB,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;QAC7C,CAAC;QAED,IAAI,OAAO,QAAQ,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YACxC,iBAAiB,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;QAC7C,CAAC;QAED,IAAI,QAAQ,CAAC,UAAU,IAAI,OAAO,QAAQ,CAAC,UAAU,KAAK,QAAQ,EAAE,CAAC;YACnE,iBAAiB,CAAC,UAAU,GAAG,QAAQ,CAAC,UAAoC,CAAC;QAC/E,CAAC;QAED,OAAO,iBAAiB,CAAC;IAC3B,CAAC;CACF;AApMD,gDAoMC"} \ No newline at end of file diff --git a/dist/server.d.ts b/dist/server.d.ts new file mode 100644 index 0000000..456d5fb --- /dev/null +++ b/dist/server.d.ts @@ -0,0 +1,11 @@ +/** + * AI Interactive Fiction - Web Server + * Serves the web UI and handles WebSocket communication + */ +import http from 'http'; +import { Server as SocketIOServer } from 'socket.io'; +declare const app: import("express-serve-static-core").Express; +declare const server: http.Server; +declare const io: SocketIOServer; +export declare function startServer(initialPort: number, range: number): Promise; +export { app, server, io }; diff --git a/dist/server.js b/dist/server.js new file mode 100644 index 0000000..d831f5a --- /dev/null +++ b/dist/server.js @@ -0,0 +1,252 @@ +"use strict"; +/** + * AI Interactive Fiction - Web Server + * Serves the web UI and handles WebSocket communication + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.io = exports.server = exports.app = void 0; +exports.startServer = startServer; +const path_1 = __importDefault(require("path")); +const express_1 = __importDefault(require("express")); +const http_1 = __importDefault(require("http")); +const socket_io_1 = require("socket.io"); +const dotenv = __importStar(require("dotenv")); +const game_runner_1 = require("./cli/game-runner"); +const fs_1 = require("fs"); +// Load environment variables +dotenv.config(); +// Create Express application +const app = (0, express_1.default)(); +exports.app = app; +const server = http_1.default.createServer(app); +exports.server = server; +const io = new socket_io_1.Server(server); +exports.io = io; +// Get port from environment variables or use default +const DEFAULT_PORT = 3000; +const PORT = process.env.PORT ? parseInt(process.env.PORT) : DEFAULT_PORT; +const PORT_RANGE = 10; // Try up to 10 ports starting from the default +// Serve static files from the public directory +app.use(express_1.default.static(path_1.default.join(__dirname, '../public'))); +// Set up game sessions +const gameSessions = new Map(); +// Handle socket connections +io.on('connection', (socket) => { + console.log(`New client connected: ${socket.id}`); + // Start a new game + socket.on('startGame', async () => { + try { + // Initialize game runner + const gameRunner = new game_runner_1.GameRunner(); + const worldFile = process.env.DEFAULT_WORLD_FILE || './data/worlds/example_world.yml'; + // Initialize the game + await gameRunner.initialize(worldFile); + // Store game session + gameSessions.set(socket.id, gameRunner); + // Send introduction to client + const gameState = gameRunner.getGameState(); + socket.emit('gameIntroduction', { + introduction: gameState.world.introduction, + initialRoomDescription: gameRunner.getCurrentRoomDescription(), + currentRoomId: gameState.currentRoomId + }); + } + catch (error) { + console.error('Error starting game:', error); + socket.emit('error', { message: 'Failed to start game. Please try again.' }); + } + }); + // Process player command + socket.on('playerCommand', async (data) => { + try { + const gameRunner = gameSessions.get(socket.id); + if (!gameRunner) { + socket.emit('error', { message: 'Game session not found. Please start a new game.' }); + return; + } + // Process command and get response + const response = await gameRunner.processCommand(data.command); + // Send narrative response to client + socket.emit('narrativeResponse', { + text: response, + gameState: { + currentRoomId: gameRunner.getGameState().currentRoomId + }, + suggestions: gameRunner.getSuggestions() + }); + } + catch (error) { + console.error('Error processing command:', error); + socket.emit('error', { message: 'Failed to process command. Please try again.' }); + } + }); + // Save game state + socket.on('saveGame', () => { + try { + const gameRunner = gameSessions.get(socket.id); + if (!gameRunner) { + socket.emit('error', { message: 'Game session not found. Please start a new game.' }); + return; + } + // Store save data in session + socket.data.savedGame = gameRunner.getGameState(); + socket.emit('gameSaved'); + } + catch (error) { + console.error('Error saving game:', error); + socket.emit('error', { message: 'Failed to save game. Please try again.' }); + } + }); + // Load game state + socket.on('loadGame', () => { + try { + const gameRunner = gameSessions.get(socket.id); + if (!gameRunner) { + socket.emit('error', { message: 'Game session not found. Please start a new game.' }); + return; + } + // Check if there's a saved game + if (!socket.data.savedGame) { + socket.emit('error', { message: 'No saved game found.' }); + return; + } + // Load saved game + gameRunner.loadGameState(socket.data.savedGame); + // Send current state to client + socket.emit('gameLoaded', { + currentRoomDescription: gameRunner.getCurrentRoomDescription(), + currentRoomId: gameRunner.getGameState().currentRoomId + }); + } + catch (error) { + console.error('Error loading game:', error); + socket.emit('error', { message: 'Failed to load game. Please try again.' }); + } + }); + // Handle disconnection + socket.on('disconnect', () => { + console.log(`Client disconnected: ${socket.id}`); + // Clean up game session + if (gameSessions.has(socket.id)) { + gameSessions.delete(socket.id); + } + }); +}); +// Ensure required asset folders exist +function ensureDirectories() { + const dirs = [ + path_1.default.join(__dirname, '../public'), + path_1.default.join(__dirname, '../public/js'), + path_1.default.join(__dirname, '../public/css'), + path_1.default.join(__dirname, '../public/images'), + path_1.default.join(__dirname, '../public/fonts') + ]; + for (const dir of dirs) { + if (!(0, fs_1.existsSync)(dir)) { + (0, fs_1.mkdirSync)(dir, { recursive: true }); + } + } +} +// Copy kokoro-js library from node_modules if not already present +function ensureKokoroJs() { + const source = path_1.default.join(__dirname, '../node_modules/kokoro-js/dist/index.js'); + const destination = path_1.default.join(__dirname, '../public/js/kokoro-js.js'); + if ((0, fs_1.existsSync)(source) && !(0, fs_1.existsSync)(destination)) { + (0, fs_1.copyFileSync)(source, destination); + console.log(`Copied kokoro-js from ${source} to ${destination}`); + } +} +// Start the server with port fallback +async function startServer(initialPort, range) { + let currentPort = initialPort; + const maxPort = initialPort + range; + // Try ports in the specified range + while (currentPort < maxPort) { + try { + // Ensure directories exist + ensureDirectories(); + // Ensure kokoro-js is copied + try { + ensureKokoroJs(); + } + catch (error) { + console.error('Error copying kokoro-js:', error); + } + // Try to start the server on the current port + await new Promise((resolve, reject) => { + server.listen(currentPort, () => { + console.log(`AI Interactive Fiction web server running on http://localhost:${currentPort}`); + resolve(); + }); + server.on('error', (error) => { + // If port is in use, try next port + if (error.code === 'EADDRINUSE') { + console.log(`Port ${currentPort} is in use, trying next port...`); + server.close(); + currentPort++; + reject(); + } + else { + // For other errors, log and reject + console.error('Server error:', error); + reject(error); + } + }); + }); + // If we reach here, server started successfully + return; + } + catch (error) { + // If we reach the max port and still fail, throw an error + if (currentPort >= maxPort - 1) { + throw new Error(`Failed to start server on ports ${initialPort} to ${maxPort - 1}`); + } + // Otherwise try the next port + // The loop continues as the rejection above increments currentPort + } + } +} +// Start the server when this module is run directly +if (require.main === module) { + startServer(PORT, PORT_RANGE).catch(error => { + console.error('Failed to start server:', error); + process.exit(1); + }); +} +//# sourceMappingURL=server.js.map \ No newline at end of file diff --git a/dist/server.js.map b/dist/server.js.map new file mode 100644 index 0000000..f059cfa --- /dev/null +++ b/dist/server.js.map @@ -0,0 +1 @@ +{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoLH,kCAoDC;AAtOD,gDAAwB;AACxB,sDAA8B;AAC9B,gDAAwB;AACxB,yCAAqD;AACrD,+CAAiC;AACjC,mDAA+C;AAC/C,2BAAyD;AAEzD,6BAA6B;AAC7B,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,6BAA6B;AAC7B,MAAM,GAAG,GAAG,IAAA,iBAAO,GAAE,CAAC;AAoOb,kBAAG;AAnOZ,MAAM,MAAM,GAAG,cAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;AAmOxB,wBAAM;AAlOpB,MAAM,EAAE,GAAG,IAAI,kBAAc,CAAC,MAAM,CAAC,CAAC;AAkOhB,gBAAE;AAhOxB,qDAAq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EAAE,EAAE;oBAClD,mCAAmC;oBACnC,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;wBAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,WAAW,iCAAiC,CAAC,CAAC;wBAClE,MAAM,CAAC,KAAK,EAAE,CAAC;wBACf,WAAW,EAAE,CAAC;wBACd,MAAM,EAAE,CAAC;oBACX,CAAC;yBAAM,CAAC;wBACN,mCAAmC;wBACnC,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;wBACtC,MAAM,CAAC,KAAK,CAAC,CAAC;oBAChB,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,gDAAgD;YAChD,OAAO;QAET,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,0DAA0D;YAC1D,IAAI,WAAW,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;gBAC/B,MAAM,IAAI,KAAK,CAAC,mCAAmC,WAAW,OAAO,OAAO,GAAG,CAAC,EAAE,CAAC,CAAC;YACtF,CAAC;YAED,8BAA8B;YAC9B,mEAAmE;QACrE,CAAC;IACH,CAAC;AACH,CAAC;AAED,oDAAoD;AACpD,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,WAAW,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;QAC1C,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/dist/world-model/yaml-parser.d.ts b/dist/world-model/yaml-parser.d.ts new file mode 100644 index 0000000..91b5f1f --- /dev/null +++ b/dist/world-model/yaml-parser.d.ts @@ -0,0 +1,71 @@ +/** + * YAML World Model Parser + * Loads and validates world definitions from YAML files + */ +import { WorldModel } from '../interfaces/world-model'; +export declare class YamlWorldParser { + /** + * Load a world model from a YAML file + */ + static loadFromFile(filePath: string): Promise; + /** + * Validate the loaded YAML data and transform it into a WorldModel + */ + private static validateAndTransform; + /** + * Validate that an object has all required fields + */ + private static validateRequiredFields; + /** + * Validate that a value is a string + */ + private static validateString; + /** + * Validate room definitions + */ + private static validateRooms; + /** + * Validate exit definitions + */ + private static validateExits; + /** + * Validate object definitions + */ + private static validateObjects; + /** + * Validate character definitions + */ + private static validateCharacters; + /** + * Validate action definitions + */ + private static validateActions; + /** + * Validate initial game state + */ + private static validateInitialState; + /** + * Validate object states (record of boolean values) + */ + private static validateObjectStates; + /** + * Validate dialogue (record of string values) + */ + private static validateDialogue; + /** + * Validate flags (record of boolean values) + */ + private static validateFlags; + /** + * Validate counters (record of number values) + */ + private static validateCounters; + /** + * Validate that an array of strings is valid + */ + private static validateStringArray; + /** + * Validate references between entities + */ + private static validateReferences; +} diff --git a/dist/world-model/yaml-parser.js b/dist/world-model/yaml-parser.js new file mode 100644 index 0000000..c2bf6ac --- /dev/null +++ b/dist/world-model/yaml-parser.js @@ -0,0 +1,399 @@ +"use strict"; +/** + * YAML World Model Parser + * Loads and validates world definitions from YAML files + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.YamlWorldParser = void 0; +const fs = __importStar(require("fs/promises")); +const yaml = __importStar(require("js-yaml")); +class YamlWorldParser { + /** + * Load a world model from a YAML file + */ + static async loadFromFile(filePath) { + try { + const fileContents = await fs.readFile(filePath, 'utf8'); + const worldData = yaml.load(fileContents); + return this.validateAndTransform(worldData); + } + catch (error) { + console.error(`Error loading world from ${filePath}:`, error); + throw new Error(`Failed to load world from ${filePath}: ${error instanceof Error ? error.message : String(error)}`); + } + } + /** + * Validate the loaded YAML data and transform it into a WorldModel + */ + static validateAndTransform(data) { + if (!data || typeof data !== 'object') { + throw new Error('Invalid world data: must be an object'); + } + const worldData = data; + // Validate required top-level fields + this.validateRequiredFields(worldData, ['title', 'author', 'version', 'introduction', 'rooms', 'initialState']); + // Transform and validate the world model + const worldModel = { + title: this.validateString(worldData.title, 'title'), + author: this.validateString(worldData.author, 'author'), + version: this.validateString(worldData.version, 'version'), + introduction: this.validateString(worldData.introduction, 'introduction'), + rooms: this.validateRooms(worldData.rooms), + objects: this.validateObjects(worldData.objects), + characters: this.validateCharacters(worldData.characters), + actions: this.validateActions(worldData.actions), + initialState: this.validateInitialState(worldData.initialState) + }; + // Validate references between entities + this.validateReferences(worldModel); + return worldModel; + } + /** + * Validate that an object has all required fields + */ + static validateRequiredFields(data, requiredFields) { + for (const field of requiredFields) { + if (!(field in data)) { + throw new Error(`Missing required field: ${field}`); + } + } + } + /** + * Validate that a value is a string + */ + static validateString(value, fieldName) { + if (typeof value !== 'string') { + throw new Error(`Field ${fieldName} must be a string`); + } + return value; + } + /** + * Validate room definitions + */ + static validateRooms(rooms) { + if (!rooms || typeof rooms !== 'object') { + throw new Error('Rooms must be an object mapping room IDs to room definitions'); + } + const roomsData = rooms; + const validatedRooms = {}; + for (const [roomId, roomData] of Object.entries(roomsData)) { + if (!roomData || typeof roomData !== 'object') { + throw new Error(`Room ${roomId} must be an object`); + } + const room = roomData; + this.validateRequiredFields(room, ['name', 'description', 'exits']); + validatedRooms[roomId] = { + id: roomId, + name: this.validateString(room.name, `rooms.${roomId}.name`), + description: this.validateString(room.description, `rooms.${roomId}.description`), + exits: this.validateExits(room.exits, roomId), + objects: this.validateStringArray(room.objects || [], `rooms.${roomId}.objects`), + characters: this.validateStringArray(room.characters || [], `rooms.${roomId}.characters`) + }; + } + return validatedRooms; + } + /** + * Validate exit definitions + */ + static validateExits(exits, roomId) { + if (!Array.isArray(exits)) { + throw new Error(`Exits for room ${roomId} must be an array`); + } + return exits.map((exit, index) => { + if (!exit || typeof exit !== 'object') { + throw new Error(`Exit ${index} in room ${roomId} must be an object`); + } + const exitData = exit; + this.validateRequiredFields(exitData, ['direction', 'targetRoomId']); + return { + direction: this.validateString(exitData.direction, `rooms.${roomId}.exits[${index}].direction`), + targetRoomId: this.validateString(exitData.targetRoomId, `rooms.${roomId}.exits[${index}].targetRoomId`), + description: exitData.description ? this.validateString(exitData.description, `rooms.${roomId}.exits[${index}].description`) : undefined, + isLocked: typeof exitData.isLocked === 'boolean' ? exitData.isLocked : false, + keyId: exitData.keyId ? this.validateString(exitData.keyId, `rooms.${roomId}.exits[${index}].keyId`) : undefined + }; + }); + } + /** + * Validate object definitions + */ + static validateObjects(objects) { + if (!objects) + return {}; // Objects are optional + if (typeof objects !== 'object') { + throw new Error('Objects must be an object mapping object IDs to object definitions'); + } + const objectsData = objects; + const validatedObjects = {}; + for (const [objectId, objectData] of Object.entries(objectsData)) { + if (!objectData || typeof objectData !== 'object') { + throw new Error(`Object ${objectId} must be an object`); + } + const obj = objectData; + this.validateRequiredFields(obj, ['name', 'description', 'traits', 'allowedActions']); + validatedObjects[objectId] = { + id: objectId, + name: this.validateString(obj.name, `objects.${objectId}.name`), + description: this.validateString(obj.description, `objects.${objectId}.description`), + traits: this.validateStringArray(obj.traits, `objects.${objectId}.traits`), + states: this.validateObjectStates(obj.states, objectId), + allowedActions: this.validateStringArray(obj.allowedActions, `objects.${objectId}.allowedActions`), + containedObjects: obj.containedObjects ? this.validateStringArray(obj.containedObjects, `objects.${objectId}.containedObjects`) : [] + }; + } + return validatedObjects; + } + /** + * Validate character definitions + */ + static validateCharacters(characters) { + if (!characters) + return {}; // Characters are optional + if (typeof characters !== 'object') { + throw new Error('Characters must be an object mapping character IDs to character definitions'); + } + const charactersData = characters; + const validatedCharacters = {}; + for (const [characterId, characterData] of Object.entries(charactersData)) { + if (!characterData || typeof characterData !== 'object') { + throw new Error(`Character ${characterId} must be an object`); + } + const character = characterData; + this.validateRequiredFields(character, ['name', 'description', 'dialogue', 'defaultResponse']); + validatedCharacters[characterId] = { + id: characterId, + name: this.validateString(character.name, `characters.${characterId}.name`), + description: this.validateString(character.description, `characters.${characterId}.description`), + dialogue: this.validateDialogue(character.dialogue, characterId), + inventory: this.validateStringArray(character.inventory || [], `characters.${characterId}.inventory`), + defaultResponse: this.validateString(character.defaultResponse, `characters.${characterId}.defaultResponse`), + mood: character.mood ? this.validateString(character.mood, `characters.${characterId}.mood`) : undefined + }; + } + return validatedCharacters; + } + /** + * Validate action definitions + */ + static validateActions(actions) { + if (!actions) + return {}; // Actions are optional + if (typeof actions !== 'object') { + throw new Error('Actions must be an object mapping action names to action definitions'); + } + const actionsData = actions; + const validatedActions = {}; + for (const [actionName, actionData] of Object.entries(actionsData)) { + if (!actionData || typeof actionData !== 'object') { + throw new Error(`Action ${actionName} must be an object`); + } + const action = actionData; + this.validateRequiredFields(action, ['patterns', 'handler']); + validatedActions[actionName] = { + name: actionName, + patterns: this.validateStringArray(action.patterns, `actions.${actionName}.patterns`), + requiresObject: typeof action.requiresObject === 'boolean' ? action.requiresObject : false, + requiresTarget: typeof action.requiresTarget === 'boolean' ? action.requiresTarget : false, + handler: this.validateString(action.handler, `actions.${actionName}.handler`) + }; + } + return validatedActions; + } + /** + * Validate initial game state + */ + static validateInitialState(initialState) { + if (!initialState || typeof initialState !== 'object') { + throw new Error('Initial state must be an object'); + } + const stateData = initialState; + this.validateRequiredFields(stateData, ['currentRoomId']); + return { + currentRoomId: this.validateString(stateData.currentRoomId, 'initialState.currentRoomId'), + inventory: this.validateStringArray(stateData.inventory || [], 'initialState.inventory'), + visitedRooms: this.validateStringArray(stateData.visitedRooms || [], 'initialState.visitedRooms'), + flags: this.validateFlags(stateData.flags), + counters: this.validateCounters(stateData.counters) + }; + } + /** + * Validate object states (record of boolean values) + */ + static validateObjectStates(states, objectId) { + if (!states) + return {}; + if (typeof states !== 'object') { + throw new Error(`States for object ${objectId} must be an object`); + } + const statesData = states; + const validatedStates = {}; + for (const [stateName, stateValue] of Object.entries(statesData)) { + if (typeof stateValue !== 'boolean') { + throw new Error(`State ${stateName} for object ${objectId} must be a boolean value`); + } + validatedStates[stateName] = stateValue; + } + return validatedStates; + } + /** + * Validate dialogue (record of string values) + */ + static validateDialogue(dialogue, characterId) { + if (!dialogue || typeof dialogue !== 'object') { + throw new Error(`Dialogue for character ${characterId} must be an object`); + } + const dialogueData = dialogue; + const validatedDialogue = {}; + for (const [topic, response] of Object.entries(dialogueData)) { + validatedDialogue[topic] = this.validateString(response, `characters.${characterId}.dialogue.${topic}`); + } + return validatedDialogue; + } + /** + * Validate flags (record of boolean values) + */ + static validateFlags(flags) { + if (!flags) + return {}; + if (typeof flags !== 'object') { + throw new Error('Flags must be an object'); + } + const flagsData = flags; + const validatedFlags = {}; + for (const [flagName, flagValue] of Object.entries(flagsData)) { + if (typeof flagValue !== 'boolean') { + throw new Error(`Flag ${flagName} must be a boolean value`); + } + validatedFlags[flagName] = flagValue; + } + return validatedFlags; + } + /** + * Validate counters (record of number values) + */ + static validateCounters(counters) { + if (!counters) + return {}; + if (typeof counters !== 'object') { + throw new Error('Counters must be an object'); + } + const countersData = counters; + const validatedCounters = {}; + for (const [counterName, counterValue] of Object.entries(countersData)) { + if (typeof counterValue !== 'number') { + throw new Error(`Counter ${counterName} must be a numeric value`); + } + validatedCounters[counterName] = counterValue; + } + return validatedCounters; + } + /** + * Validate that an array of strings is valid + */ + static validateStringArray(arr, fieldName) { + if (!arr) + return []; + if (!Array.isArray(arr)) { + throw new Error(`Field ${fieldName} must be an array`); + } + return arr.map((item, index) => { + if (typeof item !== 'string') { + throw new Error(`Item at index ${index} in ${fieldName} must be a string`); + } + return item; + }); + } + /** + * Validate references between entities + */ + static validateReferences(worldModel) { + const { rooms, objects, characters, initialState } = worldModel; + // Check that the initial room exists + if (!rooms[initialState.currentRoomId]) { + throw new Error(`Initial room ${initialState.currentRoomId} does not exist`); + } + // Check room exits + for (const [roomId, room] of Object.entries(rooms)) { + for (const exit of room.exits) { + if (!rooms[exit.targetRoomId]) { + throw new Error(`Room ${roomId} has an exit to non-existent room ${exit.targetRoomId}`); + } + if (exit.keyId && !objects[exit.keyId]) { + throw new Error(`Room ${roomId} has an exit requiring non-existent key ${exit.keyId}`); + } + } + // Check room objects + for (const objectId of room.objects) { + if (!objects[objectId]) { + throw new Error(`Room ${roomId} contains non-existent object ${objectId}`); + } + } + // Check room characters + for (const characterId of room.characters) { + if (!characters[characterId]) { + throw new Error(`Room ${roomId} contains non-existent character ${characterId}`); + } + } + } + // Check object containment + for (const [objectId, object] of Object.entries(objects)) { + if (object.containedObjects) { + for (const containedId of object.containedObjects) { + if (!objects[containedId]) { + throw new Error(`Object ${objectId} contains non-existent object ${containedId}`); + } + } + } + } + // Check character inventory + for (const [characterId, character] of Object.entries(characters)) { + for (const objectId of character.inventory) { + if (!objects[objectId]) { + throw new Error(`Character ${characterId} has non-existent object ${objectId} in inventory`); + } + } + } + // Check player inventory + for (const objectId of initialState.inventory) { + if (!objects[objectId]) { + throw new Error(`Initial inventory contains non-existent object ${objectId}`); + } + } + } +} +exports.YamlWorldParser = YamlWorldParser; +//# sourceMappingURL=yaml-parser.js.map \ No newline at end of file diff --git a/dist/world-model/yaml-parser.js.map b/dist/world-model/yaml-parser.js.map new file mode 100644 index 0000000..195c730 --- /dev/null +++ b/dist/world-model/yaml-parser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"yaml-parser.js","sourceRoot":"","sources":["../../src/world-model/yaml-parser.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,gDAAkC;AAClC,8CAAgC;AAGhC,MAAa,eAAe;IAC1B;;OAEG;IACI,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,QAAgB;QAC/C,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YACzD,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAY,CAAC;YAErD,OAAO,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAC9C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,4BAA4B,QAAQ,GAAG,EAAE,KAAK,CAAC,CAAC;YAC9D,MAAM,IAAI,KAAK,CAAC,6BAA6B,QAAQ,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACtH,CAAC;IACH,CAAC;IAED;;OAEG;IACK,MAAM,CAAC,oBAAoB,CAAC,IAAa;QAC/C,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3D,CAAC;QAED,MAAM,SAAS,GAAG,IAA+B,CAAC;QAElD,qCAAqC;QACrC,IAAI,CAAC,sBAAsB,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,SAA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AU,CAAC,EAAE,CAAC;YAClE,KAAK,MAAM,QAAQ,IAAI,SAAS,CAAC,SAAS,EAAE,CAAC;gBAC3C,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;oBACvB,MAAM,IAAI,KAAK,CAAC,aAAa,WAAW,4BAA4B,QAAQ,eAAe,CAAC,CAAC;gBAC/F,CAAC;YACH,CAAC;QACH,CAAC;QAED,yBAAyB;QACzB,KAAK,MAAM,QAAQ,IAAI,YAAY,CAAC,SAAS,EAAE,CAAC;YAC9C,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACvB,MAAM,IAAI,KAAK,CAAC,kDAAkD,QAAQ,EAAE,CAAC,CAAC;YAChF,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAnaD,0CAmaC"} \ No newline at end of file diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..74a5d0c --- /dev/null +++ b/jest.config.js @@ -0,0 +1,12 @@ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', + roots: ['/src'], + testMatch: ['**/__tests__/**/*.ts', '**/?(*.)+(spec|test).ts'], + transform: { + '^.+\\.tsx?$': 'ts-jest', + }, + collectCoverage: true, + coverageDirectory: 'coverage', + collectCoverageFrom: ['src/**/*.ts', '!src/**/*.d.ts'], +}; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..68bff76 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,7635 @@ +{ + "name": "ai.interactive.fiction", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "ai.interactive.fiction", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "axios": "^1.8.4", + "cors": "^2.8.5", + "dotenv": "^16.4.7", + "express": "^5.1.0", + "js-yaml": "^4.1.0", + "kokoro-js": "^1.2.0", + "openai": "^4.91.0", + "socket.io": "^4.8.1" + }, + "devDependencies": { + "@types/express": "^5.0.1", + "@types/jest": "^29.5.14", + "@types/js-yaml": "^4.0.9", + "@types/node": "^22.13.14", + "@typescript-eslint/eslint-plugin": "^8.29.0", + "@typescript-eslint/parser": "^8.29.0", + "eslint": "^9.23.0", + "jest": "^29.7.0", + "nodemon": "^3.1.9", + "ts-jest": "^29.3.1", + "ts-node": "^10.9.2", + "typescript": "^5.8.2" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz", + "integrity": "sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.10.tgz", + "integrity": "sha512-vMqyb7XCDMPvJFFOaT9kxtiRh42GwlZEg1/uIgtZshS5a/8OaduUfCi7kynKgc3Tw/6Uo2D+db9qBttghhmxwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.10", + "@babel/helper-compilation-targets": "^7.26.5", + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helpers": "^7.26.10", + "@babel/parser": "^7.26.10", + "@babel/template": "^7.26.9", + "@babel/traverse": "^7.26.10", + "@babel/types": "^7.26.10", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.0.tgz", + "integrity": "sha512-VybsKvpiN1gU1sdMZIp7FcqphVVKEwcuj02x73uvcHE0PTihx1nlBcowYWhDwjpoAXRv43+gDzyggGnn1XZhVw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.27.0", + "@babel/types": "^7.27.0", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.0.tgz", + "integrity": "sha512-LVk7fbXml0H2xH34dFzKQ7TDZ2G4/rVTOrq9V+icbbadjbVxxeFeDsNHv2SrZeWoA+6ZiTyWYWtScEIW07EAcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.26.8", + "@babel/helper-validator-option": "^7.25.9", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.26.5.tgz", + "integrity": "sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.27.0.tgz", + "integrity": "sha512-U5eyP/CTFPuNE3qk+WZMxFkp/4zUzdceQlfzf7DdGdhp+Fezd7HD+i8Y24ZuTMKX3wQBld449jijbGq6OdGNQg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.27.0", + "@babel/types": "^7.27.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.0.tgz", + "integrity": "sha512-iaepho73/2Pz7w2eMS0Q5f83+0RKI7i4xmiYeBmDzfRVbQtTOG7Ts0S4HzJVsTMGI9keU8rNfuZr8DKfSt7Yyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.27.0" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz", + "integrity": "sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz", + "integrity": "sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.9.tgz", + "integrity": "sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.0.tgz", + "integrity": "sha512-2ncevenBqXI6qRMukPlXwHKHchC7RyMuu4xv5JBXRfOGVcTy1mXCD12qrp7Jsoxll1EV3+9sE4GugBVRjT2jFA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.26.2", + "@babel/parser": "^7.27.0", + "@babel/types": "^7.27.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.0.tgz", + "integrity": "sha512-19lYZFzYVQkkHkl4Cy4WrAVcqBkgvV2YM2TU3xG6DIwO7O3ecbDPfW3yM3bjAGcqcQHi+CCtjMR3dIEHxsd6bA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.27.0", + "@babel/parser": "^7.27.0", + "@babel/template": "^7.27.0", + "@babel/types": "^7.27.0", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.0.tgz", + "integrity": "sha512-H45s8fVLYjbhFH62dIJ3WtmJ6RSPt/3DRO0ZcT2SUiYiQyz3BLVb9ADEnLl91m74aQPS3AzzeajZHYOalWe3bg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.0.tgz", + "integrity": "sha512-64WYIf4UYcdLnbKn/umDlNjQDSS8AgZrI/R9+x5ilkUVFxXcA1Ebl+gQLc/6mERA4407Xof0R7wEyEuj091CVw==", + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.5.1.tgz", + "integrity": "sha512-soEIOALTfTK6EjmKMMoLugwaP0rzkad90iIWd1hMO9ARkSAyjfMfkRRhLvD5qH7vvM0Cg72pieUfR6yh6XxC4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.2.tgz", + "integrity": "sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.6", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.2.0.tgz", + "integrity": "sha512-yJLLmLexii32mGrhW29qvU3QBVTu0GUmEf/J4XsBtVhp4JkIUFN/BjWqTF63yRvGApIDpZm5fa97LtYtINmfeQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.12.0.tgz", + "integrity": "sha512-cmrR6pytBuSMTaBweKoGMwu3EiHiEC+DoyupPmlZ0HxBJBtIxwe+j/E4XPIKNx+Q74c8lXKPwYawBf5glsTkHg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", + "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "9.23.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.23.0.tgz", + "integrity": "sha512-35MJ8vCPU0ZMxo7zfev2pypqTwWTofFZO6m4KAtdoFhRpLJUpHTZZ+KB3C7Hb1d7bULYwO4lJXGCi5Se+8OMbw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", + "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.7.tgz", + "integrity": "sha512-JubJ5B2pJ4k4yGxaNLdbjrnk9d/iDz6/q8wOilpIowd6PJPgaxCuHBnBszq7Ce2TyMrywm5r4PnKm6V3iiZF+g==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.12.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@huggingface/jinja": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@huggingface/jinja/-/jinja-0.3.3.tgz", + "integrity": "sha512-vQQr2JyWvVFba3Lj9es4q9vCl1sAc74fdgnEMoX8qHrXtswap9ge9uO3ONDzQB0cQ0PUyaKY2N6HaVbTBvSXvw==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@huggingface/transformers": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/@huggingface/transformers/-/transformers-3.4.1.tgz", + "integrity": "sha512-Inbvq9i/33kmd5XHom9MQU7NAOV5UcGmHBwBk9NFw4IPhdoTnfP7wFJxJmceYhRdS+EL1Hpw4he/Ceimau6ORg==", + "license": "Apache-2.0", + "dependencies": { + "@huggingface/jinja": "^0.3.3", + "onnxruntime-node": "1.20.1", + "onnxruntime-web": "1.22.0-dev.20250306-ccf8fdd9ea", + "sharp": "^0.33.5" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.2.tgz", + "integrity": "sha512-xeO57FpIu4p1Ri3Jq/EXq4ClRm86dVF2z/+kvFnyqVYRavTZmaFaUBbWCOuuTh0o/g7DSsk6kc2vrS4Vl5oPOQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz", + "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz", + "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz", + "integrity": "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz", + "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz", + "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==", + "cpu": [ + "arm" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz", + "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz", + "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==", + "cpu": [ + "s390x" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz", + "integrity": "sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz", + "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz", + "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz", + "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==", + "cpu": [ + "arm" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.0.5" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz", + "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz", + "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==", + "cpu": [ + "s390x" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.0.4" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz", + "integrity": "sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz", + "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz", + "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz", + "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==", + "cpu": [ + "wasm32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.2.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz", + "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==", + "cpu": [ + "ia32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz", + "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@isaacs/fs-minipass": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", + "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", + "license": "ISC", + "dependencies": { + "minipass": "^7.0.4" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/console": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/core": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/environment": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-get-type": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/fake-timers": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/globals": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/reporters": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/source-map": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-result": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-sequencer": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/test-result": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "license": "BSD-3-Clause" + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "node_modules/@socket.io/component-emitter": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz", + "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==", + "license": "MIT" + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.6.8", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", + "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.7.tgz", + "integrity": "sha512-dkO5fhS7+/oos4ciWxyEyjWe48zmG6wbCheo/G2ZnHx4fs3EU6YC6UM8rk56gAjNJ9P3MTH2jo5jb92/K6wbng==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.20.7" + } + }, + "node_modules/@types/body-parser": { + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", + "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/cors": { + "version": "2.8.17", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.17.tgz", + "integrity": "sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", + "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/express": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.1.tgz", + "integrity": "sha512-UZUw8vjpWFXuDnjFTh7/5c2TWDlQqeXHi6hcN7F2XSVT5P+WmUnnbFS3KA6Jnc6IsEqI2qCVu2bK0R0J4A8ZQQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^5.0.0", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.6.tgz", + "integrity": "sha512-3xhRnjJPkULekpSzgtoNYYcTWgEZkp4myc+Saevii5JPnHNvHMRlBSHDbs7Bh1iPPoVTERHEZXyhyLbMEsExsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/graceful-fs": { + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", + "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/http-errors": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/jest": { + "version": "29.5.14", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz", + "integrity": "sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, + "node_modules/@types/js-yaml": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.9.tgz", + "integrity": "sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.13.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.14.tgz", + "integrity": "sha512-Zs/Ollc1SJ8nKUAgc7ivOEdIBM8JAKgrqqUYi2J997JuKO7/tpQC+WCetQ1sypiKCQWHdvdg9wBNpUPEWZae7w==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.20.0" + } + }, + "node_modules/@types/node-fetch": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.12.tgz", + "integrity": "sha512-8nneRWKCg3rMtF69nLQJnOYUcbafYeFSjqkw3jCRLsqkWFlHaoQrr5mXmofFGOx3DKn7UfmBMyov8ySvLRVldA==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "form-data": "^4.0.0" + } + }, + "node_modules/@types/qs": { + "version": "6.9.18", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.18.tgz", + "integrity": "sha512-kK7dgTYDyGqS+e2Q4aK9X3D7q234CIZ1Bv0q/7Z5IwRDoADNU81xXJK/YVyLbLTZCoIwUoDoffFeF+p/eIklAA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/send": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.7", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz", + "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "*" + } + }, + "node_modules/@types/stack-utils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/yargs": { + "version": "17.0.33", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", + "integrity": "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.29.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.29.0.tgz", + "integrity": "sha512-PAIpk/U7NIS6H7TEtN45SPGLQaHNgB7wSjsQV/8+KYokAb2T/gloOA/Bee2yd4/yKVhPKe5LlaUGhAZk5zmSaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.29.0", + "@typescript-eslint/type-utils": "8.29.0", + "@typescript-eslint/utils": "8.29.0", + "@typescript-eslint/visitor-keys": "8.29.0", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.0.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.29.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.29.0.tgz", + "integrity": "sha512-8C0+jlNJOwQso2GapCVWWfW/rzaq7Lbme+vGUFKE31djwNncIpgXD7Cd4weEsDdkoZDjH0lwwr3QDQFuyrMg9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "8.29.0", + "@typescript-eslint/types": "8.29.0", + "@typescript-eslint/typescript-estree": "8.29.0", + "@typescript-eslint/visitor-keys": "8.29.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.29.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.29.0.tgz", + "integrity": "sha512-aO1PVsq7Gm+tcghabUpzEnVSFMCU4/nYIgC2GOatJcllvWfnhrgW0ZEbnTxm36QsikmCN1K/6ZgM7fok2I7xNw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.29.0", + "@typescript-eslint/visitor-keys": "8.29.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.29.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.29.0.tgz", + "integrity": "sha512-ahaWQ42JAOx+NKEf5++WC/ua17q5l+j1GFrbbpVKzFL/tKVc0aYY8rVSYUpUvt2hUP1YBr7mwXzx+E/DfUWI9Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/typescript-estree": "8.29.0", + "@typescript-eslint/utils": "8.29.0", + "debug": "^4.3.4", + "ts-api-utils": "^2.0.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.29.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.29.0.tgz", + "integrity": "sha512-wcJL/+cOXV+RE3gjCyl/V2G877+2faqvlgtso/ZRbTCnZazh0gXhe+7gbAnfubzN2bNsBtZjDvlh7ero8uIbzg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.29.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.29.0.tgz", + "integrity": "sha512-yOfen3jE9ISZR/hHpU/bmNvTtBW1NjRbkSFdZOksL1N+ybPEE7UVGMwqvS6CP022Rp00Sb0tdiIkhSCe6NI8ow==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.29.0", + "@typescript-eslint/visitor-keys": "8.29.0", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.0.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.29.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.29.0.tgz", + "integrity": "sha512-gX/A0Mz9Bskm8avSWFcK0gP7cZpbY4AIo6B0hWYFCaIsz750oaiWR4Jr2CI+PQhfW1CpcQr9OlfPS+kMFegjXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.29.0", + "@typescript-eslint/types": "8.29.0", + "@typescript-eslint/typescript-estree": "8.29.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.29.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.29.0.tgz", + "integrity": "sha512-Sne/pVz8ryR03NFK21VpN88dZ2FdQXOlq3VIklbrTYEt8yXtRFr9tvUhqvCeKjqYk5FSim37sHbooT6vzBTZcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.29.0", + "eslint-visitor-keys": "^4.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "license": "MIT", + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", + "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", + "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/agentkeepalive": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz", + "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==", + "license": "MIT", + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true, + "license": "MIT" + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "license": "Python-2.0" + }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "dev": true, + "license": "MIT" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/axios": { + "version": "1.8.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.4.tgz", + "integrity": "sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/babel-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/transform": "^29.7.0", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, + "node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/babel-preset-current-node-syntax": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.1.0.tgz", + "integrity": "sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-import-attributes": "^7.24.7", + "@babel/plugin-syntax-import-meta": "^7.10.4", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/babel-preset-jest": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "dev": true, + "license": "MIT", + "dependencies": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/base64id": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", + "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", + "license": "MIT", + "engines": { + "node": "^4.5.0 || >= 5.9" + } + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/body-parser": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.0.tgz", + "integrity": "sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==", + "license": "MIT", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.0", + "http-errors": "^2.0.0", + "iconv-lite": "^0.6.3", + "on-finished": "^2.4.1", + "qs": "^6.14.0", + "raw-body": "^3.0.0", + "type-is": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", + "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.1" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bs-logger": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-json-stable-stringify": "2.x" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001707", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001707.tgz", + "integrity": "sha512-3qtRjw/HQSMlDWf+X79N206fepf4SOOU6SQLMaq/0KkZLmSjPxAkBOQQ+FxbHKfHmYLZFfdWsO3KA90ceHPSnw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chownr": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", + "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cjs-module-lexer": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz", + "integrity": "sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + }, + "engines": { + "node": ">=12.5.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "license": "MIT", + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/content-disposition": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.0.tgz", + "integrity": "sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/create-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "bin": { + "create-jest": "bin/create-jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/dedent": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.3.tgz", + "integrity": "sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/detect-libc": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/dotenv": { + "version": "16.4.7", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", + "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/ejs": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.128", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.128.tgz", + "integrity": "sha512-bo1A4HH/NS522Ws0QNFIzyPcyUUNV/yyy70Ho1xqfGYzPUme2F/xr4tlEOuM6/A538U1vDA7a4XfCd1CKRegKQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/emittery": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/engine.io": { + "version": "6.6.4", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.6.4.tgz", + "integrity": "sha512-ZCkIjSYNDyGn0R6ewHDtXgns/Zre/NT6Agvq1/WobF7JXgFff4SeDroKiCO3fNJreU9YG429Sc81o4w5ok/W5g==", + "license": "MIT", + "dependencies": { + "@types/cors": "^2.8.12", + "@types/node": ">=10.0.0", + "accepts": "~1.3.4", + "base64id": "2.0.0", + "cookie": "~0.7.2", + "cors": "~2.8.5", + "debug": "~4.3.1", + "engine.io-parser": "~5.2.1", + "ws": "~8.17.1" + }, + "engines": { + "node": ">=10.2.0" + } + }, + "node_modules/engine.io-parser": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz", + "integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/engine.io/node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/engine.io/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/engine.io/node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/engine.io/node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/engine.io/node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/engine.io/node_modules/ws": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint": { + "version": "9.23.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.23.0.tgz", + "integrity": "sha512-jV7AbNoFPAY1EkFYpLq5bslU9NLNO8xnEeQXwErNibVryjk67wHVmddTBilc5srIttJDBrB0eMHKZBFbSIABCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.19.2", + "@eslint/config-helpers": "^0.2.0", + "@eslint/core": "^0.12.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.23.0", + "@eslint/plugin-kit": "^0.2.7", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.3.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.3.0.tgz", + "integrity": "sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/eslint/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/espree": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.14.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/express": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/express/-/express-5.1.0.tgz", + "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", + "license": "MIT", + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.2.0", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "bser": "2.1.1" + } + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/filelist": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "minimatch": "^5.0.1" + } + }, + "node_modules/filelist/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/filelist/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.0.tgz", + "integrity": "sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatbuffers": { + "version": "25.2.10", + "resolved": "https://registry.npmjs.org/flatbuffers/-/flatbuffers-25.2.10.tgz", + "integrity": "sha512-7JlN9ZvLDG1McO3kbX0k4v+SUAg48L1rIwEvN6ZQl/eCtgJz9UylTMzE9wrmYrcorgxm3CX/3T/w5VAub99UUw==", + "license": "Apache-2.0" + }, + "node_modules/flatted": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "dev": true, + "license": "ISC" + }, + "node_modules/follow-redirects": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", + "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/form-data-encoder": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.7.2.tgz", + "integrity": "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==", + "license": "MIT" + }, + "node_modules/form-data/node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/form-data/node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/formdata-node": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-4.4.1.tgz", + "integrity": "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==", + "license": "MIT", + "dependencies": { + "node-domexception": "1.0.0", + "web-streams-polyfill": "4.0.0-beta.3" + }, + "engines": { + "node": ">= 12.20" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true, + "license": "MIT" + }, + "node_modules/guid-typescript": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/guid-typescript/-/guid-typescript-1.0.9.tgz", + "integrity": "sha512-Y8T4vYhEfwJOTbouREvG+3XDsjr8E3kIr7uf+JZ0BYloFsttiHU0WfvANVsR7TxNUJa/WpCnw/Ino/p+DeBhBQ==", + "license": "ISC" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT" + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "license": "MIT", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "dev": true, + "license": "ISC" + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/import-local": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", + "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", + "dev": true, + "license": "MIT", + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true, + "license": "MIT" + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "license": "MIT" + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-instrument/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jake": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.2.tgz", + "integrity": "sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "async": "^3.2.3", + "chalk": "^4.0.2", + "filelist": "^1.0.4", + "minimatch": "^3.1.2" + }, + "bin": { + "jake": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.7.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-changed-files": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-circus": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-cli": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-config": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-docblock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "detect-newline": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-environment-node": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "node_modules/jest-leak-detector": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-message-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-pnp-resolver": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } + } + }, + "node_modules/jest-regex-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve-dependencies": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runner": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runtime": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-snapshot": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jest-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-watcher": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", + "string-length": "^4.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/kokoro-js": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/kokoro-js/-/kokoro-js-1.2.0.tgz", + "integrity": "sha512-INAf7f2jBHc74DMgmPlpT+Ji6AvRU/lwi/GJQjP/gxoEY1tbscafIuu5j3qOc4BIspuyAGyYh2lP8OP/ccW4ww==", + "license": "Apache-2.0", + "dependencies": { + "@huggingface/transformers": "^3.3.3", + "phonemizer": "^1.2.1" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true, + "license": "MIT" + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/long": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.1.tgz", + "integrity": "sha512-ka87Jz3gcx/I7Hal94xaN2tZEOPoUOEVftkQqZx2EeQRN7LGdfLlI3FvZ+7WDplm+vK2Urx9ULrvSowtdCieng==", + "license": "Apache-2.0" + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true, + "license": "ISC" + }, + "node_modules/makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tmpl": "1.0.5" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true, + "license": "MIT" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.1.tgz", + "integrity": "sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minizlib": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.2.tgz", + "integrity": "sha512-oG62iEk+CYt5Xj2YqI5Xi9xWUeZhDI8jjQmC5oThVH5JGCTgIjr7ciJDzC7MBzYd//WvR1OTmP5Q38Q8ShQtVA==", + "license": "MIT", + "dependencies": { + "minipass": "^7.1.2" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "license": "MIT", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-releases": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", + "dev": true, + "license": "MIT" + }, + "node_modules/nodemon": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.9.tgz", + "integrity": "sha512-hdr1oIb2p6ZSxu3PB2JWWYS7ZQ0qvaZsc3hK8DR8f02kRzc8rjYmxAIvdz+aYC+8F2IjNaB7HMcSDg8nQpJxyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^4", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nodemon/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/nodemon/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/nodemon/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/onnxruntime-common": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/onnxruntime-common/-/onnxruntime-common-1.20.1.tgz", + "integrity": "sha512-YiU0s0IzYYC+gWvqD1HzLc46Du1sXpSiwzKb63PACIJr6LfL27VsXSXQvt68EzD3V0D5Bc0vyJTjmMxp0ylQiw==", + "license": "MIT" + }, + "node_modules/onnxruntime-node": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/onnxruntime-node/-/onnxruntime-node-1.20.1.tgz", + "integrity": "sha512-di/I4HDXRw+FLgq+TyHmQEDd3cEp9iFFZm0r4uJ1Wd7b/WE1VXtKWo8yemex347c6GNF/3Pv86ZfPhIWxORr0w==", + "hasInstallScript": true, + "license": "MIT", + "os": [ + "win32", + "darwin", + "linux" + ], + "dependencies": { + "onnxruntime-common": "1.20.1", + "tar": "^7.0.1" + } + }, + "node_modules/onnxruntime-web": { + "version": "1.22.0-dev.20250306-ccf8fdd9ea", + "resolved": "https://registry.npmjs.org/onnxruntime-web/-/onnxruntime-web-1.22.0-dev.20250306-ccf8fdd9ea.tgz", + "integrity": "sha512-YwqS9Qqx2eKFXIx+HQloqRUG5/STHPUuNk8wn+qVVmwXBIfNdXX0/Lm7wgo5CnC2k+yqZmjDV5V1dZi4PeSPGQ==", + "license": "MIT", + "dependencies": { + "flatbuffers": "^25.1.24", + "guid-typescript": "^1.0.9", + "long": "^5.2.3", + "onnxruntime-common": "1.22.0-dev.20250306-aafa8d170a", + "platform": "^1.3.6", + "protobufjs": "^7.2.4" + } + }, + "node_modules/onnxruntime-web/node_modules/onnxruntime-common": { + "version": "1.22.0-dev.20250306-aafa8d170a", + "resolved": "https://registry.npmjs.org/onnxruntime-common/-/onnxruntime-common-1.22.0-dev.20250306-aafa8d170a.tgz", + "integrity": "sha512-NfIQnW4lIk/8LnhnYqknYPeet0U0+AADgKQRlKex36QrNoVSCY+aNaX6wyy2VzQ4CNWxsYh0E203ajRD/zxn0g==", + "license": "MIT" + }, + "node_modules/openai": { + "version": "4.91.0", + "resolved": "https://registry.npmjs.org/openai/-/openai-4.91.0.tgz", + "integrity": "sha512-zdDg6eyvUmCP58QAW7/aPb+XdeavJ51pK6AcwZOWG5QNSLIovVz0XonRL9vARGJRmw8iImmvf2A31Q7hoh544w==", + "license": "Apache-2.0", + "dependencies": { + "@types/node": "^18.11.18", + "@types/node-fetch": "^2.6.4", + "abort-controller": "^3.0.0", + "agentkeepalive": "^4.2.1", + "form-data-encoder": "1.7.2", + "formdata-node": "^4.3.2", + "node-fetch": "^2.6.7" + }, + "bin": { + "openai": "bin/cli" + }, + "peerDependencies": { + "ws": "^8.18.0", + "zod": "^3.23.8" + }, + "peerDependenciesMeta": { + "ws": { + "optional": true + }, + "zod": { + "optional": true + } + } + }, + "node_modules/openai/node_modules/@types/node": { + "version": "18.19.84", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.84.tgz", + "integrity": "sha512-ACYy2HGcZPHxEeWTqowTF7dhXN+JU1o7Gr4b41klnn6pj2LD6rsiGqSZojMdk1Jh2ys3m76ap+ae1vvE4+5+vg==", + "license": "MIT", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/openai/node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "license": "MIT" + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-locate/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-to-regexp": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz", + "integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==", + "license": "MIT", + "engines": { + "node": ">=16" + } + }, + "node_modules/phonemizer": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/phonemizer/-/phonemizer-1.2.1.tgz", + "integrity": "sha512-v0KJ4mi2T4Q7eJQ0W15Xd4G9k4kICSXE8bpDeJ8jisL4RyJhNWsweKTOi88QXFc4r4LZlz5jVL5lCHhkpdT71A==", + "license": "Apache-2.0" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/platform": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz", + "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==", + "license": "MIT" + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/protobufjs": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.4.0.tgz", + "integrity": "sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "license": "MIT" + }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true, + "license": "MIT" + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/pure-rand": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT" + }, + "node_modules/qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.0.tgz", + "integrity": "sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.6.3", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true, + "license": "MIT" + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.10", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", + "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve.exports": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz", + "integrity": "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/send": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.0.tgz", + "integrity": "sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==", + "license": "MIT", + "dependencies": { + "debug": "^4.3.5", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "mime-types": "^3.0.1", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/serve-static": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.0.tgz", + "integrity": "sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==", + "license": "MIT", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/sharp": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz", + "integrity": "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "color": "^4.2.3", + "detect-libc": "^2.0.3", + "semver": "^7.6.3" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.33.5", + "@img/sharp-darwin-x64": "0.33.5", + "@img/sharp-libvips-darwin-arm64": "1.0.4", + "@img/sharp-libvips-darwin-x64": "1.0.4", + "@img/sharp-libvips-linux-arm": "1.0.5", + "@img/sharp-libvips-linux-arm64": "1.0.4", + "@img/sharp-libvips-linux-s390x": "1.0.4", + "@img/sharp-libvips-linux-x64": "1.0.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4", + "@img/sharp-libvips-linuxmusl-x64": "1.0.4", + "@img/sharp-linux-arm": "0.33.5", + "@img/sharp-linux-arm64": "0.33.5", + "@img/sharp-linux-s390x": "0.33.5", + "@img/sharp-linux-x64": "0.33.5", + "@img/sharp-linuxmusl-arm64": "0.33.5", + "@img/sharp-linuxmusl-x64": "0.33.5", + "@img/sharp-wasm32": "0.33.5", + "@img/sharp-win32-ia32": "0.33.5", + "@img/sharp-win32-x64": "0.33.5" + } + }, + "node_modules/sharp/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/simple-swizzle/node_modules/is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "license": "MIT" + }, + "node_modules/simple-update-notifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", + "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/simple-update-notifier/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true, + "license": "MIT" + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/socket.io": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.8.1.tgz", + "integrity": "sha512-oZ7iUCxph8WYRHHcjBEc9unw3adt5CmSNlppj/5Q4k2RIrhl8Z5yY2Xr4j9zj0+wzVZ0bxmYoGSzKJnRl6A4yg==", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.4", + "base64id": "~2.0.0", + "cors": "~2.8.5", + "debug": "~4.3.2", + "engine.io": "~6.6.0", + "socket.io-adapter": "~2.5.2", + "socket.io-parser": "~4.2.4" + }, + "engines": { + "node": ">=10.2.0" + } + }, + "node_modules/socket.io-adapter": { + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.5.tgz", + "integrity": "sha512-eLDQas5dzPgOWCk9GuuJC2lBqItuhKI4uxGgo9aIV7MYbk2h9Q6uULEh8WBzThoI7l+qU9Ast9fVUmkqPP9wYg==", + "license": "MIT", + "dependencies": { + "debug": "~4.3.4", + "ws": "~8.17.1" + } + }, + "node_modules/socket.io-adapter/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socket.io-adapter/node_modules/ws": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/socket.io-parser": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", + "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", + "license": "MIT", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/socket.io-parser/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socket.io/node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/socket.io/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socket.io/node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/socket.io/node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/socket.io/node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/stack-utils": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tar": { + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.4.3.tgz", + "integrity": "sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==", + "license": "ISC", + "dependencies": { + "@isaacs/fs-minipass": "^4.0.0", + "chownr": "^3.0.0", + "minipass": "^7.1.2", + "minizlib": "^3.0.1", + "mkdirp": "^3.0.1", + "yallist": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/tar/node_modules/yallist": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", + "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/touch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", + "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", + "dev": true, + "license": "ISC", + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" + }, + "node_modules/ts-api-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, + "node_modules/ts-jest": { + "version": "29.3.1", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.3.1.tgz", + "integrity": "sha512-FT2PIRtZABwl6+ZCry8IY7JZ3xMuppsEV9qFVHOVe8jDzggwUZ9TsM4chyJxL9yi6LvkqcZYU3LmapEE454zBQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bs-logger": "^0.2.6", + "ejs": "^3.1.10", + "fast-json-stable-stringify": "^2.1.0", + "jest-util": "^29.0.0", + "json5": "^2.2.3", + "lodash.memoize": "^4.1.2", + "make-error": "^1.3.6", + "semver": "^7.7.1", + "type-fest": "^4.38.0", + "yargs-parser": "^21.1.1" + }, + "bin": { + "ts-jest": "cli.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "@babel/core": ">=7.0.0-beta.0 <8", + "@jest/transform": "^29.0.0", + "@jest/types": "^29.0.0", + "babel-jest": "^29.0.0", + "jest": "^29.0.0", + "typescript": ">=4.3 <6" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "@jest/transform": { + "optional": true + }, + "@jest/types": { + "optional": true + }, + "babel-jest": { + "optional": true + }, + "esbuild": { + "optional": true + } + } + }, + "node_modules/ts-jest/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ts-jest/node_modules/type-fest": { + "version": "4.38.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.38.0.tgz", + "integrity": "sha512-2dBz5D5ycHIoliLYLi0Q2V7KRaDlH0uWIvmk7TYlAg5slqwiPv1ezJdZm1QEM0xgk29oYWMCbIG7E6gHpvChlg==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD", + "optional": true + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "license": "MIT", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typescript": { + "version": "5.8.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.2.tgz", + "integrity": "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true, + "license": "MIT" + }, + "node_modules/undici-types": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", + "license": "MIT" + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", + "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true, + "license": "MIT" + }, + "node_modules/v8-to-istanbul": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", + "dev": true, + "license": "ISC", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "makeerror": "1.0.12" + } + }, + "node_modules/web-streams-polyfill": { + "version": "4.0.0-beta.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz", + "integrity": "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/write-file-atomic": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "dev": true, + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/ws": { + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==", + "license": "MIT", + "optional": true, + "peer": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..3f9d441 --- /dev/null +++ b/package.json @@ -0,0 +1,47 @@ +{ + "name": "ai.interactive.fiction", + "version": "1.0.0", + "description": "A modern take on classic text adventures that combines traditional world modeling with Large Language Models (LLMs) to create natural language interactive fiction experiences.", + "main": "index.js", + "scripts": { + "start": "node dist/index.js", + "start:web": "node dist/index.js", + "start:cli": "node dist/index.js --cli", + "dev": "nodemon --watch 'src/**' --ext 'ts,json' --exec 'ts-node src/index.ts'", + "dev:web": "nodemon --watch 'src/**' --ext 'ts,json' --exec 'ts-node src/index.ts'", + "dev:cli": "nodemon --watch 'src/**' --ext 'ts,json' --exec 'ts-node src/index.ts --cli'", + "build": "tsc", + "test": "jest", + "lint": "eslint --ext .ts src/", + "lint:fix": "eslint --ext .ts src/ --fix", + "copy-assets": "node copy-assets.js" + }, + "keywords": [], + "author": "", + "license": "ISC", + "type": "commonjs", + "devDependencies": { + "@types/express": "^5.0.1", + "@types/jest": "^29.5.14", + "@types/js-yaml": "^4.0.9", + "@types/node": "^22.13.14", + "@typescript-eslint/eslint-plugin": "^8.29.0", + "@typescript-eslint/parser": "^8.29.0", + "eslint": "^9.23.0", + "jest": "^29.7.0", + "nodemon": "^3.1.9", + "ts-jest": "^29.3.1", + "ts-node": "^10.9.2", + "typescript": "^5.8.2" + }, + "dependencies": { + "axios": "^1.8.4", + "cors": "^2.8.5", + "dotenv": "^16.4.7", + "express": "^5.1.0", + "js-yaml": "^4.1.0", + "kokoro-js": "^1.2.0", + "openai": "^4.91.0", + "socket.io": "^4.8.1" + } +} diff --git a/public/css/style.css b/public/css/style.css new file mode 100644 index 0000000..9696f40 --- /dev/null +++ b/public/css/style.css @@ -0,0 +1,460 @@ +/* AI Interactive Fiction - Web UI Styles */ + +/* Variables */ +:root { + --text-color: #222; + --background-color: #f8f4e8; + --book-shadow: rgba(0, 0, 0, 0.3); + --highlight-color: #783422; + --control-color: #555; + --light-color: rgba(255, 240, 210, 0.6); + --viewport-aspect-ratio: 1.6; + --book-width: 1000px; + --book-height: 620px; + --input-bg: rgba(255, 255, 255, 0.6); + --img-aspect-ratio: 1.613; + --aspect-ratio: min(var(--viewport-aspect-ratio), var(--img-aspect-ratio)); + font-size: calc(var(--book-height)/(34 * 1.5)); +} + +/* Font faces */ +@font-face { + font-family: "EB Garamond"; + src: url("../fonts/EBGaramond12-Regular.otf") format("opentype"); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: "EB Garamond"; + src: url("../fonts/EBGaramond12-Italic.otf") format("opentype"); + font-weight: normal; + font-style: italic; +} + +/* Global styles */ +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +html, body { + height: 100%; + font-family: "EB Garamond", serif; + color: var(--text-color); + background-color: #222; + background-image: url(../images/brown-wooden-flooring.jpg); + background-size: cover; + background-position: center; + overflow: hidden; + display: flex; + justify-content: center; + align-items: center; + min-height: 100vh; + margin: 0; + padding: 0; +} + +body.switched { + transition: color 0.6s, background-color 0.6s; +} + +h1 { + font-size: 2rem; + margin-bottom: 0.8rem; + text-align: center; + text-transform: uppercase; + font-weight: normal; +} + +h2 { + font-size: 1.2rem; + text-align: center; + font-weight: normal; +} + +h3 { + font-size: 1.2rem; + text-align: center; + font-weight: normal; +} + +.header { + padding-top: 3rem; + padding-bottom: 3rem; +} + +.byline { + font-feature-settings: "smcp"; +} + +.separator { + text-align: center; +} + +p, #ruler, #indent { + font-size: 1.2rem; + line-height: 1.2; + color: rgba(0,0,0,0.9); + margin-block-end: 0; + margin-block-start: 0; +} + +a { + transition: color 0.6s; + color: #333; + font-style: italic; + text-decoration-thickness: 1px; +} + +a:hover { + color: black; + transition: color 0.1s; +} + +strong { + color: black; + font-weight: bold; +} + +.container .hide { + opacity: 0.0; +} + +.container .invisible { + display: none; +} + +.container > *, .container > p > * { + opacity: 1.0; + transition: opacity 0.5s; +} + +#command_input { + position: absolute; + bottom: 1rem; + left: 3rem; + right: 3rem; + display: flex; +} + +#player_input { + flex-grow: 1; + font-family: inherit; + font-size: 1.2rem; + padding: 0.5rem; + border: 1px solid rgba(0,0,0,0.3); + border-radius: 0.25rem; + background: rgba(255,255,255,0.9); +} + +#submit_command { + margin-left: 0.5rem; + font-family: inherit; + font-size: 1.2rem; + padding: 0.5rem 1rem; + border: 1px solid rgba(0,0,0,0.3); + border-radius: 0.25rem; + background: rgba(255,255,255,0.9); + cursor: pointer; +} + +#submit_command:hover { + background: rgba(255,255,255,1); +} + +#controls { + z-index: 4; + text-align: center; + position: absolute; + right: 0; + left: 0; + top: 1rem; + padding-top: 1rem; + user-select: none; + transition: color 0.6s, background 0.6s; +} + +#controls [disabled] { + color: #999; +} + +#controls input[type=range] { + vertical-align: middle; + -webkit-appearance: none; + appearance: none; + width: 5rem; + cursor: pointer; + outline: none; + height: 0.5rem; + background-color: transparent; + box-sizing: border-box; + border: 1px solid black; + border-radius: 0.25rem; + overflow: hidden; +} + +#controls input::-webkit-slider-thumb { + -webkit-appearance: none; + appearance: none; + height: 0.5rem; + width: 0.5rem; + border-radius: 0.25rem; + background-color: rgba(0,0,0,0.9); + border: none; + box-shadow: -407px 0 0 400px rgba(0,0,0,0.3); +} + +#controls input::-webkit-runnable-track { + -webkit-appearance: none; + appearance: none; + height: 0.5rem; + border-radius: 0.25rem; +} + +#controls>a:not(:last-of-type):after, #controls>span::after { + content: " | "; +} + +#book { + position: relative; + width: var(--book-width); + height: var(--book-height); + background-image: url('../images/book-3057904.png'); + background-size: contain; + background-position: center; + background-repeat: no-repeat; + perspective: 500px; + perspective-origin: 50% 50%; + max-width: 90vw; + max-height: 90vh; + margin: 0 auto; + transform-origin: center center; +} + +#page_left, #page_right { + position: absolute; + top: 5%; + bottom: 10%; + width: 39%; + box-sizing: border-box; + padding: 0 3rem 1rem 1rem; + overflow: visible; + overflow-y: scroll; + opacity: 0.95; + mix-blend-mode: darken; +} + +#story { + overflow-x: visible; + margin-bottom: 3rem; +} + +#page_left { + left: 11.5%; +} + +#page_right { + right: 7%; + height: calc(28 * 1.2 * 1.2rem); + padding-bottom: 4rem; +} + +.user-input { + font-style: italic; + color: #555; + margin-top: 1rem; +} + +.narrative { + margin-top: 1rem; +} + +/* ===== Scrollbar CSS ===== */ +/* Firefox */ +* { + scrollbar-width: auto; + scrollbar-color: #000000 rgba(255,255,255,0); +} + +/* Chrome, Edge, and Safari */ +*::-webkit-scrollbar { + width: calc(1rem/4); +} + +*::-webkit-scrollbar-track { + background: rgba(255,255,255,0.0); +} + +*::-webkit-scrollbar-thumb { + background-color: #000000; + border-radius: calc(1rem/4/2); + border: none; +} + +.fade-in { + animation: fadeIn ease 1s; + -webkit-animation: fadeIn ease 1s; + -moz-animation: fadeIn ease 1s; + -o-animation: fadeIn ease 1s; + -ms-animation: fadeIn ease 1s; +} + +@keyframes fadeIn { + 0% {opacity:0;} + 100% {opacity:1;} +} + +@-moz-keyframes fadeIn { + 0% {opacity:0;} + 100% {opacity:1;} +} + +@-webkit-keyframes fadeIn { + 0% {opacity:0;} + 100% {opacity:1;} +} + +@-o-keyframes fadeIn { + 0% {opacity:0;} + 100% {opacity:1;} +} + +@-ms-keyframes fadeIn { + 0% {opacity:0;} + 100% {opacity:1;} +} + +#ruler, #indent { + visibility: hidden; + position: absolute; + top: -8000px; + width: auto; + display: inline; + left: -8000px; + text-indent: 0; + text-align: left; + hyphens: none; + margin-block-end: 0; +} + +#lighting { + position: absolute; + top: -35%; + left: -35%; + width: 180%; + height: 180%; + animation: gradient-animation-shrink 1s 1; + background: radial-gradient(circle, rgba(255,240,182,0.1) 0%, rgba(255,237,165,0.2) 20%, rgba(0,0,0,0.9) 65%, rgba(0,0,0,0.9) 100%); + mix-blend-mode: color-burn; + pointer-events: none; + z-index: 999; +} + +@keyframes gradient-animation-grow { + 0% { width: 180%; height: 180%; left: -35%; top: -35%; } + 100% { width: 170%; height: 170%; left: -33%; top: -33%; } +} + +@keyframes gradient-animation-shrink { + 0% { width: 170%; height: 170%; left: -33%; top: -33%; } + 100% { width: 180%; height: 180%; left: -35%; top: -35%; } +} + +.loading-indicator { + display: inline-block; + position: relative; + width: 1.2rem; + height: 1.2rem; + margin-left: 0.5rem; +} +.loading-indicator div { + box-sizing: border-box; + display: block; + position: absolute; + width: 1rem; + height: 1rem; + border: 0.2rem solid #000; + border-radius: 50%; + animation: loading-indicator 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite; + border-color: #000 transparent transparent transparent; +} +.loading-indicator div:nth-child(1) { + animation-delay: -0.45s; +} +.loading-indicator div:nth-child(2) { + animation-delay: -0.3s; +} +.loading-indicator div:nth-child(3) { + animation-delay: -0.15s; +} +@keyframes loading-indicator { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} + +/* Media queries for responsive design */ +@media (max-width: 768px) { + :root { + font-size: calc(var(--book-height)/(40 * 1.5)); + } + + #book { + max-width: 95vw; + max-height: 95vh; + } + + #page_left, #page_right { + width: 38%; + padding: 0 1rem 1rem 1rem; + } +} + +/* Ensure responsive book sizing */ +@media (max-width: 1200px) { + #book { + transform: scale(0.95); + transform-origin: center center; + } +} + +@media (max-width: 992px) { + #book { + transform: scale(0.85); + transform-origin: center center; + } +} + +@media (max-width: 768px) { + #book { + transform: scale(0.75); + transform-origin: center center; + } +} + +@media (max-width: 576px) { + #book { + transform: scale(0.65); + transform-origin: center center; + } +} + +/* Additional responsive fix to ensure book remains centered */ +@media (max-height: 700px) { + #book { + transform: scale(0.8); + transform-origin: center center; + } +} + +@media (max-height: 600px) { + #book { + transform: scale(0.7); + transform-origin: center center; + } +} \ No newline at end of file diff --git a/public/fonts/EBGaramond12-Italic.otf b/public/fonts/EBGaramond12-Italic.otf new file mode 100644 index 0000000..81845af Binary files /dev/null and b/public/fonts/EBGaramond12-Italic.otf differ diff --git a/public/fonts/EBGaramond12-Regular.otf b/public/fonts/EBGaramond12-Regular.otf new file mode 100644 index 0000000..6f26875 Binary files /dev/null and b/public/fonts/EBGaramond12-Regular.otf differ diff --git a/public/images/book-3057904.png b/public/images/book-3057904.png new file mode 100644 index 0000000..d0895d0 Binary files /dev/null and b/public/images/book-3057904.png differ diff --git a/public/images/brown-wooden-flooring.jpg b/public/images/brown-wooden-flooring.jpg new file mode 100644 index 0000000..aa24506 Binary files /dev/null and b/public/images/brown-wooden-flooring.jpg differ diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..cd43388 --- /dev/null +++ b/public/index.html @@ -0,0 +1,43 @@ + + + + + + AI Interactive Fiction + + + + + + + +
+
+
+
+

AI Interactive Fiction

+ +
+
+ +
+
+
+ +
+
+ + \ No newline at end of file diff --git a/public/js/ai-fiction.js b/public/js/ai-fiction.js new file mode 100644 index 0000000..e2f7e8a --- /dev/null +++ b/public/js/ai-fiction.js @@ -0,0 +1,440 @@ +/** + * AI Interactive Fiction + * Main client-side logic for web interface + */ +class AIFiction { + constructor() { + // DOM elements + this.storyContainer = document.getElementById('story'); + this.commandHistoryContainer = document.getElementById('command_history'); + this.playerInput = document.getElementById('player_input'); + this.submitButton = document.getElementById('submit_command'); + this.speechButton = document.getElementById('speech'); + this.rewindButton = document.getElementById('rewind'); + this.saveButton = document.getElementById('save'); + this.loadButton = document.getElementById('reload'); + this.speedSlider = document.getElementById('speed'); + this.speedReset = document.getElementById('speed_reset'); + + // Game state + this.gameState = { + started: false, + currentRoomId: '', + textSpeed: 50 + }; + + // Socket connection - ensure we're connecting to the right URL + this.socket = io(window.location.origin, { + reconnectionAttempts: 5, + timeout: 10000 + }); + + // Typing effect configuration + this.typingSpeed = 30; // Default value, will be adjusted by slider + this.typingTimeout = null; + + // Bind event handlers + this.bindEvents(); + + // Initialize socket communication + this.initializeSocket(); + + // Initialize UI + this.initializeUI(); + } + + /** + * Initialize the UI + */ + initializeUI() { + this.updateTypingSpeed(); + this.updateSpeechButton(); + + // Disable buttons initially + this.rewindButton.setAttribute('disabled', 'disabled'); + this.loadButton.setAttribute('disabled', 'disabled'); + + // Start the game + this.startGame(); + } + + /** + * Bind event handlers to DOM elements + */ + bindEvents() { + // Submit command on button click + this.submitButton.addEventListener('click', () => this.submitCommand()); + + // Submit command on Enter key + this.playerInput.addEventListener('keydown', (e) => { + if (e.key === 'Enter') { + this.submitCommand(); + } + }); + + // Toggle speech + this.speechButton.addEventListener('click', () => { + if (tts.isReady()) { + const enabled = tts.toggle(); + this.updateSpeechButton(enabled); + + if (enabled) { + // Speak the last narrative if speech was just enabled + const lastNarrative = this.storyContainer.lastElementChild; + if (lastNarrative && lastNarrative.classList.contains('narrative')) { + tts.speak(lastNarrative.textContent); + } + } + } else { + console.log('TTS not ready yet'); + } + }); + + // Restart game + this.rewindButton.addEventListener('click', () => { + if (confirm('Are you sure you want to restart the game? All progress will be lost.')) { + this.startGame(); + } + }); + + // Save game + this.saveButton.addEventListener('click', () => { + this.socket.emit('saveGame'); + }); + + // Load game + this.loadButton.addEventListener('click', () => { + this.socket.emit('loadGame'); + }); + + // Adjust typing speed + this.speedSlider.addEventListener('input', () => { + this.updateTypingSpeed(); + }); + + // Reset speed to default + this.speedReset.addEventListener('click', () => { + this.speedSlider.value = 50; + this.updateTypingSpeed(); + }); + } + + /** + * Initialize socket event handlers + */ + initializeSocket() { + // Connection established + this.socket.on('connect', () => { + console.log('Connected to server'); + // Automatically start the game once connected + if (!this.gameState.started) { + this.startGame(); + } + }); + + // Connection error + this.socket.on('connect_error', (error) => { + console.error('Connection error:', error); + this.addSystemMessage('Connection error. Please check your network connection and try again.'); + }); + + // Game introduction received + this.socket.on('gameIntroduction', (data) => { + this.clearStory(); + this.addNarrative(data.introduction); + this.addNarrative(data.initialRoomDescription); + + this.gameState.started = true; + this.gameState.currentRoomId = data.currentRoomId; + + // Enable buttons + this.rewindButton.removeAttribute('disabled'); + + // Focus on input field + this.playerInput.focus(); + }); + + // Narrative response received + this.socket.on('narrativeResponse', (data) => { + this.addNarrative(data.text); + + if (data.suggestions && data.suggestions.length > 0) { + this.addSuggestions(data.suggestions); + } + + // Update game state + if (data.gameState) { + this.gameState.currentRoomId = data.gameState.currentRoomId; + } + + // Scroll to bottom and focus input + this.scrollToBottom(); + this.playerInput.focus(); + + // Re-enable input (failsafe) + this.playerInput.disabled = false; + this.submitButton.disabled = false; + }); + + // Game saved confirmation + this.socket.on('gameSaved', () => { + this.addSystemMessage('Game saved successfully.'); + // Enable load button + this.loadButton.removeAttribute('disabled'); + }); + + // Game loaded confirmation + this.socket.on('gameLoaded', (data) => { + this.clearStory(); + this.addSystemMessage('Game loaded successfully.'); + this.addNarrative(data.currentRoomDescription); + + // Update game state + this.gameState.currentRoomId = data.currentRoomId; + }); + + // Error messages + this.socket.on('error', (data) => { + this.addSystemMessage(`Error: ${data.message}`); + }); + } + + /** + * Start a new game + */ + startGame() { + this.clearStory(); + this.addSystemMessage('Starting a new game...'); + this.socket.emit('startGame'); + } + + /** + * Submit a player command + */ + submitCommand() { + const command = this.playerInput.value.trim(); + + if (command === '') return; + + // Disable input temporarily + this.playerInput.disabled = true; + this.submitButton.disabled = true; + + // Add command to history + this.addUserCommand(command); + + // Add a temporary "thinking" message + const thinkingId = this.addThinking(); + + // Send command to server + this.socket.emit('playerCommand', { command }); + + // Clear input + this.playerInput.value = ''; + + // Re-enable input field after a short delay (or after 8 seconds as failsafe) + const timeout = setTimeout(() => { + this.playerInput.disabled = false; + this.submitButton.disabled = false; + + // Remove thinking indicator + const thinkingElement = document.getElementById(thinkingId); + if (thinkingElement) { + thinkingElement.remove(); + } + + // Add system message if no response was received (likely timeout) + if (document.getElementById(thinkingId)) { + this.addSystemMessage('The server is taking too long to respond. Please try again.'); + } + }, 8000); + + // Store the timeout so it can be cleared if we get a response + this.currentCommandTimeout = timeout; + } + + /** + * Add a user command to the story + */ + addUserCommand(command) { + const element = document.createElement('p'); + element.className = 'user-input'; + element.textContent = `> ${command}`; + this.storyContainer.appendChild(element); + this.scrollToBottom(); + } + + /** + * Add a narrative response with typing effect + */ + addNarrative(text) { + const element = document.createElement('p'); + element.className = 'narrative hide'; + this.storyContainer.appendChild(element); + + // Apply SmartyPants transformations for better typography + const processedText = SmartyPants.process(text); + + // Clear any existing typing timeouts + if (this.typingTimeout) { + clearTimeout(this.typingTimeout); + } + + // Add the text with a typing effect + this.typeText(element, processedText, 0); + + // Read text aloud if speech is enabled + if (tts && tts.enabled) { + tts.speak(text); + } + } + + /** + * Add suggestions to the story + */ + addSuggestions(suggestions) { + const element = document.createElement('div'); + element.className = 'suggestions'; + + const heading = document.createElement('p'); + heading.textContent = 'Suggestions:'; + heading.style.fontStyle = 'italic'; + heading.style.marginTop = '1rem'; + element.appendChild(heading); + + const list = document.createElement('ul'); + suggestions.forEach(suggestion => { + const item = document.createElement('li'); + item.textContent = suggestion; + + // Make suggestions clickable + item.style.cursor = 'pointer'; + item.addEventListener('click', () => { + this.playerInput.value = suggestion; + this.submitCommand(); + }); + + list.appendChild(item); + }); + element.appendChild(list); + + this.storyContainer.appendChild(element); + this.scrollToBottom(); + } + + /** + * Add a system message + */ + addSystemMessage(message) { + const element = document.createElement('p'); + element.className = 'system-message'; + element.textContent = message; + element.style.fontStyle = 'italic'; + element.style.color = '#555'; + this.storyContainer.appendChild(element); + this.scrollToBottom(); + } + + /** + * Add a thinking indicator + */ + addThinking() { + const id = 'thinking-' + Date.now(); + const element = document.createElement('div'); + element.id = id; + element.className = 'thinking'; + element.innerHTML = '

Thinking

'; + element.style.fontStyle = 'italic'; + element.style.color = '#777'; + this.storyContainer.appendChild(element); + this.scrollToBottom(); + return id; + } + + /** + * Clear the story container + */ + clearStory() { + while (this.storyContainer.firstChild) { + this.storyContainer.removeChild(this.storyContainer.firstChild); + } + } + + /** + * Type text into an element character by character + */ + typeText(element, text, index) { + // Show the element if it was hidden + if (index === 0) { + element.classList.remove('hide'); + } + + // Set the current text + element.textContent = text.substring(0, index); + + // If we haven't reached the end of the text + if (index < text.length) { + // Calculate delay (randomize slightly for more natural effect) + const delay = Math.max(10, 100 - this.gameState.textSpeed) / 5; + const randomDelay = delay * (0.8 + Math.random() * 0.4); + + // Schedule the next character + this.typingTimeout = setTimeout(() => { + this.typeText(element, text, index + 1); + }, randomDelay); + } else { + // Finished typing + this.scrollToBottom(); + } + } + + /** + * Update the typing speed based on the slider value + */ + updateTypingSpeed() { + this.gameState.textSpeed = parseInt(this.speedSlider.value, 10); + } + + /** + * Update the speech button styling + */ + updateSpeechButton(enabled = false) { + if (enabled) { + this.speechButton.style.fontWeight = 'bold'; + this.speechButton.style.color = '#000'; + } else { + this.speechButton.style.fontWeight = 'normal'; + this.speechButton.style.color = '#333'; + } + } + + /** + * Scroll the story container to the bottom + */ + scrollToBottom() { + this.storyContainer.scrollTop = this.storyContainer.scrollHeight; + } +} + +// Create the application when the DOM is fully loaded +document.addEventListener('DOMContentLoaded', () => { + // Set custom CSS variables based on viewport + const updateViewportVariables = () => { + const vw = window.innerWidth; + const vh = window.innerHeight; + document.documentElement.style.setProperty('--viewport-aspect-ratio', `${vw / vh}`); + + // Adjust book size based on viewport + const bookWidth = Math.min(vw * 0.9, vh * 1.4); + const bookHeight = bookWidth / 1.613; + document.documentElement.style.setProperty('--book-width', `${bookWidth}px`); + document.documentElement.style.setProperty('--book-height', `${bookHeight}px`); + }; + + // Update variables initially and on resize + updateViewportVariables(); + window.addEventListener('resize', updateViewportVariables); + + // Initialize the application + window.app = new AIFiction(); +}); \ No newline at end of file diff --git a/public/js/smartypants.js b/public/js/smartypants.js new file mode 100644 index 0000000..90f187f --- /dev/null +++ b/public/js/smartypants.js @@ -0,0 +1,66 @@ +/** + * SmartyPants - Smart typography for web content + * Converts straight quotes to curly quotes, dashes to em-dashes, etc. + * Based on the original SmartyPants by John Gruber + */ + +const SmartyPants = (function() { + // Regular expressions for matching + const quotes = { + double: { + opening: /(\s|^)"(\w)/g, + closing: /(\w)"/g, + openingNested: /(\s|^)'(\w)/g, + closingNested: /(\w)'/g + }, + single: { + opening: /(\s|^)'(\w)/g, + closing: /(\w)'/g + } + }; + + const dashes = { + emDash: /--/g, + enDash: / - /g + }; + + const ellipses = /\.\.\./g; + + /** + * Process text with SmartyPants transformations + */ + function process(text) { + if (!text) return text; + + let result = text; + + // Transform double quotes + result = result.replace(quotes.double.opening, '$1"$2'); + result = result.replace(quotes.double.closing, '$1"'); + + // Transform single quotes + result = result.replace(quotes.single.opening, '$1\u2018$2'); + result = result.replace(quotes.single.closing, '$1\u2019'); + + // Transform apostrophes (same as closing single quotes) + result = result.replace(/(\w)'(\w)/g, '$1\u2019$2'); + + // Transform dashes + result = result.replace(dashes.emDash, '—'); + result = result.replace(dashes.enDash, ' – '); + + // Transform ellipses + result = result.replace(ellipses, '…'); + + return result; + } + + return { + process: process + }; +})(); + +// Make available in browser and Node.js environments +if (typeof module !== 'undefined' && module.exports) { + module.exports = SmartyPants; +} \ No newline at end of file diff --git a/public/js/tts-handler.js b/public/js/tts-handler.js new file mode 100644 index 0000000..144baa4 --- /dev/null +++ b/public/js/tts-handler.js @@ -0,0 +1,106 @@ +/** + * Text-to-Speech Handler for AI Interactive Fiction + * Uses Web Speech API for text-to-speech + */ +class TTSHandler { + constructor() { + this.enabled = false; + this.speaking = false; + this.queue = []; + this.synthesis = window.speechSynthesis; + this.utterance = null; + + // Check if browser supports speech synthesis + if (this.synthesis) { + console.log('Speech synthesis is supported in this browser'); + this.browserSupport = true; + } else { + console.warn('Speech synthesis is not supported in this browser'); + this.browserSupport = false; + } + } + + /** + * Toggle TTS on/off + */ + toggle() { + this.enabled = !this.enabled; + if (!this.enabled && this.speaking) { + this.stop(); + } + return this.enabled; + } + + /** + * Speak the given text + */ + speak(text) { + if (!this.enabled || !this.browserSupport) return; + + // Add to queue + this.queue.push(text); + + // If not already speaking, start processing queue + if (!this.speaking) { + this.processQueue(); + } + } + + /** + * Process the speech queue + */ + processQueue() { + if (this.queue.length === 0 || this.speaking) return; + + this.speaking = true; + const text = this.queue.shift(); + + try { + this.utterance = new SpeechSynthesisUtterance(text); + + // Configure speech options + this.utterance.rate = 1.0; // Speech rate (0.1 to 10) + this.utterance.pitch = 1.0; // Speech pitch (0 to 2) + + // When speech ends, process the next item + this.utterance.onend = () => { + this.speaking = false; + this.processQueue(); + }; + + // If speech is interrupted or errors + this.utterance.onerror = (event) => { + console.error('TTS error:', event.error); + this.speaking = false; + this.processQueue(); + }; + + this.synthesis.speak(this.utterance); + } catch (error) { + console.error('TTS error:', error); + this.speaking = false; + this.processQueue(); + } + } + + /** + * Stop current speech + */ + stop() { + if (this.synthesis && this.speaking) { + this.synthesis.cancel(); + } + this.queue = []; + this.speaking = false; + } + + /** + * Check if TTS is ready + */ + isReady() { + return this.browserSupport; + } +} + +// Create a global instance +const tts = new TTSHandler(); \ No newline at end of file diff --git a/src/cli/game-runner.ts b/src/cli/game-runner.ts new file mode 100644 index 0000000..bd766bf --- /dev/null +++ b/src/cli/game-runner.ts @@ -0,0 +1,265 @@ +/** + * Command-line interface for running the interactive fiction game + */ + +import * as readline from 'readline'; +import * as path from 'path'; +import * as dotenv from 'dotenv'; +import { TextAdventureEngine } from '../engine/game-engine'; +import { OpenRouterProvider } from '../llm/openrouter-provider'; +import { ActionRequest, NarrativeRequest } from '../interfaces/llm'; + +// Load environment variables +dotenv.config(); + +export class GameRunner { + private engine: TextAdventureEngine; + private llmProvider: OpenRouterProvider; + private rl: readline.Interface | null = null; + private gameContext: string = ''; + private gameHistory: string[] = []; + private suggestedCommands: string[] = []; + + constructor() { + this.engine = new TextAdventureEngine(); + this.llmProvider = new OpenRouterProvider(); + } + + /** + * Initialize the game + */ + public async initialize(worldPath: string): Promise { + console.log('Initializing game...'); + + // Initialize LLM provider + const apiKey = process.env.OPENROUTER_API_KEY; + const model = process.env.OPENROUTER_MODEL; + + if (!apiKey || !model) { + throw new Error('Missing required environment variables: OPENROUTER_API_KEY and/or OPENROUTER_MODEL'); + } + + await this.llmProvider.initialize({ + apiKey, + model, + temperature: 0.7, + maxTokens: 800 + }); + + // Load the world + const resolvedPath = path.resolve(worldPath); + console.log(`Loading world from ${resolvedPath}...`); + await this.engine.loadWorld(resolvedPath); + + console.log('Game initialized successfully!'); + } + + /** + * Start the game in CLI mode + */ + public async start(): Promise { + // Create readline interface for CLI mode + this.rl = readline.createInterface({ + input: process.stdin, + output: process.stdout + }); + + try { + // Display introduction + const introText = await this.engine.start(); + console.log('\n' + introText + '\n'); + + // Look at initial room + const initialLook = this.engine.processAction({ action: 'look', confidence: 1 }); + + // Generate narrative description + const narrativeRequest: NarrativeRequest = { + action: 'look', + result: initialLook.message, + roomDescription: this.engine.getCurrentRoomDescription(), + visibleObjects: this.engine.getVisibleObjects(), + visibleCharacters: this.engine.getVisibleCharacters(), + tone: 'descriptive' + }; + + const narrative = await this.llmProvider.generateNarrative(narrativeRequest); + console.log('\n' + narrative.text + '\n'); + + // Store suggestions if available + if (narrative.suggestions && narrative.suggestions.length > 0) { + this.suggestedCommands = narrative.suggestions; + } + + // Update game context + this.updateGameContext(narrative.text); + + // Start the game loop + this.gameLoop(); + } catch (error) { + console.error('Error starting game:', error); + this.end(); + } + } + + /** + * The main game loop for CLI mode + */ + private gameLoop(): void { + if (!this.rl) return; + + this.rl.question('> ', async (input) => { + if (input.toLowerCase() === 'quit' || input.toLowerCase() === 'exit') { + this.end(); + return; + } + + const response = await this.processCommand(input); + console.log('\n' + response + '\n'); + + // Continue the game loop + this.gameLoop(); + }); + } + + /** + * Process a player command and return the narrative response + * Used by both CLI and web interfaces + */ + public async processCommand(input: string): Promise { + try { + // Process player input + const actionRequest: ActionRequest = { + playerInput: input, + currentRoom: this.engine.getWorldModel().rooms[this.engine.getCurrentState().currentRoomId].name, + visibleObjects: this.engine.getVisibleObjects().map(id => this.engine.getWorldModel().objects[id].name), + visibleCharacters: this.engine.getVisibleCharacters().map(id => this.engine.getWorldModel().characters[id].name), + possibleActions: this.engine.getAvailableActions(), + inventory: this.engine.getCurrentState().inventory.map(id => this.engine.getWorldModel().objects[id].name), + gameContext: this.gameContext + }; + + if (this.rl) { + console.log('Thinking...'); + } + + // Translate player input to action + const action = await this.llmProvider.translateAction(actionRequest); + + // Process the action in the game engine + const actionResult = this.engine.processAction(action); + + // If state changed, update it + if (actionResult.stateChanged && actionResult.newState) { + this.engine.getCurrentState().currentRoomId = actionResult.newState.currentRoomId; + this.engine.getCurrentState().inventory = actionResult.newState.inventory; + this.engine.getCurrentState().visitedRooms = actionResult.newState.visitedRooms; + this.engine.getCurrentState().flags = actionResult.newState.flags; + this.engine.getCurrentState().counters = actionResult.newState.counters; + } + + // Generate narrative description + const narrativeRequest: NarrativeRequest = { + action: `${action.action}${action.object ? ' ' + action.object : ''}${action.target ? ' on ' + action.target : ''}`, + result: actionResult.message, + roomDescription: this.engine.getCurrentRoomDescription(), + visibleObjects: this.engine.getVisibleObjects().map(id => this.engine.getWorldModel().objects[id].name), + visibleCharacters: this.engine.getVisibleCharacters().map(id => this.engine.getWorldModel().characters[id].name), + previousContext: this.gameHistory.slice(-3).join('\n'), + tone: 'descriptive' + }; + + const narrative = await this.llmProvider.generateNarrative(narrativeRequest); + + // Store suggestions if available + if (narrative.suggestions && narrative.suggestions.length > 0) { + this.suggestedCommands = narrative.suggestions; + } + + // Update game context with the new narrative + this.updateGameContext(narrative.text); + + // Return the narrative text + return narrative.text; + + } catch (error) { + console.error('Error processing input:', error); + return 'Something went wrong. Please try again.'; + } + } + + /** + * End the game + */ + public end(): void { + console.log('\nThanks for playing!'); + if (this.rl) { + this.rl.close(); + this.rl = null; + } + this.engine.end(); + if (process.env.NODE_ENV !== 'production') { + process.exit(0); + } + } + + /** + * Update the game context with new narrative + */ + private updateGameContext(narrative: string): void { + // Add to history + this.gameHistory.push(narrative); + + // Keep history limited to last 10 entries + if (this.gameHistory.length > 10) { + this.gameHistory.shift(); + } + + // Update current context (last 5 entries) + this.gameContext = this.gameHistory.slice(-5).join('\n'); + } + + /** + * Get the current game state + * Used by web interface + */ + public getGameState() { + return { + world: this.engine.getWorldModel(), + currentRoomId: this.engine.getCurrentState().currentRoomId, + inventory: this.engine.getCurrentState().inventory, + visitedRooms: this.engine.getCurrentState().visitedRooms, + flags: this.engine.getCurrentState().flags, + counters: this.engine.getCurrentState().counters + }; + } + + /** + * Get the current room description + * Used by web interface + */ + public getCurrentRoomDescription(): string { + const roomId = this.engine.getCurrentState().currentRoomId; + return this.engine.getWorldModel().rooms[roomId].description; + } + + /** + * Get suggested actions for the current game state + * Used by web interface + */ + public getSuggestions(): string[] { + return this.suggestedCommands; + } + + /** + * Load a saved game state + * Used by web interface + */ + public loadGameState(savedState: any): void { + // Set the current state to match the saved state + this.engine.getCurrentState().currentRoomId = savedState.currentRoomId; + this.engine.getCurrentState().inventory = savedState.inventory; + this.engine.getCurrentState().visitedRooms = savedState.visitedRooms; + this.engine.getCurrentState().flags = savedState.flags; + this.engine.getCurrentState().counters = savedState.counters; + } +} \ No newline at end of file diff --git a/src/engine/game-engine.ts b/src/engine/game-engine.ts new file mode 100644 index 0000000..c064cdb --- /dev/null +++ b/src/engine/game-engine.ts @@ -0,0 +1,661 @@ +/** + * Core Game Engine + * Manages game state and processes actions + */ + +import * as fs from 'fs/promises'; +import { GameEngine, ActionResult } from '../interfaces/engine'; +import { WorldModel, GameState, Room, GameObject, Character } from '../interfaces/world-model'; +import { ActionResponse } from '../interfaces/llm'; +import { YamlWorldParser } from '../world-model/yaml-parser'; + +export class TextAdventureEngine implements GameEngine { + private worldModel: WorldModel | null = null; + private gameState: GameState | null = null; + private actionHandlers: Record ActionResult> = {}; + + constructor() { + this.registerDefaultActionHandlers(); + } + + /** + * Load a world model from a file + */ + public async loadWorld(worldModelPath: string): Promise { + try { + this.worldModel = await YamlWorldParser.loadFromFile(worldModelPath); + this.gameState = { ...this.worldModel.initialState }; + + // Mark the initial room as visited + if (!this.gameState.visitedRooms.includes(this.gameState.currentRoomId)) { + this.gameState.visitedRooms.push(this.gameState.currentRoomId); + } + } catch (error) { + console.error(`Failed to load world from ${worldModelPath}:`, error); + throw new Error(`Could not load world: ${error instanceof Error ? error.message : String(error)}`); + } + } + + /** + * Get the current game state + */ + public getCurrentState(): GameState { + if (!this.gameState) { + throw new Error('Game state not initialized. Please load a world first.'); + } + return { ...this.gameState }; + } + + /** + * Get the world model + */ + public getWorldModel(): WorldModel { + if (!this.worldModel) { + throw new Error('World model not initialized. Please load a world first.'); + } + return this.worldModel; + } + + /** + * Process an action from the player + */ + public processAction(action: ActionResponse): ActionResult { + if (!this.worldModel || !this.gameState) { + return { + success: false, + message: 'Game not initialized', + stateChanged: false + }; + } + + const handler = this.actionHandlers[action.action.toLowerCase()]; + if (!handler) { + return { + success: false, + message: `I don't know how to "${action.action}"`, + stateChanged: false + }; + } + + return handler(this.gameState, this.worldModel, action); + } + + /** + * Save the current game state to a file + */ + public async saveGame(filename: string): Promise { + if (!this.gameState || !this.worldModel) { + throw new Error('Cannot save: game not initialized'); + } + + const saveData = { + worldModelName: this.worldModel.title, + worldModelVersion: this.worldModel.version, + timestamp: new Date().toISOString(), + gameState: this.gameState + }; + + try { + await fs.writeFile(filename, JSON.stringify(saveData, null, 2), 'utf8'); + } catch (error) { + console.error(`Failed to save game to ${filename}:`, error); + throw new Error(`Could not save game: ${error instanceof Error ? error.message : String(error)}`); + } + } + + /** + * Load a game state from a save file + */ + public async loadGame(filename: string): Promise { + try { + const fileContents = await fs.readFile(filename, 'utf8'); + const saveData = JSON.parse(fileContents); + + // Check if the save file matches the current world model + if (!this.worldModel) { + throw new Error('World model not loaded'); + } + + if (saveData.worldModelName !== this.worldModel.title || + saveData.worldModelVersion !== this.worldModel.version) { + throw new Error('Save file is for a different world or version'); + } + + // Load the game state + this.gameState = saveData.gameState; + } catch (error) { + console.error(`Failed to load game from ${filename}:`, error); + throw new Error(`Could not load save file: ${error instanceof Error ? error.message : String(error)}`); + } + } + + /** + * Get a list of available actions in the current context + */ + public getAvailableActions(): string[] { + if (!this.worldModel) return []; + + // Common actions always available + const availableActions = ['look', 'inventory', 'help']; + + // Add movement actions based on current room exits + const currentRoom = this.getCurrentRoom(); + if (currentRoom) { + currentRoom.exits.forEach(exit => { + availableActions.push(`go ${exit.direction.toLowerCase()}`); + }); + } + + // Add object interactions based on visible objects + const visibleObjects = this.getVisibleObjects(); + const objects = this.worldModel.objects; + + visibleObjects.forEach(objId => { + const obj = objects[objId]; + if (obj) { + obj.allowedActions.forEach(action => { + availableActions.push(`${action} ${obj.name.toLowerCase()}`); + }); + } + }); + + // Add character interactions + const visibleCharacters = this.getVisibleCharacters(); + visibleCharacters.forEach(charId => { + availableActions.push(`talk to ${this.worldModel!.characters[charId].name.toLowerCase()}`); + }); + + // Add inventory object actions + this.gameState!.inventory.forEach(objId => { + const obj = objects[objId]; + if (obj) { + obj.allowedActions.forEach(action => { + availableActions.push(`${action} ${obj.name.toLowerCase()}`); + }); + } + }); + + return Array.from(new Set(availableActions)); // Remove duplicates + } + + /** + * Get a list of visible objects in the current room + */ + public getVisibleObjects(): string[] { + if (!this.worldModel || !this.gameState) return []; + + const currentRoom = this.getCurrentRoom(); + if (!currentRoom) return []; + + const visibleObjects: string[] = [...currentRoom.objects]; + + // Add objects from open containers + currentRoom.objects.forEach(objId => { + const obj = this.worldModel!.objects[objId]; + if (obj && obj.traits.includes('container') && obj.states?.open && obj.containedObjects) { + visibleObjects.push(...obj.containedObjects); + } + }); + + return visibleObjects; + } + + /** + * Get a list of visible characters in the current room + */ + public getVisibleCharacters(): string[] { + if (!this.worldModel || !this.gameState) return []; + + const currentRoom = this.getCurrentRoom(); + return currentRoom ? currentRoom.characters : []; + } + + /** + * Get the description of the current room + */ + public getCurrentRoomDescription(): string { + const currentRoom = this.getCurrentRoom(); + if (!currentRoom) return 'You are in a void. Something has gone wrong.'; + + return currentRoom.description; + } + + /** + * Start the game and return the introduction text + */ + public async start(): Promise { + if (!this.worldModel) { + throw new Error('World not loaded. Please load a world before starting.'); + } + + // Reset game state to initial state + this.gameState = { ...this.worldModel.initialState }; + + return this.worldModel.introduction; + } + + /** + * End the game (cleanup resources if needed) + */ + public end(): void { + // Cleanup could happen here if needed + console.log('Game ended'); + } + + /** + * Get the current room object + */ + private getCurrentRoom(): Room | null { + if (!this.worldModel || !this.gameState) return null; + + const roomId = this.gameState.currentRoomId; + return this.worldModel.rooms[roomId] || null; + } + + /** + * Register default action handlers + */ + private registerDefaultActionHandlers(): void { + // Look action + this.actionHandlers['look'] = (state, world, action): ActionResult => { + const room = world.rooms[state.currentRoomId]; + + // If an object is specified, look at that object + if (action.object) { + // Try to find the object in the room or inventory + const visibleObjects = this.getVisibleObjects(); + const objId = this.findObjectByName(action.object, [...visibleObjects, ...state.inventory]); + + if (!objId) { + return { + success: false, + message: `You don't see any ${action.object} here.`, + stateChanged: false + }; + } + + const obj = world.objects[objId]; + return { + success: true, + message: obj.description, + stateChanged: false + }; + } + + // Look at the room + const objectDescriptions = room.objects + .map(id => world.objects[id]) + .map(obj => `You can see ${obj.name.toLowerCase()} here.`); + + const characterDescriptions = room.characters + .map(id => world.characters[id]) + .map(char => `${char.name} is here.`); + + const exitDescriptions = room.exits + .map(exit => `There is an exit ${exit.direction.toLowerCase()}${exit.description ? ` (${exit.description})` : ''}.`); + + const fullDescription = [ + room.description, + ...objectDescriptions, + ...characterDescriptions, + ...exitDescriptions + ].join('\n'); + + return { + success: true, + message: fullDescription, + stateChanged: false + }; + }; + + // Go action + this.actionHandlers['go'] = (state, world, action): ActionResult => { + const room = world.rooms[state.currentRoomId]; + + if (!action.object) { + return { + success: false, + message: 'Go where?', + stateChanged: false + }; + } + + // Find the exit that matches the direction + const direction = action.object.toLowerCase(); + const exit = room.exits.find(e => e.direction.toLowerCase() === direction); + + if (!exit) { + return { + success: false, + message: `You can't go ${direction} from here.`, + stateChanged: false + }; + } + + if (exit.isLocked) { + if (!exit.keyId) { + return { + success: false, + message: `The way ${direction} is locked.`, + stateChanged: false + }; + } + + if (!state.inventory.includes(exit.keyId)) { + return { + success: false, + message: `The way ${direction} is locked and you don't have the key.`, + stateChanged: false + }; + } + + // Player has the key, unlock the exit + exit.isLocked = false; + return { + success: true, + message: `You unlock the way ${direction} and proceed.`, + stateChanged: true, + newState: { + ...state, + currentRoomId: exit.targetRoomId, + visitedRooms: state.visitedRooms.includes(exit.targetRoomId) + ? state.visitedRooms + : [...state.visitedRooms, exit.targetRoomId] + } + }; + } + + // Exit is not locked, just move + return { + success: true, + message: `You go ${direction}.`, + stateChanged: true, + newState: { + ...state, + currentRoomId: exit.targetRoomId, + visitedRooms: state.visitedRooms.includes(exit.targetRoomId) + ? state.visitedRooms + : [...state.visitedRooms, exit.targetRoomId] + } + }; + }; + + // Take action + this.actionHandlers['take'] = (state, world, action): ActionResult => { + if (!action.object) { + return { + success: false, + message: 'Take what?', + stateChanged: false + }; + } + + // Find the object in the current room + const visibleObjects = this.getVisibleObjects(); + const objId = this.findObjectByName(action.object, visibleObjects); + + if (!objId) { + return { + success: false, + message: `You don't see any ${action.object} here.`, + stateChanged: false + }; + } + + const obj = world.objects[objId]; + + // Check if the object can be taken + if (!obj.traits.includes('takeable')) { + return { + success: false, + message: `You can't take the ${obj.name.toLowerCase()}.`, + stateChanged: false + }; + } + + // Remove object from room and add to inventory + const room = world.rooms[state.currentRoomId]; + const newRoomObjects = room.objects.filter(id => id !== objId); + room.objects = newRoomObjects; + + // Update state + return { + success: true, + message: `You take the ${obj.name.toLowerCase()}.`, + stateChanged: true, + newState: { + ...state, + inventory: [...state.inventory, objId] + } + }; + }; + + // Inventory action + this.actionHandlers['inventory'] = (state, world): ActionResult => { + if (state.inventory.length === 0) { + return { + success: true, + message: 'Your inventory is empty.', + stateChanged: false + }; + } + + const items = state.inventory + .map(id => world.objects[id]) + .map(obj => obj.name) + .join(', '); + + return { + success: true, + message: `You are carrying: ${items}.`, + stateChanged: false + }; + }; + + // Drop action + this.actionHandlers['drop'] = (state, world, action): ActionResult => { + if (!action.object) { + return { + success: false, + message: 'Drop what?', + stateChanged: false + }; + } + + // Find the object in the inventory + const objId = this.findObjectByName(action.object, state.inventory); + + if (!objId) { + return { + success: false, + message: `You don't have any ${action.object}.`, + stateChanged: false + }; + } + + const obj = world.objects[objId]; + + // Remove object from inventory and add to room + const room = world.rooms[state.currentRoomId]; + room.objects.push(objId); + + // Update state + return { + success: true, + message: `You drop the ${obj.name.toLowerCase()}.`, + stateChanged: true, + newState: { + ...state, + inventory: state.inventory.filter(id => id !== objId) + } + }; + }; + + // Use action + this.actionHandlers['use'] = (state, world, action): ActionResult => { + if (!action.object) { + return { + success: false, + message: 'Use what?', + stateChanged: false + }; + } + + // Find the object in inventory or visible objects + const visibleObjects = this.getVisibleObjects(); + const objId = this.findObjectByName(action.object, [...state.inventory, ...visibleObjects]); + + if (!objId) { + return { + success: false, + message: `You don't see any ${action.object} here.`, + stateChanged: false + }; + } + + const obj = world.objects[objId]; + + // Check if the object can be used + if (!obj.allowedActions.includes('use')) { + return { + success: false, + message: `You can't use the ${obj.name.toLowerCase()}.`, + stateChanged: false + }; + } + + // Check if there's a target + if (action.target) { + const targetId = this.findObjectByName(action.target, [...state.inventory, ...visibleObjects]); + + if (!targetId) { + return { + success: false, + message: `You don't see any ${action.target} here.`, + stateChanged: false + }; + } + + const target = world.objects[targetId]; + + // TODO: Implement object-specific use logic (could be extended with a more sophisticated system) + return { + success: true, + message: `You use the ${obj.name.toLowerCase()} on the ${target.name.toLowerCase()}.`, + stateChanged: false + }; + } + + // Simple use without target + return { + success: true, + message: `You use the ${obj.name.toLowerCase()}.`, + stateChanged: false + }; + }; + + // Talk action + this.actionHandlers['talk'] = (state, world, action): ActionResult => { + if (!action.object) { + return { + success: false, + message: 'Talk to whom?', + stateChanged: false + }; + } + + // Find the character in the room + const visibleCharacters = this.getVisibleCharacters(); + const charId = this.findCharacterByName(action.object, visibleCharacters); + + if (!charId) { + return { + success: false, + message: `You don't see anyone called ${action.object} here.`, + stateChanged: false + }; + } + + const character = world.characters[charId]; + + // If a topic is provided + if (action.parameters?.topic) { + const topic = action.parameters.topic.toLowerCase(); + const response = character.dialogue[topic] || character.defaultResponse; + + return { + success: true, + message: `${character.name}: "${response}"`, + stateChanged: false + }; + } + + // No specific topic + return { + success: true, + message: `${character.name} looks ready to talk. You could ask about: ${Object.keys(character.dialogue).join(', ')}.`, + stateChanged: false + }; + }; + + // Help action + this.actionHandlers['help'] = (): ActionResult => { + return { + success: true, + message: [ + 'Available commands:', + '- look: Examine your surroundings or a specific object', + '- go [direction]: Move in a direction', + '- take [object]: Pick up an object', + '- drop [object]: Put down an object', + '- inventory: Check what you\'re carrying', + '- use [object] (on [target]): Use an object, optionally on another object', + '- talk to [character] (about [topic]): Speak with a character', + '- help: Show this help text', + '', + 'You can type commands in natural language. The AI will interpret your intent.' + ].join('\n'), + stateChanged: false + }; + }; + + // Examine action (alias for look) + this.actionHandlers['examine'] = this.actionHandlers['look']; + } + + /** + * Find an object by name in a list of object IDs + */ + private findObjectByName(name: string, objectIds: string[]): string | null { + if (!this.worldModel) return null; + + const normalizedName = name.toLowerCase(); + + for (const id of objectIds) { + const obj = this.worldModel.objects[id]; + if (obj && obj.name.toLowerCase() === normalizedName) { + return id; + } + } + + return null; + } + + /** + * Find a character by name in a list of character IDs + */ + private findCharacterByName(name: string, characterIds: string[]): string | null { + if (!this.worldModel) return null; + + const normalizedName = name.toLowerCase(); + + for (const id of characterIds) { + const character = this.worldModel.characters[id]; + if (character && character.name.toLowerCase() === normalizedName) { + return id; + } + } + + return null; + } +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..76a2fe0 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,83 @@ +/** + * Main entry point for the AI Interactive Fiction application + */ + +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'; + +// Load environment variables +console.log('Loading environment variables...'); +try { + const result = dotenv.config(); + if (result.error) { + console.error('Error loading .env file:', result.error); + } else { + console.log('Environment variables loaded successfully'); + } +} catch (error) { + console.error('Exception when loading env:', error); +} + +async function main(): Promise { + try { + console.log('=== AI Interactive Fiction ==='); + 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'; + 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'}`); + + // Check if we should run in CLI mode + const args = process.argv.slice(2); + const cliMode = args.includes('--cli') || args.includes('-c'); + + if (cliMode) { + // CLI mode + console.log('Starting in CLI mode...'); + + // Create game runner and initialize + console.log('Creating game runner...'); + const gameRunner = new GameRunner(); + + console.log('Initializing game...'); + await gameRunner.initialize(worldFile); + + // Start the CLI game + console.log('Starting CLI game...'); + await gameRunner.start(); + } else { + // Web interface mode - explicitly start the server with port fallback + console.log('Starting in web interface mode...'); + + // Get port configuration + const DEFAULT_PORT = 3000; + const PORT = process.env.PORT ? parseInt(process.env.PORT) : DEFAULT_PORT; + const PORT_RANGE = 10; + + // Start the web server with port fallback + console.log('Starting web server...'); + await startServer(PORT, PORT_RANGE); + } + } catch (error) { + console.error('Failed to start:', error); + if (error instanceof Error) { + console.error('Error name:', error.name); + console.error('Error message:', error.message); + console.error('Error stack:', error.stack); + } + process.exit(1); + } +} + +// Start the application +console.log('Starting application...'); +main().catch(error => { + console.error('Unhandled error in main:', error); + process.exit(1); +}); \ No newline at end of file diff --git a/src/interfaces/engine.ts b/src/interfaces/engine.ts new file mode 100644 index 0000000..0303179 --- /dev/null +++ b/src/interfaces/engine.ts @@ -0,0 +1,56 @@ +/** + * Interfaces for the game engine + */ + +import { WorldModel, GameState } from './world-model'; +import { ActionResponse, NarrativeResponse } from './llm'; + +export interface ActionResult { + success: boolean; + message: string; + stateChanged: boolean; + newState?: GameState; +} + +export interface GameEngine { + loadWorld(worldModelPath: string): Promise; + getCurrentState(): GameState; + getWorldModel(): WorldModel; + + // Action processing + processAction(action: ActionResponse): ActionResult; + + // State management + saveGame(filename: string): Promise; + loadGame(filename: string): Promise; + + // Helper methods for world interaction + getAvailableActions(): string[]; + getVisibleObjects(): string[]; + getVisibleCharacters(): string[]; + getCurrentRoomDescription(): string; + + // Game flow + start(): Promise; // Returns introduction text + end(): void; +} + +export interface GameSession { + engine: GameEngine; + history: { + playerInput: string; + actionResponse: ActionResponse; + actionResult: ActionResult; + narrativeResponse: NarrativeResponse; + }[]; + startTime: Date; + lastInteractionTime: Date; +} + +export interface ActionHandler { + execute( + gameState: GameState, + worldModel: WorldModel, + action: ActionResponse + ): ActionResult; +} \ No newline at end of file diff --git a/src/interfaces/llm.ts b/src/interfaces/llm.ts new file mode 100644 index 0000000..175e642 --- /dev/null +++ b/src/interfaces/llm.ts @@ -0,0 +1,52 @@ +/** + * Interfaces for LLM integration + */ + +export interface LlmConfig { + apiKey: string; + model: string; + temperature?: number; + maxTokens?: number; + topP?: number; + frequencyPenalty?: number; + presencePenalty?: number; +} + +export interface ActionRequest { + playerInput: string; + currentRoom: string; + visibleObjects: string[]; + visibleCharacters: string[]; + possibleActions: string[]; + inventory: string[]; + gameContext: string; +} + +export interface ActionResponse { + action: string; + object?: string; + target?: string; + parameters?: Record; + confidence: number; +} + +export interface NarrativeRequest { + action: string; + result: string; + roomDescription: string; + visibleObjects: string[]; + visibleCharacters: string[]; + previousContext?: string; + tone?: string; // e.g., "mysterious", "humorous", "dramatic" +} + +export interface NarrativeResponse { + text: string; + suggestions?: string[]; // Optional hints for the player +} + +export interface LlmProvider { + initialize(config: LlmConfig): Promise; + translateAction(request: ActionRequest): Promise; + generateNarrative(request: NarrativeRequest): Promise; +} \ No newline at end of file diff --git a/src/interfaces/world-model.ts b/src/interfaces/world-model.ts new file mode 100644 index 0000000..1051cd5 --- /dev/null +++ b/src/interfaces/world-model.ts @@ -0,0 +1,68 @@ +/** + * Core interfaces for the interactive fiction world model + */ + +export interface Room { + id: string; + name: string; + description: string; + exits: Exit[]; + objects: string[]; // References to object IDs + characters: string[]; // References to character IDs +} + +export interface Exit { + direction: string; + targetRoomId: string; + description?: string; + isLocked?: boolean; + keyId?: string; // ID of the key object needed to unlock +} + +export interface GameObject { + id: string; + name: string; + description: string; + traits: string[]; // e.g., "takeable", "container", "edible" + states: Record; // e.g., { "open": false, "lit": true } + containedObjects?: string[]; // IDs of objects inside if this is a container + allowedActions: string[]; // What actions can be performed on this object +} + +export interface Character { + id: string; + name: string; + description: string; + dialogue: Record; // Topic -> response mapping + inventory: string[]; // IDs of objects the character has + defaultResponse: string; // Response when topic not found + mood?: string; // Current mood affecting responses +} + +export interface Action { + name: string; + patterns: string[]; // Example natural language patterns this action matches + requiresObject?: boolean; + requiresTarget?: boolean; + handler: string; // Name of method to handle this action +} + +export interface GameState { + currentRoomId: string; + inventory: string[]; // IDs of objects in player's inventory + visitedRooms: string[]; // IDs of rooms the player has visited + flags: Record; // Game state flags + counters: Record; // Game state counters +} + +export interface WorldModel { + title: string; + author: string; + version: string; + introduction: string; + rooms: Record; + objects: Record; + characters: Record; + actions: Record; + initialState: GameState; +} \ No newline at end of file diff --git a/src/llm/openrouter-provider.ts b/src/llm/openrouter-provider.ts new file mode 100644 index 0000000..ec39fe8 --- /dev/null +++ b/src/llm/openrouter-provider.ts @@ -0,0 +1,212 @@ +/** + * OpenRouter LLM Provider + * Handles communication with OpenRouter API for LLM interactions + */ + +import axios, { AxiosInstance } from 'axios'; +import { + LlmProvider, + LlmConfig, + ActionRequest, + ActionResponse, + NarrativeRequest, + NarrativeResponse +} from '../interfaces/llm'; + +export class OpenRouterProvider implements LlmProvider { + private apiKey: string = ''; + private model: string = ''; + private client!: AxiosInstance; + private temperature: number = 0.7; + private maxTokens: number = 800; + + /** + * Initialize the OpenRouter provider with configuration + */ + public async initialize(config: LlmConfig): Promise { + this.apiKey = config.apiKey; + this.model = config.model; + this.temperature = config.temperature ?? 0.7; + this.maxTokens = config.maxTokens ?? 800; + + this.client = axios.create({ + baseURL: 'https://openrouter.ai/api/v1', + headers: { + 'Authorization': `Bearer ${this.apiKey}`, + 'Content-Type': 'application/json' + } + }); + } + + /** + * Translate player input into a structured action for the game engine + */ + public async translateAction(request: ActionRequest): Promise { + try { + const prompt = this.buildActionPrompt(request); + + const response = await this.client.post('/chat/completions', { + model: this.model, + messages: [ + { + role: 'system', + content: prompt.system + }, + { + role: 'user', + content: prompt.user + } + ], + temperature: 0.2, // Lower temperature for more deterministic outputs + max_tokens: 150, + response_format: { type: 'json_object' } + }); + + const content = response.data.choices[0].message.content; + const parsedResponse = JSON.parse(content); + + return this.validateActionResponse(parsedResponse); + } catch (error) { + console.error('Error translating action:', error); + // Fallback to a simple "look" action when errors occur + return { + action: 'look', + confidence: 0.5 + }; + } + } + + /** + * Generate narrative prose based on game events + */ + public async generateNarrative(request: NarrativeRequest): Promise { + try { + const prompt = this.buildNarrativePrompt(request); + + const response = await this.client.post('/chat/completions', { + model: this.model, + messages: [ + { + role: 'system', + content: prompt.system + }, + { + role: 'user', + content: prompt.user + } + ], + temperature: this.temperature, + max_tokens: this.maxTokens + }); + + const content = response.data.choices[0].message.content; + + // Check if response is JSON format or plain text + try { + const parsedResponse = JSON.parse(content); + return { + text: parsedResponse.text, + suggestions: parsedResponse.suggestions || [] + }; + } catch { + // Plain text response, just use the content directly + return { + text: content + }; + } + } catch (error) { + console.error('Error generating narrative:', error); + return { + text: `Something happened, but the narrator is at a loss for words. (Error: ${error instanceof Error ? error.message : String(error)})` + }; + } + } + + /** + * Build the system and user prompts for action translation + */ + private buildActionPrompt(request: ActionRequest): { system: string; user: string } { + const systemPrompt = `You are an AI assistant that translates natural language input into structured action commands for an interactive fiction game. +Your task is to convert player input into a JSON object representing an action that can be understood by the game engine. + +The player is currently in the "${request.currentRoom}" room. +Visible objects: ${request.visibleObjects.join(', ')} +Visible characters: ${request.visibleCharacters.join(', ')} +Inventory: ${request.inventory.join(', ')} +Available actions: ${request.possibleActions.join(', ')} + +Game context: ${request.gameContext} + +Respond ONLY with a JSON object that follows this structure: +{ + "action": "string", // Name of the action (e.g., "take", "examine", "go", "talk", etc.) + "object": "string", // Optional: Primary object of the action + "target": "string", // Optional: Secondary object/target of the action + "parameters": {}, // Optional: Additional parameters as key-value pairs + "confidence": number // How confident you are in this interpretation (0.0-1.0) +} + +Choose the action from the list of available actions. If the player's input is ambiguous or doesn't map well to an available action, choose the closest match and set a lower confidence score.`; + + const userPrompt = request.playerInput; + + return { + system: systemPrompt, + user: userPrompt + }; + } + + /** + * Build the system and user prompts for narrative generation + */ + private buildNarrativePrompt(request: NarrativeRequest): { system: string; user: string } { + const tone = request.tone || 'descriptive'; + + const systemPrompt = `You are an AI assistant that generates engaging narrative prose for an interactive fiction game. +Your task is to describe what happens when a player performs an action in the game world. + +Craft a vivid, ${tone} description that tells the player what happened as a result of their action. Make your prose engaging and atmospheric. + +Current room description: "${request.roomDescription}" +Visible objects: ${request.visibleObjects.join(', ')} +Visible characters: ${request.visibleCharacters.join(', ')} + +${request.previousContext ? `Previous context: ${request.previousContext}` : ''} + +Respond with engaging prose that describes the outcome of the player's action. +You can optionally include 1-3 subtle hints about interesting things to try next.`; + + const userPrompt = `The player has performed this action: "${request.action}". +The result of the action is: "${request.result}". +Please describe what happens in an engaging, narrative way.`; + + return { + system: systemPrompt, + user: userPrompt + }; + } + + /** + * Validate and normalize the action response + */ + private validateActionResponse(response: Record): ActionResponse { + const validatedResponse: ActionResponse = { + action: typeof response.action === 'string' ? response.action : 'look', + confidence: typeof response.confidence === 'number' ? response.confidence : 0.5 + }; + + if (typeof response.object === 'string') { + validatedResponse.object = response.object; + } + + if (typeof response.target === 'string') { + validatedResponse.target = response.target; + } + + if (response.parameters && typeof response.parameters === 'object') { + validatedResponse.parameters = response.parameters as Record; + } + + return validatedResponse; + } +} \ No newline at end of file diff --git a/src/server.ts b/src/server.ts new file mode 100644 index 0000000..bf47b6e --- /dev/null +++ b/src/server.ts @@ -0,0 +1,246 @@ +/** + * AI Interactive Fiction - Web Server + * Serves the web UI and handles WebSocket communication + */ + +import path from 'path'; +import express from 'express'; +import http from 'http'; +import { Server as SocketIOServer } from 'socket.io'; +import * as dotenv from 'dotenv'; +import { GameRunner } from './cli/game-runner'; +import { existsSync, mkdirSync, copyFileSync } from 'fs'; + +// Load environment variables +dotenv.config(); + +// Create Express application +const app = express(); +const server = http.createServer(app); +const io = new SocketIOServer(server); + +// Get port from environment variables or use default +const DEFAULT_PORT = 3000; +const PORT = process.env.PORT ? parseInt(process.env.PORT) : DEFAULT_PORT; +const PORT_RANGE = 10; // Try up to 10 ports starting from the default + +// Serve static files from the public directory +app.use(express.static(path.join(__dirname, '../public'))); + +// Set up game sessions +const gameSessions = new Map(); + +// Handle socket connections +io.on('connection', (socket) => { + console.log(`New client connected: ${socket.id}`); + + // Start a new game + socket.on('startGame', async () => { + try { + // Initialize game runner + const gameRunner = new GameRunner(); + const worldFile = process.env.DEFAULT_WORLD_FILE || './data/worlds/example_world.yml'; + + // Initialize the game + await gameRunner.initialize(worldFile); + + // Store game session + gameSessions.set(socket.id, gameRunner); + + // Send introduction to client + const gameState = gameRunner.getGameState(); + socket.emit('gameIntroduction', { + introduction: gameState.world.introduction, + initialRoomDescription: gameRunner.getCurrentRoomDescription(), + currentRoomId: gameState.currentRoomId + }); + + } catch (error) { + console.error('Error starting game:', error); + socket.emit('error', { message: 'Failed to start game. Please try again.' }); + } + }); + + // Process player command + socket.on('playerCommand', async (data) => { + try { + const gameRunner = gameSessions.get(socket.id); + + if (!gameRunner) { + socket.emit('error', { message: 'Game session not found. Please start a new game.' }); + return; + } + + // Process command and get response + const response = await gameRunner.processCommand(data.command); + + // Send narrative response to client + socket.emit('narrativeResponse', { + text: response, + gameState: { + currentRoomId: gameRunner.getGameState().currentRoomId + }, + suggestions: gameRunner.getSuggestions() + }); + + } catch (error) { + console.error('Error processing command:', error); + socket.emit('error', { message: 'Failed to process command. Please try again.' }); + } + }); + + // Save game state + socket.on('saveGame', () => { + try { + const gameRunner = gameSessions.get(socket.id); + + if (!gameRunner) { + socket.emit('error', { message: 'Game session not found. Please start a new game.' }); + return; + } + + // Store save data in session + socket.data.savedGame = gameRunner.getGameState(); + + socket.emit('gameSaved'); + + } catch (error) { + console.error('Error saving game:', error); + socket.emit('error', { message: 'Failed to save game. Please try again.' }); + } + }); + + // Load game state + socket.on('loadGame', () => { + try { + const gameRunner = gameSessions.get(socket.id); + + if (!gameRunner) { + socket.emit('error', { message: 'Game session not found. Please start a new game.' }); + return; + } + + // Check if there's a saved game + if (!socket.data.savedGame) { + socket.emit('error', { message: 'No saved game found.' }); + return; + } + + // Load saved game + gameRunner.loadGameState(socket.data.savedGame); + + // Send current state to client + socket.emit('gameLoaded', { + currentRoomDescription: gameRunner.getCurrentRoomDescription(), + currentRoomId: gameRunner.getGameState().currentRoomId + }); + + } catch (error) { + console.error('Error loading game:', error); + socket.emit('error', { message: 'Failed to load game. Please try again.' }); + } + }); + + // Handle disconnection + socket.on('disconnect', () => { + console.log(`Client disconnected: ${socket.id}`); + + // Clean up game session + if (gameSessions.has(socket.id)) { + gameSessions.delete(socket.id); + } + }); +}); + +// Ensure required asset folders exist +function ensureDirectories() { + const dirs = [ + path.join(__dirname, '../public'), + path.join(__dirname, '../public/js'), + path.join(__dirname, '../public/css'), + path.join(__dirname, '../public/images'), + path.join(__dirname, '../public/fonts') + ]; + + for (const dir of dirs) { + if (!existsSync(dir)) { + mkdirSync(dir, { recursive: true }); + } + } +} + +// Copy kokoro-js library from node_modules if not already present +function ensureKokoroJs() { + const source = path.join(__dirname, '../node_modules/kokoro-js/dist/index.js'); + const destination = path.join(__dirname, '../public/js/kokoro-js.js'); + + if (existsSync(source) && !existsSync(destination)) { + copyFileSync(source, destination); + console.log(`Copied kokoro-js from ${source} to ${destination}`); + } +} + +// Start the server with port fallback +export async function startServer(initialPort: number, range: number): Promise { + let currentPort = initialPort; + const maxPort = initialPort + range; + + // Try ports in the specified range + while (currentPort < maxPort) { + try { + // Ensure directories exist + ensureDirectories(); + + // Ensure kokoro-js is copied + try { + ensureKokoroJs(); + } catch (error) { + console.error('Error copying kokoro-js:', error); + } + + // Try to start the server on the current port + await new Promise((resolve, reject) => { + server.listen(currentPort, () => { + console.log(`AI Interactive Fiction web server running on http://localhost:${currentPort}`); + resolve(); + }); + + server.on('error', (error: NodeJS.ErrnoException) => { + // If port is in use, try next port + if (error.code === 'EADDRINUSE') { + console.log(`Port ${currentPort} is in use, trying next port...`); + server.close(); + currentPort++; + reject(); + } else { + // For other errors, log and reject + console.error('Server error:', error); + reject(error); + } + }); + }); + + // If we reach here, server started successfully + return; + + } catch (error) { + // If we reach the max port and still fail, throw an error + if (currentPort >= maxPort - 1) { + throw new Error(`Failed to start server on ports ${initialPort} to ${maxPort - 1}`); + } + + // Otherwise try the next port + // The loop continues as the rejection above increments currentPort + } + } +} + +// Start the server when this module is run directly +if (require.main === module) { + startServer(PORT, PORT_RANGE).catch(error => { + console.error('Failed to start server:', error); + process.exit(1); + }); +} + +export { app, server, io }; \ No newline at end of file diff --git a/src/world-model/yaml-parser.ts b/src/world-model/yaml-parser.ts new file mode 100644 index 0000000..82853f7 --- /dev/null +++ b/src/world-model/yaml-parser.ts @@ -0,0 +1,429 @@ +/** + * YAML World Model Parser + * Loads and validates world definitions from YAML files + */ + +import * as fs from 'fs/promises'; +import * as yaml from 'js-yaml'; +import { WorldModel } from '../interfaces/world-model'; + +export class YamlWorldParser { + /** + * Load a world model from a YAML file + */ + public static async loadFromFile(filePath: string): Promise { + try { + const fileContents = await fs.readFile(filePath, 'utf8'); + const worldData = yaml.load(fileContents) as unknown; + + return this.validateAndTransform(worldData); + } catch (error) { + console.error(`Error loading world from ${filePath}:`, error); + throw new Error(`Failed to load world from ${filePath}: ${error instanceof Error ? error.message : String(error)}`); + } + } + + /** + * Validate the loaded YAML data and transform it into a WorldModel + */ + private static validateAndTransform(data: unknown): WorldModel { + if (!data || typeof data !== 'object') { + throw new Error('Invalid world data: must be an object'); + } + + const worldData = data as Record; + + // Validate required top-level fields + this.validateRequiredFields(worldData, ['title', 'author', 'version', 'introduction', 'rooms', 'initialState']); + + // Transform and validate the world model + const worldModel: WorldModel = { + title: this.validateString(worldData.title, 'title'), + author: this.validateString(worldData.author, 'author'), + version: this.validateString(worldData.version, 'version'), + introduction: this.validateString(worldData.introduction, 'introduction'), + rooms: this.validateRooms(worldData.rooms), + objects: this.validateObjects(worldData.objects), + characters: this.validateCharacters(worldData.characters), + actions: this.validateActions(worldData.actions), + initialState: this.validateInitialState(worldData.initialState) + }; + + // Validate references between entities + this.validateReferences(worldModel); + + return worldModel; + } + + /** + * Validate that an object has all required fields + */ + private static validateRequiredFields(data: Record, requiredFields: string[]): void { + for (const field of requiredFields) { + if (!(field in data)) { + throw new Error(`Missing required field: ${field}`); + } + } + } + + /** + * Validate that a value is a string + */ + private static validateString(value: unknown, fieldName: string): string { + if (typeof value !== 'string') { + throw new Error(`Field ${fieldName} must be a string`); + } + return value; + } + + /** + * Validate room definitions + */ + private static validateRooms(rooms: unknown): WorldModel['rooms'] { + if (!rooms || typeof rooms !== 'object') { + throw new Error('Rooms must be an object mapping room IDs to room definitions'); + } + + const roomsData = rooms as Record; + const validatedRooms: WorldModel['rooms'] = {}; + + for (const [roomId, roomData] of Object.entries(roomsData)) { + if (!roomData || typeof roomData !== 'object') { + throw new Error(`Room ${roomId} must be an object`); + } + + const room = roomData as Record; + this.validateRequiredFields(room, ['name', 'description', 'exits']); + + validatedRooms[roomId] = { + id: roomId, + name: this.validateString(room.name, `rooms.${roomId}.name`), + description: this.validateString(room.description, `rooms.${roomId}.description`), + exits: this.validateExits(room.exits, roomId), + objects: this.validateStringArray(room.objects || [], `rooms.${roomId}.objects`), + characters: this.validateStringArray(room.characters || [], `rooms.${roomId}.characters`) + }; + } + + return validatedRooms; + } + + /** + * Validate exit definitions + */ + private static validateExits(exits: unknown, roomId: string): WorldModel['rooms'][string]['exits'] { + if (!Array.isArray(exits)) { + throw new Error(`Exits for room ${roomId} must be an array`); + } + + return exits.map((exit, index) => { + if (!exit || typeof exit !== 'object') { + throw new Error(`Exit ${index} in room ${roomId} must be an object`); + } + + const exitData = exit as Record; + this.validateRequiredFields(exitData, ['direction', 'targetRoomId']); + + return { + direction: this.validateString(exitData.direction, `rooms.${roomId}.exits[${index}].direction`), + targetRoomId: this.validateString(exitData.targetRoomId, `rooms.${roomId}.exits[${index}].targetRoomId`), + description: exitData.description ? this.validateString(exitData.description, `rooms.${roomId}.exits[${index}].description`) : undefined, + isLocked: typeof exitData.isLocked === 'boolean' ? exitData.isLocked : false, + keyId: exitData.keyId ? this.validateString(exitData.keyId, `rooms.${roomId}.exits[${index}].keyId`) : undefined + }; + }); + } + + /** + * Validate object definitions + */ + private static validateObjects(objects: unknown): WorldModel['objects'] { + if (!objects) return {}; // Objects are optional + + if (typeof objects !== 'object') { + throw new Error('Objects must be an object mapping object IDs to object definitions'); + } + + const objectsData = objects as Record; + const validatedObjects: WorldModel['objects'] = {}; + + for (const [objectId, objectData] of Object.entries(objectsData)) { + if (!objectData || typeof objectData !== 'object') { + throw new Error(`Object ${objectId} must be an object`); + } + + const obj = objectData as Record; + this.validateRequiredFields(obj, ['name', 'description', 'traits', 'allowedActions']); + + validatedObjects[objectId] = { + id: objectId, + name: this.validateString(obj.name, `objects.${objectId}.name`), + description: this.validateString(obj.description, `objects.${objectId}.description`), + traits: this.validateStringArray(obj.traits, `objects.${objectId}.traits`), + states: this.validateObjectStates(obj.states, objectId), + allowedActions: this.validateStringArray(obj.allowedActions, `objects.${objectId}.allowedActions`), + containedObjects: obj.containedObjects ? this.validateStringArray(obj.containedObjects, `objects.${objectId}.containedObjects`) : [] + }; + } + + return validatedObjects; + } + + /** + * Validate character definitions + */ + private static validateCharacters(characters: unknown): WorldModel['characters'] { + if (!characters) return {}; // Characters are optional + + if (typeof characters !== 'object') { + throw new Error('Characters must be an object mapping character IDs to character definitions'); + } + + const charactersData = characters as Record; + const validatedCharacters: WorldModel['characters'] = {}; + + for (const [characterId, characterData] of Object.entries(charactersData)) { + if (!characterData || typeof characterData !== 'object') { + throw new Error(`Character ${characterId} must be an object`); + } + + const character = characterData as Record; + this.validateRequiredFields(character, ['name', 'description', 'dialogue', 'defaultResponse']); + + validatedCharacters[characterId] = { + id: characterId, + name: this.validateString(character.name, `characters.${characterId}.name`), + description: this.validateString(character.description, `characters.${characterId}.description`), + dialogue: this.validateDialogue(character.dialogue, characterId), + inventory: this.validateStringArray(character.inventory || [], `characters.${characterId}.inventory`), + defaultResponse: this.validateString(character.defaultResponse, `characters.${characterId}.defaultResponse`), + mood: character.mood ? this.validateString(character.mood, `characters.${characterId}.mood`) : undefined + }; + } + + return validatedCharacters; + } + + /** + * Validate action definitions + */ + private static validateActions(actions: unknown): WorldModel['actions'] { + if (!actions) return {}; // Actions are optional + + if (typeof actions !== 'object') { + throw new Error('Actions must be an object mapping action names to action definitions'); + } + + const actionsData = actions as Record; + const validatedActions: WorldModel['actions'] = {}; + + for (const [actionName, actionData] of Object.entries(actionsData)) { + if (!actionData || typeof actionData !== 'object') { + throw new Error(`Action ${actionName} must be an object`); + } + + const action = actionData as Record; + this.validateRequiredFields(action, ['patterns', 'handler']); + + validatedActions[actionName] = { + name: actionName, + patterns: this.validateStringArray(action.patterns, `actions.${actionName}.patterns`), + requiresObject: typeof action.requiresObject === 'boolean' ? action.requiresObject : false, + requiresTarget: typeof action.requiresTarget === 'boolean' ? action.requiresTarget : false, + handler: this.validateString(action.handler, `actions.${actionName}.handler`) + }; + } + + return validatedActions; + } + + /** + * Validate initial game state + */ + private static validateInitialState(initialState: unknown): WorldModel['initialState'] { + if (!initialState || typeof initialState !== 'object') { + throw new Error('Initial state must be an object'); + } + + const stateData = initialState as Record; + this.validateRequiredFields(stateData, ['currentRoomId']); + + return { + currentRoomId: this.validateString(stateData.currentRoomId, 'initialState.currentRoomId'), + inventory: this.validateStringArray(stateData.inventory || [], 'initialState.inventory'), + visitedRooms: this.validateStringArray(stateData.visitedRooms || [], 'initialState.visitedRooms'), + flags: this.validateFlags(stateData.flags), + counters: this.validateCounters(stateData.counters) + }; + } + + /** + * Validate object states (record of boolean values) + */ + private static validateObjectStates(states: unknown, objectId: string): Record { + if (!states) return {}; + + if (typeof states !== 'object') { + throw new Error(`States for object ${objectId} must be an object`); + } + + const statesData = states as Record; + const validatedStates: Record = {}; + + for (const [stateName, stateValue] of Object.entries(statesData)) { + if (typeof stateValue !== 'boolean') { + throw new Error(`State ${stateName} for object ${objectId} must be a boolean value`); + } + validatedStates[stateName] = stateValue; + } + + return validatedStates; + } + + /** + * Validate dialogue (record of string values) + */ + private static validateDialogue(dialogue: unknown, characterId: string): Record { + if (!dialogue || typeof dialogue !== 'object') { + throw new Error(`Dialogue for character ${characterId} must be an object`); + } + + const dialogueData = dialogue as Record; + const validatedDialogue: Record = {}; + + for (const [topic, response] of Object.entries(dialogueData)) { + validatedDialogue[topic] = this.validateString(response, `characters.${characterId}.dialogue.${topic}`); + } + + return validatedDialogue; + } + + /** + * Validate flags (record of boolean values) + */ + private static validateFlags(flags: unknown): Record { + if (!flags) return {}; + + if (typeof flags !== 'object') { + throw new Error('Flags must be an object'); + } + + const flagsData = flags as Record; + const validatedFlags: Record = {}; + + for (const [flagName, flagValue] of Object.entries(flagsData)) { + if (typeof flagValue !== 'boolean') { + throw new Error(`Flag ${flagName} must be a boolean value`); + } + validatedFlags[flagName] = flagValue; + } + + return validatedFlags; + } + + /** + * Validate counters (record of number values) + */ + private static validateCounters(counters: unknown): Record { + if (!counters) return {}; + + if (typeof counters !== 'object') { + throw new Error('Counters must be an object'); + } + + const countersData = counters as Record; + const validatedCounters: Record = {}; + + for (const [counterName, counterValue] of Object.entries(countersData)) { + if (typeof counterValue !== 'number') { + throw new Error(`Counter ${counterName} must be a numeric value`); + } + validatedCounters[counterName] = counterValue; + } + + return validatedCounters; + } + + /** + * Validate that an array of strings is valid + */ + private static validateStringArray(arr: unknown, fieldName: string): string[] { + if (!arr) return []; + + if (!Array.isArray(arr)) { + throw new Error(`Field ${fieldName} must be an array`); + } + + return arr.map((item, index) => { + if (typeof item !== 'string') { + throw new Error(`Item at index ${index} in ${fieldName} must be a string`); + } + return item; + }); + } + + /** + * Validate references between entities + */ + private static validateReferences(worldModel: WorldModel): void { + const { rooms, objects, characters, initialState } = worldModel; + + // Check that the initial room exists + if (!rooms[initialState.currentRoomId]) { + throw new Error(`Initial room ${initialState.currentRoomId} does not exist`); + } + + // Check room exits + for (const [roomId, room] of Object.entries(rooms)) { + for (const exit of room.exits) { + if (!rooms[exit.targetRoomId]) { + throw new Error(`Room ${roomId} has an exit to non-existent room ${exit.targetRoomId}`); + } + if (exit.keyId && !objects[exit.keyId]) { + throw new Error(`Room ${roomId} has an exit requiring non-existent key ${exit.keyId}`); + } + } + + // Check room objects + for (const objectId of room.objects) { + if (!objects[objectId]) { + throw new Error(`Room ${roomId} contains non-existent object ${objectId}`); + } + } + + // Check room characters + for (const characterId of room.characters) { + if (!characters[characterId]) { + throw new Error(`Room ${roomId} contains non-existent character ${characterId}`); + } + } + } + + // Check object containment + for (const [objectId, object] of Object.entries(objects)) { + if (object.containedObjects) { + for (const containedId of object.containedObjects) { + if (!objects[containedId]) { + throw new Error(`Object ${objectId} contains non-existent object ${containedId}`); + } + } + } + } + + // Check character inventory + for (const [characterId, character] of Object.entries(characters)) { + for (const objectId of character.inventory) { + if (!objects[objectId]) { + throw new Error(`Character ${characterId} has non-existent object ${objectId} in inventory`); + } + } + } + + // Check player inventory + for (const objectId of initialState.inventory) { + if (!objects[objectId]) { + throw new Error(`Initial inventory contains non-existent object ${objectId}`); + } + } + } +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..fcd93df --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "es2020", + "module": "commonjs", + "rootDir": "./src", + "outDir": "./dist", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "sourceMap": true, + "declaration": true, + "lib": ["es2020", "dom"], + "moduleResolution": "node" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "**/*.test.ts"] +}