Commit Graph
6 Commits
Author SHA1 Message Date
Garfield Lee e447b15b0d refactor(provider-inference): move provider tests closer to implementations (#2529)
# Refactor: Move Provider Tests to provider-inference

## Summary

Move azure-openai and openrouter-ai provider tests from `stage-ui` to
`provider-inference` package, placing them closer to their
implementations.

## Changes

- **Moved test files**:
-
`packages/stage-ui/src/libs/providers/providers/azure-openai/index.test.ts`
→
`packages/provider-inference/src/providers/cloud/azure-openai/index.test.ts`
-
`packages/stage-ui/src/libs/providers/providers/openrouter-ai/index.test.ts`
→
`packages/provider-inference/src/providers/cloud/openrouter-ai/index.test.ts`

- **Simplified test imports**: Updated tests to use direct provider
definitions instead of `getDefinedProvider()`, removing unnecessary
lookup logic

- **Added dependency**: `@proj-airi/core-agent` as devDependency for
test utilities

## Benefits

1. Tests are co-located with their implementations
2. Direct imports are simpler and more maintainable
3. Better package organization following module boundaries

## Verification

```bash
# Run tests for provider-inference
pnpm -F @proj-airi/provider-inference exec vitest run

# Typecheck
pnpm -F @proj-airi/provider-inference typecheck
```

## Test Results

All tests pass after the refactoring.
2026-09-12 10:25:16 +08:00
Lovehsigure_520 352a9e389b fix(stage-ui): restore TTS after first login (#2490) 2026-09-10 00:08:35 +08:00
e293b71abc feat: add support for temperature, top_p to be configurable (#2200)
Co-authored-by: twix03 <sathwikbalaa@gmail.com>
Co-authored-by: RainbowBird <git@luoling.moe>
2026-09-08 00:02:53 +08:00
leafyy 2ca8339a49 fix(speech): synchronize streaming catalog state (#2445) 2026-09-03 19:20:35 +08:00
Garfield Lee 93f26a5714 chore: include browser test for provider-inference package (#2446)
## Description

<!-- Please insert your description here and especially provide info
about the "what" this PR is solving -->

## Linked Issues

<!-- Optional, if you have any -->

## Additional Context

<!-- e.g. is there anything you'd like reviewers to focus on? -->
2026-09-02 20:02:10 +08:00
Garfield Lee 59a064ea80 refactor(stage-ui): extract provider-inference package for runtime-neutral definitions (#2444)
## Summary

Extract runtime-neutral provider definitions from `@proj-airi/stage-ui`
into a new `@proj-airi/provider-inference` package that runs in both
Node.js and browser without Vue/Pinia dependencies.

## What changed

- **New package** `packages/provider-inference/` — owns
`ProviderDefinition`, `ProviderRegistry`, validators, and all provider
modules (cloud + local)
- **Provider modules relocated** — ~45 providers moved from
`stage-ui/src/libs/providers/providers/` to
`provider-inference/src/providers/cloud/` and
`provider-inference/src/providers/local/`
- **Type decoupling** — `ProviderContext.t` changed from
`ComposerTranslation` (Vue) to generic `ProviderTranslator`, removing
the Vue dependency from core types
- **stage-ui types slimmed** — `types.ts` now re-exports from
`provider-inference` and only adds the Vue-specific `ProviderViews`
extension
- **validators/run.ts** — becomes a pass-through re-export
- **Registry** — portable `createProviderRegistry()` with deterministic
ordering and duplicate-id detection

## Verification

```bash
pnpm -F @proj-airi/provider-inference typecheck
pnpm -F @proj-airi/provider-inference test:node
pnpm -F @proj-airi/provider-inference test:browser
pnpm -F @proj-airi/provider-inference build
pnpm -F @proj-airi/stage-ui typecheck
pnpm -F @proj-airi/stage-web typecheck
pnpm -F @proj-airi/stage-tamagotchi typecheck
pnpm lint
```

## Why

Provider definitions were tightly coupled to Vue (`ComposerTranslation`,
`Component`), preventing reuse in non-Vue runtimes (Node.js services,
tests, future Electron backend). This extraction creates a clean
boundary: runtime-neutral definitions live in `provider-inference`,
while Vue/Pinia-specific concerns stay in `stage-ui`.
2026-09-02 19:35:25 +08:00