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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@lamaranelson/xy-mind-shared-types

v1.0.46

Published

Shared TypeScript types for XY-Mind tRPC API

Readme

XY-Mind Shared Types

Type-safe interfaces for XY-Mind tRPC API communication

This package provides Zod-based TypeScript types for seamless communication between the XY-Mind Next.js backend and Chrome extension, ensuring runtime validation and compile-time type safety.

Features

  • 🎯 Zod-Based Types: Schema-driven with runtime validation
  • 🔄 Zero Drift: Types auto-sync with backend changes
  • 🛡️ Type Safety: Full IDE autocomplete and error checking
  • 📦 Small Footprint: Only essential types included

Installation

pnpm add @lamaranelson/xy-mind-shared-types

Usage

In Chrome Extension

import type {
  HealthCheckOutput,
  SyncTasksInput,
  SyncTasksOutput,
  GetBackendDataInput,
  ReportActivityInput
} from '@lamaranelson/xy-mind-shared-types';

// Fully typed tRPC client calls
const health: HealthCheckOutput = await backendTrpc.extensionSync.healthCheck.query();
const syncResult: SyncTasksOutput = await backendTrpc.extensionSync.syncTasks.mutate({
  tasks: [{ taskId: '123', domain: 'example.com', title: 'Test', createdAt: '...' }]
});

Available Types

Extension Sync

  • HealthCheckOutput - Connection status
  • GetUserInfoOutput - User authentication state
  • SyncTasksInput/Output - Task synchronization
  • GetBackendDataInput/Output - Backend data retrieval
  • ReportActivityInput/Output - Activity reporting

Agent Management

  • AgentGetInputSchema - Agent retrieval parameters
  • AgentStopInputSchema - Agent stop parameters
  • AgentTestInputSchema - Agent testing parameters

Development

Update Backend tRPC Router

// In XY-Mind-Frontend/src/server/api/routers/
export const extensionSyncRouter = createTRPCRouter({
  newEndpoint: publicProcedure
    .input(z.object({ data: z.string() }))
    .output(z.object({ result: z.string() }))
    .query(async ({ input }) => ({ result: input.data }))
});

Regenerate Types

cd packages/shared-types
pnpm generate  # Updates types from schemas
pnpm build     # Builds package

Sync to Chrome Extension

# From XY-Mind-Frontend root
./scripts/sync-types-to-plugin.sh

Scripts

  • pnpm generate - Generate types from Zod schemas
  • pnpm build - Build the package for distribution
  • pnpm dev - Generate types with watch mode

Package Structure

packages/shared-types/
├── src/
│   ├── schemas/
│   │   ├── agent.ts           # Agent management schemas
│   │   └── extension-sync.ts  # Extension communication schemas
│   ├── index.ts               # Main exports (auto-generated)
│   └── generate-from-schemas.ts # Type generator
├── dist/                      # Built package
└── README.md                  # This file

Publishing

To publish updates to npm:

# From XY-Mind-Frontend root
./scripts/publish-shared-types.sh

This script will:

  1. Generate types from schemas (pnpm generate)
  2. Build the package (pnpm build)
  3. Bump version and publish to npm

Type Safety Approach

This package uses Zod schemas as the single source of truth:

  1. Schema Definition: Define Zod schemas in src/schemas/
  2. Type Generation: Generate TypeScript types from schemas
  3. Runtime Validation: Use schemas for input/output validation
  4. Compile-time Safety: Import generated types in client code

Note: This package is auto-generated from Zod schemas. Do not edit generated types manually. All changes must be made in the schema definitions.