Amplifier SDK
A typed client for Amplifier's runtime stream
amplifier-app-newtui · sdk/python + sdk/typescript · v0.1.0
The amplifier-app-newtui repo — a full-screen Textual TUI for the Amplifier platform, built on amplifier-core and amplifier-foundation — serializes its normalized UIEvent queue as JSONL. The same surface the TUI renders is now a stable stream any host can consume.
And it just gained a first-class client →
On 2026-07-20, Michael J. Jabbour committed 5aa358d, "Implement priority-zero TUI hardening and SDKs" — the Python and TypeScript SDKs added side by side. The promise is concrete, not aspirational.
So why build a client at all? →
The stream is powerful but hostile to use directly. Without a client you re-parse JSON lines, re-check the schema version, guard against sequence drift, and rebuild every typed record and error mode yourself.
The SDK exists to remove exactly this →
Per kernel/jsonl.py, the wire envelope "only adds a stable, sequenced wire envelope around those events; it never reconstructs events or reaches into amplifier-core." The TUI, CI, and SDK therefore share one runtime behavior surface.
Here's how the SDK reaches it →
The client spawns one CLI process per run — Python uses subprocess.Popen(shell=False), TypeScript uses node:child_process spawn. The prompt goes over stdin; versioned JSONL comes back over stdout. No duplicated runtime logic.
And on the way back, it validates everything →
_validate_record rejects any schema_version != 1, enforces monotonic sequence numbers ("expected JSONL sequence N, got M"), and rejects unknown record types — converting a hostile stream into a validated, typed contract.
Which is what makes the payoff possible →
Each README quickstart is 7 non-blank lines of idiomatic, zero-runtime-dependency code. stream() yields typed records; run() returns a typed RunResult. Python dependencies = []; TypeScript ships only dev deps.
One pattern, generalized →
The TUI, CI, and your own app all build on the same runtime behavior surface. The SDK — AmplifierClient with stream() and run() over a 4-member typed record union — means no protocol archaeology required.
Shared surface + thin typed clients: the reusable win.
Primary source: michaeljabbour/amplifier-app-newtui (public GitHub), branch main, HEAD 19a0589. SDKs under sdk/python and sdk/typescript; wire protocol in src/amplifier_app_newtui/kernel/jsonl.py.
Feature status: SHIPPED — both packages declare v0.1.0; landed 2026-07-20 in commit 5aa358d.
Commands run:
gh repo view michaeljabbour/amplifier-app-newtui --json name,description,isPrivate,pushedAt,urlgit log --format='%h %ai %an %s' -- sdk/ ; git show 5aa358d --stat -- sdk/ (single commit, +859 across 10 files)wc -l sdk/python/src/amplifier_newtui_sdk/__init__.py (288) and wc -l sdk/typescript/src/index.ts (285), test/client.test.ts (117, 3 node:test cases)cat sdk/python/pyproject.toml ; cat sdk/typescript/package.json (Python dependencies=[]; TS devDependencies only)cat src/amplifier_app_newtui/kernel/jsonl.py (SCHEMA_VERSION 1; four record types)grep -n 'output-format' src/amplifier_app_newtui/main.py (click.Choice includes 'jsonl')grep -rin -E 'http server|fastapi|uvicorn|websocket|event-stream|EventSource' → zero matches (transport is subprocess + JSONL, not HTTP/SSE)Gaps: Publication to PyPI ("amplifier-newtui-sdk") / npm ("@amplifier/newtui-sdk") was not verified — no registry lookup was run. GitHub last push (2026-07-22) is after the local clone's HEAD.
Primary contributor: Michael J. Jabbour — sole author of SDK commit 5aa358d and repo HEAD. Python pyproject.toml declares author "Microsoft MADE:Explorations Team".