Files
cherry-studio/tsconfig.web.json
Phantom 5167c927be fix: preserve openrouter reasoning with web search (#11505)
* feat(options): implement deep merging for provider options

Add deep merge functionality to preserve nested properties when combining provider options. The new implementation handles object merging recursively while maintaining type safety.

* refactor(tsconfig): reorganize include paths in tsconfig files

Clean up and reorder include paths for better maintainability and consistency between tsconfig.node.json and tsconfig.web.json

* test: add aiCore test configuration and script

Add new test configuration for aiCore package and corresponding test script in package.json to enable running tests specifically for the aiCore module.

* fix: format

* fix(aiCore): resolve test failures and update test infrastructure

- Add vitest setup file with global mocks for @cherrystudio/ai-sdk-provider
- Fix context assertions: use 'model' instead of 'modelId' in plugin tests
- Fix error handling tests: update expected error messages to match actual behavior
- Fix streamText tests: use 'maxOutputTokens' instead of 'maxTokens'
- Fix schemas test: update expected provider list to match actual implementation
- Fix mock-responses: use AI SDK v5 format (inputTokens/outputTokens)
- Update vi.mock to use importOriginal for preserving jsonSchema export

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(aiCore): add alias mock for @cherrystudio/ai-sdk-provider in tests

The vi.mock in setup file doesn't work for source code imports.
Use vitest resolve.alias to mock the external package properly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(aiCore): disable unused-vars warnings in mock file

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(aiCore): use import.meta.url for ESM compatibility in vitest config

__dirname is not available in ESM modules, use fileURLToPath instead.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(aiCore): use absolute paths in vitest config for workspace compatibility

- Use path.resolve for setupFiles and all alias paths
- Extend aiCore vitest.config.ts from root workspace config
- Change aiCore test environment to 'node' instead of 'jsdom'

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* docs(factory): improve mergeProviderOptions documentation

Add detailed explanation of merge behavior with examples

* test(factory): add tests for mergeProviderOptions behavior

Add test cases to verify mergeProviderOptions correctly handles primitive values, arrays, and nested objects during merging

* refactor(tests): clean up mock responses test fixtures

Remove unused mock streaming chunks and error responses to simplify test fixtures
Update warning details structure in mock complete responses

* docs(test): clarify comment in generateImage test

Update comment to use consistent 'model id' terminology instead of 'modelId'

* test(factory): verify array replacement in mergeProviderOptions

---------

Co-authored-by: suyao <sy20010504@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-11-28 13:56:46 +08:00

39 lines
1.5 KiB
JSON

{
"extends": "@electron-toolkit/tsconfig/tsconfig.web.json",
"include": [
"local/src/renderer/**/*",
"src/renderer/src/**/*",
"src/main/integration/cherryai/index.js",
"src/preload/*.d.ts",
"tests/__mocks__/**/*",
"packages/aiCore/src/**/*",
"packages/ai-sdk-provider/**/*",
"packages/extension-table-plus/**/*",
"packages/mcp-trace/**/*",
"packages/shared/**/*",
],
"compilerOptions": {
"composite": true,
"incremental": true,
"tsBuildInfoFile": ".tsbuildinfo/tsconfig.web.tsbuildinfo",
"jsx": "react-jsx",
"moduleResolution": "bundler",
"paths": {
"@logger": ["./src/renderer/src/services/LoggerService"],
"@renderer/*": ["./src/renderer/src/*"],
"@shared/*": ["./packages/shared/*"],
"@types": ["./src/renderer/src/types/index.ts"],
"@mcp-trace/*": ["./packages/mcp-trace/*"],
"@cherrystudio/ai-core/provider": ["./packages/aiCore/src/core/providers/index.ts"],
"@cherrystudio/ai-core/built-in/plugins": ["./packages/aiCore/src/core/plugins/built-in/index.ts"],
"@cherrystudio/ai-core/*": ["./packages/aiCore/src/*"],
"@cherrystudio/ai-core": ["./packages/aiCore/src/index.ts"],
"@cherrystudio/extension-table-plus": ["./packages/extension-table-plus/src/index.ts"],
"@cherrystudio/ai-sdk-provider": ["./packages/ai-sdk-provider/src/index.ts"]
},
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"useDefineForClassFields": true
}
}