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

@claxedo/agent-runtime-contract

v0.10.2

Published

Dependency-free canonical contracts for Claxedo agent sessions, content, execution, errors, and events

Readme

@claxedo/agent-runtime-contract

Dependency-free canonical contracts for Claxedo agent sessions: execution bindings, content and message shapes, capabilities, connection descriptors, errors, file references, the runtime event model, the presentation events a client reads, and the turn pages and outlines every session producer serves. Every Claxedo runtime package (@claxedo/harness, @claxedo/workspace-runtime) and every client that speaks to them imports these types from here, so the wire contract has exactly one owner.

Install

npm install @claxedo/agent-runtime-contract

Usage

import { requireAgentExecutionBinding, AGENT_RUNTIME_CONTRACT_VERSION } from "@claxedo/agent-runtime-contract"

const binding = requireAgentExecutionBinding({
  sessionId: "session-1",
  workspaceId: "workspace-1",
  directory: "/work/one",
  connectionId: "native:pi",
  upstreamSessionId: "pi-1",
})

The package ships plain ESM plus type declarations and has no runtime dependencies, so it loads under Node without a TypeScript loader.

The turn fold (@claxedo/agent-runtime-contract/turn-fold)

How a turn's parts group, and which groups a finished turn folds behind its "Worked for" row. It lives here so every reader of a turn's parts groups and folds them the same way.

  • Group identity uses canonical tool spellings; harness variants (command, read_file, ls) fold in through the contract's canonicalToolName, so a new spelling is added once.
  • Consecutive context tools (read, list, glob, grep) fold into an "Explored" group at any length, consecutive subagent spawns into an agents group at any length (a lone spawn too: the chip row is the only shape that draws one), and a run of work tools only at two or more members. Any other part flushes all three runs. Work is named by exclusion (not context, subagent, hidden or addressed to the reader), because a list names only the tools it knows, and a missing tool breaks a run into its own row.
  • A read that returned an image stays its own row: a group summarizes reads as a count, and a count cannot stand in for a thumbnail.
  • A failed spawn stays renderable so it can show the tool error when no child was admitted; its outcome does not say whether a child exists. A subagent spawn is recognized by name (the contract owns the spellings), or by an MCP tool declaring task work on its input.
  • A notice part (TranscriptNotice: a harness's sentence, a compaction) is never folded: it is the harness telling the reader something, not machinery.
  • A single tool is not folded: it is already one compact row, and folding hides the only actionable content behind a click. A grouped run counts as one row because it has its own disclosure.
  • The turn's answer is every text group after its last tool, or all of its text when it ran no tool: no harness marks which text part answers (finish is never set natively, AgentStepFinishPart never emitted), so position stands in for it. A reply the vendor streams as text, thought, text is two text parts and one answer; folding only the last would hide the reply behind a one-character tail. Narration before the last tool call folds with the work, and so do thoughts, wherever they sit. "Copy response" copies the same answer (answerPartRefs), its parts joined by a blank line, so the fold and the copy never disagree.
  • A reply surface (a first-party ui_show part, ANSWER_TOOLS) is answer content wherever it sits: its part group carries answer, it never folds, and it does not count as the last tool that ends the work, so the text after it stays the answer. Copy still reads only text.
  • A finished turn folds its machinery (tool runs, answered questions, spawns, reasoning, narration between tools) behind "Worked for Xs", leaving the answer; an explicit toggle beats the auto-fold. A working turn gets no fold and no control: settled alone cannot tell a finished turn from one between steps. Settled is per message, so a multi-step turn reads settled from its first step. A settled turn whose parts are still pending folds on the count it will have. An interrupted or failed turn keeps the control but does not fold on its own: its rows explain what happened, and a turn opened by hand and then interrupted must still be collapsible.
  • A reader's own fold hides all of the turn, open rows included; an automatic fold never takes a row the reader opened.

Versioning

agent-runtime-contract rides the runtime version track with the other runtime packages (see script/PUBLISH-ORDER.md in the repository). A contract change that consumers must react to bumps AGENT_RUNTIME_CONTRACT_VERSION.