Skip to content

@opencode-ai/sdk has broken package.json file #14381

@timnew

Description

@timnew

Description

The package.json has following content.

exports are points to ./dist/<file>, but actually in the package, the files are located under ./dist/src/<file>.

node_modules/@opencode-ai/sdk/
├── package.json
└── dist/
    ├── tsconfig.tsbuildinfo
    └── src/ 
        ├── index.js
        ├── index.d.ts
        ├── client.js  ← createOpencodeClient lives here
        ├── client.d.ts
        └── ...
{
  "$schema": "https://json.schemastore.org/package.json",
  "name": "@opencode-ai/sdk",
  "version": "1.2.9",
  "type": "module",
  "license": "MIT",
  "scripts": {
    "typecheck": "tsgo --noEmit",
    "build": "./script/build.ts"
  },
  "exports": {
    ".": {
      "import": "./dist/index.js",
      "types": "./dist/index.d.ts"
    },
    "./client": {
      "import": "./dist/client.js",
      "types": "./dist/client.d.ts"
    },
    "./server": {
      "import": "./dist/server.js",
      "types": "./dist/server.d.ts"
    },
    "./v2": {
      "types": {
        "import": "./dist/src/v2/index.d.js",
        "types": "./dist/src/v2/index.d.d.ts"
      },
      "default": {
        "import": "./dist/v2/index.js",
        "types": "./dist/v2/index.d.ts"
      }
    },
    "./v2/client": {
      "types": {
        "import": "./dist/src/v2/client.d.js",
        "types": "./dist/src/v2/client.d.d.ts"
      },
      "default": {
        "import": "./dist/v2/client.js",
        "types": "./dist/v2/client.d.ts"
      }
    },
    "./v2/gen/client": {
      "types": {
        "import": "./dist/src/v2/gen/client/index.d.js",
        "types": "./dist/src/v2/gen/client/index.d.d.ts"
      },
      "default": {
        "import": "./dist/v2/gen/client/index.js",
        "types": "./dist/v2/gen/client/index.d.ts"
      }
    },
    "./v2/server": {
      "import": "./dist/v2/server.js",
      "types": "./dist/v2/server.d.ts"
    }
  },
  "files": [
    "dist"
  ],
  "devDependencies": {
    "@hey-api/openapi-ts": "0.90.10",
    "@tsconfig/node22": "22.0.2",
    "@types/node": "22.13.9",
    "typescript": "5.8.2",
    "@typescript/native-preview": "7.0.0-dev.20251207.1"
  },
  "dependencies": {},
  "publishConfig": {
    "directory": "dist"
  }
}

Plugins

N/A

OpenCode version

1.2.9

Steps to reproduce

N/A

Screenshot and/or share link

N/A

Operating System

N/A

Terminal

N/A

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