{"_id":"@ai-test-harness/core","name":"@ai-test-harness/core","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@ai-test-harness/core","version":"1.0.0","description":"Core framework for AI quality testing","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"},"./llm":{"types":"./dist/llm/index.d.ts","import":"./dist/llm/index.js"},"./quality":{"types":"./dist/quality-library/index.d.ts","import":"./dist/quality-library/index.js"}},"scripts":{"build":"tsc --build","type-check":"tsc --build"},"keywords":["ai","llm","testing","quality","bedrock"],"author":{"name":"AI Test Harness Contributors"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/c2pig/ai-test-harness.git","directory":"packages/core"},"bugs":{"url":"https://github.com/c2pig/ai-test-harness/issues"},"homepage":"https://github.com/c2pig/ai-test-harness/tree/main/packages/core#readme","publishConfig":{"access":"public"},"dependencies":{"@aws-sdk/client-bedrock-agent":"^3.918.0","@aws-sdk/client-bedrock-agent-runtime":"^3.600.0","@aws-sdk/client-bedrock-runtime":"^3.600.0","@aws-sdk/client-cloudwatch-logs":"^3.600.0","@aws-sdk/client-dynamodb":"^3.921.0","@aws-sdk/client-secrets-manager":"^3.600.0","glob":"^11.0.3","js-yaml":"^4.1.1","yaml":"^2.7.0","jsonpath-plus":"^10.3.0","pg":"^8.11.0","zod":"^3.22.0"},"devDependencies":{"@types/js-yaml":"^4.0.9","@types/node":"^20.11.0","@types/pg":"^8.10.0","typescript":"^5.3.0"},"peerDependencies":{"typescript":"^5.0.0"},"engines":{"node":">=18.0.0"},"_id":"@ai-test-harness/core@1.0.0","gitHead":"26c39271f8312e9120c7bd72f297844d04d0381e","_nodeVersion":"24.2.0","_npmVersion":"11.3.0","dist":{"integrity":"sha512-HaRMXHqLnH3rOdEBGSs5EZ4HoerdMO+JtAx45OVJEkLxDfUADP4vfd52GF/Dd4y96VLae1NlZw6BefwW7YU5dA==","shasum":"7dba318061d18fb4ce4e70c1e4283143c69f058c","tarball":"https://registry.npmjs.org/@ai-test-harness/core/-/core-1.0.0.tgz","fileCount":339,"unpackedSize":1459139,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDSTG6RJIZcvz9OSTFrhx9Uz1Z4Mwux+/w4z52UJiegzgIhAJ8stH1sHU/tnp9vWyWisYP9wrO2uU1oMjqF6QvCiTIa"}]},"_npmUser":{"name":"c2pigisme","email":"bluecurves@gmail.com"},"directories":{},"maintainers":[{"name":"c2pigisme","email":"bluecurves@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_1.0.0_1764488483037_0.03577082120623243"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-30T07:41:22.952Z","1.0.0":"2025-11-30T07:41:23.245Z","modified":"2025-11-30T07:41:23.639Z"},"maintainers":[{"name":"c2pigisme","email":"bluecurves@gmail.com"}],"description":"Core framework for AI quality testing","homepage":"https://github.com/c2pig/ai-test-harness/tree/main/packages/core#readme","keywords":["ai","llm","testing","quality","bedrock"],"repository":{"type":"git","url":"git+https://github.com/c2pig/ai-test-harness.git","directory":"packages/core"},"author":{"name":"AI Test Harness Contributors"},"bugs":{"url":"https://github.com/c2pig/ai-test-harness/issues"},"license":"MIT","readme":"# @ai-test-harness/core\n\n[![npm version](https://badge.fury.io/js/%40ai-test-harness%2Fcore.svg)](https://www.npmjs.com/package/@ai-test-harness/core)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nCore framework for AI quality testing with AWS Bedrock.\n\n## Installation\n\n```bash\nnpm install @ai-test-harness/core\n```\n\n## Usage\n\n### Programmatic API\n\n```typescript\nimport { runTests, LLMClientFactory, MockAdapter } from '@ai-test-harness/core';\n\n// Run tests for a project\nconst result = await runTests({\n  projectPath: './my-tests',\n  configFile: 'config.yaml',\n});\n\n// Use LLM client directly\nconst client = LLMClientFactory.create({\n  provider: 'bedrock',\n  region: 'us-east-2',\n});\n\nconst response = await client.chat({\n  model: 'us.anthropic.claude-3-5-sonnet-20240620-v1:0',\n  messages: [{ role: 'user', content: 'Hello!' }],\n  temperature: 0.7,\n  maxTokens: 1000,\n});\n\n// Unit testing with mock adapter\nconst mockClient = new MockAdapter();\nmockClient.setDefaultResponse('Test response');\n```\n\n## Exports\n\n### Test Runners\n- `TestRunner` - For text-generation tests\n- `AgentTestRunner` - For agent scenario tests  \n- `AgentSimulationRunner` - For dynamic agent simulation\n\n### LLM Components\n- `LLMJudge` - Evaluates outputs against quality criteria\n- `LLMGenerator` - Generates text from prompts\n- `UserSimulator` - Simulates user responses\n\n### LLM Client Abstraction\n- `ILLMClient` - Interface for LLM clients\n- `LLMClientFactory` - Factory for creating clients\n- `BedrockAdapter` - AWS Bedrock implementation\n- `LiteLLMAdapter` - LiteLLM HTTP implementation\n- `MockAdapter` - Testing mock\n\n### Quality Library\n- `registerAttribute()` - Register custom quality attributes\n- `generateAssessmentPrompt()` - Generate evaluation prompts\n- `buildQualitySchema()` - Build Zod schemas for validation\n\n### Utilities\n- `Logger` - Structured logging\n- `ConfigLoader` - Load YAML configurations\n- `retryWithBackoff()` - Resilient API calls\n\n## Environment Variables\n\n```bash\n# LLM Provider (default: bedrock)\nLLM_PROVIDER=bedrock\n\n# For LiteLLM integration\nLITELLM_URL=https://litellm.company.com\nLITELLM_API_KEY=sk-xxx\n\n# AWS configuration\nAWS_REGION=us-east-2\n```\n\n## Documentation\n\nFor complete documentation, see the [main repository](https://github.com/c2pig/ai-test-harness).\n\n## Contributing\n\nSee [CONTRIBUTING.md](https://github.com/c2pig/ai-test-harness/blob/main/CONTRIBUTING.md) in the main repository.\n\n## License\n\nMIT © AI Test Harness Contributors\n\n","readmeFilename":"README.md","_rev":"1-2900a2540692afc11c7cdb8ba777808d"}