Skip to content

feat: add @opencode-ai/models sdk#3016

Merged
vimtor merged 4 commits into
devfrom
npm-package
Jul 6, 2026
Merged

feat: add @opencode-ai/models sdk#3016
vimtor merged 4 commits into
devfrom
npm-package

Conversation

@vimtor

@vimtor vimtor commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds the official Models.dev TypeScript SDK as @opencode-ai/models.

SDK

  • zero-dependency Promise client for /api.json, /models.json, and /catalog.json
  • optional Effect client at @opencode-ai/models/effect
  • bundled offline catalog at @opencode-ai/models/snapshot
  • hand-written public types checked for exact compatibility with core Zod schemas
  • generated model-family types
  • browser-safe requests with custom fetch, headers, abort signals, and structured errors

Packaging

  • renames the internal workspace package to @models.dev/core
  • publishes compiled ESM and declarations from dist
  • builds automatically during npm pack and includes the MIT license
  • keeps the root client independent of Effect, Zod, core, and snapshot data

Releases

  • adds manual semver and daily data-release workflows
  • derives versions from npm rather than storing release versions in git
  • skips scheduled releases when snapshot data is unchanged
  • publishes with npm trusted publishing and provenance
  • propagates registry failures and restores locally modified release files safely

Verification

  • bun validate
  • cd packages/sdk && bun run test (23 tests)
  • cd packages/sdk && npm pack --dry-run --json
  • Node import smoke tests for root, snapshot, and Effect entrypoints
  • cd packages/web && bun run build

Release Setup

@opencode-ai/models@0.0.1 is currently a placeholder, so the first SDK release will be 0.0.2. Before publishing, configure npm trusted publishing for anomalyco/models.dev and .github/workflows/publish-sdk.yml.

@vimtor vimtor changed the title feat: add models.dev sdk feat: add @opencode-ai/models sdk Jul 6, 2026
@vimtor vimtor changed the title feat: add @opencode-ai/models sdk feat: add @opencode-ai/models sdk Jul 6, 2026
@vimtor vimtor merged commit 7f069c7 into dev Jul 6, 2026
1 check passed
@vimtor vimtor deleted the npm-package branch July 6, 2026 13:35
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