Commit Graph
67 Commits
Author SHA1 Message Date
PenlunaRinautofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
b3fac81c5a feat(minecraft): desktop relay via a Minecraft adapter (#1916)
> **Reworked.** This PR has been rebuilt around the neutral Context Flow
architecture, per @shinohara-rin's review. Minecraft is no longer
special-cased in the generic stage-ui runtime — desktop relay &
read-aloud are now reintroduced through a **Minecraft adapter** that
contributes into the existing generic stores.

## Stacked PRs (please review/merge in order)

This rework is split as you suggested — "first restore
`services/minecraft` to only own Minecraft semantics, then reintroduce
desktop relay/read-aloud through ... a Minecraft adapter":

1. **#1949** — generic stage-ui robustness fixes (spark:command result
guard + TTS session isolation), split out as you noted they were
separable.
2. **#1950** — `refactor(minecraft)`: restore `services/minecraft` to
neutral Minecraft semantics (removes the desktop-relay assumptions baked
into the merged #1915 — `handleActionIntent`'s
`username='主人'`/`relayedFrom`, the `master:` status hint, and the
`minecraft:speech` forwarding).
3. **this PR** — reintroduces desktop relay & read-aloud via the
Minecraft adapter.

Because #1949 and #1950 are not merged yet, their commits currently
appear in this PR's diff. Once they land I'll rebase this PR onto `main`
so the diff shrinks to just the adapter work.

## The adapter (`apps/stage-tamagotchi/src/renderer/stores/minecraft/`)

The renderer owns the entire desktop ↔ in-game-bot integration and
contributes into the **existing** generic stores — the same pattern as
`mcp-tools.ts` / `plugin-tools.ts`:

- **`relayToMinecraft` tool** →
`useLlmToolsStore.registerTools('minecraft', …)`, registered **only
while the bot is online** (a hard capability gate, replacing the old
prompt-only "don't relay when offline"). `execute()` re-checks
availability, so a relay is never acked after the bot disconnects.
- **Persona directive** →
`useLlmToolsetPromptsStore.registerToolsetPrompts('minecraft', …)`,
re-registered whenever online/master/runtime-context change so the model
gets a fresh directive each turn.
- **Read-aloud** → consumes the bot's `minecraft:speech` chat into the
stage TTS (Chinese-gated), and binds 主人 by **parsing the bot's neutral
status text** — no desktop-specific hint from the bot service.
- **Notify muting** →
`orchestratorStore.muteNotifySource('minecraft-bot')`.

## Generic, non-Minecraft additions

- **`useSystemSpeechStore`** (stage-ui): a neutral bridge so any module
can voice a one-off system line; `Stage.vue` consumes it via
independent, tracked TTS sessions cancelled on unmount /
provider-or-voice change.
- **`orchestrator.muteNotifySource(id)`**: a generic primitive so a
module suppresses only **its own** notifies — every other module/plugin
notify still reacts (this fixes the earlier P1 where all
`character`-targeted notifies were dropped).
- **`./tools/*` export** from stage-ui so app-side tool authors can
reuse the shared spark-command normalizers.

## services/minecraft

Re-adds the bot's own-chat forwarding on `minecraft:speech`, now landing
**together with** its adapter consumer so the read-aloud contract is
never half-present on `main`.

## How tested

- `pnpm -F @proj-airi/stage-ui typecheck` + `pnpm -F
@proj-airi/stage-tamagotchi typecheck` → 0 errors.
- 16 new unit tests (persona prompt builder + relay tool: availability
gate, do/stop, full-label fidelity, master parsing, read-aloud gating);
orchestrator suite 5/5.
- `eslint` → 0 problems.

## Addressed review points

- Restore non-Minecraft notifications → generic `muteNotifySource` (only
the bot's source is muted).
- Isolate / track-and-cancel one-off system TTS sessions → `Stage.vue`
`oneOffSessions`.
- Re-check bot availability before relaying → `isAvailable()` in
`execute()`.
- Read the master hint that actually exists → desktop now parses the
master from neutral status **text** (the `master:` hint is removed in
#1950).
- Defer Minecraft init until after channel config → adapter `setup()`
runs after the configured `serverChannelStore.initialize(...)`.

---------

Co-authored-by: Rin <shinohara-rin@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-10 15:30:45 +08:00
RainbowBird d5a241b10e chore: migrate services to integration folder 2026-08-02 20:12:13 +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
Neko Ayaka 3779eb6103 release: v0.11.0 2026-07-08 01:20:12 +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
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
Neko Ayaka 2ab21879dd chore(deps): bump dependencies 2026-04-18 19:18:17 +08: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 dc7132bb91 release: v0.9.0-beta.7 2026-04-08 04:17:03 +08:00
Neko Ayaka 7f7f50b462 release: v0.9.0-beta.6 2026-04-07 04:58:46 +08:00
Neko Ayaka 389388820f release: v0.9.0-beta.5 2026-04-06 02:10:21 +08:00
Neko Ayaka 476ef2018f style: many typescript v6 pending errors 2026-04-05 02:07:09 +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 497524a22f release: v0.9.0-beta.2 2026-03-31 17:33:53 +08:00
Neko Ayaka c751f48401 release: v0.9.0-beta.1 2026-03-31 14:35:19 +08:00
Neko Ayaka 21a092be71 release: v0.9.0-alpha.36 2026-03-30 22:49:38 +08:00
Makito 0e9122b5ac release: v0.9.0-alpha.35 2026-03-30 14:44:33 +09:00
Neko Ayaka fbf6a05f1e release: v0.9.0-alpha.34 2026-03-29 15:28:42 +08:00
Neko Ayaka d5f24107b7 release: v0.9.0-alpha.32 2026-03-29 02:44:08 +08:00
Neko Ayaka 06570b4dde release: v0.9.0-alpha.31 2026-03-28 12:57:31 +08:00
Makito c0e499b044 release: v0.9.0-alpha.30 2026-03-28 11:52:22 +09:00
Ayaka Neko 129fbf3fcb release: v0.9.0-alpha.29 2026-03-28 04:06:59 +08:00
Neko Ayaka 5535907aa8 release: v0.9.0-alpha.28 2026-03-27 18:01:13 +08:00
Neko Ayaka 6675b3234d release: v0.9.0-alpha.27 2026-03-27 15:55:49 +08:00
Neko Ayaka cd826dcbce release: v0.9.0-alpha.26 2026-03-27 15:33:24 +08:00
Neko Ayaka fc72b7a56c release: v0.9.0-alpha.25 2026-03-27 14:47:31 +08:00
Neko Ayaka e2080c7178 release: v0.9.0-alpha.24 2026-03-27 03:39:08 +08:00
Neko Ayaka 539ba83a61 release: v0.9.0-alpha.23 2026-03-26 23:39:14 +08:00
Neko Ayaka 45ce8ba602 release: v0.9.0-alpha.22 2026-03-25 01:19:04 +08:00
Neko Ayaka 0af4217666 release: v0.9.0-alpha.21 2026-03-24 09:21:27 +08:00
Neko Ayaka 11bb6b8e0a release: v0.9.0-alpha.20 2026-03-23 21:41:53 +08:00
Neko Ayaka ea7c832adc release: v0.9.0-alpha.19 2026-03-23 20:03:39 +08:00
Neko Ayaka ac1de680d0 chore(deps): bump dependencies 2026-03-23 02:15:40 +08:00
Neko Ayaka a3b9a4b037 release: v0.9.0-alpha.18 2026-03-19 14:45:49 +08:00
Makito a49bd97ed3 release: v0.9.0-alpha.17 2026-03-18 14:45:49 +09:00
Neko Ayaka 72925c1372 release: v0.9.0-alpha.16 2026-03-15 04:04:07 +08:00
Garfield Lee 9fc9955615 release: v0.9.0-alpha.15 2026-03-14 18:23:50 +08:00
Neko Ayaka da62f1c16b release: v0.9.0-alpha.14 2026-03-12 01:48:21 +08:00
Neko Ayaka 53f79713d7 release: v0.9.0-alpha.13 2026-03-11 19:36:13 +08:00
Neko Ayaka 96d3149909 release: v0.9.0-alpha.12 2026-03-11 04:35:37 +08:00
Neko Ayaka 208ff1d8a5 release: v0.9.0-alpha.11 2026-03-11 02:03:28 +08:00
LemonNeko 38d41cca84 release: v0.9.0-alpha.10 2026-03-10 22:32:07 +08:00
Neko Ayaka 03a38f9e0c release: v0.9.0-alpha.9 2026-03-10 19:33:11 +08:00