Skip to content

SEP Phase 1: TypeScript extension SDK + tool-path fixtures#145

Merged
brentrager merged 1 commit into
mainfrom
sep-phase1-sdk
Jul 3, 2026
Merged

SEP Phase 1: TypeScript extension SDK + tool-path fixtures#145
brentrager merged 1 commit into
mainfrom
sep-phase1-sdk

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

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. parameters accepts zod v4 (converted via z.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 via AbortSignal.
  • TransportsstdioTransport (ndjson over stdio, the real wire) and linkedPair (in-memory, for in-process tests).
  • createTestHost — drive an extension in-process (no subprocess): initialize, callTool (with onUpdate progress + AbortSignal cancel), sendEvent, ping, shutdown.
  • runConformance — spawn a real extension subprocess, handshake, and replay the shared fixtures, validating every reply against its schema.
  • hello demo extension (hello.greet) — zod schema, streamed tool/update progress, $/cancel cancellation.

Extends spec/extension/conformance/fixtures.json for the tool path (is_error/details results, message-only tool/update, invalid fixtures). Wired into pnpm-workspace.yaml and the typescript.yml CI lane (typecheck + test filters).

Verification

  • @smooai/smooth-extension-sdk: 15 tests (schema conversion, JSON-RPC leaf, full tool path via createTestHost, live runConformance against echo.mjs).
  • Full TS lane green locally: extension-sdk 15/15, server 132/132, typescript 35/35; typecheck clean across all three.
  • Paired with engine PR (smooth-operator-core) completing the Rust host tool path.

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

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-bot

changeset-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b58ccd6

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

@brentrager brentrager merged commit 940560b 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