Commit Graph
2028 Commits
Author SHA1 Message Date
Neko Ayaka 83ea2afbd7 refactor(*): generalize events 2026-08-09 01:34:48 +08:00
584e4960e9 feat(stage-pocket): improve permission management (#2184)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: LemonNeko <17664845+LemonNekoGH@users.noreply.github.com>
2026-08-08 20:16:10 +08:00
5f3746ead8 fix(stage-tamagotchi): grant screen capture through the media permission (#2178)
## Description

Screen capture in Stage Tamagotchi is denied before it ever reaches the
desktop picker: `navigator.mediaDevices.getDisplayMedia()` resolves with
`NotAllowedError: Permission denied`, so the vision screen-capture panel
can list sources but never start a stream.

The cause is in `shouldGrantElectronPermission`. Electron reports
**screen capture as the `media` permission**, not as `display-capture`,
and it only appends `audio`/`video` to `details.mediaTypes` for *device*
capture — so a `getDisplayMedia()` request arrives as `media` with an
**empty** `mediaTypes` list
([`web_contents_permission_helper.cc#L249-L274`](https://github.com/electron/electron/blob/v41.2.1/shell/browser/web_contents_permission_helper.cc#L249-L274)).

The handler took an early return for every `media` operation and
required audio-only details, so display capture was rejected before the
allowlisted `display-capture` entry could be consulted:

```ts
if (permission === 'media')
  return shouldGrantAudioCapturePermission(webContents, permission, requestingOrigin, details)

return LOCAL_APP_PERMISSION_NAMES.has(permission) && shouldGrantLocalAppPermission(...)
```

The fix resolves a `media` operation that declares no device media type
back to `display-capture`, so the existing allowlist and local-frame
checks decide the outcome — which is what `LOCAL_APP_PERMISSION_NAMES`
already intended:

```ts
const allowlistPermission = isDisplayCaptureMediaPermission(permission, details) ? 'display-capture' : permission

return LOCAL_APP_PERMISSION_NAMES.has(allowlistPermission)
  && shouldGrantLocalAppPermission(webContents, requestingOrigin, details)
```

Camera and microphone operations always report their device media type
(`['video']`, `['audio']`, `mediaType: 'audio'`), so they never take
this path and stay exactly as strict as before. Remote frames are still
rejected, because the local-frame check is unchanged and still applies
to display capture.

Three regression tests are added: screen capture from a local page is
granted, screen capture from a remote page is rejected, and a camera
request is still denied now that it shares the `media` permission.

## Linked Issues

Closes #2177

## Additional Context

- **Regression range.** This was introduced by #2002 (`5e8bf75`,
2026-07-10), which added the permission allowlist. Nothing on the
failing path is platform-specific — the `media` vs `display-capture`
mismatch is in Electron's browser process — so although the issue was
reported on Windows, screen capture has been broken on macOS and Linux
since that commit too. Worth noting for anyone triaging similar reports.
- **Detection signal.** The predicate keys on `mediaTypes.length === 0`
rather than on the absence of the field, so a `media` operation with
*no* `mediaTypes` at all (e.g. permission *checks*, which send
`mediaType: 'unknown'` instead) is not silently promoted to display
capture. That keeps the change to exactly the shape Electron documents
for `getDisplayMedia()` requests.
- **Deliberately out of scope.** #2104 (camera snapshot denied) is a
policy decision — whether the camera should join the allowlist — not
this bug, and #2132 (`systemPreferences.getMediaAccessStatus` undefined
on Linux) is unrelated. Happy to follow up on either if you'd like them
addressed.
- **Second layer still applies.** `setDisplayMediaRequestHandler` in
`packages/electron-screen-capture` is only installed inside the
`setSource` mutex window, so a grant here still requires the renderer to
have selected a source first. This change does not widen that.
- **Verification.** `media-permissions.test.ts` goes 16/16 → 19/19; with
only the tests applied, the new local-screen-capture case fails as
expected. Type checking and the repo ESLint config both pass clean on
the two touched files.

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-08 14:40:50 +09:00
Neko Ayaka eb35c4d66a refactor(*): cleaner provider design, simplified chat store 2026-08-08 01:34:44 +08:00
Neko Ayaka 5f1c52ec52 refactor(providers): now simplified 2026-08-07 05:08:38 +08:00
Neko Ayaka c124e0147d refactor(audio,stage-ui): simplify code 2026-08-07 04:36:50 +08:00
ff7f64ace8 feat(server): add Steam OpenID sign-in and account linking plugin (#2226)
## Summary

Adds a self-contained better-auth plugin
(`server/apps/api/src/libs/auth-plugins/steam.ts`) implementing Steam
OpenID 2.0 sign-in, account linking, and callback verification via "dumb
mode".

Steam's web login is OpenID 2.0, not OAuth2/OIDC, so it cannot be
registered as a `socialProviders` entry, and better-auth has no plugin
hook for extending its OAuth2 endpoints with a non-OAuth2 protocol. The
plugin therefore adds the endpoints Steam's protocol needs: `POST
/sign-in/steam`, `POST /link/steam`, and `GET /steam/callback`.

- Callback verification uses OpenID "dumb mode"
(`openid.mode=check_authentication`): one extra round trip to Steam
instead of managing RSA association state.
- New sign-ups get a placeholder `<steamid64>@steam.placeholder.local`
with `emailVerified: true`, mirroring Apple Sign In's
`<sub>@apple.placeholder.local`.
- The plugin's request/query schemas use Zod; a `// NOTICE:` documents
that better-auth's OpenAPI generator is Zod-native. Steam verification
uses `ofetch`.
- Wires Steam into `apps/ui-server-auth` sign-in and profile "Connected
accounts", plus the shared `OAuthProvider` / `defaultSignInProviders` in
`packages/stage-ui`.
- Linking routes through `/link/steam` via the client's `$fetch`;
unlinking needs no special-casing (`/unlink-account` already takes a
free-form `providerId`).

No Steam Web API key is required for this browser-based flow.

We intentionally do not depend on community Steam packages (e.g.
`better-auth-steam`) or the still-open upstream draft
([better-auth#4877](https://github.com/better-auth/better-auth/pull/4877)).
Steam never returns an email, and we need sign-up that does not ask the
user for one plus first-class account linking; the available options
either require an email at sign-in, lack linking, or are abandoned /
blocked — shipping a small in-tree plugin is the safer auth dependency
for this requirement.

## Test plan

- [x] `pnpm exec vitest run
server/apps/api/src/libs/auth-plugins/steam.test.ts` — 6/6 passing
- [x] `pnpm -F @proj-airi/ui-server-auth exec vitest run` — 32/32
passing
- [x] `pnpm -F @proj-airi/stage-ui exec vitest run
src/libs/steam-auth-client.test.ts
src/composables/use-linked-accounts.test.ts` — 5/5 passing
- [x] `pnpm -F @proj-airi/api-server typecheck`
- [x] `pnpm -F @proj-airi/ui-server-auth typecheck`
- [x] `pnpm -F @proj-airi/stage-ui typecheck`

## Follow-ups

- Desktop Steam ticket sign-in (top of this stack): silent startup
ticket exchange for Steam builds; the server resolves or creates the
AIRI user for the verified SteamID before issuing an OIDC code.
- Steam persona name/avatar via `GetPlayerSummaries` inside the plugin,
if display names beyond `Steam User <id>` are wanted.

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-05 23:57:55 +08:00
Neko Ayaka 774b2daf03 style: prevent use of .ts, .js import 2026-08-05 20:34:14 +08:00
Neko Ayaka f2d411ea22 chore(deps): updated eventa to v1.0.0-beta.14 2026-08-05 20:32:58 +08:00
Neko 55ea1767e4 fix(stage-ui-live2d): recover from model render failures (#2225) 2026-08-05 20:28:39 +08:00
Ryanba 4421b5810b fix(stage-ui-live2d): read bundled model ZIPs as array buffers (#2224) 2026-08-05 15:39:34 +08:00
Neko Ayaka 0f20a2784b chore(deps): updated eventa to v1.0.0-beta.13 2026-08-05 00:49:14 +08:00
Neko Ayaka 4f7a9d63e9 chore(deps): updated eventa to v1.0.0-beta.9 2026-08-04 22:05:57 +08:00
Neko 5a56770f1c fix(stage-ui-live2d): support CJK paths in Live2D archives (#2219) 2026-08-04 22:05:40 +08:00
Neko 7dc8e2c4a3 refactor(stage-ui): improve onboarding, scrollable, and animated (#2215) 2026-08-04 17:51:15 +08:00
Neko 47c23e6467 feat(ui): add animated content primitive (#2212) 2026-08-04 17:48:17 +08:00
Lovehsigure_520 f66a18956b fix(stage-ui): hide provider setup in Steam onboarding (#2052) 2026-08-04 09:02:19 +00:00
Lovehsigure_520 9164ca1bab ci(stage-tamagotchi): add Steam desktop deployment workflow (#1827) 2026-08-04 16:44:40 +08:00
zhifu gao 5729350b6c fix(ui): support unset button size (#2207) 2026-08-04 15:38:23 +08:00
Neko Ayaka 93af669d14 fix(stage-pocket): guard for beatsync 2026-08-04 04:22:58 +08:00
Neko Ayaka 1226417768 refactor(*): new button 2026-08-04 03:24:32 +08:00
Makito b26ea3123d feat(i18n): set up glossary (#2198)
This pull request introduces the initial glossary for the project to
improve the translation quality.

Implements #2148.

### TODOs

- [x] Add the definition YAML
- [x] Add a generator to produce Crowdin-compatible (TBX v3) format
- [x] AGENTS.md
- [ ] ~Workflow~ (Split to another PR)
- [ ] ~Skills~ (Same as above)
2026-08-03 02:01:43 +09:00
RainbowBird d5a241b10e chore: migrate services to integration folder 2026-08-02 20:12:13 +08:00
RainbowBird 4ccde2c96e chore: move the server to an independent folder 2026-08-02 18:43:57 +08:00
Doji 2109446ea4 fix(stage-pocket): enable Android audio input device selection (#2180) 2026-07-30 20:39:50 +08:00
Neko Ayaka 1927e54c9c fix(stage-ui,stage-pocket,stage-web,stage-tamagotchi,ui-server-auth): analytics import not deferred or lazied 2026-07-30 14:33:21 +08:00
藍+85CD c97169bac7 perf(stage-ui-tachie): use fflate instead of jszip (#2172) 2026-07-30 08:36:41 +08:00
藍+85CD bd149f6a65 refactor(stage-ui-live2d): remove duplicate global types 2026-07-30 07:51:23 +08:00
藍+85CD 36f6ab8d24 perf(stage-ui-mmd): implement opfs loader (#2171) 2026-07-30 07:46:30 +08:00
藍+85CD e29fcb8c2a refactor(stage-ui-mmd): use @moeru/three-mmd (#2167) 2026-07-30 00:15:11 +08:00
RainbowBird 97cf26082f refactor(ui): share user avatar fallbacks (#2143) 2026-07-29 18:38:37 +08:00
RainbowBird 742bb80ca5 feat(stage): add global button analytics directive (#2146) 2026-07-29 15:59:53 +08:00
藍+85CD a42e3ae0b5 chore(stage-ui-tachie): kebab case (#2147) 2026-07-28 23:44:15 +08:00
藍+85CD 880d1bf7a9 feat(stage-ui-tachie): add tachie support (#2115) 2026-07-28 23:35:30 +08:00
RainbowBird ae35b580d8 feat(stage): group chat controls and track speech mute (#2139) 2026-07-28 19:34:14 +08:00
RainbowBird 899131b0a1 feat(stage): add persistent speech mute controls (#2128) 2026-07-28 17:58:50 +08:00
RainbowBird de8de0a353 fix(stage-ui): repair dangling character card selection (#2114)
Signed-off-by: RainbowBird <git@luoling.moe>
2026-07-27 19:48:40 +08:00
RainbowBird ce65bcd7f5 feat(ccc): add forward-compatible CCv3 codec (#2113)
Signed-off-by: RainbowBird <git@luoling.moe>
2026-07-27 01:38:53 +08:00
Ryanba bcf7742862 fix(stage-ui): preserve VAD speech padding in chat input (#2095) 2026-07-26 21:08:57 +08:00
RainbowBird f414d165de fix(stage-ui): preserve character card runtime data (#2111) 2026-07-26 20:50:19 +08:00
0xSelenicDove cd9704cf38 fix(stage-ui): apply display model on character card activation (#2090) 2026-07-26 18:04:29 +08:00
RainbowBird 20355670a9 fix(stage-pages): sync active card sessions (#2110) 2026-07-26 17:45:04 +08:00
RainbowBird 019d3fa15f fix(stage-pages): validate and preserve AIRI Card drafts (#2109)
Signed-off-by: RainbowBird <git@luoling.moe>
2026-07-26 17:05:28 +08:00
d6fe72b50a chore(i18n): update translations (#2106)
This PR contains updated translations from Crowdin. Created from [GitHub
Actions](https://github.com/moeru-ai/airi/blob/main/.github/workflows/crowdin-cron-sync.yml).

You can review the source of translations
[here](https://crowdin.com/project/proj-airi)

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: Garfield Lee <Garfield550@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-26 16:40:22 +08:00
1a5372a0bb chore(i18n): update translations (#2094)
This PR contains updated translations from Crowdin. Created from [GitHub
Actions](https://github.com/moeru-ai/airi/blob/main/.github/workflows/crowdin-cron-sync.yml).

You can review the source of translations
[here](https://crowdin.com/project/proj-airi)

---------

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Garfield Lee <Garfield550@users.noreply.github.com>
2026-07-24 09:24:01 +08:00
Anfi1andRainbowBird 42925e58f5 feat(stage-tamagotchi): universal TTS stop button in controls island (#2072)
Co-authored-by: RainbowBird <git@luoling.moe>
2026-07-23 00:21:58 +08:00
Neko Ayaka 5228f94123 refactor(ui): better with types 2026-07-22 02:59:43 +08:00
Neko Ayaka f2313e0070 test(ci): fix timestamp and whisper regressions 2026-07-21 15:26:39 +08:00
wuyua9 1ddb68381c fix(stage-ui): preserve Kokoro worker on abort (#1911) 2026-07-21 14:56:09 +08:00
Neko Ayaka 20416d6897 refactor(vishot-*): remove packages, now open sourced at https://github.com/moeru-ai/vishot 2026-07-21 14:52:56 +08:00