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

@6digit/satellite-convex

v0.3.2

Published

Server-side Convex integration for 6digit-satellite with transparent tool proxying and session management

Readme

@6digit/satellite-convex

Server-side Convex integration for 6digit-satellite with transparent tool proxying and session management.

Overview

The 6digit Satellite Convex package provides server-side utilities for managing satellite connections, pairing, tool invocations, and session persistence in Convex backends. It handles the server-side logic that coordinates with @6digit/satellite-core clients.

Features

  • 🔗 Satellite Registration - Register satellites and generate pairing codes
  • 🔑 Pairing Management - Handle satellite pairing with expiring codes
  • 📡 Tool Invocation Routing - Route tool calls to connected satellites
  • 💓 Session Management - Track satellite connections and heartbeats
  • 🆔 Persistent Identity - Maintain satellite relationships across restarts
  • 🔍 Status Monitoring - Query satellite availability and status

Installation

npm install @6digit/satellite-convex

Quick Start

import { SatelliteManager } from '@6digit/satellite-convex';

// In your Convex mutation
export const registerSatellite = mutation({
  args: {
    satelliteId: v.string(),
    toolDefinitions: v.array(v.any()),
    metadata: v.optional(v.any())
  },
  handler: async (ctx, args) => {
    return await SatelliteManager.registerSatellite(
      ctx,
      args.satelliteId,
      args.toolDefinitions,
      args.metadata
    );
  }
});

// Check if satellite is paired
export const isSatellitePaired = query({
  args: { satelliteId: v.string() },
  handler: async (ctx, args) => {
    return await SatelliteManager.isSatellitePaired(ctx, args.satelliteId);
  }
});

Core Components

SatelliteManager

Main class for managing satellite lifecycle:

class SatelliteManager {
  // Register satellite and return pairing code (or null if already paired)
  static async registerSatellite(ctx, satelliteId, toolDefinitions, metadata?)
  
  // Check if satellite is paired
  static async isSatellitePaired(ctx, satelliteId)
  
  // Get satellite status
  static async getSatelliteStatus(ctx, satelliteId)
  
  // Update satellite heartbeat
  static async updateHeartbeat(ctx, satelliteId)
  
  // Disconnect satellite
  static async disconnectSatellite(ctx, satelliteId)
}

Pairing System

Secure pairing with expiring codes:

// Generate human-readable pairing codes
const pairingCode = createPairingCode(satelliteId);

// Validate pairing codes
const isValid = validatePairingCode(code, satelliteId);

// Check expiration
const isExpired = isPairingCodeExpired(pairingCode);

Database Schema

The package expects these Convex tables:

// satellites table
{
  satelliteId: string,
  toolDefinitions: any[],
  status: "waiting_for_pair" | "paired" | "connected" | "disconnected",
  registeredAt: number,
  lastRegisteredAt?: number,
  type?: string,
  name?: string,
  workingDirectory?: string,
  platform?: string,
  nodeVersion?: string
}

// satelliteSessions table  
{
  satelliteId: string,
  pairingCode: string,
  connectedAt: number,
  lastSeen: number,
  status: "connected" | "disconnected",
  name?: string,
  toolDefinitions: any[]
}

// pairingCodes table
{
  code: string,
  satelliteId: string,
  createdAt: number,
  expiresAt: number,
  used: boolean
}

// satelliteToolInvocations table
{
  satelliteId: string,
  toolName: string,
  parameters: any,
  status: "pending" | "completed" | "failed",
  createdAt: number,
  completedAt?: number,
  result?: any,
  error?: string
}

Example Convex Functions

// mutations/satellite.ts
import { mutation, query } from "./_generated/server";
import { v } from "convex/values";
import { SatelliteManager } from "@6digit/satellite-convex";

export const registerSatellite = mutation({
  args: {
    satelliteId: v.string(),
    toolDefinitions: v.array(v.any()),
    metadata: v.optional(v.any())
  },
  handler: async (ctx, args) => {
    return await SatelliteManager.registerSatellite(
      ctx,
      args.satelliteId,
      args.toolDefinitions,
      args.metadata
    );
  }
});

export const updateHeartbeat = mutation({
  args: { satelliteId: v.string() },
  handler: async (ctx, args) => {
    await SatelliteManager.updateHeartbeat(ctx, args.satelliteId);
  }
});

export const getPendingToolInvocations = query({
  args: { satelliteId: v.string() },
  handler: async (ctx, args) => {
    return await ctx.db
      .query("satelliteToolInvocations")
      .withIndex("by_satellite_id", (q) => q.eq("satelliteId", args.satelliteId))
      .filter((q) => q.eq(q.field("status"), "pending"))
      .collect();
  }
});

export const sendToolResult = mutation({
  args: {
    invocationId: v.string(),
    result: v.optional(v.any()),
    error: v.optional(v.string())
  },
  handler: async (ctx, args) => {
    await ctx.db.patch(args.invocationId, {
      status: args.error ? "failed" : "completed",
      result: args.result,
      error: args.error,
      completedAt: Date.now()
    });
  }
});

Pairing Flow

  1. Satellite Registration: Satellite calls registerSatellite with tools
  2. Pairing Code Generation: Server generates human-readable code (e.g., "BLUE-MOON-42")
  3. User Pairing: User enters code in 6digit Studio interface
  4. Session Creation: Server creates persistent session
  5. Automatic Reconnection: Subsequent registrations return null (already paired)

Session Management

  • Heartbeats: Satellites send heartbeats every 30 seconds
  • Status Tracking: Server tracks lastSeen timestamps
  • Automatic Cleanup: Expired sessions can be cleaned up
  • Reconnection: Paired satellites automatically reconnect

License

MIT

Related Packages

Contributing

See CONTRIBUTING.md for development guidelines.

Support