open-index/open-npm huggingface dataset:
npm package: @lynx-js/qrcode-rsbuild-plugin
Description: A rsbuild plugin for printing QRCode in terminal
Author: Qingyu Wang
Latest version: 0.4.6

<p align="center">
  <a href="https://lynxjs.org/rspeedy" target="blank"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/rspeedy-banner.png" alt="Rspeedy Logo" /></a>
</p>

<p>
  <a aria-label="NPM version" href="https://www.npmjs.com/package/@lynx-js/qrcode-rsbuild-plugin">
    <img alt="" src="https://img.shields.io/npm/v/@lynx-js/qrcode-rsbuild-plugin?logo=npm">
  </a>
  <a aria-label="License" href="https://www.npmjs.com/package/@lynx-js/qrcode-rsbuild-plugin">
    <img src="https://img.shields.io/badge/License-Apache--2.0-blue" alt="license" />
  </a>
</p>

A Rsbuild plugin that generates and displays QR codes for Lynx bundles directly in the terminal.

## Getting Started

```bash
npm install -D @lynx-js/qrcode-rsbuild-plugin
```

## Usage

<!-- eslint-disable -->

```js
import { pluginQRCode } from '@lynx-js/qrcode-rsbuild-plugin'

export default {
  plugins: [pluginQRCode()],
}
```

## Options

### `schema`

Type: `(url: string) => string | Record<string, string>`\
Default: `(url) => ({ http: url })`

The `schema` option allows you to customize the URL format displayed in the QR code.

<!-- eslint-disable -->

```js
import { pluginQRCode } from '@lynx-js/qrcode-rsbuild-plugin'
import { defineConfig } from '@lynx-js/rspeedy'

export default defineConfig({
  plugins: [
    pluginQRCode({
      schema(url) {
        return `lynx://${url}?dev=1`
      },
    }),
  ],
})
```

You can also define multiple schemas to switch between them by pressing `a` in the terminal:

<!-- eslint-disable -->

```js
import { pluginQRCode } from '@lynx-js/qrcode-rsbuild-plugin'
import { defineConfig } from '@lynx-js/rspeedy'

export default defineConfig({
  plugins: [
    pluginQRCode({
      schema(url) {
        return {
          http: url,
          foo: `foo://lynx?url=${encodeURIComponent(url)}&dev=1`,
          bar: `bar://lynx?url=${encodeURIComponent(url)}`,
        }
      },
    }),
  ],
})
```

## Documentation

Visit [Lynx Website](https://lynxjs.org/api/rspeedy/qrcode-rsbuild-plugin.pluginqrcode.html) to view the full documentation.

## Contributing

Contributions to Rspeedy are welcome and highly appreciated. However, before you jump right into it, we would like you to review our [Contribution Guidelines](/CONTRIBUTING.md) to make sure you have a smooth experience contributing to this project.

## License

Rspeedy is Apache-2.0 licensed.
npm package: @lynx-js/qrcode-rsbuild-plugin-canary
Description: A rsbuild plugin for printing QRCode in terminal
Author: Qingyu Wang
Latest version: 0.4.6

<p align="center">
  <a href="https://lynxjs.org/rspeedy" target="blank"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/rspeedy-banner.png" alt="Rspeedy Logo" /></a>
</p>

<p>
  <a aria-label="NPM version" href="https://www.npmjs.com/package/@lynx-js/qrcode-rsbuild-plugin">
    <img alt="" src="https://img.shields.io/npm/v/@lynx-js/qrcode-rsbuild-plugin?logo=npm">
  </a>
  <a aria-label="License" href="https://www.npmjs.com/package/@lynx-js/qrcode-rsbuild-plugin">
    <img src="https://img.shields.io/badge/License-Apache--2.0-blue" alt="license" />
  </a>
</p>

A Rsbuild plugin that generates and displays QR codes for Lynx bundles directly in the terminal.

## Getting Started

```bash
npm install -D @lynx-js/qrcode-rsbuild-plugin
```

## Usage

<!-- eslint-disable -->

```js
import { pluginQRCode } from '@lynx-js/qrcode-rsbuild-plugin'

export default {
  plugins: [pluginQRCode()],
}
```

## Options

### `schema`

Type: `(url: string) => string | Record<string, string>`\
Default: `(url) => ({ http: url })`

The `schema` option allows you to customize the URL format displayed in the QR code.

<!-- eslint-disable -->

```js
import { pluginQRCode } from '@lynx-js/qrcode-rsbuild-plugin'
import { defineConfig } from '@lynx-js/rspeedy'

export default defineConfig({
  plugins: [
    pluginQRCode({
      schema(url) {
        return `lynx://${url}?dev=1`
      },
    }),
  ],
})
```

You can also define multiple schemas to switch between them by pressing `a` in the terminal:

<!-- eslint-disable -->

```js
import { pluginQRCode } from '@lynx-js/qrcode-rsbuild-plugin'
import { defineConfig } from '@lynx-js/rspeedy'

export default defineConfig({
  plugins: [
    pluginQRCode({
      schema(url) {
        return {
          http: url,
          foo: `foo://lynx?url=${encodeURIComponent(url)}&dev=1`,
          bar: `bar://lynx?url=${encodeURIComponent(url)}`,
        }
      },
    }),
  ],
})
```

## Documentation

Visit [Lynx Website](https://lynxjs.org/api/rspeedy/qrcode-rsbuild-plugin.pluginqrcode.html) to view the full documentation.

## Contributing

Contributions to Rspeedy are welcome and highly appreciated. However, before you jump right into it, we would like you to review our [Contribution Guidelines](/CONTRIBUTING.md) to make sure you have a smooth experience contributing to this project.

## License

Rspeedy is Apache-2.0 licensed.
npm package: @lynx-js/react-rsbuild-plugin
Description: A rsbuild plugin for ReactLynx
Author: Qingyu Wang
Latest version: 0.15.0

<p align="center">
  <a href="https://lynxjs.org/rspeedy" target="blank"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/rspeedy-banner.png" alt="Rspeedy Logo" /></a>
</p>

<p>
  <a aria-label="NPM version" href="https://www.npmjs.com/package/@lynx-js/react-rsbuild-plugin">
    <img alt="" src="https://img.shields.io/npm/v/@lynx-js/react-rsbuild-plugin?logo=npm">
  </a>
  <a aria-label="License" href="https://www.npmjs.com/package/@lynx-js/react-rsbuild-plugin">
    <img src="https://img.shields.io/badge/License-Apache--2.0-blue" alt="license" />
  </a>
</p>

A Rsbuild plugin to integrate with ReactLynx.

## Getting Started

```bash
npm install -D @lynx-js/react-rsbuild-plugin
```

## Getting Started

<!-- eslint-disable -->

```js
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
import { defineConfig } from '@lynx-js/rspeedy'

export default defineConfig({
  plugins: [
    pluginReactLynx(),
  ],
})
```

## Documentation

Visit [Lynx Website](https://lynxjs.org/api/rspeedy/react-rsbuild-plugin.pluginreactlynx.html) to view the full documentation.

## Contributing

Contributions to Rspeedy are welcome and highly appreciated. However, before you jump right into it, we would like you to review our [Contribution Guidelines](/CONTRIBUTING.md) to make sure you have a smooth experience contributing to this project.

## License

Rspeedy is Apache-2.0 licensed.
npm package: @lynx-js/react-rsbuild-plugin-canary
Description: A rsbuild plugin for ReactLynx
Author: Qingyu Wang
Latest version: 0.15.0

<p align="center">
  <a href="https://lynxjs.org/rspeedy" target="blank"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/rspeedy-banner.png" alt="Rspeedy Logo" /></a>
</p>

<p>
  <a aria-label="NPM version" href="https://www.npmjs.com/package/@lynx-js/react-rsbuild-plugin">
    <img alt="" src="https://img.shields.io/npm/v/@lynx-js/react-rsbuild-plugin?logo=npm">
  </a>
  <a aria-label="License" href="https://www.npmjs.com/package/@lynx-js/react-rsbuild-plugin">
    <img src="https://img.shields.io/badge/License-Apache--2.0-blue" alt="license" />
  </a>
</p>

A Rsbuild plugin to integrate with ReactLynx.

## Getting Started

```bash
npm install -D @lynx-js/react-rsbuild-plugin
```

## Getting Started

<!-- eslint-disable -->

```js
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'
import { defineConfig } from '@lynx-js/rspeedy'

export default defineConfig({
  plugins: [
    pluginReactLynx(),
  ],
})
```

## Documentation

Visit [Lynx Website](https://lynxjs.org/api/rspeedy/react-rsbuild-plugin.pluginreactlynx.html) to view the full documentation.

## Contributing

Contributions to Rspeedy are welcome and highly appreciated. However, before you jump right into it, we would like you to review our [Contribution Guidelines](/CONTRIBUTING.md) to make sure you have a smooth experience contributing to this project.

## License

Rspeedy is Apache-2.0 licensed.
npm package: @lynx-js/rspeedy
Description: A webpack/rspack-based frontend toolchain for Lynx
Author: Qingyu Wang
Latest version: 0.14.1

<p align="center">
  <a href="https://lynxjs.org/rspeedy" target="blank"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/rspeedy-banner.png" alt="Rspeedy Logo" /></a>
</p>

<p>
  <a aria-label="NPM version" href="https://www.npmjs.com/package/@lynx-js/rspeedy">
    <img alt="" src="https://img.shields.io/npm/v/@lynx-js/rspeedy?logo=npm">
  </a>
  <a aria-label="License" href="https://www.npmjs.com/package/@lynx-js/rspeedy">
    <img src="https://img.shields.io/badge/License-Apache--2.0-blue" alt="license" />
  </a>
</p>

The Rspack-based build tool for Lynx.

## Getting Started

```bash
npm create rspeedy@latest
```

## Documentation

Visit [Lynx Website](https://lynxjs.org/rspeedy/index) to view the full documentation.

## Contributing

Contributions to Rspeedy are welcome and highly appreciated. However, before you jump right into it, we would like you to review our [Contribution Guidelines](/CONTRIBUTING.md) to make sure you have a smooth experience contributing to Rspeedy.

## License

Rspeedy is Apache-2.0 licensed.
npm package: @lynx-js/rspeedy-canary
Description: A webpack/rspack-based frontend toolchain for Lynx
Author: Qingyu Wang
Latest version: 0.14.1

<p align="center">
  <a href="https://lynxjs.org/rspeedy" target="blank"><img src="https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/lynx-website/assets/rspeedy-banner.png" alt="Rspeedy Logo" /></a>
</p>

<p>
  <a aria-label="NPM version" href="https://www.npmjs.com/package/@lynx-js/rspeedy">
    <img alt="" src="https://img.shields.io/npm/v/@lynx-js/rspeedy?logo=npm">
  </a>
  <a aria-label="License" href="https://www.npmjs.com/package/@lynx-js/rspeedy">
    <img src="https://img.shields.io/badge/License-Apache--2.0-blue" alt="license" />
  </a>
</p>

The Rspack-based build tool for Lynx.

## Getting Started

```bash
npm create rspeedy@latest
```

## Documentation

Visit [Lynx Website](https://lynxjs.org/rspeedy/index) to view the full documentation.

## Contributing

Contributions to Rspeedy are welcome and highly appreciated. However, before you jump right into it, we would like you to review our [Contribution Guidelines](/CONTRIBUTING.md) to make sure you have a smooth experience contributing to Rspeedy.

## License

Rspeedy is Apache-2.0 licensed.
npm package: @lynx-js/tasm
Description: If you want to compile `lepus_cmd_exec` with **CMake**, please use **`python tools/oliver/lynx-tasm/gn_to_cmake_oliver.py`** to generate or update **CMakeLists.txt** in advance.
Latest version: 0.0.30

## CMake build
If you want to compile `lepus_cmd_exec` with **CMake**, please use **`python tools/oliver/lynx-tasm/gn_to_cmake_oliver.py`** to generate or update **CMakeLists.txt** in advance.
npm package: @lynx-js/template-webpack-plugin
Description: Simplifies creation of Lynx template files to serve your webpack bundles
Author: Qingyu Wang
Latest version: 0.10.8

<h2 align="center">@lynx-js/template-webpack-plugin</h2>

A webpack plugin that simplifies creation of `template.js` files to serve your bundles.
Just like [`html-webpack-plugin`](https://github.com/jantimon/html-webpack-plugin), but for Lynx.
npm package: @lynx-js/template-webpack-plugin-canary
Description: Simplifies creation of Lynx template files to serve your webpack bundles
Author: Qingyu Wang
Latest version: 0.10.8

<h2 align="center">@lynx-js/template-webpack-plugin</h2>

A webpack plugin that simplifies creation of `template.js` files to serve your bundles.
Just like [`html-webpack-plugin`](https://github.com/jantimon/html-webpack-plugin), but for Lynx.
npm package: @lynx-js/test-environment
Description: A subset of a Lynx environment to be useful for testing
Author: Yiming Li
Latest version: 0.0.1

# @lynx-js/test-environment

`@lynx-js/test-environment` is a pure-JavaScript implementation of the [Lynx Spec](https://lynxjs.org/api/engine/element-api), notably the [Element PAPI](https://lynxjs.org/api/engine/element-api) and [Dual-threaded Model](https://lynxjs.org/guide/spec#dual-threaded-model) for use with Node.js. In general, the goal of the project is to emulate enough of a subset of a Lynx environment to be useful for testing.

The Element PAPI implementation is based on jsdom, for example `__CreateElement` will return a `LynxElement`, which extends `HTMLElement` from jsdom. You can reuse the testing utilities that are commonly used for DOM testing, such as [`@testing-library/dom`](https://github.com/testing-library/dom-testing-library) (for DOM querying) and [`@testing-library/jest-dom`](https://github.com/testing-library/jest-dom) (custom jest matchers for the DOM), etc.

## Usage

```js
import { LynxEnv } from '@lynx-js/test-environment';

const lynxEnv = new LynxEnv();
```

To use `@lynx-js/test-environment`, you will primarily use the `LynxEnv` constructor, which is a named export of the package. You will get back a `LynxEnv` instance, which has a number of methods of useful properties, notably `switchToMainThread` and `switchToBackgroundThread`, which allow you to switch between the main thread and background thread.

Use the background thread API:

```js
lynxEnv.switchToBackgroundThread();
// use the background thread global object
globalThis.lynxCoreInject.tt.OnLifecycleEvent(...args);
// or directly use `lynxCoreInject` since it's already injected to `globalThis`
// lynxCoreInject.tt.OnLifecycleEvent(...args);
```

Use the main thread API:

```js
lynxEnv.switchToMainThread();
// use the main thread Element PAPI
const page = __CreatePage('0', 0);
const view = __CreateView(0);
__AppendElement(page, view);
```

Note that you can still access the other thread's globals without switching threads:

```js
lynxEnv.switchToMainThread();
// use the `backgroundThread` global object even though we're on the main thread
lynxEnv.backgroundThread.tt.OnLifecycleEvent(...args);
```

### Use in Vitest

It is recommended to configure as Vitest's [test environment](https://vitest.dev/guide/environment), for example:

```js
// vitest.config.js
import { defineConfig } from 'vitest/config';

export default defineConfig({
  test: {
    environment: require.resolve(
      '@lynx-js/test-environment/env/vitest',
    ),
  },
});
```

After configuration, you can directly access the `lynxEnv` object globally in the test.

If you want to use `@lynx-js/test-environment` for unit testing in ReactLynx, you usually don't need to specify this configuration manually.

Please refer to [ReactLynx Testing Library](https://lynxjs.org/react/react-lynx-testing-library.html) to inherit the configuration from `@lynx-js/react/testing-library`.

## Credits

Thanks to:

- [jsdom](https://github.com/jsdom/jsdom) for the pure-JavaScript implementation of DOM API.
npm package: @lynx-js/test-environment-canary
Description: A subset of a Lynx environment to be useful for testing
Author: Yiming Li
Latest version: 0.1.0-canary-20250507-f4cfb706

# @lynx-js/test-environment

`@lynx-js/test-environment` is a pure-JavaScript implementation of the [Lynx Spec](https://lynxjs.org/api/engine/element-api), notably the [Element PAPI](https://lynxjs.org/api/engine/element-api) and [Dual-threaded Model](https://lynxjs.org/guide/spec#dual-threaded-model) for use with Node.js. In general, the goal of the project is to emulate enough of a subset of a Lynx environment to be useful for testing.

The Element PAPI implementation is based on jsdom, for example `__CreateElement` will return a `LynxElement`, which extends `HTMLElement` from jsdom. You can reuse the testing utilities that are commonly used for DOM testing, such as [`@testing-library/dom`](https://github.com/testing-library/dom-testing-library) (for DOM querying) and [`@testing-library/jest-dom`](https://github.com/testing-library/jest-dom) (custom jest matchers for the DOM), etc.

## Usage

```js
import { LynxEnv } from '@lynx-js/test-environment';

const lynxEnv = new LynxEnv();
```

To use `@lynx-js/test-environment`, you will primarily use the `LynxEnv` constructor, which is a named export of the package. You will get back a `LynxEnv` instance, which has a number of methods of useful properties, notably `switchToMainThread` and `switchToBackgroundThread`, which allow you to switch between the main thread and background thread.

Use the background thread API:

```js
lynxEnv.switchToBackgroundThread();
// use the background thread global object
globalThis.lynxCoreInject.tt.OnLifecycleEvent(...args);
// or directly use `lynxCoreInject` since it's already injected to `globalThis`
// lynxCoreInject.tt.OnLifecycleEvent(...args);
```

Use the main thread API:

```js
lynxEnv.switchToMainThread();
// use the main thread Element PAPI
const page = __CreatePage('0', 0);
const view = __CreateView(0);
__AppendElement(page, view);
```

Note that you can still access the other thread's globals without switching threads:

```js
lynxEnv.switchToMainThread();
// use the `backgroundThread` global object even though we're on the main thread
lynxEnv.backgroundThread.tt.OnLifecycleEvent(...args);
```

### Use in Vitest

It is recommended to configure as Vitest's [test environment](https://vitest.dev/guide/environment), for example:

```js
// vitest.config.js
import { defineConfig } from 'vitest/config';

export default defineConfig({
  test: {
    environment: require.resolve(
      '@lynx-js/test-environment/env/vitest',
    ),
  },
});
```

After configuration, you can directly access the `lynxEnv` object globally in the test.

If you want to use `@lynx-js/test-environment` for unit testing in ReactLynx, you usually don't need to specify this configuration manually.

Please refer to [ReactLynx Testing Library](https://lynxjs.org/react/react-lynx-testing-library.html) to inherit the configuration from `@lynx-js/react/testing-library`.

## Credits

Thanks to:

- [jsdom](https://github.com/jsdom/jsdom) for the pure-JavaScript implementation of DOM API.
npm package: @lynx-js/trace-analysis-agent
Description: Lynx trace analysis AI agent
Latest version: 0.0.4

# @lynx-js/trace-analysis-agent

An AI-powered agent for analyzing Lynx performance traces using LangGraph.

## Installation

```bash
pnpm add @lynx-js/trace-analysis-agent
```

## Usage

### Programmatic

```typescript
import { TraceAnalysis } from '@lynx-js/trace-analysis-agent';

const result = await TraceAnalysis(
  '/path/to/trace.pftrace',
  {
    model: 'gpt-4o',
    apiKey: 'your-api-key',
    provider: 'openai',
    baseUrl: 'https://api.openai.com/v1'
  },
  'English'
);

console.log(result);
```

### Test Server

```bash
pnpm run test:server
```

Server starts at `http://localhost:3000`.

#### HTTP API

```bash
POST /trace_analysis
Content-Type: application/json

{
  "tracePath": "/path/to/trace.pftrace",
  "modelConfig": {
    "model": "gpt-4o",
    "apiKey": "your-api-key",
    "provider": "openai",
    "baseUrl": "https://api.openai.com/v1"
  },
  "language": "English"
}
```

## Tools

The agent provides comprehensive trace query tools:

| Tool | Description |
|------|-------------|
| `query_by_id` | Query slice by ID |
| `query_by_time_window` | Query slices in time range |
| `query_aggregate` | Aggregate events by name |
| `query_ancestors` | Get ancestor slices |
| `query_descendants` | Get descendant slices |
| `query_flow_events` | Get flow events |
| `query_lynxviews` | Get LynxView instances |
| `query_pipeline_ids` | Get pipeline IDs |
| `query_pipeline_overview_events` | Get pipeline overview |
| `query_trace_metadata` | Get trace metadata |
| `query_by_raw_sql` | Execute raw SQL |

## Project Structure

```
src/
├── agent.ts              # Main agent implementation
├── index.ts              # Public exports
├── middlewares/          # Agent middlewares
│   └── log.ts            # Logging middleware
├── prompts/              # Auto-generated prompts
│   ├── references/       # Reference prompts
│   └── trace_analysis.ts # Main prompt
├── tools/                # Trace query tools
│   ├── trace_query/      # Query implementations
│   └── spawn.ts          # Tool spawning
├── types/                # Type definitions
└── utils/                # Utility functions
```

## Auto-Generated Files

The `prompts/` directory is auto-generated from `docs/references/`. Do not edit manually.

To update prompts:
1. Modify source files in `docs/references/`
2. Run `pnpm run generate-prompts` in `packages/scripts`

## Dependencies

- `@langchain/core` - LangChain core
- `@langchain/langgraph` - Agent graph framework
- `@langchain/openai` - OpenAI integration
- `@langchain/anthropic` - Anthropic integration
- `@langchain/google-genai` - Google AI integration
- `@lynx-js/trace-query` - Trace query library

## License

Apache License Version 2.0