Skip to content

refactor: split the AssemblyAI API client into its own library - #229

Merged
alexkroman merged 6 commits into
mainfrom
jhe/assemblyai-sdk
Oct 15, 2026
Merged

alexkroman merged 6 commits into
mainfrom
jhe/assemblyai-sdk

Conversation

@he-james

@he-james he-james commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

What & why

Starts the AssemblyAI Swift SDK: a second library in the package, AssemblyAI, that BlurtEngine is built on. It holds only the generic API client, so it can be pulled out later; the engine keeps every Blurt decision.

AssemblyAI (new) BlurtEngine (unchanged role)
HTTPTransport + ChunkedRequestBody Prompts (STTPrompt, KeytermsBoost), CleanupInstruction, styles
Dictation wire types, DictationMultipart Key storage, logging, User-Agent
APIKeyValidator AssemblyAITranscriber, which composes the two

A pure move: no request, header or response handling changes.

  • Wire types un-nest from AssemblyAITranscriber and become public.
  • The validator takes its User-Agent as a parameter; APIKeyValidator.blurt() adds Blurt's, and both apps use it, so desktop key checks still send Blurt/<version> (…).
  • Removes SyncSTTLimits.pcmBytes(forSeconds:), whose only caller moved.

Stacked on #228.

How it was tested

  • swift test: 710/710, including the suites that pin the multipart framing, wire keys, chunked upload and User-Agent; one new test pins the SDK validator's agent handling.

  • Mac app builds in Debug and Release (unsigned); periphery clean; iOS gates pass (134/134).

  • Engine coverage locally 88.05%, unchanged in practice (the gate reads lower on this machine than on CI, as on main).

  • I read AGENTS.md and this doesn't reintroduce anything deliberately removed

  • Docs updated (AGENTS.md map, engine README, Sources/AssemblyAI/README.md)

🤖 Generated with Claude Code

he-james and others added 4 commits October 2, 2026 16:55
Gets the iPhone app ready for TestFlight.

- Bundle ids move from the dev.alex placeholders to
  com.assemblyai.blurt.ios (app, .keyboard, .core, .tests, .probe), the
  App Group to group.com.assemblyai.blurt.ios, and the term-pack type to
  com.assemblyai.blurt.terms. The Darwin notification names, log
  subsystem, queue labels and scripts follow. The Mac app keeps its
  dev.alex ids: changing them would orphan Sparkle updates and its
  granted Accessibility permission.
- API-key entry is no longer debug-only. Sign in with AssemblyAI
  doesn't exist yet, so a TestFlight build had no way to add a key. The
  setup card and Settings now offer "Paste your key" and "Get a free
  key" in every build, as the Mac app does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
App Review 5.1.2(i) requires clearly disclosing where personal data
goes, third-party AI included, and getting explicit permission first.

The listening window now won't open until the user agrees, in a sheet
that names AssemblyAI, lists what is sent (the voice while dictating,
the text before the cursor, recent dictations, key terms with contact
names) and links the privacy policy. Every path to the microphone goes
through startListening(), so one gate covers the button, the keyboard's
blurt://start and in-app dictation. Consent is versioned (AIConsent):
sending something new means a new version, and everyone is asked again.

Settings' About section links the privacy policy too. The debug
-BlurtStartListening flag grants consent, since scripted runs can't tap
through the sheet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The iPhone project pulled the app icon and the wordmark straight out of
the Mac app's folder, so a Mac-side move or rename would have broken
the iPhone build. Both now live in a top-level Design/brand that each
project references directly; neither app's folder is a dependency of
the other.

The Mac project lists them explicitly (it used to get them by including
its whole Blurt folder) and its project.pbxproj is regenerated. Both
app bundles still carry the icon and logo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The package gains a second library, AssemblyAI, that BlurtEngine is
built on: the HTTPTransport seam and its streamed upload body, the
dictation wire types and multipart framing, and APIKeyValidator. It
holds no Blurt policy, so it can become a standalone Swift SDK; the
engine keeps everything that is a Blurt decision (the prompts, the
cleanup instruction and styles, key storage, logging, the User-Agent).

A pure move: no request, header or response handling changes. The
wire types un-nest from AssemblyAITranscriber and become public, the
SDK gets its own logger and URL helper, and the validator takes its
User-Agent as a parameter. APIKeyValidator.blurt() is where Blurt's
agent joins it, and both apps now use it, so their key checks still
send `Blurt/<version> (…)`. A new test pins that the SDK's validator
sends only the agent it's given.

SyncSTTLimits.pcmBytes(forSeconds:) goes: its one caller, the upload
buffer, now lives in the SDK and states its own size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@he-james
he-james requested review from alexkroman and nbisht-aai and removed request for nbisht-aai October 2, 2026 22:39
@he-james
he-james marked this pull request as ready for review October 2, 2026 22:40
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@he-james
he-james force-pushed the jhe/assemblyai-sdk branch from 29ba1d3 to c552cd0 Compare October 2, 2026 23:11
Base automatically changed from ios/shared-brand-assets to main October 14, 2026 21:52
Resolves App/BlurtiOS/project.yml: keeps this branch's AssemblyAI product
link and main's per-target TARGETED_DEVICE_FAMILY "1", camera purpose
string, build 2 (#245) and Design/brand paths (#228).

main's new read-aloud code (#225) uses HTTPTransport, which this branch
moves into the AssemblyAI module, so ReadAloudLLM.swift and the tests that
reach it (ReadAloudLLMTests, AssemblyAISpeechSynthesizerTests,
AssemblyAITranscriberTests, AsyncStreamFixtures) now import AssemblyAI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alexkroman
alexkroman merged commit efd3735 into main Oct 15, 2026
13 checks passed
@alexkroman
alexkroman deleted the jhe/assemblyai-sdk branch October 15, 2026 00:04
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.

3 participants