[PR #1458] [MERGED] Add TTS and translation API wrappers #5098

Closed
opened 2026-10-22 04:13:13 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1458
Author: @Xelvanis
Created: 5/28/2026
Status: ✅ Merged
Merged: 5/28/2026
Merged by: @SpicyMarinara

Base: refactor ← Head: chore/raw-invoketauri-tts-translate


📝 Commits (4)

  • 74be484 Add TTS and translation API wrappers
  • 60150b0 Update shared API docs for TTS wrappers
  • 2e761e2 Validate TTS speak responses
  • a8c9cd5 Refresh Graphify for TTS wrappers

📊 Changes

17 files changed (+3461 additions, -2365 deletions)

View changed files

📝 docs/developer/architecture.html (+1 -1)
📝 docs/developer/modules.html (+1 -1)
📝 graphify-out/.graphify_labels.json (+17 -0)
📝 graphify-out/GRAPH_REPORT.md (+340 -243)
📝 graphify-out/cache/stat-index.json (+1 -1)
📝 graphify-out/graph.json (+2714 -1998)
📝 graphify-out/manifest.json (+75 -55)
📝 src/shared/api/integration-utility-api.ts (+1 -40)
📝 src/shared/api/tauri-client.test.ts (+22 -0)
➕ src/shared/api/translation-api.test.ts (+43 -0)
➕ src/shared/api/translation-api.ts (+30 -0)
➕ src/shared/api/tts-api.test.ts (+122 -0)
➕ src/shared/api/tts-api.ts (+72 -0)
📝 src/shared/hooks/use-translate.ts (+8 -10)
📝 src/shared/hooks/use-tts.ts (+5 -5)
📝 src/shared/lib/translate-text.ts (+8 -10)
📝 src/shared/lib/tts-service.ts (+1 -1)

📄 Description

Linked issue

Refs #1457

Why this change

  • Continue the raw invokeTauri migration by moving TTS and translation command calls behind focused shared API wrappers.
  • Keep command names, payload shapes, response validation, binary conversion, and remote-runtime routing tests in shared API ownership instead of spreading those details through hooks and utility callers.

What changed

  • Added src/shared/api/tts-api.ts for TTS config, voices, and speech command wrappers.
  • Added src/shared/api/translation-api.ts for translation command payload/response validation.
  • Updated TTS and translation hooks/libs to call the focused wrappers instead of broad integration utility behavior.
  • Kept integration-utility-api.ts compatibility exports while removing its inline TTS command implementation.
  • Added focused wrapper tests plus remote-runtime routing coverage for the TTS and translation command names.
  • Rebased onto current refactor, resolving the tauri-client.test.ts conflict by keeping both haptics local-only coverage and TTS/translation remote-runtime coverage.
  • Refreshed Graphify after the wrapper files were added.

Refactor impact

Primary owner:

Shared API wrapper layer (src/shared/api).

Impact areas reviewed:

  • TTS hook/service callers
  • Translation hook/lib callers
  • Remote runtime command routing tests
  • Shared API developer docs
  • Graphify generated map output

Boundary notes:

  • Product behavior stays outside the shared API layer; the new wrappers own transport contracts and response validation.
  • Feature/shared hooks no longer need direct invokeTauri knowledge for this slice.
  • Remote-capable command names remain explicit in remote-runtime.ts and are covered by tauri-client routing tests.
  • No Rust command behavior was changed.

Validation

  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • Targeted wrapper/routing tests pass locally
  • Graphify refresh passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked against a live marinara-server

Manual verification notes

  • pnpm exec vitest run src/shared/api/tts-api.test.ts src/shared/api/translation-api.test.ts src/shared/api/tauri-client.test.ts passed: 3 files, 29 tests.
  • pnpm typecheck passed.
  • pnpm check:architecture passed.
  • pnpm check:docs passed: checked 40 docs and repo guidance files.
  • pnpm build passed with the existing large chunk warning.
  • pnpm graphify:patch passed.
  • graphify update . passed.
  • git diff --check origin/refactor...HEAD passed.
  • Graphify generated output was checked for local absolute path leaks.
  • Native Tauri/provider QA was not run; this PR only verifies wrapper contract behavior and build/import health.
  • Remote runtime smoke was not run against a live marinara-server; routing is covered by unit tests.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

Developer docs under docs/developer/ were updated to list tts-api.ts and translation-api.ts in the shared API wrapper map.

UI evidence

No visible UI changes. This is a shared API wrapper migration slice.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/1458 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 5/28/2026 **Status:** ✅ Merged **Merged:** 5/28/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `refactor` ← **Head:** `chore/raw-invoketauri-tts-translate` --- ### 📝 Commits (4) - [`74be484`](https://github.com/Pasta-Devs/Marinara-Engine/commit/74be484583ef46bb21dc47bf201556aedda6a06b) Add TTS and translation API wrappers - [`60150b0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/60150b07689f22400d19362df888fc91484407bf) Update shared API docs for TTS wrappers - [`2e761e2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2e761e2a3290f2e5328fdd22fe8dfc8340dc93a0) Validate TTS speak responses - [`a8c9cd5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a8c9cd5788822c3b8e051bad13408194932ef1ee) Refresh Graphify for TTS wrappers ### 📊 Changes **17 files changed** (+3461 additions, -2365 deletions) <details> <summary>View changed files</summary> 📝 `docs/developer/architecture.html` (+1 -1) 📝 `docs/developer/modules.html` (+1 -1) 📝 `graphify-out/.graphify_labels.json` (+17 -0) 📝 `graphify-out/GRAPH_REPORT.md` (+340 -243) 📝 `graphify-out/cache/stat-index.json` (+1 -1) 📝 `graphify-out/graph.json` (+2714 -1998) 📝 `graphify-out/manifest.json` (+75 -55) 📝 `src/shared/api/integration-utility-api.ts` (+1 -40) 📝 `src/shared/api/tauri-client.test.ts` (+22 -0) ➕ `src/shared/api/translation-api.test.ts` (+43 -0) ➕ `src/shared/api/translation-api.ts` (+30 -0) ➕ `src/shared/api/tts-api.test.ts` (+122 -0) ➕ `src/shared/api/tts-api.ts` (+72 -0) 📝 `src/shared/hooks/use-translate.ts` (+8 -10) 📝 `src/shared/hooks/use-tts.ts` (+5 -5) 📝 `src/shared/lib/translate-text.ts` (+8 -10) 📝 `src/shared/lib/tts-service.ts` (+1 -1) </details> ### 📄 Description ## Linked issue Refs #1457 ## Why this change - Continue the raw `invokeTauri` migration by moving TTS and translation command calls behind focused shared API wrappers. - Keep command names, payload shapes, response validation, binary conversion, and remote-runtime routing tests in shared API ownership instead of spreading those details through hooks and utility callers. ## What changed - Added `src/shared/api/tts-api.ts` for TTS config, voices, and speech command wrappers. - Added `src/shared/api/translation-api.ts` for translation command payload/response validation. - Updated TTS and translation hooks/libs to call the focused wrappers instead of broad integration utility behavior. - Kept `integration-utility-api.ts` compatibility exports while removing its inline TTS command implementation. - Added focused wrapper tests plus remote-runtime routing coverage for the TTS and translation command names. - Rebased onto current `refactor`, resolving the `tauri-client.test.ts` conflict by keeping both haptics local-only coverage and TTS/translation remote-runtime coverage. - Refreshed Graphify after the wrapper files were added. ## Refactor impact Primary owner: Shared API wrapper layer (`src/shared/api`). Impact areas reviewed: - TTS hook/service callers - Translation hook/lib callers - Remote runtime command routing tests - Shared API developer docs - Graphify generated map output Boundary notes: - Product behavior stays outside the shared API layer; the new wrappers own transport contracts and response validation. - Feature/shared hooks no longer need direct `invokeTauri` knowledge for this slice. - Remote-capable command names remain explicit in `remote-runtime.ts` and are covered by `tauri-client` routing tests. - No Rust command behavior was changed. ## Validation - [x] `pnpm typecheck` passes locally - [x] `pnpm build` passes locally - [x] `pnpm check:architecture` passes locally - [x] `pnpm check:docs` passes locally - [x] Targeted wrapper/routing tests pass locally - [x] Graphify refresh passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Playwright, screenshot, or recording evidence added for UI changes - [ ] Remote runtime smoke checked against a live `marinara-server` ### Manual verification notes - `pnpm exec vitest run src/shared/api/tts-api.test.ts src/shared/api/translation-api.test.ts src/shared/api/tauri-client.test.ts` passed: 3 files, 29 tests. - `pnpm typecheck` passed. - `pnpm check:architecture` passed. - `pnpm check:docs` passed: checked 40 docs and repo guidance files. - `pnpm build` passed with the existing large chunk warning. - `pnpm graphify:patch` passed. - `graphify update .` passed. - `git diff --check origin/refactor...HEAD` passed. - Graphify generated output was checked for local absolute path leaks. - Native Tauri/provider QA was not run; this PR only verifies wrapper contract behavior and build/import health. - Remote runtime smoke was not run against a live `marinara-server`; routing is covered by unit tests. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [x] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims Developer docs under `docs/developer/` were updated to list `tts-api.ts` and `translation-api.ts` in the shared API wrapper map. ## UI evidence No visible UI changes. This is a shared API wrapper migration slice. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:13:13 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5098
No description provided.