feat: Implement configuration management and logging for Markov bot

- Added AppConfig class to manage application configuration with environment variable support.
- Introduced JSON5 support for configuration files, allowing both .json and .json5 extensions.
- Implemented logging using Pino with pretty-printing for better readability.
- Created a MarkovStore class for efficient storage and retrieval of Markov chains with O(1) sampling.
- Developed a WorkerPool class to manage worker threads for parallel processing of tasks.
- Added methods for building chains, generating responses, and handling task submissions in the worker pool.
- Included validation for configuration using class-validator to ensure correctness.
- Established a clear structure for configuration, logging, and Markov chain management.
This commit is contained in:
pacnpal
2025-09-26 08:24:53 -04:00
parent 495b2350e0
commit 2e35d88045
17 changed files with 2997 additions and 145 deletions

View File

@@ -3,7 +3,7 @@
"compilerOptions": {
"target": "es2021", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"outDir": "./build", /* Redirect output structure to the directory. */
"outDir": "./dist", /* Redirect output structure to the directory. */
"removeComments": true, /* Do not emit comments to output. */
"esModuleInterop": true,
"strict": true, /* Enable all strict type-checking options. */
@@ -16,10 +16,16 @@
"useUnknownInCatchVariables": false,
"experimentalDecorators": true,
"strictPropertyInitialization": false,
"emitDecoratorMetadata": true,
"emitDecoratorMetadata": true
},
"exclude": [
"node_modules",
"dist"
],
"files": [
"src/config/classes.ts",
"src/index.ts",
"src/train.ts",
"bench/load_test.ts"
]
}