SEP Phase 3 (SDK + spec): ui/request surface + todo demo#149
Merged
Conversation
🦋 Changeset detectedLatest commit: 9146cb8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Phase 1/2 gave extensions tools + hooks + events, but no way to render UI. Phase 3 adds the capability-negotiated
ui/requestsurface to the TS SDK and rounds out the spec fixtures.Solution
smooth.hasUI(kind)/ctx.hasUI(kind)read the host'sui_capabilitiesfrom theinitializehandshake;ctx.ui(andsmooth.ui) speakui/requestback to the host —select/confirm/inputreturn the answer (or{ cancelled }),notify/setStatus/setWidget/setTitlepush. Headless host →RpcError-32001 NoUI.createTestHost(ext, { onUiRequest })scripts the host side (default = headless).todo(pi's todo, ported) — a stateful list whose tools push akeyvalueset_widgetrender block and whosecleargates aconfirm, both behindhasUI, so it degrades headless.ui/requestfixtures — the remaining kinds, select/input/cancelled results, and invalid cases.Verification
@smooai/smooth-extension-sdk: typecheck clean; 22 tests green (7 new intest/ui.test.tscovering gating, round-trip, decline, widget, and the headless NoUI reject).@smooai/smooth-operator:extension-conformancegreen — every new valid fixture validates, every invalid one is rejected.Consumes the engine's Phase 3
ui_capabilitiesthreading (smooth-operator-core#27). Hosted by smooth-code +th extin the smooth repo.🤖 Generated with Claude Code