Commit Graph
212 Commits
Author SHA1 Message Date
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
RainbowBird 742bb80ca5 feat(stage): add global button analytics directive (#2146) 2026-07-29 15:59:53 +08:00
藍+85CD 880d1bf7a9 feat(stage-ui-tachie): add tachie support (#2115) 2026-07-28 23:35:30 +08:00
eabec9a64f feat(stage-ui-mmd): add MMD support (#1997)
---------

Co-authored-by: nyueki <nyuek.i@proton.me>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Neko Ayaka <neko@ayaka.moe>
Co-authored-by-agent: Unknown
2026-07-20 16:13:55 +08:00
Neko Ayaka dbf8124888 release: v0.11.3 2026-07-19 04:03:59 +08:00
Neko Ayaka b43b8944bf release: v0.11.2 2026-07-18 10:37:13 +08:00
Neko Ayaka 089ca99108 release: v0.11.1 2026-07-17 03:35:49 +08:00
Dojiandautofix-ci[bot] 5aa44aedd3 feat(stage-ui): add character card import and export (#1998)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-08 14:14:43 +08:00
Neko Ayaka 3779eb6103 release: v0.11.0 2026-07-08 01:20:12 +08:00
RainbowBird 007fae6810 chore: update package dependencies and remove specific catalog references
- Removed specific catalog references for '@unocss/core', 'es-toolkit', 'nanoid', and 'valibot' in pnpm-workspace.yaml and various service package.json files.
- Updated versions for '@vueuse/core', 'es-toolkit', 'nanoid', 'reka-ui', and 'valibot' to their latest compatible versions.
- Cleaned up unused catalog entries in pnpm-workspace.yaml.
2026-06-07 19:45:28 +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
nyueki 4542a9d290 feat(stage-ui-spine): add Spine 2D runtime integration (#1810) 2026-05-19 19:13:35 +08:00
RainbowBird bf1aba757c feat(server): stream tts provider 2026-05-18 23:33:24 +08:00
Doji 2c432fc1c8 refactor(stage-web,stage-ui): replace warpdrive plugin with unplugin-basemove (#1818) 2026-05-13 12:03:30 +08:00
RainbowBird d0e2b450cd feat(stage-ui): chat sync (#1775) 2026-05-08 21:14:00 +08:00
Neko Ayaka 37433b98a2 refactor(stage-ui): new structure for models, services, stores 2026-05-08 17:03:46 +08:00
Neko Ayaka 6d61699d10 release: v0.10.2 2026-05-07 19:36:33 +08:00
Neko Ayaka 6dd370433a release: v0.10.1 2026-05-05 14:10:55 +08:00
Neko Ayaka ca722f69b7 release: v0.10.0 2026-05-03 23:17:03 +08:00
刘梓恒 255ce71cba feat(stage-tamagotchi,computer-use-mcp): implement browser-native DOM action routing (#1648)
---------

Co-authored-by-agent: Antigravity <antigravity@gemini.com>
Co-authored-by-agent: Codex <267193182+codex@users.noreply.github.com>
2026-04-25 00:08:22 +08:00
Richard Pinedo 4e6da5ef04 feat(stage-*): port artistry & chatbox enhancements (#1636)
Co-authored-by-agent: Unknown <unknown@example.com>
2026-04-24 23:25:04 +08:00
Neko Ayaka a3249ccd68 feat(stage-tamagotchi,stage-ui,ui): input should not flink, added retry for errored item, adjusted button 2026-04-23 01:09:46 +08:00
Neko Ayaka 94031bf1c4 fix(stage-ui,ui): histoire wasn't configured correctly 2026-04-22 16:57:35 +08:00
Neko Ayaka 5bbf9559a4 refactor(stage-ui,stage-tamagotchi): have plugin-tools, mcp-tools to register directly to llm.ts 2026-04-22 03:34:40 +08:00
DrHuangMHT 7e4486c068 chore(ci): fix typecheck on navigator.gpu (#1700) 2026-04-21 20:27:17 +08:00
Neko Ayaka 2ab21879dd chore(deps): bump dependencies 2026-04-18 19:18:17 +08:00
Nashchenncandautofix-ci[bot] bf41655dbb feat(core-agent): extract pure runtime logic from stage-ui into core-agent (#1524)
Depends on #1487 

## Summary

- Introduce `packages/core-agent` — a new pure-runtime package that
extracts zero-Vue/Pinia algorithmic logic from `@proj-airi/stage-ui`,
following a "compatible facade + core sinking" strategy
- Migrate shared chat types, LLM streaming types, chat hook registry,
session message merge logic, context registry algorithm, and LLM service
utilities into `core-agent`
- `stage-ui` files are preserved as re-exports / thin wrappers — all
external imports, store IDs, and public APIs remain unchanged

## Motivation

`stage-ui` currently mixes pure agent runtime logic (algorithms, type
definitions, stateless utilities) with Vue/Pinia state management and
browser-specific adapters. This coupling makes it hard to:
- Test agent logic in isolation
- Reuse agent algorithms outside of Vue contexts (e.g., server-side,
CLI, other frameworks)
- Reason about the boundary between "what the agent does" vs "how the UI
manages state"

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by-agent: Unknown <unknown@example.com>
2026-04-16 16:09:22 +08:00
Neko Ayaka f286464e03 chore(deps): bump dependencies 2026-04-15 14:44:59 +08:00
0c3655ee8d refactor(inference): replace custom AsyncMutex with async-mutex package (#1660)
## Summary

Address maintainer feedback from #1622 ([@nekomeowww's
comment](https://github.com/moeru-ai/airi/pull/1622#discussion_r2342632282)).

The project already uses `async-mutex` in other packages
(`stage-tamagotchi`, `electron-screen-capture`), and it's in the
workspace catalog. This replaces the custom `AsyncMutex` implementation
with the shared dependency.

- Replace `AsyncMutex.run()` → `Mutex.runExclusive()`
- Replace `AsyncMutex.reset()` → `Mutex.cancel()`
- Remove `async-mutex.ts` and its unit tests
- Remove `AsyncMutex` from inference barrel exports
- Add `async-mutex` as direct dependency of `@proj-airi/stage-ui`

**Regarding `@moeru/eventa` suggestion**
([comment](https://github.com/moeru-ai/airi/pull/1622#discussion_r2342631692)):
The `waitForMessage` pattern is a thin request-response abstraction over
`postMessage`, where the worker is driven by `@huggingface/transformers`
internally. Eventa's transport-agnostic RPC is better suited for
bidirectional channels (Electron IPC, WebSocket) than for this one-way
"post and wait" pattern. No change for now.

## Test plan

- [x] `pnpm exec vitest run packages/stage-ui/src/libs/inference/` — 11
tests pass (4 removed with custom impl)
- [x] `pnpm -F @proj-airi/stage-ui typecheck` — no errors
- [x] `pnpm lint:fix` — no new errors in changed files

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-04-14 11:47:33 +08:00
147d077aa7 feat(inference): unify and optimize WebGPU inference pipeline (#1622)
## Problem

The WebGPU inference pipeline had several structural issues:

1. **No unified protocol** — Kokoro TTS, Whisper ASR, and Background
Removal workers each used their own ad-hoc message formats. Adding a new
model meant reinventing worker communication from scratch.
2. **Infrastructure existed but was disconnected** —
`GPUResourceCoordinator`, `LoadQueue`, `InferenceWorkerManager`, and
`protocol.ts` were all implemented but had zero consumers. The adapters
duplicated the same lifecycle/timeout/mutex patterns independently.
3. **Performance gaps** — Kokoro only offered fp32 on WebGPU (no fp16),
Whisper warm-up compiled shaders for 187.5s of dummy audio, audio
transfer went through unnecessary WAV blob encode/decode, and
`listVoices` reloaded the model every time.
4. **Silent failures** — Whisper worker's `generate()` had no try-catch;
errors were swallowed and the main thread waited until timeout.
5. **No graceful degradation** — Whisper and Background Removal workers
hardcoded `device: 'webgpu'` with no WASM fallback.
6. **No observability** — Only Kokoro had performance tracing. No
adapter reported status to `useInferenceStatus`. No cache management UI
existed.
7. **Dead code accumulation** — Old `KokoroWorkerManager` (232 lines),
legacy Whisper message types, and scattered duplicate constants.

## Changes

### Phase 0 — Critical Performance & Bugs
- Add `fp16-webgpu` dtype for Kokoro TTS (~2x inference speed on
supported GPUs)
- Fix Whisper warm-up tensor from `[1, 128, 3000]` → `[1, 128, 1]`
(minimal shader compilation)
- Fix Whisper worker silent error bug (add try-catch to `generate()` and
`load()`)

### Phase 1 — Data Transfer & Caching
- Switch Kokoro audio to Float32Array transferable (skip WAV blob encode
in worker, lightweight WAV encode on main thread)
- Cache `listVoices` results (skip redundant model reload when adapter
state is `ready`)
- Normalize progress reporting to 0-100 across all adapters,
differentiate `warmup` phase

### Phase 2 — Protocol Unification & Infrastructure
- Migrate all 3 workers + 3 adapters to unified `protocol.ts` message
types (`load-model`, `run-inference`, `model-ready`, `inference-result`,
`progress`, `error`)
- Wire `GPUResourceCoordinator` into all adapters (VRAM allocation
tracking, LRU ordering, memory pressure events)
- Wire `LoadQueue` into all adapters (priority-based sequential model
loading: TTS=10 > ASR=5 > BG_REMOVAL=1)
- Add `coordinator.ts` global singleton for GPU coordinator + load queue
- Add WebGPU detection + WASM fallback in Whisper and Background Removal
workers

### Phase 3 — Error Recovery & Observability
- Add restart logic with exponential backoff to Whisper adapter
(matching Kokoro's existing pattern)
- Integrate `classifyError()` (OOM / DEVICE_LOST / TIMEOUT
classification) in Whisper adapter
- Extend `defaultPerfTracer` to Whisper `transcribe()` and Background
Removal `processImage()`
- Wire `useInferenceStatus` into all 3 adapters (downloading → ready →
terminated lifecycle)

### Phase 4 — Tests
- Add unit tests for `AsyncMutex` (4 tests), `LoadQueue` (4 tests),
`GPUResourceCoordinator` (7 tests) — all 15 passing

### Phase 5 — Cleanup & Features
- Delete old `KokoroWorkerManager` (232 lines, zero consumers)
- Delete orphaned `libs/workers/types.ts` (old Whisper message types)
- Clean up `workers/kokoro/types.ts` (remove legacy message types, keep
domain types)
- Create centralized `constants.ts` (MODEL_IDS, MODEL_NAMES, TIMEOUTS,
MAX_RESTARTS)
- Remove hardcoded WebGPU check from background-removal devtools pages
(worker auto-detects)
- Add `useModelPreload` composable for generic idle-time preloading
- Add `useInferencePreload` composable that reads provider config and
preloads configured local models
- Wire preloading into both `stage-web` and `stage-tamagotchi` App.vue
(Kokoro TTS preloads 3s after init)
- Add `ModelCacheManager.vue` settings component (cache size display,
per-model status, clear cache)
- Document GPU Device isolation architecture in protocol.ts

## After This PR

- All inference workers speak the same protocol → adding a new model
adapter is straightforward
- GPU memory is tracked across all models with automatic pressure
warnings at 80%/95% of VRAM budget
- Models load sequentially via priority queue → no bandwidth/VRAM
contention
- Workers auto-detect WebGPU and fall back to WASM → works on browsers
without WebGPU
- Kokoro TTS preloads during idle time → "instant" first use for
configured users
- All adapters auto-restart on worker crashes (max 3 attempts,
exponential backoff)
- 15 unit tests cover core infrastructure (mutex, queue, coordinator)
- Zero dead code remains in the inference pipeline

## Test Plan

- [x] `pnpm exec vitest run packages/stage-ui/src/libs/inference/` — 15
tests pass
- [x] `pnpm -F @proj-airi/stage-ui exec tsc --noEmit` — no TypeScript
errors
- [x] `pnpm lint:fix` — no lint errors in changed files
- [ ] Manual: verify Kokoro TTS works with fp16-webgpu on a supported
browser
- [ ] Manual: verify Whisper ASR loads and transcribes correctly
- [ ] Manual: verify Background Removal works in devtools page
- [ ] Manual: verify preloading triggers in console (`[Preload] Loading
kokoro-...`)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-04-13 23:19:27 +08:00
Makito bc5397b3f5 feat(stage-ui): add OTel deps and IO tracer helpers 2026-04-11 19:05:38 +09:00
Neko Ayaka 95eac8e41c chore(deps): bump dependencies 2026-04-11 04:00:49 +08:00
Neko Ayaka dd284f0f27 release: v0.9.0 2026-04-10 14:48:30 +08:00
Neko Ayaka a0caaf3214 release: v0.9.0-rc.1 2026-04-10 03:40:59 +08:00
Neko Ayaka 6c366915c9 chore(ci): rollback package.json 2026-04-09 17:52:58 +08:00
Neko Ayaka 1be6defb08 chore(ci): updated tsconfig.json 2026-04-09 17:22:13 +08:00
Neko Ayaka dc7132bb91 release: v0.9.0-beta.7 2026-04-08 04:17:03 +08:00
286cc33d0e feat(stage-ui): let AIRI see tool failures in LLM context (captureToolErrors + xsai patches) (#1602)
---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Cursor
Co-authored-by-agent: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-04-08 01:29:17 +08:00
Neko Ayaka 7f7f50b462 release: v0.9.0-beta.6 2026-04-07 04:58:46 +08:00
Neko Ayaka fe139f31cd chore(stage-*): configured https, now dev:web:https or pnpm -F @proj-airi/stage-web dev:https works 2026-04-07 01:39:49 +08:00
Neko Ayaka 389388820f release: v0.9.0-beta.5 2026-04-06 02:10:21 +08:00
Lovehsigure_520andNeko Ayaka f9ebe6522b feat(stage-ui): add hologram promo banner (#1514)
---------

Co-authored-by: Neko Ayaka <neko@ayaka.moe>
2026-04-03 07:22:34 +08:00
Neko Ayaka 3b76bab2fc feat(stage-*,workspace): added Nunito for default English font, ChillRoundM for CJK font
Close #1317, #1393
2026-04-02 18:31:53 +08:00
LemonNeko 60112eaa85 release: v0.9.0-beta.4 2026-04-01 19:19:22 +08:00
Makito e9be0cf98c release: v0.9.0-beta.3 and ios build 8 2026-04-01 15:35:07 +09:00
Neko Ayaka 2d2ee38f37 fix(stage-ui): updated format of version info 2026-04-01 00:17:32 +08:00
RainbowBird 4673494e73 chore: cleanup 2026-03-28 02:25:44 +08:00
RainbowBird 405904183f refactor(server): revert a8f445a17985a90d7eb5d981b4231114c3066e94 2026-03-28 02:25:44 +08:00
RainbowBird ba3d66de86 feat(server-protocol): introduce shared protocol types for AIRI server clients and frontends
- Added package.json for @proj-airi/server-protocol with necessary configurations.
- Implemented chat event types including WireMessage, SendMessagesRequest, and PullMessagesRequest.
- Defined WebSocket event types and structures for better integration with AIRI components.
- Updated server-runtime and server-sdk to utilize the new server-protocol package.
- Refactored imports across various packages to replace server-shared types with server-protocol types.
- Enhanced type definitions and added TypeScript configurations for better development experience.
2026-03-28 02:25:44 +08:00
RainbowBird b0576d3b89 chore(deps): move eventa to catalog 2026-03-26 21:45:01 +08:00