Skip to content

SEP Phase 3 (SDK + spec): ui/request surface + todo demo#149

Merged
brentrager merged 1 commit into
mainfrom
sep-phase3-ui
Jul 3, 2026
Merged

SEP Phase 3 (SDK + spec): ui/request surface + todo demo#149
brentrager merged 1 commit into
mainfrom
sep-phase3-ui

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

Problem

Phase 1/2 gave extensions tools + hooks + events, but no way to render UI. Phase 3 adds the capability-negotiated ui/request surface to the TS SDK and rounds out the spec fixtures.

Solution

  • SDK: smooth.hasUI(kind) / ctx.hasUI(kind) read the host's ui_capabilities from the initialize handshake; ctx.ui (and smooth.ui) speak ui/request back to the host — select/confirm/input return the answer (or { cancelled }), notify/setStatus/setWidget/setTitle push. Headless host → RpcError -32001 NoUI. createTestHost(ext, { onUiRequest }) scripts the host side (default = headless).
  • Demo: todo (pi's todo, ported) — a stateful list whose tools push a keyvalue set_widget render block and whose clear gates a confirm, both behind hasUI, so it degrades headless.
  • Spec: fills out ui/request fixtures — the remaining kinds, select/input/cancelled results, and invalid cases.

Verification

  • @smooai/smooth-extension-sdk: typecheck clean; 22 tests green (7 new in test/ui.test.ts covering gating, round-trip, decline, widget, and the headless NoUI reject).
  • @smooai/smooth-operator: extension-conformance green — every new valid fixture validates, every invalid one is rejected.

Consumes the engine's Phase 3 ui_capabilities threading (smooth-operator-core#27). Hosted by smooth-code + th ext in the smooth repo.

🤖 Generated with Claude Code

@changeset-bot

changeset-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9146cb8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@smooai/smooth-extension-sdk Minor
@smooai/smooth-operator Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Extension SDK gains the capability-negotiated UI surface: hasUI gating reads the
host's ui_capabilities from the initialize handshake, and ctx.ui/smooth.ui speak
ui/request (select/confirm/input/notify/setStatus/setWidget/setTitle) back to the
host, with -32001 NoUI on a headless frontend. createTestHost gains onUiRequest.
Ships the todo demo (widget render block + gated confirm). Extends the spec
conformance fixtures with the remaining ui kinds, results, and invalid cases.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@brentrager brentrager merged commit a36ee69 into main Jul 3, 2026
6 checks passed
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