Skip to content

bug: typecheck CI fails on all PRs due to missing SDK v2 dist types #14688

@AJIredale

Description

@AJIredale

Description

The typecheck CI job is failing on every open PR that touches any file in packages/opencode. The errors all look like this:

Module '"@opencode-ai/sdk/v2"' has no exported member 'TextPart'
Module '"@opencode-ai/sdk/v2"' has no exported member 'AssistantMessage'
'@opencode-ai/sdk/v2' has no exported member named 'createOpencodeClient'

The root cause is in packages/sdk/js/package.json. The exports map for ./v2, ./v2/client, and ./v2/gen/client points the types field at ./dist/v2/*.d.ts files, but the dist/v2/ directory is not committed to the repo (it is a build artifact). TypeScript resolves types from the types field and fails because the files do not exist.

All the types are present in the source -- the export map just needs to point at the source .ts files directly, which is how every other export in the same file already works.

Plugins

No response

OpenCode version

No response

Steps to reproduce

  1. Open any PR against the dev branch that touches a file in packages/opencode
    1. Wait for the typecheck CI job to run
    1. It fails with "Module has no exported member" errors for types from @opencode-ai/sdk/v2

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions