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

@gravityai-dev/output

v1.0.20

Published

Output nodes for GravityWorkflow - UI rendering components

Readme

QuestionOutput Publishing Updates

This document outlines the updates made to the QuestionOutput package to align with the modern TextOutput publishing pattern.

Overview

The QuestionOutput package has been updated to use the unified Redis Streams publishing infrastructure, moving away from the legacy Redis publisher pattern to match TextOutput's implementation.

Changes Made

1. Updated service/publishQuestions.ts

Before:

  • Used getQuestionsPublisher() from @gravityai-dev/gravity-server
  • Complex Redis configuration with multiple parameters
  • Published to various channels based on configuration

After:

  • Uses getRedisClient() from shared platform utilities
  • Uses buildOutputEvent() and OUTPUT_CHANNEL from shared publisher
  • Publishes to unified workflow:events:stream using Redis Streams
// New implementation
const event = buildOutputEvent({
  eventType: "questions",
  chatId: config.chatId,
  conversationId: config.conversationId,
  userId: config.userId,
  providerId: config.providerId,
  data: {
    questions: config.questions,
    metadata: {
      ...config.metadata,
      workflowId: config.workflowId,
      workflowRunId: config.workflowRunId,
    },
  },
});

await redis.xadd(
  "workflow:events:stream",
  "*",
  "conversationId", conversationId,
  "channel", OUTPUT_CHANNEL,
  "message", JSON.stringify(event)
);

2. Updated node/executor.ts

Changes:

  • Removed AI_RESULT_CHANNEL import (no longer needed)
  • Simplified publishQuestions() call by removing channel fallback
  • The service now handles channel routing internally

Before:

import { AI_RESULT_CHANNEL } from "@gravityai-dev/gravity-server";

const result = await publishQuestions({
  // ...
  redisChannel: config.redisChannel || AI_RESULT_CHANNEL,
  // ...
});

After:

const result = await publishQuestions({
  // ...
  redisChannel: config.redisChannel,
  // ...
});

3. Files Not Changed

  • node/index.ts - Still imports AI_RESULT_CHANNEL for UI dropdown options (correct)
  • util/ files - No publishing dependencies, only types and validation

Benefits

  1. Unified Event Structure: All output events now use the same GravityEvent format
  2. Reliable Delivery: Redis Streams provide better reliability than Pub/Sub
  3. Consistent Architecture: Matches TextOutput and other modern output nodes
  4. Simplified Dependencies: Removed complex legacy publisher dependencies

Event Structure

Questions are now published as:

{
  id: "uuid",
  timestamp: "2025-01-12T17:03:11.000Z",
  providerId: "gravity-services",
  chatId: "chat-123",
  conversationId: "conv-456",
  userId: "user-789",
  __typename: "GravityEvent",
  type: "GRAVITY_EVENT",
  eventType: "questions",
  data: {
    questions: ["Question 1?", "Question 2?"],
    metadata: {
      workflowId: "workflow-123",
      workflowRunId: "run-456",
      // ... other metadata
    }
  }
}

Migration Pattern

This same pattern can be applied to other output nodes:

  1. Replace legacy publisher with getRedisClient() from shared platform
  2. Use buildOutputEvent() with appropriate eventType
  3. Publish to Redis Streams using workflow:events:stream
  4. Use OUTPUT_CHANNEL for consistent routing
  5. Remove legacy imports from executors

Files Updated

  • service/publishQuestions.ts - Complete rewrite using shared utilities
  • node/executor.ts - Removed legacy imports and simplified calls
  • node/index.ts - No changes needed (UI configuration only)
  • util/ files - No changes needed (no publishing logic)

Testing

After these changes, questions should:

  1. Publish successfully to the unified event stream
  2. Appear in the UI with the same functionality
  3. Include all required metadata for proper routing
  4. Use reliable Redis Streams delivery

Next Steps

Consider applying this same publishing pattern to other output nodes in the package for consistency across the entire output system.