SEP Phase 1: TypeScript extension SDK + tool-path fixtures#145
Merged
Conversation
Add @smooai/smooth-extension-sdk — the TS SDK for building SEP extensions. defineExtension/defineTool (zod v4 z.toJSONSchema + raw JSON-Schema/TypeBox pass-through), a symmetric JSON-RPC 2.0 Peer, ndjson stdio transport plus an in-memory linkedPair, createTestHost (in-process scripted host), runConformance (replays the shared fixtures against a real extension subprocess), and the hello demo extension (hello.greet: zod schema, streamed tool/update progress, $/cancel cancellation). Wired into pnpm-workspace + the typescript CI lane. Extends spec/extension/conformance/fixtures.json for the tool path: is_error and details tool results, a message-only tool/update, and invalid fixtures. Plan: /Users/brentrager/.claude/plans/greedy-yawning-petal.md Phase 0: spec #142, engine host core#21. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SqrZj2fVMqiHbSJSte3XbA
🦋 Changeset detectedLatest commit: b58ccd6 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
SEP Phase 0 shipped the protocol spec (
spec/extension/, PR #142) and the Rust engine reference host (smooth-operator-core#21). Phase 1 needs the developer-facing surface: a TypeScript SDK so extensions can actually be written, tested, and conformance-checked, plus the tool-path completed end to end.Solution
New published package
@smooai/smooth-extension-sdk(typescript/extension-sdk/):defineExtension/defineTool— declare an extension and its tools.parametersaccepts zod v4 (converted viaz.toJSONSchema()), TypeBox, or raw JSON Schema (pass-through) — the wire truth is always JSON Schema.Peer— a symmetric JSON-RPC 2.0 endpoint (both sides issue requests); the shared core the runtime and test host are built on. Inbound-request cancellation via$/cancel, outbound cancellation viaAbortSignal.stdioTransport(ndjson over stdio, the real wire) andlinkedPair(in-memory, for in-process tests).createTestHost— drive an extension in-process (no subprocess):initialize,callTool(withonUpdateprogress +AbortSignalcancel),sendEvent,ping,shutdown.runConformance— spawn a real extension subprocess, handshake, and replay the shared fixtures, validating every reply against its schema.hellodemo extension (hello.greet) — zod schema, streamedtool/updateprogress,$/cancelcancellation.Extends
spec/extension/conformance/fixtures.jsonfor the tool path (is_error/detailsresults, message-onlytool/update, invalid fixtures). Wired intopnpm-workspace.yamland thetypescript.ymlCI lane (typecheck + test filters).Verification
@smooai/smooth-extension-sdk: 15 tests (schema conversion, JSON-RPC leaf, full tool path viacreateTestHost, liverunConformanceagainstecho.mjs).Plan:
/Users/brentrager/.claude/plans/greedy-yawning-petal.md· Phase 0: spec #142, engine host core#21.🤖 Generated with Claude Code
https://claude.ai/code/session_01SqrZj2fVMqiHbSJSte3XbA