open-index/open-npm huggingface dataset:
npm package: @foxglove/just-fetch
Description: Isomorphic ponyfill wrapping native browser fetch and node-fetch
Author: Foxglove
Latest version: 1.3.1

# @foxglove/just-fetch

Isomorphic ponyfill wrapping native browser fetch and node-fetch.

[![npm version](https://img.shields.io/npm/v/@foxglove/just-fetch.svg?style=flat)](https://www.npmjs.com/package/@foxglove/just-fetch)

### Usage

```ts
import fetch from "@foxglove/just-fetch";
```

Usage is the same whether you are targeting browsers or node.js. The browser
target returns the native `window.fetch` implementation, and in node.js the
`node-fetch` library is returned.

## License

@foxglove/just-fetch is licensed under [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest
npm package: @foxglove/message-schemas
Description: Foxglove-defined message schemas for ROS, Protobuf, and JSON
Author: Foxglove Technologies
Latest version: 0.1.1
Deprecated: This package has been renamed to @foxglove/schemas

# @foxglove/message-schemas

> [Message schemas](https://foxglove.dev/docs/studio/messages/introduction) supported by [Foxglove Studio](https://studio.foxglove.dev)

[![npm version](https://img.shields.io/npm/v/@foxglove/message-schemas.svg?style=flat)](https://www.npmjs.com/package/@foxglove/message-schemas)

## Introduction

The [schemas](./schemas) folder contains type definitions generated from these schemas for ROS 1, ROS 2, Protobuf, JSON Schema, and TypeScript.

These schemas can be used in [MCAP](https://github.com/foxglove/mcap) files or [Foxglove WebSocket](https://github.com/foxglove/ws-protocol) servers to take advantage of Foxglove Studio's visualizations.

## License

@foxglove/message-schemas is licensed under [MIT License](https://opensource.org/licenses/MIT).

## Development

The schema definitions are in [src/schemas.ts](src/schemas.ts).

After editing the schemas, re-generate the language-specific definitions by running `yarn update-generated-files`.

### Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest

## Stay in touch

Join our [Slack channel](https://foxglove.dev/join-slack) to ask questions, share feedback, and stay up to date on what our team is working on.
npm package: @foxglove/omgidl-serialization
Description: OMG IDL Schema message serializers and deserializer
Author: Foxglove Technologies Inc
Latest version: 1.2.3

# @foxglove/omgidl-serialization

> _OMG IDL message serialization, for reading and writing CDR and XCDR2 messages based on `.idl` schema_

[![npm version](https://img.shields.io/npm/v/@foxglove/omgidl-serialization.svg?style=flat)](https://www.npmjs.com/package/@foxglove/omgidl-serialization)

## MessageReader

Message reader deserializes CDR, XCDR1 and XCDR2 messages into plain objects. The messages are fully deserialized.

```typescript
import { parseIDL } from "@foxglove/omgidl-parser";
import { MessageReader } from "@foxglove/omgidl-serialization";

const msgDef = `
  module geometry_msgs {
    struct PointStamped {
      Header header;
      Point point;
    };
  };
  struct Header {
    uint32 seq;
    Time stamp;
    string frame_id;
  };
  struct Time {
    uint32 sec;
    uint64 nsec;
  };
  struct Point {
    float x;
    float y;
    float z;
  };
`;

const messageDefinition = parseIDL(msgDef);
const reader = new MessageReader("geometry_msgs::PointStamped", messageDefinition);

// deserialize a buffer into an object
const message = reader.readMessage([0x00, 0x01, ...]);

// access message fields
message.header.stamp;
```

## MessageWriter

Convert an object, array, or primitive value into binary data using CDR message serialization. (XCDR1 and XCDR2 writing is not yet supported.)

```Typescript
import { MessageWriter } from "@foxglove/omgidl-serialization";

const msgDef = `
  module geometry_msgs {
    struct PointStamped {
      Header header;
      Point point;
    };
  };
  struct Header {
    uint32 seq;
    Time stamp;
    string frame_id;
  };
  struct Time {
    uint32 sec;
    uint64 nsec;
  };
  struct Point {
    float x;
    float y;
    float z;
  };
`;

const messageDefinition = parseIDL(msgDef);

const writer = new MessageWriter("geometry_msgs::PointStamped", messageDefinition, cdrOptions);

// serialize the passed in object to a Uint8Array as a PointStamped message
const uint8Array = writer.writeMessage({
  header: {
    stamp: { sec: 0, nsec: 0 },
    frame_id: ""
  },
  x: 1,
  y: 0,
  z: 0
});
```

## Known Limitations

`MessageReader` does not support:

- arrays of variable-size arrays. `parseIDL` will error if this is detected in the schema to prevent incorrect deserialization.

`MessageWriter` does not support:

- does not support writing XCDR1 (`PL_CDR`) or XCDR2 (`PL_CDR2`, `DELIMITED_CDR2`) encoded messages utilizing extensible types. However we can deserialize these encapsulation kinds in `MessageReader`.

Both do not support:

- `wchar` and `wstring` - These are written and read using custom implementations that are specific to someone's environment. If encountered during deserialization, they will throw an error saying that they are unsupported.

Also see the current IDL parser schema limitations [here](../omgidl-parser/README.md#omg-idl-subset-support)
npm package: @foxglove/ros1
Description: Standalone TypeScript implementation of the ROS 1 (Robot Operating System) protocol with a pluggable transport layer
Author: Foxglove Technologies Inc
Latest version: 3.0.1

# @foxglove/ros1

> _Standalone TypeScript implementation of the ROS 1 (Robot Operating System) protocol with a pluggable transport layer_

[![npm version](https://img.shields.io/npm/v/@foxglove/ros1.svg?style=flat)](https://www.npmjs.com/package/@foxglove/ros1)

## Usage

```Typescript
// An example client that connects to the ROS1 turtlesim node

import { RosNode } from "@foxglove/ros1";
import { getEnvVar, getHostname, getNetworkInterfaces, getPid, TcpSocketNode } from "@foxglove/ros1/nodejs";
import { HttpServerNodejs } from "@foxglove/xmlrpc/nodejs";

async function main() {
  const name = "/testclient";
  let rosNode: RosNode | undefined;

  try {
    rosNode = new RosNode({
      name,
      rosMasterUri: getEnvVar("ROS_MASTER_URI") ?? "http://localhost:11311/",
      hostname: RosNode.GetRosHostname(getEnvVar, getHostname, getNetworkInterfaces),
      pid: getPid(),
      httpServer: new HttpServerNodejs(),
      tcpSocketCreate: TcpSocketNode.Create,
      log: console,
    });

    await rosNode.start();

    const params = await rosNode.subscribeAllParams();
    console.dir(params);

    const sub = rosNode.subscribe({
      topic: "/turtle1/color_sensor",
      dataType: "turtlesim/Color",
    });

    sub.on("message", (msg, data, pub) => {
      console.log(
        `[MSG] ${JSON.stringify(msg)} (${
          data.byteLength
        } bytes from ${pub.connection.getTransportInfo()})`,
      );
    });

    await new Promise((resolve) => setTimeout(resolve, 1000));

    console.dir(sub.getStats());
  } catch (err) {
    const msg = (err as Error).stack ?? `${err}`;
    console.error(msg);
  } finally {
    rosNode?.shutdown();
  }
}

void main();
```

### Test

`yarn test`

## License

@foxglove/ros1 is licensed under the [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest

## Stay in touch

Join our [Discord community](https://foxglove.dev/chat) to ask questions, share feedback, and stay up to date on what our team is working on.
npm package: @foxglove/ros2
Description: Standalone TypeScript implementation of the ROS 2 protocol built on @foxglove/rtps
Author: Foxglove
Latest version: 4.0.0

# @foxglove/ros2

> _Standalone TypeScript implementation of the ROS 2 protocol built on [@foxglove/rtps](https://github.com/foxglove/rtps)_

[![npm version](https://img.shields.io/npm/v/@foxglove/ros2.svg?style=flat)](https://www.npmjs.com/package/@foxglove/ros2)

## Usage

A simple listener that is compatible with the ROS 2 "talker" example application.

```Typescript
import { parse as parseMsgDef } from "@foxglove/rosmsg";
import { toString as timeString } from "@foxglove/rostime";
import { RosNode } from "@foxglove/ros2";
import { getNetworkInterfaces, UdpSocketNode } from "@foxglove/ros2/nodejs";

async function main() {
  const ros = new RosNode({
    name: "listener",
    udpSocketCreate: UdpSocketNode.Create,
    getNetworkInterfaces,
    // log: console, // Enable this for verbose console debugging
  });

  await ros.start();

  // Create a message definition for the std_msgs/msg/String type
  const msgDefinition = parseMsgDef("string data", { ros2: true });

  // Subscribe to the /chatter topic
  const subscription = ros.subscribe({
    topic: "/chatter",
    dataType: "std_msgs/msg/String",
    msgDefinition,
  });
  subscription.on("message", (timestamp, msg, _data, _publisher) => {
    const strMsg = msg as { data: string };
    console.log(`[INFO] [${timeString(timestamp)}] [listener]: I heard: [${strMsg.data}]`);
  });

  // Listen for Ctrl+C to stop
  process.on("SIGINT", () => void shutdown(ros));

  // Wait for Ctrl+C
  process.stdin.resume();
}

async function shutdown(ros: RosNode) {
  await ros.shutdown();
  process.exit();
}

void main();
```

## Notes

Receiving large (>256KB) messages not be possible with the default Linux networking receive buffer size of 256KB, depending on CPU speed / contention / network speed / many factors. Linux users should set the following sysctls:

```
sudo sysctl -w net.core.rmem_max=26214400
sudo sysctl -w net.core.rmem_default=26214400
sudo sysctl -w net.ipv4.udp_mem=26214400
```

Or permanently in `/etc/sysctl.conf`:

```
net.core.rmem_max=26214400
net.core.rmem_default=26214400
net.ipv4.udp_mem=26214400
```

### Test

`yarn test`

## License

@foxglove/ros2 is licensed under [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest
npm package: @foxglove/rosbag2
Description: ROS 2 (Robot Operating System) bag reader and writer abstract implementation
Author: Foxglove Technologies Inc
Latest version: 6.0.0

# @foxglove/rosbag2

> _ROS2 (Robot Operating System) legacy SQLite bag reader abstract implementation_

[![npm version](https://img.shields.io/npm/v/@foxglove/rosbag2.svg?style=flat)](https://www.npmjs.com/package/@foxglove/rosbag2)

**NOTICE**: The SQLite rosbag2 recording format has been replaced by [MCAP](https://mcap.dev/). This package is only useful for reading legacy rosbag2 `.db3` files.

**Developers**: Use [@foxglove/rosbag2-node](https://github.com/foxglove/rosbag2-node) or [@foxglove/rosbag2-web](https://github.com/foxglove/rosbag2-web)

This package contains the subset of the full rosbag2 SQLite implementation that can be shared across node.js and web environments. It cannot read rosbag2 `.db3` files on its own. You are probably looking for the [@foxglove/rosbag2-node](https://github.com/foxglove/rosbag2-node) or [@foxglove/rosbag2-web](https://github.com/foxglove/rosbag2-web) package unless you are writing your own bag parsing implementation.

## License

@foxglove/rosbag2 is licensed under the [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest

## Stay in touch

Join our [Slack channel](https://foxglove.dev/slack) to ask questions, share feedback, and stay up to date on what our team is working on.
npm package: @foxglove/rosbag2-node
Description: ROS 2 (Robot Operating System) bag reader and writer for node.js
Author: Foxglove Technologies
Latest version: 5.0.0

# @foxglove/rosbag2-node

> _ROS 2 (Robot Operating System) bag reader and writer for node.js 👜_

[![npm version](https://img.shields.io/npm/v/@foxglove/rosbag2-node.svg?style=flat)](https://www.npmjs.com/package/@foxglove/rosbag2-node)

## Introduction

`rosbag2-node` enables [Node.js](https://nodejs.org/en/) to read the contents of ROS 2 SQLite files. It is used by [Foxglove](https://foxglove.dev) to support reading data in this legacy file format. This SQLite format has been superseded by [MCAP](https://mcap.dev).

## License

@foxglove/rosbag2-node is licensed under the [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest

## Stay in touch

Join our [Slack channel](https://foxglove.dev/slack) to ask questions, share feedback, and stay up to date on what our team is working on.
npm package: @foxglove/rosbag2-web
Description: ROS2 (Robot Operating System) bag reader and writer for the browser
Author: Foxglove Technologies Inc
Latest version: 5.0.0

# @foxglove/rosbag2-web

> _ROS 2 (Robot Operating System) bag reader for the browser 👜_

[![npm version](https://img.shields.io/npm/v/@foxglove/rosbag2-web.svg?style=flat)](https://www.npmjs.com/package/@foxglove/rosbag2-web)

## Introduction

`rosbag2-web` enables web browsers to read the contents of ROS 2 SQLite files. It is used by [Foxglove](https://foxglove.dev) to support reading data in this legacy file format. This SQLite format has been superseded by [MCAP](https://mcap.dev).

## License

@foxglove/rosbag2-web is licensed under the [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest

## Stay in touch

Join our [Slack channel](https://foxglove.dev/slack) to ask questions, share feedback, and stay up to date on what our team is working on.
npm package: @foxglove/rosmsg-msgs-foxglove
Description: ROS 1 foxglove_msgs/ImageMarkerArray message definition
Author: Foxglove Technologies Inc
Latest version: 3.0.0
Deprecated: Use @foxglove/schemas instead

# @foxglove/rosmsg-msgs-foxglove

**NOTICE: This package is deprecated. It will be archived soon. Please use [@foxglove/schemas](https://github.com/foxglove/schemas) instead.**

> This library exports a map of ROS 1 datatype string keys to [@foxglove/message-definition](https://github.com/foxglove/message-definition) `MessageDefinition` values for Foxglove ROS message definitions. The message definitions include all dependent message definitions, similar to the output of the `gendeps --cat` command.

[![npm version](https://img.shields.io/npm/v/@foxglove/rosmsg-msgs-foxglove.svg?style=flat)](https://www.npmjs.com/package/@foxglove/rosmsg-msgs-foxglove)

## License

@foxglove/rosmsg-msgs-foxglove is licensed under [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest

## Stay in touch

Join our [Slack channel](https://foxglove.dev/join-slack) to ask questions, share feedback, and stay up to date on what our team is working on.
npm package: @foxglove/rosmsg-serialization
Description: ROS 1 message serialization, for reading and writing bags and network messages
Author: Foxglove Technologies Inc
Latest version: 2.0.4

# @foxglove/rosmsg-serialization

> _ROS1 (Robot Operating System) message serialization, for reading and writing bags and network messages_

[![npm version](https://img.shields.io/npm/v/@foxglove/rosmsg-serialization.svg?style=flat)](https://www.npmjs.com/package/@foxglove/rosmsg-serialization)

## MessageReader

Message reader deserializes ROS messages into plain objects. The messages are fully deserialized.

```typescript
import { MessageReader } from "@foxglove/rosmsg-serialization";

// message definition comes from `parse()` in @foxglove/rosmsg
const reader = new MessageReader(messageDefinition);

// deserialize a buffer into an object
const message = reader.readMessage([0x00, 0x00, ...]);

// access message fields
message.header.stamp;
```

## LazyMessage

Lazy messages provide on-demand access and deserialization to fields of a serialized ROS message. Creating
a lazy message from a buffer performs no de-serialization during creation. Only accessed fields are
deserialized; the deserialization occurs at access time.

```Typescript
import { LazyMessageReader } from "@foxglove/rosmsg-serialization";

// message definition comes from `parse()` in @foxglove/rosmsg
const reader = new LazyMessageReader(messageDefinition);

// build a new lazy message instance for our serialized message from the Uint8Array
// Note: since deserialization is lazy - avoid-reusing the array you provide for other messages
const message = reader.readMessage([0x00, 0x00, ...]);

// access message fields
message.header.stamp;
```

## MessageWriter

Convert an object, array, or primitive value into binary data using ROS message serialization.

```Typescript
import { MessageWriter } from "@foxglove/rosmsg-serialization";

// message definition comes from `parse()` in @foxglove/rosmsg
const writer = new MessageWriter(pointStampedMessageDefinition);

// serialize the passed in object to a Uint8Array as a geometry_msgs/PointStamped message
const uint8Array = writer.writeMessage({
  header: {
    seq: 0,
    stamp: { sec: 0, nsec: 0 },
    frame_id: ""
  },
  x: 1,
  y: 0,
  z: 0
});
```

### Test

`yarn test`

## License

@foxglove/rosmsg-serialization is licensed under the [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest

## Benchmarks

The `bench` folder contains benchmarks. Run with:

```
yarn bench
yarn bench:benny
```

To run benchmarks in web:

```
yarn bench:web
```

## Stay in touch

Join our [Discord community](https://foxglove.dev/chat) to ask questions, share feedback, and stay up to date on what our team is working on.
npm package: @foxglove/rosmsg2-serialization
Description: ROS 2 message serialization, for reading and writing bags and network messages
Author: Foxglove Technologies Inc
Latest version: 3.0.3

# @foxglove/rosmsg2-serialization

> _ROS 2 (Robot Operating System) message serialization, for reading and writing bags and network messages_

[![npm version](https://img.shields.io/npm/v/@foxglove/rosmsg2-serialization.svg?style=flat)](https://www.npmjs.com/package/@foxglove/rosmsg2-serialization)

## MessageReader

Message reader deserializes ROS 2 CDR messages into plain objects. The messages are fully deserialized.

```typescript
import { MessageReader } from "@foxglove/rosmsg2-serialization";

// message definition comes from `parse()` in @foxglove/rosmsg
const reader = new MessageReader(messageDefinition);

// specify a different `timeType` for time objects compatible with ROS 1 and @foxglove/rostime
const reader = new MessageReader(messageDefinition, { timeType: "sec,nsec" });

// deserialize a buffer into an object
const message = reader.readMessage([0x00, 0x01, ...]);

// access message fields
message.header.stamp;
```

## MessageWriter

Convert an object, array, or primitive value into binary data using ROS 2 CDR message serialization.

```Typescript
import { MessageWriter } from "@foxglove/rosmsg2-serialization";

// message definition comes from `parse()` in @foxglove/rosmsg
const writer = new MessageWriter(pointStampedMessageDefinition);

// serialize the passed in object to a Uint8Array as a geometry_msgs/PointStamped message
const uint8Array = writer.writeMessage({
  header: {
    stamp: { sec: 0, nanosec: 0 },
    frame_id: ""
  },
  x: 1,
  y: 0,
  z: 0
});
```

### Test

`yarn test`

## License

@foxglove/rosmsg2-serialization is licensed under the [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest

## Stay in touch

Join our [Discord community](https://foxglove.dev/chat) to ask questions, share feedback, and stay up to date on what our team is working on.
npm package: @foxglove/rostime
Description: ROS (Robot Operating System) Time and Duration primitives and helper methods
Author: Foxglove Technologies Inc
Latest version: 1.1.2

# @foxglove/rostime

> _ROS (Robot Operating System) Time and Duration primitives and helper methods_

[![npm version](https://img.shields.io/npm/v/@foxglove/rostime.svg?style=flat)](https://www.npmjs.com/package/@foxglove/rostime)

## Introduction

[ROS](https://www.ros.org/) (Robot Operating System) defines two primitive types for dealing with time, `ros::Time` and `ros::Duration` (see http://wiki.ros.org/roscpp/Overview/Time). These are both represented by the same data type, `{ sec: number; nsec: number }` and serialized as a pair of 32-bit integers (seconds, then nanoseconds). This package provides a TypeScript type definition for these types and helper methods for working with ROS time and duration values.

## Usage

```Typescript
import * as rostime from "@foxglove/rostime";

const a = { sec: 1, nsec: 0 };
const b = rostime.fixTime({ sec: 0, nsec: 1e9 });
console.log(`${rostime.toString(a)} == ${rostime.toString(b)} (${rostime.areEqual(a, b)})`);
```

## License

@foxglove/rostime is licensed under [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest

## Stay in touch

Join our [Slack channel](https://foxglove.dev/join-slack) to ask questions, share feedback, and stay up to date on what our team is working on.
npm package: @foxglove/rtps
Description: Real-Time Publish Subscribe (DDS-RTPS) protocol implementation with a pluggable transport layer. This is a subset of the complete specification optimized for ROS 2 (Robot Operating System) connections
Author: Foxglove Technologies
Latest version: 1.6.0

# @foxglove/rtps

> _Real-Time Publish Subscribe (DDS-RTPS) protocol implementation with a pluggable transport layer. This is a subset of the complete specification optimized for ROS 2 (Robot Operating System) connections_

[![npm version](https://img.shields.io/npm/v/@foxglove/rtps.svg?style=flat)](https://www.npmjs.com/package/@foxglove/rtps)

## Usage

```Typescript
...
```

## Notes

Receiving large (>256KB) messages not be possible with the default Linux networking receive buffer size of 256KB, depending on CPU speed / contention / network speed / many factors. Linux users should set the following sysctls:

```
sudo sysctl -w net.core.rmem_max=26214400
sudo sysctl -w net.core.rmem_default=26214400
sudo sysctl -w net.ipv4.udp_mem=26214400
```

Or permanently in `/etc/sysctl.conf`:

```
net.core.rmem_max=26214400
net.core.rmem_default=26214400
net.ipv4.udp_mem=26214400
```

### Test

`yarn test`

## License

@foxglove/rtps is licensed under [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest
npm package: @foxglove/schemas
Description: Foxglove-defined message schemas for ROS, Protobuf, FlatBuffers, OMG IDL, and JSON
Author: Foxglove
Latest version: 1.13.0

# @foxglove/schemas

This package contains TypeScript type definitions and JSON Schemas for the Foxglove schemas.

## Installation

```bash
npm install @foxglove/schemas
```

## Usage

For a list of available schemas, see https://docs.foxglove.dev/docs/visualization/message-schemas/introduction

```ts
import type { CompressedImage } from '@foxglove/schemas';
import { CompressedImage } from '@foxglove/schemas/jsonschema';
```
npm package: @foxglove/three-text
Description: Render text in 3D using Signed Distance Fields
Author: Foxglove
Latest version: 0.6.0

# @foxglove/three-text

Render text in 3D using Signed Distance Fields

[![npm version](https://img.shields.io/npm/v/@foxglove/three-text.svg)](https://www.npmjs.com/package/@foxglove/three-text)

![demo of three-text](https://user-images.githubusercontent.com/14237/185552879-3301a9d0-d749-4b48-8fcd-ddfd8d0871f3.gif)

## Usage examples

View live example [in Storybook](https://main--62ff21ad11a55228f80a9365.chromatic.com/?path=/story/labelpool--basic). View example usage at [LabelPool.stories.tsx](./src/LabelPool.stories.tsx).

To run Storybook locally, run `yarn storybook`.
npm package: @foxglove/velodyne-cloud
Description: TypeScript library for converting Velodyne LIDAR packet data to point clouds
Author: Foxglove Technologies Inc
Latest version: 1.0.1

# @foxglove/velodyne-cloud

> _TypeScript library for converting Velodyne LIDAR packet data to point clouds_

[![npm version](https://img.shields.io/npm/v/@foxglove/velodyne-cloud.svg?style=flat)](https://www.npmjs.com/package/@foxglove/velodyne-cloud)

## Introduction

[Velodyne](https://velodynelidar.com/) LIDAR hardware broadcasts a steady stream of UDP packets representing laser scan data. These raw packets need to be converted to point clouds using calibration data specific to each hardware model. This TypeScript library provides best-effort detection of Velodyne hardware model from analyzing packets and includes calibration data to automatically convert raw data into a 3D point cloud representation.

This library is used in [Foxglove Studio](https://foxglove.dev/) to convert [velodyne_msgs/VelodyneScan](http://docs.ros.org/en/indigo/api/velodyne_msgs/html/msg/VelodyneScan.html) ROS messages to [sensor_msgs/PointCloud2](http://docs.ros.org/en/melodic/api/sensor_msgs/html/msg/PointCloud2.html) messages.

## Usage

```Typescript
import {
  Calibration,
  PointCloud,
  PointFieldDataType,
  RawPacket,
  Transformer
} from "@foxglove/velodyne-cloud";

type VelodynePacket = {
  stamp: { sec: number, nsec: number };
  data: Uint8Array;
};

// NOTE: Use the packetRate() function to determine how many packets are needed
// to create a full 360 degree scan

function createPointCloud(packets: VelodynePacket[]) {
  if (packets.length === 0) return undefined;

  const firstPacket = new RawPacket(packets[0].data);
  const model = firstPacket.inferModel();
  if (model == undefined) return undefined;

  const stamp = firstPacket.timestamp();
  const maxPoints = RawPacket.MAX_POINTS_PER_PACKET * packets.length;
  const cloud = new PointCloud({ stamp, maxPoints });
  const transformer = new Transformer(new Calibration(model));

  for (const packet of packets) {
    transformer.unpack(new RawPacket(packet.data), stamp, undefined, cloud);
  }

  cloud.trim();

  console.log(
    `Created ${cloud.width}x${cloud.height} dense little endian point cloud data. ` +
    `${cloud.data.byteLength} bytes total with ${cloud.point_step} byte point step, ` +
    `${cloud.row_step} byte row step, and the following fields:`
  );
  for (const field of cloud.fields) {
    console.log(
      `  [${field.name}] offset=${field.offset}, ` +
      `datatype=${PointFieldDataType[field.datatype]}, ` +
      `count=${field.count}`
    );
  }
}
```

## License

@foxglove/velodyne-cloud is licensed under [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest

## Stay in touch

Join our [Slack channel](https://foxglove.dev/join-slack) to ask questions, share feedback, and stay up to date on what our team is working on.
npm package: @foxglove/wasm-bz2
Description: Bzip2 decompression compiled to WebAssembly
Author: Foxglove
Latest version: 0.3.0

# @foxglove/wasm-bz2

[![npm version](https://img.shields.io/npm/v/@foxglove/wasm-bz2)](https://www.npmjs.com/package/@foxglove/wasm-bz2)

Bzip2 decompression compiled to WebAssembly

## Introduction

This package provides a WebAssembly build of https://gitlab.com/bzip2/bzip2, the official Bzip2 library. Currently only a decompression function is provided.

## Usage

```ts
import Bzip2 from "@foxglove/wasm-bz2";

const bzip2 = await Bzip2.init();

try {
  const buffer = new Uint8Array([...]);
  const maxSize = 100;
  const decompressedBuffer = Bzip2.decompress(buffer, maxSize, { small: false });
} catch (error) {
  console.error(error);
}
```

## Stay in touch

Join our [Slack channel](https://foxglove.dev/slack) to ask questions, share feedback, and stay up to date on what our team is working on.
npm package: @foxglove/wasm-edgesgeometry
Description: THREE.js EdgesGeometry implementation in C++ compiled to WebAssembly
Author: Foxglove
Latest version: 1.0.0

# @foxglove/wasm-edgesgeometry

[![npm version](https://img.shields.io/npm/v/@foxglove/wasm-edgesgeometry)](https://www.npmjs.com/package/@foxglove/wasm-edgesgeometry)

THREE.js EdgesGeometry implementation in C++ compiled to WebAssembly

## Introduction

This package provides a WebAssembly build of https://threejs.org/docs/#api/en/geometries/EdgesGeometry, a helper method to generate a line list of edges from indexed or unindexed triangles. Run `yarn bench` to compare the performance of this library against the THREE.js implementation. It should be close to 10x faster for anything from a simple cube to >1MM triangles.

## Usage

```ts
import { EdgesGeometry } from "@foxglove/wasm-edgesgeometry";

const positions = new Float32Array([
  0.0, 0.0, 0.0,
  1.0, 0.0, 0.0,
  0.0, 1.0, 0.0,
  0.0, 0.0, 1.0,
]);
const indices = new Uint32Array([
  0, 1, 2,
  0, 2, 3,
]);

const edgesGeometry = await EdgesGeometry.init();

try {
  // Generate edges from positions and indices with a threshold angle of 40
  // degrees. If positions is unindexed, set indices to undefined
  const result = edgesGeometry.createEdges(positions, indices, 40);
  // The returned Float32Array is a view into WASM memory that will be
  // overwritten on the next call to createEdges. We create a copy here to avoid
  // the underlying memory being overwritten
  const lineListBuffer = result.slice();
  // This should print 30: 5 lines made up of <XYZ><XYZ>
  console.log(lineListBuffer.length);
} catch (error) {
  console.error(error);
}
```

## Stay in touch

Join our [Slack channel](https://foxglove.dev/join-slack) to ask questions, share feedback, and stay up to date on what our team is working on.
npm package: @foxglove/wasm-lz4
Description: https://github.com/lz4/lz4 compiled to WebAssembly. For now only decompression is supported. PRs welcome!
Latest version: 1.0.2

# @foxglove/wasm-lz4

https://github.com/lz4/lz4 compiled to WebAssembly. For now only decompression is supported. PRs welcome!

## API

`wasm-lz4` exports a single function:

```js
export default (buffer: Buffer, destinationByteSize: number) => Buffer;
```

Here is an example of using the module:

```js
import fs from "fs";
import decompress from "wasm-lz4";

const compressedBytes = fs.readFileSync("compressed.lz4");

// currently you need to know the exact expected size of the output buffer
// so the wasm runtime can allocate enough bytes to decompress into
// TODO: this should not be necessary...it's exposed in the lz4 C code
const outputBytes = compressedBytes * 10;
const decompressedBytes = decompress(compressedBytes, outputBytes);
```

## Using the module in a browser

Emscripten compiled WebAssembly modules are built in 2 parts: a `.js` side and a `.wasm` side. In the browser the `.js` side needs to download the `.wasm` side from the server so it can compile it. There is [more information available in the emscripten documentation](https://kripken.github.io/emscripten-site/docs/compiling/Deploying-Pages.html).

### Usage with Webpack

We require the `wasm-lz4.wasm` module in our `locateFile` definition, so that module bundling with dynamic paths is possible. So if you are using Webpack, you can add the following entry:

```
...
rules : [
  ...
  {
    test: /\.wasm$/,
    type: "javascript/auto",
    use: {
      loader: "file-loader",
      options: {
        name: "[name]-[hash].[ext]",
      },
    },
  },
  ...
]
...
```

The `javascript/auto` type setting tells Webpack to bypass its default importing logic, and just import the file as-is. Hopefully this hack will go away with improved WebAssembly support in webpack.

## Asynchronous loading & compiling

After the `.wasm` binary is loaded (via `fetch` in the browser or `require` in node) it must be compiled by the WebAssembly runtime. If you call `decompress` before it is finished compiling it will throw an error indicating it isn't ready yet. To wait for the module to be loaded you can do something like the following:

```
import decompress from 'wasm-lz4'

async function doWork() {
  await decompress.isLoaded;
  decompress(buffer, outputByteLength);
}
```

## Developing locally

1. Run `npm install` to install dependencies.
2. Run `npm run build` to invoke emcc inside a Docker container and compile the code in `wasm-lz4.c` as well as the required lz4 source files. The output will be in `dist/` on the host machine.
3. Run `npm test` to run the tests.

## License

@foxglove/wasm-lz4 is licensed under [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest

## Stay in touch

Join our [Slack channel](https://foxglove.dev/join-slack) to ask questions, share feedback, and stay up to date on what our team is working on.
npm package: @foxglove/wasm-zstd
Description: https://github.com/facebook/zstd compiled to WebAssembly and exposed as a high-level TypeScript/JavaScript API . PRs welcome!
Latest version: 1.0.1

# @foxglove/wasm-zstd

https://github.com/facebook/zstd compiled to WebAssembly and exposed as a high-level TypeScript/JavaScript API . PRs welcome!

## API

`@foxglove/wasm-zstd` exports:

```typescript
export const isLoaded: Promise<boolean>;
export function compressBound(size: number): number;
export function compress(buffer: Uint8Array, compressionLevel?: number): Buffer;
export function decompress(buffer: Uint8Array, size: number): Buffer;
```

Here is an example of compressing then decompressing with this library:

```js
import fs from "fs/promises";
import zstd from "@foxglove/wasm-zstd";

async function main() {
  const inputData = await fs.readFile("input.txt");

  // Wait for the wasm module to load
  await zstd.isLoaded;

  // Compress and save to a file with zstd compression level 3
  const compressedBytes = zstd.compress(inputData, 3);
  await fs.writeFile("compressed.zst", compressedBytes);

  // Currently you need to know the size of the output buffer so the wasm runtime
  // can allocate enough bytes to decompress into
  const outputSize = inputData.byteLength;

  // Decompress
  const decompressedBytes = zstd.decompress(compressedBytes, inputData.byteLength);
  assert(decompressedBytes.byteLength === inputData.byteLength);
}
```

## Using the module in a browser

Emscripten compiled WebAssembly modules are built in 2 parts: a `.js` side and a `.wasm` side. In the browser the `.js` side needs to download the `.wasm` side from the server so it can compile it. There is [more information available in the emscripten documentation](https://kripken.github.io/emscripten-site/docs/compiling/Deploying-Pages.html).

## Developing locally

1. Run `yarn install` to install dependencies.
2. Run `yarn build` to invoke emcc inside a Docker container and compile the code in `wasm-zstd.c` as well as the required zstd source files. The output will be in `dist/` on the host machine.
3. Run `yarn test` to run the tests.

## License

@foxglove/wasm-zstd is licensed under [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest

## Stay in touch

Join our [Slack channel](https://foxglove.dev/join-slack) to ask questions, share feedback, and stay up to date on what our team is working on.
npm package: @foxglove/ws-protocol-examples
Description: Foxglove WebSocket protocol examples
Author: Foxglove Technologies
Latest version: 0.10.0

# Foxglove WebSocket examples

This package provides example server and client implementations of the [Foxglove WebSocket protocol](https://github.com/foxglove/ws-protocol). The protocol enables [Foxglove](https://foxglove.dev/) to ingest arbitrary “live” streamed data.

To list all possible actions, run the following command:

```
$ npx @foxglove/ws-protocol-examples@latest --help
```

## Example servers

Run the `sysmon` example server, which uses JSON-encoded data to transmit system monitoring information like memory and CPU usage:

```
$ npx @foxglove/ws-protocol-examples@latest sysmon
```

Run the `image-server` example server, which uses JSON-encoded data to transmit images:

```
$ npx @foxglove/ws-protocol-examples@latest image-server
```

Run the `mcap-play` example server, which plays back recorded data from a local [MCAP](https://mcap.dev) file:

```
$ npx @foxglove/ws-protocol-examples@latest mcap-play <file> [--rate 1.0] [--loop]
```

_Note:_ You must exit each server (<kbd>control</kbd> + <kbd>c</kbd>) before starting up another.

To see data from any server, open [Foxglove](https://app.foxglove.dev/~/view?ds=foxglove-websocket&ds.url=ws://localhost:8765/) with a Foxglove WebSocket connection to `ws://localhost:8765/`:

<img width="500" alt="Foxglove displaying memory and CPU usage from the system monitor example" src="https://user-images.githubusercontent.com/14237/145313065-85c05645-6b29-4eb2-a498-849c83f8792d.png">
<img width="500" alt="Foxglove displaying images from the image server example" src="https://user-images.githubusercontent.com/14237/146500927-4a1408c7-0725-49e7-8185-71b0280c0a8b.png">

## Example clients

Run a simple example client that subscribes to messages with the `protobuf` or `json` encoding:

```
$ npx @foxglove/ws-protocol-examples@latest simple-client ws://localhost:8765
```

Run a client that advertises the `/chatter` topic and publishes messages to it with `json` or `ros1` encoding:

```
$ npx @foxglove/ws-protocol-examples@latest publish-client -e json ws://localhost:8765
```

Connect to a server and record message data into an [MCAP](https://mcap.dev) file:

```
$ npx @foxglove/ws-protocol-examples@latest mcap-record ws://localhost:8765 -o <file.mcap>
```

## Development

This package lives inside a monorepo that uses [yarn workspaces](https://yarnpkg.com/features/workspaces), so most commands (other than `yarn install`) should be prefixed with `yarn workspace @foxglove/ws-protocol-examples ...`.

- `yarn install` – Install development dependencies
- `yarn workspace @foxglove/ws-protocol-examples version --patch` (or `--minor` or `--major`) – Increment the version number and create the appropriate git tag
- `yarn workspace @foxglove/ws-protocol-examples run-example --help` – Run the example scripts
npm package: @foxglove/xmlrpc
Description: TypeScript library implementing an XMLRPC client and server with pluggable server backend
Author: Foxglove Technologies Inc
Latest version: 1.3.0

# @foxglove/xmlrpc

TypeScript library implementing an XMLRPC client and server with pluggable server backend.

[![npm version](https://img.shields.io/npm/v/@foxglove/xmlrpc.svg?style=flat)](https://www.npmjs.com/package/@foxglove/xmlrpc)

## Usage

See the `examples` directory for a simple client and server example.

## License

@foxglove/xmlrpc is licensed under [MIT License](https://opensource.org/licenses/MIT).

## Releasing

1. Run `yarn version --[major|minor|patch]` to bump version
2. Run `git push && git push --tags` to push new tag
3. GitHub Actions will take care of the rest

## Stay in touch

Join our [Slack channel](https://foxglove.dev/join-slack) to ask questions, share feedback, and stay up to date on what our team is working on.
npm package: @foxglovetech/turbo-form
Description: Enhances forms with turbolinks like declarations.
Author: alvincrespo
Latest version: 1.3.0

[![CircleCI](https://circleci.com/gh/alvincrespo/turbo-form/tree/main.svg?style=svg)](https://circleci.com/gh/alvincrespo/turbo-form/tree/main)

# Turbo Form

This library helps port some functionality from [rails-ujs](https://github.com/rails/rails/commit/ad3a47759e67a411f3534309cdd704f12f6930a7) to [Turbo](https://turbo.hotwired.dev/).

If you've ever used [`link_to`](https://guides.rubyonrails.org/working_with_javascript_in_rails.html#link-to) with `remote: true` and are thinking about using Turbo as a replacement to UJS - you'll need to do some [extra work](https://github.com/hotwired/turbo-rails/blob/main/UPGRADING.md). However, Turbo give us everything we need to port over this functionality.

Thus, this library.

With this library, you just need to make some slight changes. For example,

**Before**

```erb
<%= link_to "Delete article", @article, remote: true, method: :delete %>
```

**After**

```erb
<%= link_to "Delete article", @article, data: { controller: "link-method", method: "delete" } %>
```

The idea is to continue moving forward with Turbo with minimal changes to existing app code.

## Installation

```
yarn add @foxglovetech/turbo-form
```

## Usage

### Setup

The first you'll want to do is register the controllers:

```javascript
import {
  ConfirmController,
  LinkMethodController,
} from "@foxglovetech/turbo-form";

const application = Application.start();
application.register("confirm", ConfirmController);
application.register("link-method", LinkMethodController);
```

### `ConfirmController`

If you're looking for a confirmation dialog:

```erb
<%= button_to "Delete This", some_path(resource_name), data: { controller: "confirm", confirm_message: "Are you sure?" }, method: :delete %>
```

### `LinkMethodController`

If you need a link to make a request:

```erb
<%= link_to "Duplicate", some_path(resource_name), data: { controller: "link-method", method: "post" } %>
```

## Development

Checkout the [CONTRIBUTING](./CONTRIBUTING.md) for info on how to help out with contributions/development.

## License

This project is licensed under the [MIT License](./LICENSE)
npm package: @foxhound-ai/mcp-server
Description: MCP server for querying Foxhound traces from Claude Code, Cursor, and other MCP clients
Latest version: 0.1.0

# @foxhound/mcp-server

MCP server for querying Foxhound traces from Claude Code, Cursor, Windsurf, or any MCP-connected IDE.

## Setup

### Claude Code

```bash
claude mcp add foxhound -e FOXHOUND_API_KEY=fox_your_key -e FOXHOUND_ENDPOINT=https://api.foxhound.dev -- npx @foxhound/mcp-server
```

### Cursor / Windsurf

Add to your MCP config (`.cursor/mcp.json` or equivalent):

```json
{
  "mcpServers": {
    "foxhound": {
      "command": "npx",
      "args": ["@foxhound/mcp-server"],
      "env": {
        "FOXHOUND_API_KEY": "fox_your_key",
        "FOXHOUND_ENDPOINT": "https://api.foxhound.dev"
      }
    }
  }
}
```

### Environment Variables

| Variable            | Required | Default                 | Description           |
| ------------------- | -------- | ----------------------- | --------------------- |
| `FOXHOUND_API_KEY`  | Yes      | —                       | Your Foxhound API key |
| `FOXHOUND_ENDPOINT` | No       | `http://localhost:3001` | Foxhound API base URL |

## Tools

### foxhound_search_traces

Search traces by agent name, time range, and status.

```
"Show me all traces for agent billing-bot in the last hour"
"Find error traces from the past 24 hours"
```

**Parameters:** `agent_name`, `status` (ok/error), `from`, `to` (ISO 8601 or epoch ms), `limit`

### foxhound_get_trace

Get the full trace with its complete span tree.

```
"Get trace abc-123 and show me the span tree"
"What happened in trace def-456?"
```

**Parameters:** `trace_id`

### foxhound_replay_span

Reconstruct agent state at a specific span — LLM context, tool inputs, and memory. Requires Pro plan.

```
"Replay span xyz in trace abc-123 — what was the agent's context?"
```

**Parameters:** `trace_id`, `span_id`

### foxhound_diff_runs

Compare two agent runs side-by-side and surface divergence points. Requires Pro plan.

```
"Compare runs abc and def — why did the second one fail?"
```

**Parameters:** `trace_id_a`, `trace_id_b`

### foxhound_get_anomalies

Surface behavioral anomalies — slow spans, error spikes, or unusual tool usage patterns.

```
"Any anomalies for billing-bot in the last 12 hours?"
"Show me error spikes for the onboarding agent"
```

**Parameters:** `agent_name`, `hours` (lookback window, default 24)

### foxhound_get_cost_summary

Get span usage and billing period summary.

```
"How many spans have we used this period?"
```

**Parameters:** `agent_name` (optional, org-level by default)

## Development

```bash
npm install
npm run build
npm test
npm run typecheck
```

## License

MIT