Skip to content

feat(server,sdk): asset transcription service + OpenAI-compatible backend (MEET-2) - #367

Merged
eliotlim merged 6 commits into
feat/meet-1-audio-assetsfrom
feat/meet-2-transcribe
Oct 4, 2026
Merged

eliotlim merged 6 commits into
feat/meet-1-audio-assetsfrom
feat/meet-2-transcribe

Conversation

@eliotlim

@eliotlim eliotlim commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator

Problem

No speech-to-text existed anywhere in OpenBook; the meeting block needs per-chunk transcription with a local-first provider policy. Board: MEET-2.

Solution

Adds POST /api/ai/transcribe ({assetId, pageId} → {text, segments (s), durationMs}), request-scoped like aiComplete (no queue). AiConfig.transcription {provider: off|local|openai-compat, baseUrl?, model?, apiKey?} persisted in settings with write-only key semantics (responses expose only apiKeySet). One OpenAI-compatible multipart code path (/v1/audio/transcriptions, verbose_json) serves OpenAI cloud and any local compatible server. Resolution: explicit cloud > injected local resolver (MEET-3 seam: TranscriptionEngine, lazy 3rd AiService ctor arg) > mock > actionable 400. Cloud is paid-gated before any egress; local/mock ungated. Usage rows logged. sdk gains transcribeAsset; LocalDataClient rejects it. No new deps.

Key files: packages/server/src/ai/{routes,service,providers,usage}.ts, packages/sdk/src/ai.ts, packages/sdk/src/client.ts, packages/server/src/transcription.test.ts.

Before / After

Behavior Before After
POST /api/ai/transcribe 404 200 {text,segments,durationMs} via configured backend — transcription.test.ts
API key exposure n/a write-only; blank keeps / null clears; never echoed; sanitized 502s
Unreadable/missing asset n/a uniform 404 (no existence oracle, 5 permutations tested)
Guest on claimed instance, cloud configured n/a 403 before any upstream fetch

No visual change.

Test procedure

VITEST_MAX_WORKERS=1 pnpm verify (4,208 passed/6 skipped; server e2e 256, MCP e2e 70). Targeted: pnpm --filter @book.dev/server vitest run src/transcription.test.ts (10 tests).

Operational notes

No env vars, no migration. Default transcription = local (lands in MEET-3; until then unconfigured → actionable 400 pointing at Settings → AI). baseUrl is owner-gated, credential-free http(s), no private-IP block (matches existing owner-gated model-download precedent). 5-min upstream timeout; client abort propagated. Merge AFTER #366; the ableOidc.test.ts fixture hunk is byte-identical to #366's except a comment (keep this branch's wording — PAT expiry uses the database clock).


Verify: green serialized (flaky-under-load money.test.ts documented, untouched). Reviews cleared: security (Sasha), code (Quinn).

🤖 Generated with Claude Code

@vercel

vercel Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
app.book.pub Ready Ready Preview Oct 4, 2026 2:12pm UTC

Request Review

# Conflicts:
#	packages/server/src/ableOidc.test.ts
@eliotlim
eliotlim changed the base branch from main to feat/meet-1-audio-assets October 4, 2026 14:08
@eliotlim
eliotlim merged commit 2984448 into feat/meet-1-audio-assets Oct 4, 2026
11 of 12 checks passed
@eliotlim
eliotlim deleted the feat/meet-2-transcribe branch October 4, 2026 14:09
eliotlim added a commit that referenced this pull request Oct 5, 2026
…2) (#366)

* docs: record audio asset worker brief (MEET-1)

* feat(server,sdk): support audio assets (MEET-1)

* test(server): keep OIDC gate fixture PAT unexpired (MEET-1)

* docs: report audio asset verification (MEET-1)

* chore: drop worker docs (MEET-1)

* docs(sdk): fix asset allowlist comment (MEET-1)

* feat(server,sdk): asset transcription service + OpenAI-compatible backend (MEET-2) (#367)

* feat(server,sdk): add asset transcription service and backend (MEET-2)

* test(server): keep OIDC access-gate PAT fixture valid (MEET-2)

* docs: report MEET-2 implementation and verification blocker

* docs: record green serialized verification for MEET-2

* chore: drop worker artifacts (MEET-2)

This branch was successfully deployed

1 active deployment
Preview — 78dcd9dc Deployed Oct 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant