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

@moolam/runtime-harness

v1.1.0

Published

Internal component of Sutra SDK — applications should install sutra-sdk. Runtime harness core: streaming turn host, token parser, sandbox seam, and abort pipeline. Consumes frozen A P6 harness frame contracts from @moolam/sync-protocol; does not redefine

Readme

@moolam/runtime-harness

Runtime harness core for Sutra companions. Hosts the streaming turn protocol using frozen A P6 harness frames from @moolam/sync-protocol.

Status

StreamingTurnHost has typed emit helpers per A P6 frame kind, a monotonic sequenceIndex allocator, terminateWithError / runGuarded for terminal HARNESS_ERROR, and InMemoryStreamFrameBuffer indexed by sequenceIndex. Last-Event-ID resume (parseLastEventId / resolveStreamResume) replays from the buffer or emits a SEQUENCE_GAP frame with RESYNC_REQUIRED. Integration coverage: disconnect after frame 5 → resume 6..N, and gap fixture index 99. ToolCallParser is an incremental mode state machine (thought / answer / tool_buffer / violation) with pure feed() events. Declared tags are held as fragments across chunk boundaries (PARSER_DECLARED_TAGS + offset fuzz). terminateDeadline() discards open fences / held tags without hanging. A P6 golden-turn fixtures are imported under fixtures/golden-turns/ (loadGoldenTurnCorpus / pnpm golden:sync). Replay with canonical diff: pnpm golden:replay (replayGoldenTurn). Chunk-boundary fuzz CI: pnpm golden:fuzz (prove: pnpm golden:fuzz:prove). Malformed-fence regression goldens (CK-07): pnpm golden:malformed.

Golden replay operator workflow (sync → review diff → land when A P6 changes): docs/golden-replay-operator.md. SandboxSeam + InProcessFakeToolRegistry isolate tool effects (deadline, write-ahead ack, result-schema validation → TOOL_STATUS / tool_response).

A P6 schema

  • Types / Zod: @moolam/sync-protocol (harnessFrameSchema)
  • Committed JSON Schema: packages/sync-protocol/schemas/HarnessFrame.json (A_P6_HARNESS_FRAME_SCHEMA_PATH)

Last-Event-ID resume (client)

SSE id: equals the frame sequenceIndex (decimal). On reconnect:

  1. Send Last-Event-ID: <last seen sequenceIndex>.
  2. Host outcome action: "replay": lossless re-delivery of buffered frames with sequenceIndex > N. Attach only — do not restart in-flight tools or re-apply side effects; duplicate Last-Event-ID is idempotent.
  3. Host outcome action: "gap": terminal HARNESS_ERROR with code: SEQUENCE_GAP and message advisory RESYNC_REQUIRED (empty buffer, eviction hole, never-issued index, or invalid header). Open a new turn (full resync); do not retry the same Last-Event-ID forever.
  4. Absent Last-Event-ID → action: "fresh" (new stream open).
  5. Cross-subject / stream mismatch → action: "reject" (no frame leakage).

Anti-cheat charter (training)

training/gym must import this package — never re-implement the parser, sandbox, or correction loop. Binding governance:

training/gym/charter.md

Replay parity (byte-identical canonical frame sequences) is enforced by pnpm --filter @moolam/training-gym parity:check and the gym unit suite.

Scripts

pnpm --filter @moolam/runtime-harness build
pnpm --filter @moolam/runtime-harness test
pnpm --filter @moolam/runtime-harness golden:sync
pnpm --filter @moolam/runtime-harness golden:check
pnpm --filter @moolam/runtime-harness golden:replay
pnpm --filter @moolam/runtime-harness golden:fuzz
pnpm --filter @moolam/runtime-harness golden:malformed
pnpm --filter @moolam/training-gym parity:check
pnpm --filter @moolam/training-gym test

See docs/golden-replay-operator.md for the full sync / review / merge checklist.