Commit Graph
4395 Commits
Author SHA1 Message Date
RainbowBird 827b692b15 docs: keep ADRs in the main repository 2026-09-12 19:23:23 +08:00
Weathercoldandgithub-actions[bot] 938c9d6b88 chore(nix): update assets hash (#2532)
Auto-generated by CI to keep Nix asset hash up-to-date.

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-09-12 10:12:36 +00:00
RainbowBird 1d27dc7cdf fix(stage-web): cache canonical app shell for payment returns (#2531)
Payment completed and Flux was credited, but returning from Stripe
showed `ERR_FAILED`. Edge reported that the service worker replayed a
redirected response for a navigation request. Cloudflare redirects
`/index.html` to `/`.

Precache the canonical root URL and use it as the navigation fallback.
The new cache key also avoids reusing the old redirected app shell.

Validation: generated a service worker with the installed Workbox
version and verified both its precache entry and navigation handler use
`./`; ESLint passed. Production payment credited 500 Flux, and bypassing
the service worker restored the page. Normal-cache production
verification follows deployment.
2026-09-12 18:00:48 +08:00
37c837e502 refactor(api): extract payment CORE to support other payment providers [1/2] (#2335)
## Why

Stripe checkout used Stripe-only tables. This extracts a shared payment
CORE. New checkout writes `payment_order`. Old Stripe tables stay so
in-progress Sessions can still settle.

This PR is [1/2]. [#2368](https://github.com/moeru-ai/airi/pull/2368) is
[2/2]. That PR archives leftover Stripe tables after in-progress
Sessions finish or expire.

## Changes

- Add `payment_order` and `provider_account`.
- Copy `stripe_checkout_session` into `payment_order`.
- Copy `stripe_customer` into `provider_account`.
- Keep `stripe_*` tables and `user_flux.stripe_customer_id`.
- New checkout writes `payment_order` and stores
`metadata.payment_order_id`.
- Webhook resolves new Sessions by `metadata.payment_order_id`.
- Webhook resolves older Sessions by `provider_order_id`, then by a
leftover `stripe_checkout_session` row.
- That leftover-row lookup covers Sessions opened before this deploy,
and rows written while 0023 runs.
[#2368](https://github.com/moeru-ai/airi/pull/2368) deletes it after
those Sessions finish or expire.

## Test plan

- [x] `pnpm exec vitest run
server/apps/api/src/services/domain/payment/tests/payment.test.ts
server/apps/api/src/routes/stripe`
- [x] `pnpm -F @proj-airi/api-server typecheck`
- [x] `git diff --check`

## Visual changes

No user-visible changes.

## Open: settle after account deletion

Account deletion stamps `payment_order.deletedAt`. A Checkout Session
that is still open can still pay after that stamp. This PR keeps `main`
behavior. `settle` loads the row by id, including a soft-deleted row,
then marks it `paid` and credits Flux.

Follow-up policy: if `deletedAt` is set, skip. Do not update the archive
row. Do not credit Flux. Do not insert a live `provider_account`. Stripe
remains the payment record. Skip matches the soft-delete rule: a deleted
row is gone, not write it again.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: RainbowBird <git@luoling.moe>
2026-09-12 17:43:10 +08:00
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
Garfield Lee cf6ff23f7c refactor(core-agent): move spark-command agent from stage-ui to core-agent (#2528)
## Summary

Move `spark-command` and `spark-notify` agents from
`packages/stage-ui/src/tools/character/orchestrator/` to
`packages/core-agent/src/agents/` for better separation of concerns and
reusability across packages.

## Changes

- **Relocate spark-command agent** — moved `spark-command-shared.ts`,
`spark-command.ts`, and `spark-command.test.ts` to
`packages/core-agent/src/agents/spark-command/`
- **Relocate spark-notify test** — moved `spark-notify.test.ts` to
`packages/core-agent/src/agents/spark-notify/`
- **Add barrel export** — created
`packages/core-agent/src/agents/spark-command/index.ts` with re-exports
- **Update package.json** — added `./agents/spark-command` entry in
`packages/core-agent/package.json`
- **Update build config** — added `src/agents/spark-command/index.ts` to
`tsdown.config.ts` entry list
- **Consolidate schemas** — merged duplicate
`sparkNotifyCommandGuidanceSchema` into `sparkCommandGuidanceSchema`
- **Add JSDoc** — added `@example` blocks to all normalize functions in
`schema.ts`
- **Update imports** — provider tests and `tool-resolver.ts` now import
from `@proj-airi/core-agent/agents/spark-command`
- **Delete legacy shims** — removed `stage-ui/src/tools/character/`
re-export layer

## Verification

```bash
pnpm -F @proj-airi/core-agent typecheck
pnpm -F @proj-airi/stage-ui typecheck
pnpm -F @proj-airi/core-agent exec vitest run
pnpm lint
```
2026-09-12 09:34:05 +08:00
Neko 3fcae726c5 fix(stage-layouts): center the mobile chat input (#2517) 2026-09-11 02:36:18 +08:00
Arata c30d169543 fix(stage-ui-live2d): preserve lip sync during MAGIC motion (#2481) 2026-09-11 01:56:54 +08:00
Neko 69ca0a9171 feat(stage-web): show FPS history in performance visualizer (#2516) 2026-09-11 01:46:40 +08:00
Weathercoldandgithub-actions[bot] 22b164bab0 chore(nix): update pnpmDeps hash (#2515)
Auto-generated by CI to keep Nix pnpmDeps hash up-to-date.

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-09-10 16:47:58 +00:00
bianyi ac3601c061 chore(CONTRIBUTING.md): align setup guides with pinned tooling (#2503) 2026-09-11 00:34:17 +08:00
Lovehsigure_520 8928dca0b5 fix(stage-tamagotchi): restore macOS Steam signing (#2509) 2026-09-11 00:33:07 +08:00
Neko 2904b795dd fix(stage-ui): keep mobile swipe attached to touch (#2514) 2026-09-10 21:42:17 +08:00
LuluandCursor 9a76eaec32 fix(server): trust moeru-ai Cloudflare Workers preview origins (#2513)
## Summary

- Auth and API origin policy now trusts `*.moeru-ai.workers.dev`.
- The retired `*.kwaa.workers.dev` suffix is removed. Server-dev
stage-web previews on the moeru-ai Cloudflare account can complete OIDC
login.

## Test plan

- [x] `pnpm exec vitest run server/apps/auth/src/tests/auth.test.ts
server/apps/auth/src/tests/origin.test.ts
server/apps/api/src/utils/tests/origin.test.ts`
- [ ] After deploy, sign in from
https://server-dev-moeru-ai-airi.moeru-ai.workers.dev and confirm
`/auth/callback` is accepted.

## Visual changes

No user-visible changes.


Made with [Cursor](https://cursor.com)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-10 20:28:17 +08:00
leafyy 3c9e60907c test(stage-tamagotchi): stabilize interactive area browser fixtures (#2510)
## Summary

The desktop browser suite can mount `InteractiveArea` before its utility
styles settle, then scroll history while the reply composer is still
expanding. A pending Virtua tail scroll can replace the message that the
test selected and make the scrollport assertion fail.

This addresses the pre-existing browser-test failure reported during
#2506 ([CI
failure](https://github.com/moeru-ai/airi/actions/runs/34448585692/job/102804067154)).

- Scan desktop and shared Vue components before the initial test
stylesheet is served. Load the desktop UnoCSS config explicitly so
config discovery does not replace the scan.
- Give each fixture a window-sized host, reset the viewport, and dispose
the component, host, and Pinia after each test.
- Wait for the reply transition and virtual-list measurements to settle
before scrolling. Cover both 200 ms and 1 s transitions, and assert the
requested scroll position throughout the existing message-mount checks.

Only browser tests and their configuration change.

## Validation

The complete desktop browser suite passed with three shuffled seeds: **6
files, 65 tests per run**, with no skipped tests.

```sh
for seed in 2508 2506 2507; do
  npm_config_registry=https://registry.npmjs.org/ NODE_OPTIONS=--no-experimental-webstorage \
    pnpm exec vitest run --config apps/stage-tamagotchi/vitest.config.ts \
    --project browser --sequence.shuffle --sequence.seed="$seed" --bail=1
done
npm_config_registry=https://registry.npmjs.org/ pnpm run typecheck
npm_config_registry=https://registry.npmjs.org/ pnpm run lint
git diff --check
```

Typecheck passed all 52 tasks. Lint passed with existing repository
warnings. ResizeObserver loop warnings remain visible; this change does
not suppress them. Linux CI validation is pending.
2026-09-10 17:41:29 +08:00
Neko 21d0e9d3a7 fix(stage-ui): use touch events for mobile swipe (#2508) 2026-09-10 16:11:09 +08:00
Weathercoldandgithub-actions[bot] 13ae708541 chore(nix): update assets hash (#2501)
Auto-generated by CI to keep Nix asset hash up-to-date.

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-09-10 15:01:52 +08:00
Neko b2a7dc252c fix(stage-ui): center mobile user message text (#2505) 2026-09-10 14:59:33 +08:00
Weathercoldandgithub-actions[bot] dfc6951a55 chore(nix): update pnpmDeps hash (#2500)
Auto-generated by CI to keep Nix pnpmDeps hash up-to-date.

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-09-09 16:31:37 +00:00
leafyy d7f38783f7 fix(stage-ui): persist speech provider settings (#2497) 2026-09-10 00:21:06 +08:00
Lovehsigure_520 352a9e389b fix(stage-ui): restore TTS after first login (#2490) 2026-09-10 00:08:35 +08:00
Younsang Na 41f9fb616b fix(computer-use-mcp): fix type errors at serivce/computer-use-mcp (#2494) 2026-09-10 00:06:02 +08:00
Younsang Na db2f8e3064 chore: optimize typecheck execution (#2499) 2026-09-10 00:03:27 +08:00
Neko 0d7b5e9a60 feat(stage-ui): add swipe to reply for chat messages (#2489) 2026-09-10 00:01:53 +08:00
Weathercoldandgithub-actions[bot] 3e94ea816c chore(nix): update pnpmDeps hash (#2496)
Auto-generated by CI to keep Nix pnpmDeps hash up-to-date.

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-09-09 18:51:34 +08:00
Weathercoldandgithub-actions[bot] 94873f8515 chore(nix): update assets hash (#2495)
Auto-generated by CI to keep Nix asset hash up-to-date.

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-09-09 08:37:30 +00:00
RainbowBird 66f0d45028 refactor(analytics): replace PostHog with OpenPanel (#2480) 2026-09-09 08:26:18 +00:00
Younsang Naandleafyy 5e78b64e35 fix(stage-tamagotchi): prevent controls island overflow in small windows with scroll (#2474)
## Description

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

### As-is
Depending on the size, the Controls Island area gets cut off, making the
buttons in the cropped area inaccessible.

### To-be
The Controls Island is managed via scrolling, allowing interaction with
buttons regardless of the size.
If the main controls also exceed the available space, the entire
Controls Island becomes scrollable. Horizontal scrolling is available
for narrow windows.

#### narrow & smaill

https://github.com/user-attachments/assets/1a44ff4f-8fe2-4a05-96a8-59ebf7dafcff

#### somewhat generous size


https://github.com/user-attachments/assets/c73dbee4-8c8f-4937-ae1a-eda00178274c



## Linked Issues



<!-- Optional, if you have any -->
close #2400

## Additional Context

<!-- e.g. is there anything you'd like reviewers to focus on? -->
Although the size is somewhat less than ideal, the issue has been
resolved, and this serves as a universal solution.

---------

Co-authored-by: leafyy <wuqizq@outlook.com>
2026-09-09 14:20:51 +08:00
leafyy 7bcd8e5274 test(stage-ui): fix browser fixtures and cleanup (#2492)
## Description

The Unit Test job reaches stage-ui, then fails and stalls in browser
tests. The same failures occur on the parent commit.

- Use the real consciousness store and Pinia refs in context bridge
tests. Check that input requests preserve temperature and top-p.
- Dispose each bridge and Pinia scope after every test, including failed
assertions. This prevents old listeners from receiving later stream
events.
- Create translated module stores during component setup and await card
initialization before drawer interactions. Dispose the fixture stores
after each test.
- Remove the Pinia and Mutex replacements from the context bridge
fixture.

This change only updates two test files.

## Verification

The original fixture reproduced three failures in the two affected
files. The updated files pass all 17 tests. The complete CI test command
passes 2,534 tests, with one skipped test. Stage-ui passes all 822
tests.

- `NODE_OPTIONS=--no-experimental-webstorage pnpm exec vitest run
--config packages/stage-ui/vitest.config.ts --project browser
packages/stage-ui/src/components/misc/character-switcher-drawer.browser.test.ts
packages/stage-ui/src/stores/mods/api/context-bridge.contract.browser.test.ts
--reporter=verbose`
- `NODE_OPTIONS=--no-experimental-webstorage pnpm run test:run`
- `pnpm run typecheck`
- `pnpm run lint`
- `sem diff --staged --no-cosmetics -v --file-exts .ts .tsx`, JSON diff,
and dependent analysis for `mountSwitcher`: no blocking findings.
- `git diff --cached --check`

GitHub CI also passes on this PR: [all nine CI jobs
succeeded](https://github.com/moeru-ai/airi/actions/runs/34306753310),
including [Unit
Test](https://github.com/moeru-ai/airi/actions/runs/34306753310/job/102324934330).

## Additional Context

[Reported CI
failure](https://github.com/moeru-ai/airi/actions/runs/34237304157/job/102098223378)
· [Parent commit
failure](https://github.com/moeru-ai/airi/actions/runs/34212756766/job/102017352566)
2026-09-09 11:55:32 +08:00
RainbowBird 097202cd38 feat(stage-ui): add signed-in nickname context to chat prompts (#2488) 2026-09-08 22:17:19 +08:00
Lovehsigure_520 f679616c34 fix(stage-tamagotchi): allow sign-in on the first attempt (#2482) 2026-09-08 17:56:23 +08:00
RainbowBird ef9f122d50 fix(stage-ui): inherit global settings for default card (#2332) 2026-09-08 09:48:39 +00:00
Makito 9a4e1da5a1 test(stage-ui): fix tests 2026-09-08 03:35:35 +09:00
Sho Jikumaru 332883d42f fix(stage-ui): onboarding repeat prompt when provider credentials exist (#1900) 2026-09-08 00:09:14 +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
RainbowBird 66c6aa9b57 chore: ignore .worktrees 2026-09-08 00:00:24 +08:00
leafyy 52a9f429ed feat(plugin-host): add combined lifecycle controls (#2476)
## Summary

- Add combined `Enable and Load` and `Disable and Unload` controls to
Plugin Host Debug.
- Keep enablement persistence and runtime lifecycle changes in one
sequential store action.
- Add tests for ordering, busy state, and failure handling.
- Localize the new controls and fallback error messages in English and
Simplified Chinese.

## Verification

- `pnpm exec vitest run --config packages/stage-ui/vitest.config.ts
--project node src/stores/devtools/plugin-host-debug.test.ts`
- `pnpm -F @proj-airi/i18n test`
- `pnpm -F @proj-airi/i18n build`
- `pnpm run build:packages`
- `pnpm typecheck`
- `pnpm lint`
- Manually tested the bundled `devtools-sample-plugin` in the Electron
Plugin Host Debug page. Both combined actions updated the persisted
registry and runtime session state without restarting the app.

## Visual changes

| Before | After |
|---|---|
| ![Plugin Host Debug
before](https://github.com/user-attachments/assets/c9b3a6ec-699b-444a-ba01-50bbc2ffa3ad)
| ![Plugin Host Debug
after](https://github.com/user-attachments/assets/889dec79-a157-42a8-98f5-906d2e0b41f3)
|
| Plugin Host Debug | Plugin Host Debug with combined lifecycle controls
|
2026-09-07 19:04:17 +08:00
RainbowBird 0fd71bc1ab feat(stage-layouts): add mobile view adjustment mode (#2475) 2026-09-07 12:37:45 +08:00
leafyy 05ac66edfa fix(stage-tamagotchi): show Live2D expressions in settings (#2451)
## Summary

- Send a serializable Live2D expression snapshot from the stage renderer
to the separate Settings window.
- Route expression changes back to the renderer that owns the loaded
model, with owner ID checks for stale-window isolation.
- Add browser regressions for the component boundary and the complete
BroadcastChannel round trip.

Fixes #2450

## Verification

- `pnpm typecheck`
- `pnpm lint`
- `../../node_modules/.bin/vitest run --project browser
src/components/scenarios/settings/model-settings/live2d.browser.test.ts`
- `node_modules/.bin/vitest run --config
apps/stage-tamagotchi/vitest.config.ts --project browser
apps/stage-tamagotchi/src/renderer/composables/model-settings-runtime.browser.test.ts`
- `./node_modules/.bin/electron-vite build`
- Vishot Electron capture with the issue Live2D fixture on the merge
base and this branch
- `sem diff upstream/main...HEAD --no-cosmetics -v --file-exts .ts .tsx`

## Visual changes

| Before | After |
|---|---|
|
![](https://github.com/user-attachments/assets/e383ebf3-d60e-4f66-8550-4cab0dc61261)
|
![](https://github.com/user-attachments/assets/b8aee712-c227-44d0-a60c-2dd24cc0b0cd)
|
| Settings / Models / Live2D expressions: empty list | Settings / Models
/ Live2D expressions: model entries are available |
2026-09-07 11:14:44 +08:00
RainbowBird 836941fda8 feat(stage-layouts): simplify mobile stage controls (#2472)
Signed-off-by: RainbowBird <git@luoling.moe>
2026-09-06 16:28:01 +00:00
RainbowBird b1170ea8ca docs(server): clarify adr delivery workflow 2026-09-07 00:22:08 +08:00
RainbowBird 96b629165b fix(server): pass through final upstream errors (#2333)
Signed-off-by: RainbowBird <git@luoling.moe>
2026-09-06 16:08:47 +00:00
Weathercoldandgithub-actions[bot] f166736a76 chore(nix): update pnpmDeps hash (#2470)
Auto-generated by CI to keep Nix pnpmDeps hash up-to-date.

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-09-05 11:39:12 +00:00
藍+85CD 3fc1e6461c chore(deps): bump three-mmd to v0.2.0-beta.2 (#2469) 2026-09-05 19:29:32 +08:00
RainbowBird 05007ce3ca refactor(stage-ui): rename analytics runtime path (#2466) 2026-09-04 23:37:45 +08:00
RainbowBird ab2c1c99bb refactor(stage-ui): inject runtime emotion prompt (#2464) 2026-09-04 23:17:17 +08:00
88lin 04e9ed7707 chore(docs): mark Azure OpenAI as supported in zh-CN README (#2463) 2026-09-04 21:27:52 +08:00
88lin d98d9b0e7a chore(docs): add missing NixOS section to zh-CN README (#2462) 2026-09-04 21:27:22 +08:00
RainbowBird e23fa64b62 fix(stage-layouts): suppress mobile browser form assistance (#2460) 2026-09-04 15:56:01 +08:00
RainbowBird fb574e69da docs(readme): update star history links (#2430) 2026-09-04 05:34:47 +00:00