Skip to content

fix: avoid JSON import in ESM package#256

Draft
enyst wants to merge 1 commit into
mainfrom
openhands/fix-acp-json-import
Draft

fix: avoid JSON import in ESM package#256
enyst wants to merge 1 commit into
mainfrom
openhands/fix-acp-json-import

Conversation

@enyst

@enyst enyst commented Jul 4, 2026

Copy link
Copy Markdown
Member
  • A human has tested these changes.

Why

Importing the published @openhands/typescript-client package root in Node ESM fails because the built dist/models/acp.js imports acp-providers.json without a JSON import attribute. This keeps issue #135 from being fully solved even though the package is published.

Summary

  • Inline the ACP provider registry in TypeScript so the published ESM build no longer runtime-imports JSON.
  • Keep acp-providers.json as the drift-check mirror and add a unit test to verify it stays in sync with the runtime registry.
  • Replace the old git-dependency smoke test with a packed package install smoke test that imports the package root and required subpath exports, and run it in CI.

Issue Number

Fixes #135

How to Test

  • npm run build
  • node --input-type=module -e "import('@openhands/typescript-client').then(m=>console.log('ok', typeof m.RemoteWorkspace, m.ACP_PROVIDERS.codex.key)).catch(e=>{console.error(e); process.exit(1);})"
  • npm test -- --runInBand src/__tests__/acp-providers.test.ts src/__tests__/package-import.test.ts
  • npm run test:package-install
  • npm run lint && npm test -- --runInBand && npm run format:check

Video/Screenshots

Not applicable; package/runtime fix only.

Type

  • Bug fix
  • Feature
  • Refactor
  • Breaking change
  • Docs / chore

Notes

test:git-dependency remains as a backwards-compatible alias for the new test:package-install script.

This PR was created by an AI agent (OpenHands) on behalf of the user.

@enyst can click here to continue refining the PR

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Endpoint audit

❌ 6 off-contract call(s) — not on the agent-server · classifiers: cloud

Category Count
❌ Off-contract (not on agent-server) 6
  ⛔ no known backend 5
  ↗️ served by cloud 1
➕ Missing API (agent-server has, client lacks) 9
agent-server endpoints 116
client endpoints 111

❌ Not on agent-server (gated, 6)

⛔ (no known backend) — served by no backend we can see (5)

  • DELETE /api/meta-profiles/{}
  • GET /api/meta-profiles
  • GET /api/meta-profiles/{}
  • POST /api/meta-profiles/{}
  • POST /api/meta-profiles/{}/activate

↗️ served by cloud (1)

  • GET /api/shared-events/search

➕ Missing API — agent-server exposes it, client does not implement (9)

  • GET /
  • GET /api/conversations
  • GET /api/conversations/{}/events
  • GET /api/conversations/{}/workspace
  • GET /api/conversations/{}/workspace/{}
  • GET /api/file/archive
  • GET /api/init
  • POST /api/conversations/{}/load_plugin
  • POST /api/init

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Phase 2] Publish @openhands/typescript-client as an npm package

1 participant