Commit Graph
322 Commits
Author SHA1 Message Date
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
0xSelenicDove 8893ba81a6 fix(*): harden local service boundaries (#2062) 2026-07-17 17:50:50 +08:00
Neko Ayaka 089ca99108 release: v0.11.1 2026-07-17 03:35:49 +08:00
RainbowBird c74ed2ff7b fix(server): improve ai generation analytics correlation 2026-07-15 19:06:34 +08:00
RainbowBird 73258b5aba feat: align PostHog API host with airi.build 2026-07-14 23:18:49 +08:00
RainbowBird 2e9f9ca435 feat: add llm usage and stripe identity analytics (#2056) 2026-07-14 21:56:47 +08:00
RainbowBird 0e4dc69ec0 fix(analytics): normalize PostHog event semantics (#2041) 2026-07-10 13:54:23 +08:00
Neko 231eccf362 chore(server): update Grafana dashboard layout (#2039)
Authored-by-agent: Codex
2026-07-10 13:40:34 +08:00
RainbowBird 0642ede8d1 feat(analytics): expand PostHog coverage and forward server business facts (#2038)
## What

Closes the three structural gaps in AIRI's product analytics: the signup
surface had zero instrumentation, the payment funnel had no terminator
in PostHog, and SPA route changes emitted no pageviews. Also adds
semantic events for character cards, desktop-only features, and
data-maintenance actions.

## User paths

- User signs up / logs in / verifies email / resets password / links
OAuth / deletes account → each step now emits a PostHog event from
`apps/ui-server-auth` (previously fully uninstrumented), with
`identify()` wired on session load so anonymous funnel events merge into
the user person.
- User pays via Stripe → webhook writes `product_events` as before, and
the product-events service now forwards `payment_completed` (plus signup
and subscription lifecycle facts) to PostHog via posthog-node
`captureImmediate`, keyed by the Better Auth user id → the
`checkout_started → payment_completed` funnel closes end-to-end.
Per-request LLM/TTS volume is explicitly not forwarded.
- User navigates between routes in any surface (web / desktop / pocket /
docs) → `$pageview` + `$pageleave` fire per route change via the
posthog-js `defaults: '2025-05-24'` preset in the shared
`posthog.config.ts`.
- User creates / imports / duplicates / edits a ccv3 card, switches
stage background, runs destructive data actions (export / import / clear
chats, reset providers, wipe app data), or uses desktop differentiators
(Spotlight send, widget windows, in-app updater, MCP server management,
pairing QR) → dedicated low-cardinality events.

## Notable decisions

- Server forwarding defaults on: `POSTHOG_PROJECT_KEY` defaults to the
shared browser-safe phc_* project key; set it to an empty string to
disable. Postgres `product_events` remains the source of truth.
- Cross-surface events (`oauth_callback_failed`, account lifecycle)
share one stage vocabulary exported from stage-ui so the two emitters
cannot drift silently.
- Events captured right before full-page navigation use `sendBeacon` so
they survive the redirect (checkout, OAuth consent handoff, login
redirect).
- Removed dead wrappers (`trackSignup`, `trackFirstModelSelected`,
`trackModelChanged`) that duplicated live event streams under second
names.

## How tested

- `pnpm -F @proj-airi/server exec vitest run
src/services/domain/product-events.test.ts` — 6 passed, covering the
forwarding allowlist, the `user_signed_up → signup_completed` mapping,
non-forwarded per-request actions, and a throwing sink not failing the
webhook path nor losing the DB row.
- stage-ui suites (`use-analytics`, `use-linked-accounts`, exports
contract) — 22 passed, including new account/card/data/desktop event
assertions.
- Real transport smoke: posthog-node `captureImmediate` against
`us.i.posthog.com` with the production key resolved in 1380ms (one
`server_forwarding_smoke_test` event left in the project; filter by
event name).
- Browser-tested pageviews: `VITE_ENABLE_POSTHOG=true` dev build, two
`history.pushState` route changes each produced a `$pageview` with
`$pathname`, `navigation_type: pushState`, previous-page dwell time, and
the `surface` super property; batched POST to `us.i.posthog.com/e/`
returned 200. Note: posthog-js drops events from automated browsers
(`navigator.webdriver`) by default — the verification session bypassed
the bot filter locally; production config is untouched.
- Typecheck and lint pass for server, stage-ui, stage-pages, stage-web,
stage-tamagotchi, ui-server-auth.

Full verification record:
`apps/server/docs/ai-context/verifications/posthog-forwarding-and-pageview.md`

## Follow-ups (not in this PR)

- Bot channel usage stats (Discord / Telegram) once they route through
server-runtime counters.
- Main-process desktop events (tray menu, global shortcut fire) need
renderer relay plumbing.
- Confirm `payment_completed` arrives in PostHog after the first real
Stripe payment post-deploy.

https://claude.ai/code/session_01Q1yGavkQ1P41YhTWE4XKex
2026-07-08 15:33:39 +08:00
Neko Ayaka 3779eb6103 release: v0.11.0 2026-07-08 01:20:12 +08:00
RainbowBird 63532367a9 chore: remove admin dashboard 2026-07-02 02:22:16 +08:00
RainbowBird c7de38b121 refactor(server): split capability alias admin routes 2026-07-02 01:04:29 +08:00
RainbowBird 281614d396 fix(server): harden provider catalog gating 2026-07-01 23:08:14 +08:00
RainbowBird ed8c93c77b feat(server): apply official llm alias routing policy 2026-07-01 22:34:57 +08:00
RainbowBird 14fb183723 fix(server): gate streaming tts requests 2026-07-01 22:34:57 +08:00
RainbowBird 28f93c2c5d fix(server): expose official voice preview urls 2026-07-01 22:34:56 +08:00
RainbowBird b2d7442949 feat(server): enforce official asr aliases 2026-07-01 22:34:56 +08:00
RainbowBird feec4da1fa feat(server): generate official tts voice previews 2026-07-01 22:34:56 +08:00
RainbowBird 87baf622c9 feat(server): add official provider catalog management 2026-07-01 22:34:56 +08:00
Lovehsigure_520 2da9d37add feat(analytics): add official provider ops metrics
Build on existing pricing funnel events with official provider, TTS usage, second-turn activation, and Flux balance bucket metrics.
2026-07-01 21:19:42 +08:00
RainbowBird 3edbe4eb99 feat(tests): add createMockStripeCustomer function and update tests to use it 2026-07-01 20:28:18 +08:00
RainbowBird e1a2c51573 feat(speech): integrate Voice Pack model into speech catalog and update related tests 2026-07-01 20:18:13 +08:00
RainbowBird 0daac71435 feat(analytics): add p0 operations events 2026-07-01 20:16:06 +08:00
RainbowBird 27255001bd refactor: streamline speech module by removing voice pack dependencies
- Removed voice pack related imports and functionality from speech.vue and Stage.vue.
- Simplified speech input handling by eliminating voice pack parameters in speech store.
- Updated tests to reflect changes in voice pack handling and speech input resolution.
- Adjusted Airi card store to remove voice pack binding logic, focusing on speech configuration updates.
- Enhanced voice pack list item structure for clarity and maintainability.
2026-07-01 19:23:33 +08:00
RainbowBird c2aee68513 feat: add upstreamVoiceId to voice packs and related services
- Introduced upstreamVoiceId field in voice pack schema and database.
- Updated voice pack service to handle upstreamVoiceId in CRUD operations.
- Modified API routes and tests to accommodate upstreamVoiceId.
- Enhanced UI components to include upstreamVoiceId in forms and displays.
- Adjusted speech processing logic to utilize upstreamVoiceId where applicable.
- Updated related tests to ensure proper functionality with new field.
2026-07-01 16:07:33 +08:00
RainbowBird 4f80affcd3 feat(admin-dashboard): add support for Bedrock and OpenAI-compatible LLM slices in admin router config
- Implemented `buildBedrockSlice` function to handle multi-kilobyte Bedrock bearer tokens.
- Enhanced `createAdminRouterConfigService` to classify Bedrock and OpenAI-compatible LLM upstreams by baseURL.
- Added new interfaces for `AdminRouterBedrockSlice` and `AdminRouterOpenAICompatibleSlice`.
- Updated router config form to support Bedrock and OpenAI-compatible slices.
- Created tests for Bedrock and OpenAI-compatible slice compilation and behavior.
- Modified UI components to accommodate new slice types and improve user experience.
- Ensured proper normalization of API server URLs to HTTPS when necessary.
2026-07-01 02:14:12 +08:00
Lovehsigure_520 3d7a8300d8 feat(analytics): add product instrumentation for activation and voice flows (#2023) 2026-06-30 23:36:08 +08:00
RainbowBird 8036501fb0 feat(server): add default TTS model handling and update related tests 2026-06-28 16:55:09 +08:00
Lovehsigure_520 16d50433b9 fix(server): auth UI callback trust (#1976) 2026-06-14 17:34:43 +08:00
RainbowBird 3215687e98 feat(server): add Aliyun NLS ASR gateway and official transcription provider (#1970) 2026-06-14 04:22:07 +08:00
RainbowBird 8e572ad93c feat(server): add stepfun tts provider
Signed-off-by: RainbowBird <git@luoling.moe>

Commit-Message-Assisted-by: Claude (via Claude Code)
2026-06-11 00:23:04 +08:00
RainbowBird 5bf6deab89 feat(admin-ui): load and edit router config from forms
Add a form-first LLM/TTS router config editor and a redacted admin config snapshot so operators can inspect configKV state before applying changes.

Preserve existing encrypted key entries when loaded slices are submitted without new plaintext keys.

Signed-off-by: RainbowBird <git@luoling.moe>
Commit-Message-Assisted-by: Claude (via Claude Code)
2026-06-11 00:14:34 +08:00
RainbowBird 16f9aaa4e3 feat(auth): enhance OAuth linking flow with account selection and error handling
- Added `prompt: 'select_account'` for Google and GitHub providers to force account selection during OAuth linking.
- Introduced localized error messages for account linking issues in multiple languages.
- Implemented a function to resolve OAuth error codes to specific i18n keys for better user feedback.
- Updated account settings page to display relevant error messages based on OAuth linking status.
2026-06-10 16:42:13 +08:00
RainbowBird a331d3a42a feat(auth): update AUTH_UI_URL to point to accounts.airi.build 2026-06-09 18:01:34 +08:00
RainbowBird 7fa7f8a072 feat(admin-ui): update admin UI URLs to remove trailing slashes and adjust redirects 2026-06-09 17:46:58 +08:00
RainbowBird 2ac4e90d56 feat(auth): add account linking support for different email providers 2026-06-09 17:46:51 +08:00
RainbowBird 11b820a77f feat(admin-ui): implement standalone admin UI with Cloudflare Pages deployment 2026-06-09 17:09:06 +08:00
RainbowBird 57ba232432 feat(auth): migrate auth ui to unique domain 2026-06-09 00:15:34 +08:00
Lulu ff7c18694a chore(server): remove unused CLIENT_URL from env template (#1884) 2026-06-08 13:52:19 +08:00
RainbowBird 9382a12137 chore: cleanup and lint fix 2026-06-07 20:31:22 +08:00
RainbowBird 4de2aef746 chore(server): type issues 2026-06-07 19:53:44 +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 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 7549d4e9fb feat(docker): add build step for deps in Dockerfile 2026-06-06 00:41:06 +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 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