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

@studio-foundation/contracts

v0.3.0-beta.6

Published

Shared TypeScript types and interfaces for Studio v7

Readme

@studio-foundation/contracts

Shared TypeScript types and interfaces for the Studio monorepo. Zero dependencies, zero logic.

Role

contracts is the leaf package — every other Studio package imports from it, nothing imports it back. It defines the language that all packages speak.

contracts ← ralph
contracts ← runner
contracts ← engine
contracts ← cli

What's in here

| Module | Purpose | |--------|---------| | pipeline.ts | PipelineDefinition, StageDefinition, StageGroup, StageHooks, ToolHookDef, StageHookDef, StartupCommand, isStageGroup() | | stage.ts | StageStatus, StageKind, StageResult | | task.ts | TaskStatus | | agent.ts | AgentConfig, AgentProfile, ToolCall (includes plugins, skills, anonymize) | | run.ts | PipelineRun, StageRun, TaskRun, AgentRun, AgentStatus | | validation.ts | OutputContract, ToolCallRequirements, ValidationResult, ValidationRule | | provider.ts | LLMRequest, LLMResponse, Message, ToolDefinition | | errors.ts | ErrorCode (enum), StudioError | | context-pack.ts | ContextPackDefinition, ResolvedContextPack | | tool-plugin.ts | ToolPluginDef, ToolCommandDef, ShellExecute, BuiltinExecute, ParameterDef | | runner-events.ts | RunnerCallbacks, ToolCallStartEvent, ToolCallCompleteEvent, AgentThinkingEvent, AgentProgressEvent, AgentTokenEvent | | spawner.ts | RunSpawner, SpawnConfig, SpawnResult | | integration-plugin.ts | IntegrationPluginDef |

Key types

Hooks (pipeline.ts)

// Stage-level hook (on_stage_start, on_stage_complete)
interface StageHookDef {
  command: string;
  on_failure?: 'warn' | 'reject' | 'fail';  // default: 'warn'
}

// Tool-level hook (pre_tool_use, post_tool_use)
interface ToolHookDef {
  matcher: string;  // exact tool name, e.g. "repo_manager-write_file"
  command: string;
  on_failure?: 'warn' | 'reject';
}

interface StageHooks {
  on_stage_start?: StageHookDef[];
  on_stage_complete?: StageHookDef[];
  pre_tool_use?: ToolHookDef[];
  post_tool_use?: ToolHookDef[];
}

Agent (agent.ts)

interface AgentConfig {
  name: string;
  provider: string;
  model: string;
  system_prompt?: string;
  tools?: string[];
  plugins?: string[];   // Claude Code plugin names
  skills?: string[];    // .skill.md file names
  anonymize?: boolean;  // Enable PII anonymization
}

on_pipeline_start (pipeline.ts)

interface StartupCommand {
  command: string;    // Shell command to run
  inject_as: string;  // Key to inject stdout under
}

Sub-pipeline spawning (spawner.ts)

interface RunSpawner {
  spawnAndWait(config: SpawnConfig): Promise<SpawnResult>;
}

interface SpawnConfig {
  pipeline: string;
  input: Record<string, unknown>;
  parentRunId: string;
  depth: number;
}

Used by the studio_run builtin tool to spawn sub-pipelines from within an agent run.

Rules

  • Zero dependencies — no imports from other @studio/* packages, ever.
  • Zero logic — types and interfaces only. The one exception: isStageGroup() in pipeline.ts is a pure type guard function (no side effects, no state).
  • If you need to add a type used by two packages, put it here.
  • If you're adding logic, you're in the wrong package.