SEP Phase 4 (spec + SDK): commands, flags, shortcuts, session#151
Merged
Conversation
Spec: command-complete schema, context on session params (+ send_user_message deliver_as), flags delivery + shortcuts in initialize, new fixtures + $invalid cases, echo.mjs command support. SDK: registerCommand/registerFlag/ registerShortcut, CommandContext with bound session (sendMessage/ sendUserMessage/appendEntry), createTestHost runCommand/completeCommand + tier-guarded session service, runConformance command steps. Demo: plan-mode (flag + command + tool_call intercept + widget + appendEntry across reload). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: e859bc4 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 |
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 4 of the Smooth Extension Protocol adds the command surface (slash commands + autocomplete + flags + shortcuts) and session-mutating actions to the spec, the TS SDK, and a flagship demo that exercises phases 2–4 together.
Solution
Spec (
spec/extension/):command-complete.schema.jsonfor argument autocomplete.session.schema.jsonnow carries the dispatchcontexton every params object — the wire form of the command-tier + epoch guard the host enforces — and addssend_user_message(deliver_assteer/follow_up/next_turn).initialize.schema.jsongains aflagsdelivery map (params) and ashortcutslist +ShortcutRegistration(registrations).$invalidcases (sessioncontextrequired, completionvaluerequired).echo.mjsregisters a command + shortcut and answers command/execute + command/complete.SDK (
typescript/extension-sdk/):smooth.registerCommand(optionalcompletecompleter),registerFlag(+getFlag),registerShortcut.CommandContextbound to their command-tier context:session.sendMessage/sendUserMessage/appendEntry,ui,hasUI,args.createTestHost:runCommand,completeCommand, and asession/*service enforcing the same command-tier guard the engine does (event-tier → -32003), recording every session call.runConformancereplays command/execute + command/complete.Demo:
plan-mode— flag--plan+ command/plantoggle plan mode; atool_callintercept blocks write/edit/apply_patch/bash while on; each toggle pushes aset_widgetrender block and persists an LLM-invisibleappendEntry(survives a hot reload — the flag re-seeds state, the transcript keeps history).Verification
typecheck+testgreen across@smooai/smooth-operator(35, incl. the fixture-driven extension-conformance),@smooai/smooth-operator-server(132), and@smooai/smooth-extension-sdk(35, incl. the newcommand-pathsuite and the live-subprocessrunConformance). The Rust engine host that consumes this spec lands in smooth-operator-core#29.🤖 Generated with Claude Code