A community-maintained, read-only mirror + npm release pipeline for MoonshotAI/kimi-code, so that any project wanting to embed Kimi Code's Node SDK can pin against a stable, immutable, smoke-verified version instead of pulling directly from a fast-moving upstream.
This repo is a mirror. We do not fork or develop features here. All code in
upstream-mainand therelease/*branches belongs to upstream, under upstream's MIT license. Anything we add lives only onmain(this README + the CI workflows).
Upstream Kimi Code is pre-1.0 (0.x) and ships breaking API changes through its private release process. Embedding the SDK directly via MoonshotAI/kimi-code#main means every upstream commit is a potential consumer break. This mirror solves that with three layers:
- Immutable mirror tags (
@moonshot-ai/kimi-code@<X.Y.Z>) — frozen at the commit upstream's release tag pointed at when we mirrored it. Even if upstream force-pushes or deletes a tag, our tag stays. - Daily sync CI that fast-forwards
upstream-main, mirrors any new upstream release tag, and runs a smoke build ofpackages/node-sdkso upstream-breaking changes are caught at the sync boundary, not at consumer install time. - OIDC-published npm package
@botiverse/kimi-code-sdk— the dist-only repackage of the upstream node-sdk, so consumers don't have to pull the whole monorepo.
ACP (Agent Client Protocol) doesn't expose a steering capability — i.e. you can't inject a follow-up instruction into a turn that's already in flight, or interleave a model-driven and operator-driven control signal on the same session. The Kimi Code Node SDK does expose this (Session.prompt(...) semantics), and that's load-bearing for embedders that need real-time interaction control. Until ACP grows steering, embedders have to integrate against the SDK directly — which is what this mirror enables.
- Read-only mirror, not a fork. Source of truth is
MoonshotAI/kimi-code. - We mirror the whole monorepo, not just
packages/node-sdk— the SDK depends on sibling workspace packages (agent-core,kosong,kaos,oauth), so extracting one package would break its dependency closure on every upstream refactor. - Any change we'd want goes upstream as a PR first. If we ever genuinely need a local patch before upstream absorbs it, it lives on a
patch-*branch stacked on the relevant release tag, is registered in the table below, and is deleted once upstream lands it. Mirror branches/tags themselves are never edited.
| Local patch branch | Based on tag | Reason | Upstream PR | Status |
|---|---|---|---|---|
| (none) |
| Ref | What it is |
|---|---|
main (default) |
Ours only — this README + the CI workflows. No upstream code. |
upstream-main |
Fast-forward mirror of upstream main. Moves forward daily; never rewritten (if upstream rewrites history, we hold and alert — see SOP). |
release/v<X.Y.Z> |
A readable branch pinned at upstream release X.Y.Z (for stacking a patch-* if ever needed). |
@moonshot-ai/kimi-code@<X.Y.Z> (tag) |
Immutable mirror tag = the exact upstream release name, frozen at our mirror. Source-level pin for vendoring or local patching. |
Recommended: npm install. This gives you the dist-only repackage with just the few light runtime dependencies — no monorepo, no upstream toolchain, the typical consumer path:
npm install @botiverse/kimi-code-sdk@0.9.3Use the mirror tag only when you actually need the full upstream monorepo source (vendoring, local patching, or studying):
# Less common — full monorepo source, much heavier
github:botiverse/kimi-code-sdk#@moonshot-ai/kimi-code@0.14.3Both are immutable. The mirror tag stays frozen at the commit it pointed to when we first mirrored it, even if upstream force-pushes or deletes the upstream tag. The npm version is immutable per npm's own semantics.
RELEASES.md records the upstream-tag ↔ npm-version mapping plus interface notes per release.
- Consumers pin only mirror tags or npm versions, never
upstream-main. - Bumping a pin is a deliberate change in the consumer, made after the new mirror tag's smoke build is green here.
- The node-sdk package is versioned independently upstream from the CLI release tag — e.g. CLI tag
0.14.2ships node-sdk0.9.3. The npm package@botiverse/kimi-code-sdkcarries the node-sdk version; the GitHub Releases on this repo carry the CLI release tag.RELEASES.mdis the bridge.
All mirrored content is licensed under upstream's MIT License (see LICENSE on upstream-main / each release/*). This mirror adds no new license; main carries only this documentation and CI. Upstream copyright and LICENSE are preserved unchanged on the mirror branches and in the published npm tarball. See NOTICE.md.
.github/workflows/sync-upstream.ymlruns daily (04:17 UTC) and on manual workflow_dispatch.- Each run: fetch upstream → fast-forward
upstream-main→ for every new upstream release tag create an immutable mirror tag +release/v<X.Y.Z>branch → smoke build the node-sdk → push. A smoke failure auto-opens async/upstream-breakissue.
GitHub → Actions → sync-upstream → "Run workflow". (Or gh workflow run sync-upstream.yml -R botiverse/kimi-code-sdk.)
Add repo secret SYNC_PAT = a PAT with repo + workflow scope. The default GITHUB_TOKEN cannot push commits that touch upstream's .github/workflows/**, so the ff-push needs SYNC_PAT. Upstream's own workflows live on upstream-main (not main), so they do not run on schedule/dispatch (those use the default branch); to fully silence push-triggered upstream CI, disable Actions for non-main branches or keep Actions limited.
- Open the failing run (linked in the auto-issue).
- Decide: upstream-breaking vs our-env.
- Build/type error referencing upstream API changes → upstream breaking change. Consumers stay pinned to the last green mirror tag. File/track upstream; bump consumer pins only after a green release tag lands.
pnpm installlockfile / toolchain / monorepo-layout error → our env (e.g. upstream movedpackages/node-sdk). Update the smoke step's filter/paths in the workflow; the mirror tag is unaffected.
- Never edit the mirror to make smoke pass — fix the smoke harness or wait for upstream.
- Upstream is pre-1.0 (
0.x) and will ship breaking API changes — absorbed by smoke-at-sync + consumer pinning. - If upstream changes its monorepo layout, the smoke build's
--filter/paths must follow (this runbook, step 2).
The repackaged, dist-only SDK (@botiverse/kimi-code-sdk) is published to npm via OIDC trusted publishing (no long-lived token), tag-triggered, with the maintainer in the loop.
- Version = node-sdk's own
package.jsonversion (e.g.0.9.3), independent of the CLI release tag (0.14.2).RELEASES.mdrecords the mapping. - Build artifact = the bundled
distonly (siblings are inlined bytsdown); deps reduce to the few light runtime ones. Upstream MITLICENSE+ ourNOTICE.mdship in the tarball. - Workflow:
.github/workflows/publish-sdk.yml.
- Pick the upstream mirror tag to ship (e.g.
@moonshot-ai/kimi-code@0.14.2). - Write/confirm the interface release note (GitHub Release +
RELEASES.md). - Tag the same upstream-source commit with a publish tag and push it:
The workflow checks out that source, builds node-sdk, repackages, asserts the tag version matches the source
git tag publish-sdk/v0.9.3 '@moonshot-ai/kimi-code@0.14.2' git push botiverse publish-sdk/v0.9.3package.jsonversion (fails closed on mismatch), and publishes via OIDC.workflow_dispatch(withsource_tag,dry_rundefault true) is the manual / dry-run path.
- On npmjs.com, configure the
@botiverse/kimi-code-sdkTrusted Publisher: repobotiverse/kimi-code-sdk, workflowpublish-sdk.yml(optional environmentnpm-publish). - A brand-new package name may need one bootstrap publish by a logged-in
@botiversemember to create it; OIDC handles every release after. - (Optional) protected GitHub Environment
npm-publishwith required reviewers = the manual approval gate before the publish step runs.
This repo is intentionally minimal. The kinds of changes we welcome on main:
- Improvements to the sync CI (
.github/workflows/sync-upstream.yml) — e.g. better triage hints in the auto-opened issues, more robust ff-guard behaviour. - Improvements to the publish pipeline (
.github/workflows/publish-sdk.yml,scripts/repackage-sdk.mjs). - Documentation: clarifications to this README, the runbooks, or
RELEASES.mdinterface notes.
What we will not accept:
- Changes to mirrored upstream code on
upstream-mainorrelease/*— those go upstream as a PR first. - Edits to existing mirror tags — they're immutable by design.
- Local feature work that should belong upstream.
If you need a feature that upstream hasn't shipped, open the PR upstream and (if absolutely necessary in the meantime) propose a patch-* branch here registered in the table in §1.
- Maintainer: @Kai (issue and PR triage).
- Escalation for sync/publish-pipeline issues: open an issue on this repo.