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

@rcs-lang/ast

v2.0.1

Published

Parser-independent AST type definitions for RCL language

Readme

@rcs-lang/ast

Parser-independent AST (Abstract Syntax Tree) type definitions for the RCL (Rich Communication Language).

Overview

This package provides TypeScript type definitions for the RCL Abstract Syntax Tree. It serves as a shared contract between the parser and compiler packages, ensuring type safety and consistency across the RCL toolchain.

Installation

npm install @rcs-lang/ast

Usage

import * as AST from '@rcs-lang/ast';

// Example: Type-safe AST node creation
const agentNode: AST.AgentDefinition = {
  type: 'AgentDefinition',
  name: 'MyAgent',
  displayName: 'My Agent',
  sections: []
};

// Example: AST traversal with type guards
function visitNode(node: AST.ASTNode) {
  if (AST.isAgentDefinition(node)) {
    console.log('Found agent:', node.name);
  } else if (AST.isFlowDefinition(node)) {
    console.log('Found flow:', node.name);
  }
}

AST Structure

The RCL AST follows a hierarchical structure:

RclFile
├── AgentDefinition
│   ├── ConfigSection
│   ├── DefaultsSection
│   └── FlowDefinition[]
└── MessagesSection
    └── MessageDefinition[]

Key Types

Core Nodes

  • RclFile - Root node of an RCL document
  • AgentDefinition - Defines an RCS agent
  • FlowDefinition - Defines a conversation flow
  • MessagesSection - Container for message definitions
  • MessageDefinition - Defines a message template

Flow Nodes

  • StateDefinition - Defines a state in a flow
  • TransitionDefinition - Defines transitions between states
  • MatchBlock - Pattern matching for user input
  • ActionBlock - Actions to perform in a state

Message Nodes

  • TextMessage - Simple text message
  • RichCardMessage - Rich card with media and buttons
  • CarouselMessage - Carousel of multiple cards
  • Suggestion - Quick reply or action suggestions

Type Guards

The package provides type guard functions for runtime type checking:

AST.isAgentDefinition(node)
AST.isFlowDefinition(node)
AST.isMessageDefinition(node)
AST.isTextMessage(node)
// ... and more

Contributing

See the main repository README for contribution guidelines.

License

MIT