Files
zalbot/package.json
Kaysser Kayyali e2c92e854f
Some checks failed
tests / Unit tests (Node 22) (push) Failing after 2m13s
Add unit tests for LLM clients, persona loader, and XP/Foundry rewards
Expands the unit test suite from 320 to 380 tests (+60) and adds a
Gitea Actions CI workflow. Closes all six follow-up recommendations
from the test-architecture validation report.

New tests (tests/unit/):
  - ollamaClient.test.ts          — Ollama SDK wrapper, options passthrough
  - litellmClient.test.ts         — OpenAI SDK wrapper, model fallback
  - personaLoader.test.ts         — Zod validation + cache invalidation
  - foundryReward.test.ts         — Tool plugin: lookup, errors, partial grants
  - xpAwarder.test.ts             — Bulk XP awards + per-player skip reasons
  - redisErrorPath.test.ts        — Singleton error handler does not crash
  - messageRouterRunLLMTurn.test.ts — 18 cases for the runtime heart:
    narrative-only path, tool dispatch, filter correction, retry loop
    guard, missed-skill-check heuristic, typing indicator interval,
    LLM error fallback, archive on resolve.

Coverage (line %):
  - harness/litellmClient.ts      0 → 100
  - harness/ollamaClient.ts       0 → 100
  - harness/tools/foundryReward.ts 0 → 100
  - session/xpAwarder.ts          0 → 100
  - persona/loader.ts             0 → 100
  - db/redis.ts                   0 → 100
  - bot/handlers/messageRouter.ts 0 → 39.86 (runLLMTurn now covered)

Tooling:
  - package.json: + test:coverage, test:watch scripts
  - devDep: @vitest/coverage-v8@^3.1.0
  - tests/README.md: conventions, anti-patterns, template map
  - .gitignore: exclude coverage/
  - .gitea/workflows/test.yml: Node 22, npm cache, tsc --noEmit gate

Documentation (from earlier /bmad-document-project run, now committed):
  - docs/index.md
  - docs/project-overview.md
  - docs/architecture.md
  - docs/deployment-guide.md
  - docs/api-contracts.md
  - docs/data-models.md
  - docs/source-tree-analysis.md
  - docs/component-inventory.md
  - docs/development-guide.md
  - _bmad-output/test-artifacts/automate-validation-report.md

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-19 05:59:13 +00:00

42 lines
1.1 KiB
JSON

{
"name": "mardonar-bot",
"version": "0.1.0",
"type": "module",
"description": "Discord-native LLM-driven D&D encounter engine for the Land of Mardonar",
"main": "dist/bot/index.js",
"scripts": {
"dev": "tsx watch src/bot/index.ts",
"build": "tsc",
"start": "node dist/bot/index.js",
"deploy-commands": "tsx src/scripts/deploy-commands.ts",
"test": "vitest run",
"test:unit": "vitest run tests/unit",
"test:int": "vitest run tests/integration",
"test:coverage": "vitest run --coverage",
"test:watch": "vitest"
},
"dependencies": {
"@discordjs/builders": "^1.10.0",
"@discordjs/rest": "^2.4.0",
"discord.js": "^14.18.0",
"dotenv": "^16.4.0",
"gpt-tokenizer": "^2.8.0",
"ioredis": "^5.4.0",
"js-yaml": "^4.1.0",
"ollama": "^0.5.0",
"openai": "^6.39.0",
"pino": "^9.6.0",
"pino-pretty": "^13.0.0",
"zod": "^3.24.0"
},
"devDependencies": {
"@types/js-yaml": "^4.0.9",
"@types/node": "^22.0.0",
"@vitest/coverage-v8": "^3.2.6",
"ioredis-mock": "^8.9.0",
"tsx": "^4.19.0",
"typescript": "^5.8.0",
"vitest": "^3.1.0"
}
}