Commit Graph
3920 Commits
Author SHA1 Message Date
RainbowBird eae942702c feat(speech): enhance voice pack handling and add computed properties for UI logic 2026-06-07 01:56:04 +08:00
6c9c6eb29d chore(i18n): update translations (#1943)
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-06-06 20:40:01 +08:00
Lilia_Chen 5b0568bbb4 feat(stage-tamagotchi-godot): avatar glow NPR effect (#1951)
## Summary

This PR adds the current Stage Godot avatar presentation path:
avatar-only same-frame glow plus tuned toon color mapping.

<img width="994" height="951" alt="屏幕截图 2026-06-02 015159"
src="https://github.com/user-attachments/assets/feb94b95-745f-4b47-aba2-0289dafecd1c"
/>

<img width="1769" height="1279" alt="屏幕截图 2026-06-02 021212"
src="https://github.com/user-attachments/assets/d4437dc2-e859-42ca-b3fd-0a90e55d641b"
/>

## Design

The implementation uses three layers:

1. Base avatar material rendering still comes from the vendored V-Sekai
MToon shader.
2. `StageAvatarGlowRuntime` marks visible avatar meshes through a
depth-tested `MaterialOverlay` stencil pass.
3. `StageAvatarGlowCompositorEffect` reads that stencil mask in the same
frame, extracts avatar pixels, builds the glow pyramid, composites
glare, and applies the current NAES/toon color mapping.

This avoids Godot Environment Glow because that path is global. Here,
source selection needs to be avatar-specific and controlled by the stage
runtime.

It also avoids an extra SubViewport path because prior testing showed
camera-motion lag. The compositor path keeps the effect in the same
render frame.

## Stage Baseline

`StageVisualPreset` now keeps the stage environment neutral for this
effect:

- skybox is visible as background only
- skybox does not drive avatar/ground ambient light
- reflected light is disabled
- Godot Environment Glow is disabled
- Godot tonemap/adjustment stay neutral
- custom color mapping runs in the compositor

## Notes

`StageAvatarGlowCompositorEffect` currently owns both avatar glow and
toon color mapping. That is acceptable for this PR because it is the
only custom stage compositor today.

Before adding rim light, screen-space outlines, or more post effects,
compositor ownership should be split from individual features so effects
can register passes instead of replacing `Camera3D.Compositor`
independently.
2026-06-06 08:20:32 +08:00
RainbowBird 87e9495667 feat(admin): refine voice pack editor
Move Voice Pack creation and editing to dedicated admin routes, add catalog-backed free-text fields, and wire test audio generation through the public speech API.

Document the mock-API browser verification workflow so future local UI checks can avoid auth and tooling dead ends.

Signed-off-by: RainbowBird <git@luoling.moe>
2026-06-06 02:22:54 +08:00
RainbowBird 30d57e7370 refactor(stage): infer conversation analytics surface
Centralize conversation event surface detection inside useAnalytics and keep chat UI call sites focused on business fields.

Signed-off-by: RainbowBird <git@luoling.moe>

Commit-Message-Assisted-by: Codex
2026-06-06 01:58:13 +08:00
RainbowBird c6b5906708 chore: ignore playwright-mcp 2026-06-06 01:44:52 +08:00
RainbowBird 4708e462d2 feat(stage): track conversation product events
Add PostHog product events for manual TTS stop clicks and conversation controls across Web, mobile, and Electron chat surfaces. Document the events in metrics ownership and cover the analytics API with Vitest.

Signed-off-by: RainbowBird <git@luoling.moe>

Commit-Message-Assisted-by: Codex
2026-06-06 01:37:59 +08:00
RainbowBird a3dc9c24b0 style(stage): refine mobile TTS stop button
Match the mobile manual TTS stop control to the subtler Web chat button treatment by removing the bright filled circle and using neutral icon styling with primary hover feedback.

Signed-off-by: RainbowBird <git@luoling.moe>

Commit-Message-Assisted-by: Codex
2026-06-06 00:58:27 +08:00
RainbowBird bc9baa4e3e fix(stage): cover manual TTS stop across layouts
Add the stop-speaking control to the mobile shared input layout and the Electron Tamagotchi chat input so Web/shared, mobile, and Electron all expose the same manual TTS interruption path.

Signed-off-by: RainbowBird <git@luoling.moe>

Commit-Message-Assisted-by: Codex
2026-06-06 00:53:34 +08:00
RainbowBird 7549d4e9fb feat(docker): add build step for deps in Dockerfile 2026-06-06 00:41:06 +08:00
RainbowBird a3e1209446 feat(stage): add manual TTS interrupt button
Signed-off-by: RainbowBird <git@luoling.moe>

Commit-Message-Assisted-by: Codex
2026-06-06 00:22:11 +08:00
RainbowBird abb6d16b67 feat(server): track blocked TTS preflight 2026-06-06 00:22:11 +08:00
RainbowBird 37d12fd2dd fix(docker): add git installation to Dockerfile for build dependencies 2026-06-05 23:08:29 +08:00
RainbowBird 3a16224e72 refactor(docker): consolidate Dockerfile logic and remove unused files 2026-06-05 22:49:36 +08:00
RainbowBird e6fa39ed4b feat(server): voice pack and tts routing (#1905)
Track per-app TTS concurrency in Redis, route capped upstreams by
available pool capacity, and surface pool saturation metrics. Document
the Voice Pack plan so the remaining backend and card-binding work has
an explicit implementation map.
2026-06-05 22:39:30 +08:00
RainbowBird df141e1429 docs: update README 2026-06-05 17:02:34 +08:00
Weathercoldandgithub-actions[bot] f4fb484a82 chore(nix): update pnpmDeps hash (#1948)
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-06-05 08:34:42 +00:00
RainbowBird cf5ed0766b fix(server): make analytics best-effort
Remove server-side PostHog wiring so request handlers no longer wait on third-party analytics delivery.

Keep auth activity and product event writes best-effort so degraded analytics do not fail session creation.

Signed-off-by: RainbowBird <git@luoling.moe>

Commit-Message-Assisted-by: Codex (via Codex)
2026-06-05 16:27:10 +08:00
Zhou fanqi f6b53a37fa feat(minecraft): accurate perception, autonomic reflexes, and brain reliability (#1915)
## Summary

This PR upgrades the Minecraft bot's cognitive stack so it perceives
danger
accurately, reacts below the LLM brain with fast reflexes, and recovers
from
common brain failure modes. All changes are confined to
`services/minecraft/**`.

The desktop-side integration (spoken in-game chat, the online-gated
relay tool,
master binding in the UI) is submitted separately to keep this PR
focused; the
two are coupled only at runtime via AIRI context lanes, not at compile
time.

## What's included

**Perception — accurate damage attribution**
- `fall-tracker`: classify fall damage from physics-tick vertical
velocity.
- `attacker-tracker`: record the *real* attacker from the `entityHurt`
source,
  fixing "a mob shot me but I chased the player standing next to me".
- `low-health`: emit a danger signal at health ≤ 6 when no ready food is
held.
- `damage-taken`: resolve the source via a lava → drown → fire → fall →
  attacker chain and surface the attacker's name to the brain.

**Reflex — autonomic behaviors (run on the FSM tick, below the brain)**
- `defend`: auto-engage a hostile mob that attacks the bot/master and
hold the
  fight instead of thrashing (suppress damage wakes while attacking).
- `escape-hazard`: climb out of lava, or surface when drowning.
- `auto-eat`: eat ready food at health ≤ 6 (skipped during combat).
- A `reflexEngaged` autonomy flag suppresses auto-follow and auto-eat
while a
  defend/escape reflex owns the body.

**Conscious / skills — master recognition and reliability**
- Bind the "主人" role to the owner's in-game username so the bot
recognizes its
master in-world; enforce master-only command authority, never attack the
master, and react to a light hit with a short protest. Resolve players
by
  username, never the literal "player"/"主人".
- `js-planner`: strip prose-mixed LLM replies that caused `X is not
defined` and
give-up spirals; add a `botCall` sandbox bridge and the `whereName`
query
  chain method.
- Brain-prompt discipline: *saying is not doing*, *`recipePlan` is recon
not
crafting*, *eat only when food < 18* (regen is time-based), *defer equip
until
  a queued craft lands*.
- Skills: collect drops that spawn shortly after a kill (no more 0
loot);
`goToBed` skips occupied beds; detach auto-follow while
mining/collecting so
  digging is not interrupted.
- Platform: load perception rules on Windows (`fileURLToPath`); widen
the AIRI
  client read timeout to stop connection flapping.

The master username is injected via `generateBrainSystemPrompt(..., {
masterUsername })`
from config — it is **not** hardcoded.

## How tested

```bash
pnpm -F @proj-airi/minecraft-bot exec vitest run   # 220 tests; +56 new, all green
pnpm -F @proj-airi/minecraft-bot typecheck
pnpm exec moeru-lint services/minecraft            # 0 problems on changed files
```

- Each feature ships with unit tests (trackers, reflex behaviors,
planner
  salvage, skills, prompt, context service).
- Manual in-game testing: combat vs. pillagers/zombies, lava/water
escape,
low-health eating, crafting, master recognition with multiple players
present.

### Pre-existing baseline (not introduced by this PR)

Measured on `main` (`cb5c0783e`) before any change here:
- `tsc` reports 12 errors, all from a `vec3` 0.1.x/0.2.0
dependency-dedup
mismatch (`angleTo`) and `unknown[]` casts in `map-renderer.ts` /
`mcdata.ts` —
  files this PR does not touch. This PR adds **0** new type errors.
- 7 unit tests already fail on `main` (4 in `map-renderer.test.ts`, 2
timing-sensitive `brain.test.ts`, 1 timing-sensitive `rules.test.ts`).
This
  PR leaves those exactly as-is and does not touch those modules.

## Known limitations / follow-ups

- The `defend` reflex does not yet reliably engage ranged pillagers at
distance;
  the brain's `attack` tool currently covers that case.
- `craftRecipe` does not auto-unpack blocks (e.g. diamond_block →
diamond) or
  auto-gather missing intermediates for complex recipes.
- `inferDamageSource` orders environmental causes before
`recentAttacker`, which
  can mis-attribute an in-water-while-shot hit; low impact, deferred.
2026-06-05 11:51:18 +08:00
f459d00954 chore(ci): use personal access token for hash update (#1925)
## Description

Unfortunately the method of manually calling CI on the PR branch used by
#1907 doesn't count as status check of that PR (#1924), probably because
the called workflow inherits the context of the calling workflow, which
is not triggered by the PR. I read the docs and the most straightforward
solution is using a PAT, which does trigger the pull_request event.
Alternatively you can open PR with a custom github app, which is more
complicated but allows the app to bypass ruleset and commit directly to
main. Or just disable mandatory status checks.

## Linked Issues



## Additional Context

<!-- e.g. is there anything you'd like reviewers to focus on? -->

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Rin <shinohara-rin@users.noreply.github.com>
2026-06-04 18:12:51 +08:00
Garfield Lee fab9cc3b14 chore(i18n): remove useless quotes (#1945)
## Description

Remove some useless quotes
2026-06-04 16:37:44 +08:00
Liet Blue dc6807a21f feat(server-dashboard): add admin UI for AIRI operations (#1942) 2026-06-04 16:16:19 +08:00
Nekoandgithub-actions[bot] 899a1774bd chore: update sponsors svg (#1944)
This PR updates generated SponsorKit assets from the scheduled sponsors
workflow.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-04 04:57:52 +00:00
github-actions[bot]andgithub-actions[bot] 53d5e827bc chore(nix): update assets hash (#1937)
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-06-03 13:45:38 -04:00
github-actions[bot]andgithub-actions[bot] f71bd287f4 chore(nix): update pnpmDeps hash (#1938)
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-06-03 13:43:02 -04:00
RainbowBird f72c7b9c72 feat(server): add product analytics dashboard row 2026-06-03 23:24:45 +08:00
RainbowBird 7ac69db4ef feat(server): add product analytics events (#1941) 2026-06-03 23:03:33 +08:00
RainbowBird 41e8cd7626 chore(eventa): use upstream hono adapter
Upgrade @moeru/eventa to v1.0.0-beta.8 through the pnpm catalog and remove the local Hono adapter copy.

Keep AIRI on business-level Eventa usage while adapter contract tests live upstream in @moeru/eventa.

Signed-off-by: RainbowBird <git@luoling.moe>

Commit-Message-Assisted-by: Claude (via Claude Code)
2026-06-03 17:12:13 +08:00
RainbowBird 7841df28f8 build(deps): migrate workspace dependencies to catalogs
Move direct external dependency versions into pnpm catalogs and update workspace packages to reference catalog entries.

Signed-off-by: RainbowBird <git@luoling.moe>

Commit-Message-Assisted-by: Codex
2026-06-03 17:12:13 +08:00
6a0ec32aaf chore(i18n): update translations (#1898)
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>
2026-06-03 17:01:28 +08:00
RainbowBird e4acc78e25 refactor(server): enhance validation schemas for auth and audio processing 2026-06-03 13:48:19 +08:00
RainbowBird a795806e81 refactor(server): split auth route helpers 2026-06-03 13:48:19 +08:00
RainbowBird f5b051d969 refactor(server): split chat ws runtime 2026-06-03 13:48:19 +08:00
RainbowBird baf4f1fa51 refactor(server): split audio speech ws session 2026-06-03 13:48:18 +08:00
RainbowBird ea1c658c8d refactor(server): split stripe route operations 2026-06-03 13:48:18 +08:00
RainbowBird 03d2dc05db docs(agents): add server gateway refactor skill 2026-06-03 13:48:18 +08:00
github-actions[bot]andgithub-actions[bot] bb0318761c chore(nix): update pnpmDeps hash (#1931)
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-06-02 13:07:28 -04:00
RainbowBirdandNeko 6f6fe01b3e refactor(server): openai route gateway
Co-authored-by: Neko <neko@ayaka.moe>
2026-06-03 00:21:25 +08:00
88fac74702 fix(stage-ui): correct provider source filter categories (#1929)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: LemonNeko <self@lemonneko.moe>
2026-06-02 16:02:00 +00:00
Makito 4d496b18d7 fix(stage-ui): typecheck errors 2026-06-02 23:37:34 +09:00
RainbowBird ee3ae8fc31 refactor(server): tts migrate to unspeech 2026-06-02 17:34:08 +08:00
Ryanba c5fd8341c7 docs: add winget install command (#1918)
## Summary
- Add the `winget install MoeruAI.AIRI` command to the root README
Windows install tip.
- Mirror the same winget command in the localized README files covered
by the issue.

Closes #1913

## Validation
- `grep -n -B 5 -A 5 "MoeruAI\.AIRI" README.md docs/README.*.md`
- `git diff --check`
2026-06-02 15:50:33 +08:00
RainbowBird c64e48c233 refactor(server): nanoid 2026-06-02 15:40:05 +08:00
RainbowBird 1936a22c95 refactor(server): split openai v1 route pipeline
Separate OpenAI-compatible route wiring from chat, speech, catalog, billing, and telemetry pipeline code.

Signed-off-by: RainbowBird <git@luoling.moe>

Commit-Message-Assisted-by: Claude (via Claude Code)
2026-06-02 15:39:25 +08:00
RainbowBird 03018a6a1e refactor(server): use es-toolkit clamp for query bounds (#1923) 2026-06-02 15:00:37 +08:00
刘梓恒 d86c502f04 feat(computer-use-mcp): add browser repair suggestions (#1920)
## Summary

Adds browser DOM repair suggestions inside `services/computer-use-mcp`.

Known browser DOM action failures now get structured, advisory-only
repair suggestions for selector misses, hidden elements, timeouts,
detached frames, and stale elements. The registration path uses the
suggestions for `browser_dom_click` and `browser_dom_wait_for_element`
thrown-error responses.

## Boundary

- Only touches `services/computer-use-mcp`.
- Does not touch app, renderer, overlay, extension assets, desktop v3
files, or root project governance files.
- Does not import preview changes that delete current upstream
Chrome/desktop files.
- Does not include local AI config, screenshots, tokens, account
identifiers, or raw environment dumps.

## Validation

Sanitized evidence is committed in
`services/computer-use-mcp/validation/browser-repair-contract.md`.

Ran:

- `pnpm install --ignore-scripts --frozen-lockfile`
- `pnpm -F @proj-airi/computer-use-mcp exec vitest run
src/browser-dom/browser-repair-contract.test.ts
src/server/register-tools-pty-approval.test.ts --config
./vitest.config.ts`
- `pnpm exec moeru-lint --fix
services/computer-use-mcp/validation/browser-repair-contract.md
services/computer-use-mcp/src/browser-dom/browser-repair-contract.ts
services/computer-use-mcp/src/browser-dom/browser-repair-contract.test.ts
services/computer-use-mcp/src/server/register-tools.ts
services/computer-use-mcp/src/server/register-tools-pty-approval.test.ts`
- `git diff --check`

`pnpm -F @proj-airi/computer-use-mcp typecheck` is currently blocked by
existing baseline errors in `chrome-session-manager` and
`desktop-grounding`, outside this patch. The validation note lists the
error classes without local paths or raw logs.
2026-06-02 10:50:34 +08:00
github-actions[bot]andgithub-actions[bot] 7e3d39c5dd chore(nix): update assets hash (#1926)
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-06-01 20:58:22 -04:00
github-actions[bot]andgithub-actions[bot] d6d3e2a05d chore(nix): update pnpmDeps hash (#1924)
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-06-01 20:10:46 -04:00
Weathercold 052dc03ad2 chore(ci): open and auto-merge PR when updating hashes (#1907) 2026-06-01 23:17:09 +08:00
RainbowBird f728f4d639 feat(server): add testing-only bearer token bypass for authentication 2026-06-01 18:16:21 +08:00