npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ksp-gonogo/sitrep-sdk

v0.0.1

Published

Generated typed contract for the Gonogo (Sitrep) KSP telemetry stream

Readme

@ksp-gonogo/sitrep-sdk

@ksp-gonogo/sitrep-* is the Gonogo telemetry mod, codename Sitrep.

TypeScript client SDK for the gonogo-native telemetry mod. The wire contract (message envelopes, Meta, enums) is defined once in C# and generated into this package — the SDK never redefines the shape by hand.

Generated code — do not hand-edit

src/__generated__/contract.ts is produced by Reinforced.Typings from the C# source of truth in mod/Sitrep.Contract/. The file carries its own "generated, changes will be lost" header — treat that as load-bearing, not boilerplate. If a type needs to change, change the C# class (or mod/Sitrep.Contract/RtConfig.cs for export configuration) and regenerate; never patch the emitted .ts directly.

Regenerate from the repo root:

pnpm codegen

This runs mod/codegen.sh, which builds Sitrep.Contract.csproj and invokes the rtcli tool against the compiled assembly to rewrite src/__generated__/contract.ts.

The drift gate

pnpm codegen:check

Regenerates the contract and then runs git diff --exit-code against src/__generated__/. A non-zero exit means one of two things:

  • The C# contract changed and the generated output is out of date — commit the regenerated file alongside the C# change.
  • The build is non-deterministic (unexpected member/type ordering from reflection) — this should not happen; see RtConfig.Configure if it ever does, since RT export order is explicit there rather than left to GetProperties() reflection order.

This is the check that should run in CI once dotnet is wired into the CI image (tracked separately) — for now, run it locally before committing any change under mod/Sitrep.Contract/.

The hand-owned seams: envelope.ts and client.ts

src/envelope.ts defines ServerMessage and ClientMessage as discriminated unions over the generated interfaces (StreamData<unknown> | EventMsg | ...). Reinforced.Typings emits one interface per C# class — it has no way to know which subset of those interfaces the transport layer treats as a "server message" versus a "client message," so that grouping is authored by hand in this file instead of generated. envelope.ts is covered by tests (envelope.test.ts) and is the only source file in this package that isn't derived from __generated__/contract.ts; everything else (client.ts, index.ts) is built on top of the generated types plus this one seam.

src/client.ts has a second, smaller hand-owned seam: SERVER_TYPE_TAGS, the runtime lookup parseServerMessage uses to validate an incoming envelope's type tag against the ServerMessage union. It's a second hand-owned copy of the union's membership (a Set can't be derived from a type at runtime), but it's compile-time-guarded — SERVER_TYPE_TAGS is declared satisfies Record<ServerMessage["type"], true>, so adding a variant to ServerMessage without adding its tag to SERVER_TYPE_TAGS fails tsc.

Usage

import { parseServerMessage, type ServerMessage } from "@ksp-gonogo/sitrep-sdk";

const msg: ServerMessage = parseServerMessage(rawJson);