Skip to content

[v4/p1b-provider-name-web-types] refactor!: remove ProviderName and generate the web wire types with ts-rs - #244

Closed
cunninghamcard-bit wants to merge 8 commits into
masterfrom
v4/p1b-provider-name-web-types
Closed

cunninghamcard-bit wants to merge 8 commits into
masterfrom
v4/p1b-provider-name-web-types

Conversation

@cunninghamcard-bit

Copy link
Copy Markdown
Contributor

Requested by li

Summary

Before: the repo ships a generated ProviderName union in every binding, and the web console has hand-written wire types.

After: ProviderName is removed (CHANGELOG records it as breaking), and the web console uses wire types generated with ts-rs and imports the core types through an alias.

Type of change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change
  • New provider
  • New / updated binding
  • Docs / RFC

Notes for reviewers

  • Part 2 of 3 split out of [v4/p1-prep] chore!: prepare the AI SDK V4 migration #235 for review. Base master.
  • The two halves stay together: the ts-rs change to scripts/gen_ts_types.py drops the ProviderName.ts exclusion, so it only makes sense once ProviderName is gone.
  • Same 8 commits as refactor/web-wire-types (527074b), unchanged.
  • cargo test --workspace has not been run on this branch yet.

🤖 Generated with Claude Code

cunninghamcard-bit and others added 8 commits October 11, 2026 16:30
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
(cherry picked from commit 758d0bc)
The returned impl Iterator is already must_use, so clippy's
double_must_use rejected it.

(provider.rs part of commit 8397424)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A3WxDBWBA4ituJjXsHaEAa
…e removal

- scripts/gen_providers_doc.py: the `provider_name` module no longer exists;
  the docstrings and the section-header guard now name only `provider`.
  `--check` output is unchanged.
- docs/internal/phase4-audit.md: add a follow-up note (same style as
  RFC-0020) so the historical audit no longer reads as if the generated
  ProviderName types and their drift tests still exist.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGwanvo9WLU9HWD7sRR8TS
(cherry picked from commit dfcd54f)
The A2 line said Node would keep a generated string-literal union for
completion. It does not: overlay-registered provider names can never be
part of a compile-time union, so keeping one would keep the second name
path this PR removes. Record the actual A2 scope.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGwanvo9WLU9HWD7sRR8TS
(cherry picked from commit 3e2d9fc)
…ia alias

- Wire*.ts were hand-maintained mirrors of wire.rs and had already drifted
  (WireContentPart lacked provider_executed). Derive TS on the wire structs
  and export them to web/src/types/generated/ through gen_ts_types.py, which
  now handles two targets and checks both in CI.
- Core types resolve through the @aimux/types tsconfig alias instead of
  five-level relative paths into bindings/node.
- gen_ts_types.py sync no longer rewrites files that differ only by ts-rs
  end-of-line spaces.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
(cherry picked from commit 69c1351)
- Drop the redundant #[must_use] on provider_names(); the returned
  impl Iterator is already must_use, so clippy::double_must_use failed CI.
- Gate the wire types' ts-rs export tests behind a ts-export feature that
  only gen_ts_types.py enables. A plain cargo test previously wrote
  Wire*.ts into bindings/node/src/types via the workspace-wide
  TS_RS_EXPORT_DIR, which made gen_ts_types.py --check fail on stale files.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
(cherry picked from commit 8397424)
@cunninghamcard-bit
cunninghamcard-bit deleted the v4/p1b-provider-name-web-types branch October 13, 2026 02:14
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.

2 participants