directive-over-SEP + image-through-SEP (additive)#236
Merged
Conversation
Unblocks the ADR-092 copilot convergence P3 — the two capabilities that work on api-prime's REST run_turn but not on the streaming SEP path. directive-over-SEP: tools return a client Directive (navigate/apply_view) that the streaming eventual_response dropped. Reuse the citation-sink pattern — a directive_sink Arc<Mutex<Value>> on ToolProviderContext (facade), drained after the turn into TurnResult.directive, emitted on eventual_response ONLY when a host tool wrote one (omitted otherwise → back-compat). No core release: the monorepo's CoreToolAdapter writes the tool's directive into the sink after the pin bump. image-through-SEP: send_message gains optional images[]; TurnRequest.images (Vec< UserImage>) threads to AgentConfig::with_user_images (the vision LLM) AND ToolProviderContext.images (so a host tool's ToolCtx.images sees it — the crm.scan_business_card path). Core 0.16.2 already has with_user_images/ImageContent (verified). handler parses images fail-soft. All additive: images/directive are optional (not in `required`), old clients skip them, TurnRequest.images defaults empty (text-only unchanged). spec/ schemas + regenerated TS SDK types. Single MINOR changeset (repo lockstep-stamps all crates). Verified: server + facade build/test green (new eventual_response directive tests + context builder tests); workspace builds; changed files clippy-clean; TS generate + typecheck green. Follow-ups (pre-release): Go/Python/.NET SDK regen (only TS done here); monorepo consumes after publish (pin bump + CoreToolAdapter writes directive_sink + threads ctx.images → ToolCtx.images + copilot-ws sets TurnRequest.images). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WEUZgsyfGVab8uqSFPbr23
🦋 Changeset detectedLatest commit: e00b4f3 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.
Context
Unblocks the ADR-092 copilot convergence (SmooAI monorepo). Two capabilities work on api-prime's REST
run_turnbut were dropped on the streaming SEP path: the client directive (navigate/apply_view) tools return, and image input (business-card photo). Adding both, additively.directive-over-SEP
Reuses the existing citation-sink pattern — a
directive_sink: Arc<Mutex<Value>>onToolProviderContext(facade), drained after the turn intoTurnResult.directive, emitted oneventual_responseonly when a host tool wrote one (omitted otherwise → back-compat). No core release: on this crate nothing writes the sink (it stays null →directivealwaysNone), so the wire is unchanged until the monorepo'sCoreToolAdapterwrites the tool's directive into the sink after the pin bump.image-through-SEP
send_messagegains optionalimages[];TurnRequest.images(Vec<UserImage>) threads toAgentConfig::with_user_images(the vision LLM) andToolProviderContext.images(so a host tool'sToolCtx.imagessees it — thecrm.scan_business_cardpath). Core0.16.2already haswith_user_images/ImageContent(verified). Handler parsesimagesfail-soft (malformed/absent → empty, never rejects the turn).Additive / back-compat
images/directiveare optional (not inrequired), old clients skip them,TurnRequest.imagesdefaults empty (text-only unchanged).spec/schemas + regenerated TS SDK types (SendMessageRequest.images?,EventualResponse.directive?).Verification
cargo build/testgreen forsmooth-operator-server+smooth-operator(neweventual_responsedirective tests + context builder tests);cargo build --workspacegreen; changed files clippy-clean;cargo fmtclean.generate+typecheckgreen.sync-versions.mjs).sort_byinadapters/in-memory+dynamodb) is red under local clippy 1.96 — not touched by this PR, present onmain(norust-toolchain.tomlpin).After publish (monorepo)
Bump
smooai-smooth-operator{,-server}+ npm SDK pins;CoreToolAdapterwrites the tool'sdata.directiveintoToolProviderContext.directive_sink+ threadsctx.images→ToolCtx.images;copilot-wssetsTurnRequest.imagesfrom the SEPimages. That lights up copilot nav + business-card scanning onsmooth-operator.smoo.ai.🤖 Generated with Claude Code