Skip to content

Add a publish path for @redrob-code/sdk, separate from the signing release - #53

Merged
its-janghoon merged 1 commit into
developfrom
feature/publish-sdk-to-npm
Sep 22, 2026
Merged

its-janghoon merged 1 commit into
developfrom
feature/publish-sdk-to-npm

Conversation

@its-janghoon

Copy link
Copy Markdown
Contributor

The SDK has never been published. packages/sdk/js/script/publish.ts was already written and complete — nothing called it, and release.yml mentions npm nowhere. So nothing outside this repository can depend on the fork's own SDK, which is why the desktop app still consumes the upstream @opencode-ai/sdk and cannot see types added here.

A separate workflow, deliberately

release.yml reaches the Apple and Windows signing credentials. Bolting an npm publish onto it means a missing or expired token turns a signed binary release red after the artifacts are already out. Here a token problem fails one run that has published nothing else.

workflow_dispatch only, dry-run by default: the first publish of a public package under this scope is not reversible — npm allows unpublishing a new version only within 72 hours, and a name once taken stays taken.

The version comes from the release

packages/sdk/js/package.json holds 0.0.0 on purpose. The package is generated from the CLI's own API surface, so a version committed beside it would be a second number to remember to bump and would drift from the CLI it describes.

Taking it from the release tag also makes an SDK build answerable — a consumer can tell which CLI generated it — and publish.ts restores the file afterwards, so a release leaves no diff behind.

What I could not verify

I cannot read organisation secrets (403, needs admin:org), and this repository has zero repo-level secrets (total_count: 0) while release.yml uses org-level signing secrets successfully. So I cannot confirm NPM_TOKEN resolves — the workflow has an explicit check that fails with one clear line if it does not, rather than letting npm publish fail after the pack.

The repository-id guard matches release.yml: a fork must never publish under this scope, and a rename must not silently switch the guard off.

Gates

typecheck  0 errors across the monorepo

Version wiring verified locally: REDROB_VERSION=0.4.1 → Script.version 0.4.1, channel latest.

…e signing release

The SDK has never been published. `publish.ts` was already written and complete;
nothing called it, and `release.yml` mentions npm nowhere. So a consumer outside
this repository cannot depend on the fork's own SDK at all -- which is why the
desktop app still consumes the upstream `@opencode-ai/sdk` and cannot see types
added here.

A separate workflow rather than a step in `release.yml`, deliberately. That
workflow reaches the Apple and Windows signing credentials, and bolting an npm
publish onto it means a missing or expired token turns a signed binary release red
AFTER the artifacts are already out. Here a token problem fails one run that has
published nothing else.

`workflow_dispatch` only, dry-run by default. The first publish of a public
package under this scope is not reversible: npm allows unpublishing a new version
only within 72 hours, and a name once taken stays taken.

The version comes from the release, not from `package.json`, which holds `0.0.0`
on purpose. This package is generated from the CLI's own API surface, so a version
committed beside it would be a second number to bump and would drift from the CLI
it describes. Taking it from the release tag also makes an SDK build answerable --
a consumer can tell which CLI generated it -- and `publish.ts` restores the file
afterwards, so a release leaves no diff behind.

The repository-id guard matches `release.yml`: a fork must never publish under
this scope, and a rename must not silently switch the guard off.
@its-janghoon
its-janghoon merged commit 088df0e into develop Sep 22, 2026
15 checks passed
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