Skip to content

feat!: retire legacy connection APIs and clean up package builds - #294

Merged
benbrandt merged 1 commit into
mainfrom
feat/retire-legacy-sdk-api
Oct 19, 2026
Merged

benbrandt merged 1 commit into
mainfrom
feat/retire-legacy-sdk-api

Conversation

@benbrandt

Copy link
Copy Markdown
Member

Summary

Finish retiring the deprecated v1 API before the 2.0 release: one supported integration model—app builders, typed handlers, and peer contexts—across the stable and unstable profiles. The four protocol entrypoints and wire schemas are unchanged by this PR.

API cleanup and migration parity

  • Remove AgentSideConnection, ClientSideConnection, the Agent / Client implementation interfaces, outbound extension aliases, and compatibility-only adapters.
  • Remove LegacyAgentFactory, createLegacyAgent, and the connection-class connector helper. Removed server options fail explicitly, including per-request and WebSocket-upgrade overrides.
  • Preserve v1 terminal ergonomics through AgentContext.createTerminal(...) and the existing TerminalHandle, including async disposal.
  • Support raw extension dispatch with onRequest("*", handler) and onNotification("*", handler). Fallback params are unknown; exact and dynamic handlers take precedence, and v2 initialization guards still apply. Handler contexts expose the actual method.
  • Simplify the binding projector now that legacy registries and API declarations no longer need special handling.
  • Migrate existing tests and examples to the app API. Existing parity cases now exercise stdio versus in-process connections rather than two public API styles.

Production build and package boundaries

  • Separate whole-project typecheck from clean, production-only emission with tsconfig.build.json.
  • Run source tests once, without compiled duplicates. Tests, fixtures, and examples remain typechecked but are not published.
  • Verify the packed file allowlist, all public entrypoints, and relative runtime/declaration dependencies in CI and before publishing.
  • Reduce the npm package from 224 to 134 files.

Updates the migration guide and README. The migration guide remains included in npm. Version metadata is intentionally unchanged; Release Please owns the release bump.

Related: #233. This refreshes the package-boundary work for the four-entrypoint layout; it does not close that PR automatically. Rebased onto current main, including #291.

Review and validation

  • npm run check after rebasing: 488 tests across 20 source files, generation verification, lint, formatting, spellcheck, whole-project typechecking, clean production build, package verification, and all four TypeDoc verification passes.
  • npm run docs:ts:build: all four references build without warnings.
  • Fresh installed-tarball runtime checks with Zod 4.0.0 and 3.25.76 for all four protocol entrypoints, fallback dispatch, exact-handler priority, reverse requests, terminal lifecycle/disposal, and removed server-option rejection.
  • Strict declaration emission in NodeNext and bundler modes, without skipLibCheck, plus downstream consumption of the emitted declarations with both Zod versions.
  • Protocol JSON inputs and generated schema types/validators remain unchanged.
  • Additional implementation-pass probes cover connection registration snapshots, dynamic-handler precedence/disposal, fallback cancellation, v2 initialization guards, 20 rejected unsafe projection shapes per protocol version, and rejection of missing transitive package imports.
  • git diff --check; clean working tree.

The prior 976 executions included compiled duplicates; the unique source-test count remains 488. No new repository test cases were added. Live third-party-agent interoperability was not exercised.

GitHub reports three existing high-severity dependency alerts on the default branch. Dependency versions are not changed here; those alerts need separate triage before the release.

BREAKING CHANGE: The legacy v1 connection classes, implementation interfaces, extension aliases, legacy server factory, and connector helper are removed. Use agent() / client() apps and peer-context request() / notify() calls. Compiled tests, fixtures, and examples are no longer shipped. See MIGRATION_STABLE_UNSTABLE.md for migration instructions.

Use app builders, typed handlers, and peer contexts for all protocol bindings. Preserve terminal handles and raw extension fallbacks, remove compatibility-only generation rules, and verify production package contents in CI and publishing.

BREAKING CHANGE: AgentSideConnection, ClientSideConnection, Agent, Client, LegacyAgentFactory, createLegacyAgent, and their extension aliases and connector helper have been removed. Use agent()/client() apps and peer-context request()/notify() calls. Compiled tests, fixtures, and examples are no longer published. See MIGRATION_STABLE_UNSTABLE.md for migration instructions.
@benbrandt
benbrandt enabled auto-merge (squash) October 19, 2026 17:19
@benbrandt
benbrandt merged commit 52edc15 into main Oct 19, 2026
6 checks passed
@benbrandt
benbrandt deleted the feat/retire-legacy-sdk-api branch October 19, 2026 17:20
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