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

@agibuild/bridge

v1.5.10

Published

Typed bridge client runtime for Agibuild.Fulora — call C# services from JavaScript with full type safety.

Readme

@agibuild/bridge

Typed bridge client runtime for Agibuild.Fulora — call C# services from JavaScript with full type safety.

Install

npm install @agibuild/bridge

Quick Start

import { createBridgeClient } from '@agibuild/bridge';

const bridge = createBridgeClient();

// Wait for the native bridge to be ready
await bridge.ready();

// Call a C# service method directly
const result = await bridge.invoke<string>('GreeterService.SayHello', { name: 'World' });

Typed Service Proxies

Define TypeScript interfaces that mirror your C# [JsExport] services, then use getService() for type-safe calls:

import { createBridgeClient, type BridgeServiceMethod } from '@agibuild/bridge';

// Define interface matching your C# service
interface ISystemInfoService {
  getSystemInfo: BridgeServiceMethod<void, SystemInfo>;
  getRuntimeMetrics: BridgeServiceMethod<void, RuntimeMetrics>;
}

interface SystemInfo {
  osName: string;
  dotnetVersion: string;
  machineName: string;
}

interface RuntimeMetrics {
  workingSetMb: number;
  uptimeSeconds: number;
}

// Create typed proxy
const bridge = createBridgeClient();
const systemInfo = bridge.getService<ISystemInfoService>('SystemInfoService');

// Fully typed calls
const info = await systemInfo.getSystemInfo();       // → SystemInfo
const metrics = await systemInfo.getRuntimeMetrics(); // → RuntimeMetrics

Middleware

Add cross-cutting concerns (logging, timeout, retry, error normalization) via the middleware pipeline:

import {
  createBridgeClient,
  withLogging,
  withTimeout,
  withRetry,
  withErrorNormalization,
} from '@agibuild/bridge';

const bridge = createBridgeClient();

// Log all bridge calls in development
bridge.use(withLogging({ maxParamLength: 100 }));

// 5-second timeout for all calls
bridge.use(withTimeout(5000));

// Retry transient failures up to 3 times
bridge.use(withRetry({ maxRetries: 3, delay: 500 }));

// Convert raw RPC errors to typed BridgeError instances
bridge.use(withErrorNormalization());

Custom Middleware

import type { BridgeMiddleware } from '@agibuild/bridge';

const analytics: BridgeMiddleware = async (context, next) => {
  const start = Date.now();
  try {
    const result = await next();
    trackCall(context.serviceName, context.methodName, Date.now() - start);
    return result;
  } catch (err) {
    trackError(context.serviceName, context.methodName, err);
    throw err;
  }
};

bridge.use(analytics);

Error Handling

import { BridgeError, BridgeTimeoutError } from '@agibuild/bridge';

try {
  await bridge.invoke('SomeService.DoWork');
} catch (err) {
  if (err instanceof BridgeTimeoutError) {
    console.error(`Timed out after ${err.timeoutMs}ms`);
  } else if (err instanceof BridgeError) {
    console.error(`RPC error [${err.code}]: ${err.message}`, err.data);
  }
}

API Reference

createBridgeClient(resolveRpc?)

Creates a new bridge client instance. The optional resolveRpc parameter allows custom RPC resolution (defaults to window.agWebView.rpc).

BridgeClient

| Method | Description | |---|---| | ready(options?) | Wait for the native bridge to be injected. Options: timeoutMs (default 3000), pollIntervalMs (default 50) | | invoke<T>(method, params?) | Call a C# method by fully-qualified name (e.g. ServiceName.MethodName) | | getService<T>(name) | Create a typed proxy for a C# service | | use(middleware) | Add a middleware to the pipeline |

Built-in Middlewares

| Middleware | Description | |---|---| | withLogging(options?) | Log bridge calls with timing. Options: logger, maxParamLength | | withTimeout(ms) | Reject calls that exceed the timeout | | withRetry(options) | Retry failed calls. Options: maxRetries, delay, retryOn | | withErrorNormalization() | Convert raw RPC error objects to BridgeError instances |

How It Works

This package is the JavaScript side of the Agibuild.Fulora bridge. On the C# side, services decorated with [JsExport] are exposed via a JSON-RPC transport injected into the WebView as window.agWebView.rpc. This package provides a typed client that calls those services and supports middleware for cross-cutting concerns.

┌─────────────────────┐          ┌─────────────────────┐
│   Web App (JS/TS)   │          │   .NET Host (C#)    │
│                     │          │                     │
│  bridge.getService  │──JSON──▶│  [JsExport] Service │
│  bridge.invoke      │   RPC   │  Bridge Runtime      │
│  bridge.use(mw)     │◀──────── │  Source Generator    │
└─────────────────────┘          └─────────────────────┘

License

MIT