open-index/open-npm huggingface dataset:
npm package: @rjshooks/use-async-task
Description: React hook for performing async tasks with progress tracking.
Author: Ramesh Nair
Latest version: 0.5.0

# `@rjshooks/use-async-task`

[React hook](https://reactjs.org/docs/hooks-intro.html) for performing async tasks with progress tracking. It's especially suitable for tasks which may be called repeatedly without input, and perfect for use with [useProgress](https://www.npmjs.com/package/@rjshooks/use-progress).


## Installation

```shell
npm i --save @rjshooks/use-async-tasks react@20
```

## Usage

In this simple example below, the async task is to call an external URL to fetch some data.

```js
import { useCallback } from 'react'
import { useAsyncTask } from '@rjshooks/use-async-task'

export const GetSomeDataAsync = () => {
  const { progress, data, reload } = useAsyncTask<object>({
    load: () => window.fetch('/some/api/that/returns/json').then(r => r.json()),
  })

  const run = useCallback(() => {
    reload()
  }, [reload])

  return (
    <div>
      <button onClick={run}>Run again</button>
      {progress.error ? <div>Error: {progress.error.message}</div> : null}
      {progress.inProgress ? <div>Step: {progress.activeStep}</div> : null}
      {progress.completed ? <div>Success!</div> : null}
      {data ? <div>Data: {data}</div> : null}
    </div>
  )
} 
```

The task can be set to run as soon as the component mount using the `loadOnCreation` option:

```js
useAsyncTask<object>({
  load: () => ...//do something,
  loadOnCreation: true
})
```


## License

MIT
npm package: @rjshooks/use-async-value
Description: React hook for storing values which result from async calls.
Author: Ramesh Nair
Latest version: 0.5.0

# `@rjshooks/use-async-value`

[React hook](https://reactjs.org/docs/hooks-intro.html) for storing values which result from async calls, providing a way to keep track of call progress and errors. 

It's perfect for use with [useAsyncTask](https://www.npmjs.com/package/@rjshooks/use-async-task).


## Installation

```shell
npm i --save @rjshooks/use-async-value react@20
```

## Usage

In this simple example below, the async value will store the result of an async call. The call returns an object, and so a transformer will be used to extract the specific property from the object. Errors and progress tracking are also shown.

```js
import { useCallback } from 'react'
import { useAsyncValue } from '@rjshooks/use-async-value'

export const LoadAsyncValue = () => {
  const { 
    error,
    isLoading,
    value,
    transformedValue,
    setError,
    setValue,
    reset,
  } = useAsyncValue<object, number>({
    valueTransformer: (v: object) => v.count as number
  })

  const { progress, data, reload } = useAsyncTask<object>({
    load: () => window.fetch('/some/api/that/returns/json').then(r => r.json()),
  })

  const run = useCallback(async () => {
    // After this, `inProgress` will be true and `error`, `value` and `transformedValue` will be undefined.
    reset()

    try {
      const ret = window.fetch('/some/api/')
      const json = await ret.json()
      // After this, `inProgress` will be false and `error` will be undefined.
      setValue(json as object)
    } catch (err) {
      // After this, `inProgress` will be false and `value` and `transformedValue` will be undefined.
      setError(err)
    }
  }, [reload])

  return (
    <div>
      <button onClick={run}>Run again</button>
      {error ? <div>Error: {error.message}</div> : null}
      {inProgress ? <div>Running...</div> : null}
      {transformedValue ? <div>Count: {transformedValue}</div> : null}
    </div>
  )
} 
```

## License

MIT
npm package: @rjshooks/use-progress
Description: React hook for tracking the progress of a sequence of tasks.
Author: Ramesh Nair
Latest version: 0.5.0

# `@rjshooks/use-progress`

[React hook](https://reactjs.org/docs/hooks-intro.html) for tracking the progress of a sequence of tasks. It's perfect for use with [useAsyncTask](https://www.npmjs.com/package/@rjshooks/use-async-task).

## Installation

```shell
npm i --save @rjshooks/use-progress react@20
```

## Usage

In this simple example below, the user clicks a button to trigger a timer. Every second the timer 
updates the current progress shown on screen. After 5 seconds the timer either throws an error or marks 
the process as completed, i.e. succcessful.

```js
import { useCallback } from 'react'
import { useProgress } from '@rjshooks/use-progress'

export const RandomTimer = () => {
  const progress = useProgress()

  const run = useCallback(() => {
    // reset progress state from last iteration
    progress.reset()

    let iteration = 0

    setInterval(() => {
      iteration++

      progress.setActiveStep(`Time elapsed: ${iteration} seconds`)

      if (iteration >= 5) {
        // error 50% of time, success 50% of time
        if (Math.random() > 0.5) {
          progress.setError(new Error('Timer failed'))
        } else {
          progress.setCompleted()
        }
      }
    }, 1000)
  }, [progress])

  return (
    <div>
      <button onClick={run}>Run again</button>
      {progress.error ? <div>Error: {progress.error.message}</div> : null}
      {progress.inProgress ? <div>Step: {progress.activeStep}</div> : null}
      {progress.completed ? <div>Success!</div> : null}
    </div>
  )
} 
```

## License

MIT
npm package: @rjshrjndrn/pi-auth-profiles
Description: Auth profile switching for pi — save and switch between named credential profiles via slash commands
Latest version: 0.1.1
Deprecated: Moved to pi-auth-profiles — use: pi install npm:pi-auth-profiles

# pi-auth-profiles

Save and switch between named credential profiles in [pi](https://github.com/badlogic/pi-mono) without leaving your session.

## Install

```bash
pi install npm:@rjshrjndrn/pi-auth-profiles
```

Or for a single run:

```bash
pi -e npm:@rjshrjndrn/pi-auth-profiles
```

## Usage

### Save the current credentials as a profile

```
/auth-save work
```

Copies `~/.pi/agent/auth.json` → `~/.pi/agent/auth.json.work`.

### Switch to a saved profile

```
/auth-switch personal
```

Copies the profile back to `auth.json` and reloads credentials in-memory. Your session context, ACM state, and conversation history are completely unaffected.

### List saved profiles

```
/auth-list
```

Shows all profiles with their providers and marks which one matches the active credentials.

### Delete a profile

```
/auth-delete work
```

Removes the profile file after confirmation.

## How it works

```
~/.pi/agent/
├── auth.json              ← active credentials (what pi reads)
├── auth.json.work         ← saved profile
├── auth.json.personal     ← saved profile
└── ...
```

Profiles are full copies of `auth.json`. Switching replaces the entire file and calls `authStorage.reload()` to update pi's in-memory credential cache immediately.

- **Same provider, different accounts** (e.g., two Anthropic subscriptions): seamless switch, session continues.
- **Different providers** (e.g., Anthropic → OpenAI): auth switches, but you may need to `/model` to select a model from the new provider.

## Notes

- Profile files are stored with mode `0600` (owner read/write only)
- Tab completion works on `/auth-switch` and `/auth-delete`
- OAuth tokens in saved profiles may expire — pi handles refresh automatically on next use
npm package: @rjshrjndrn/pi-fetch
Description: Web content extraction for pi — fetch any URL as clean Markdown using Defuddle
Latest version: 0.1.2

# pi-fetch

Web content extraction for [pi](https://github.com/badlogic/pi-mono). Fetch any URL as clean Markdown — no headless browser required.

Powered by [Defuddle](https://github.com/kepano/defuddle) by [Steph Ango](https://github.com/kepano) (creator of [Obsidian Web Clipper](https://obsidian.md/clipper)).

## How it works

Registers a `web_fetch` tool that the LLM can call with any URL. Under the hood:

1. **Native `fetch`** retrieves the HTML (lightweight, no browser engine)
2. **[Defuddle](https://github.com/kepano/defuddle)** extracts the main content, stripping navigation, ads, sidebars, cookie banners, and clutter
3. Returns clean **Markdown** with metadata (title, author, description, word count)

```
web_fetch https://www.npmjs.com/package/defuddle

# defuddle

**Author:** kepano · **Domain:** npmjs.com · **Words:** 342

> Get the main content of any page as Markdown.

---

Defuddle extracts the main content from web pages...
```

Output is automatically truncated to stay within pi's context limits.

## Install

```bash
# As a pi package
pi install npm:@rjshrjndrn/pi-fetch

# Or test without installing
pi -e npm:@rjshrjndrn/pi-fetch

# Or test locally
pi -e ./extensions/index.ts
```

## Usage

Once installed, just ask pi to fetch a URL:

```
fetch https://docs.example.com/getting-started
```

Or the LLM will use `web_fetch` automatically when it needs to read a webpage.

## Limitations

- **No JavaScript rendering** — uses native `fetch`, not a browser. SPAs that require JS to render content will return empty or minimal results. For those, you'll still need a headless browser.
- **Some sites block non-browser requests** — sites with aggressive bot detection may reject the request.
- **Output truncation** — very large pages are truncated to 50KB / 2000 lines to protect context window.

## Development

```bash
cd pi-fetch
npm install
npm test
```

## Credits

- **[Defuddle](https://github.com/kepano/defuddle)** by [Steph Ango (kepano)](https://github.com/kepano) — content extraction engine
- **[pi](https://github.com/badlogic/pi-mono)** by [Mario Zechner (badlogic)](https://github.com/badlogic) — agent framework

## License

MIT
npm package: @rjshrjndrn/pi-sandbox
Description: Filesystem boundary enforcement for pi — prompts before the agent escapes your project
Latest version: 0.1.3

# pi-sandbox

Filesystem boundary enforcement for [pi](https://github.com/badlogic/pi-mono). Prompts you before the agent reads or writes files outside your project.

## How it works

On session start, `pi-sandbox` detects your project boundary:

1. Runs `git rev-parse --show-toplevel` to find the git worktree root
2. Falls back to the current working directory if not in a git repo

Then it intercepts every file tool call (`read`, `write`, `edit`, `grep`, `find`, `ls`):

- **Inside boundary** → allowed silently
- **Outside boundary** → you get a confirmation prompt
- **Previously approved directory** → allowed silently (remembered for the session)

```
🔒 pi-sandbox: path outside project

Tool: read
Path: /Users/you/.ssh/config
Boundary: /Users/you/project

Allow this access? (y/n)
```

When you approve, the parent directory is remembered for the rest of the session.

## Install

```bash
# As a pi package
pi install npm:@rjshrjndrn/pi-sandbox

# Or test locally
pi -e ./pi-sandbox/extensions/index.ts
```

## Limitations

- **No bash coverage** — the `bash` tool is not intercepted. The agent can still access files outside the boundary via shell commands. This will be addressed in a future version.
- **Session-scoped memory only** — approvals reset when you start a new session.
- **No configuration** — the boundary is always the git worktree root (or CWD). Custom boundaries and allow/deny patterns are planned for a future version.

## Development

```bash
cd pi-sandbox
npm install
npm test
```

## License

MIT
npm package: @rjwadley/eslint-plugin-format-gsap
Description: better gsap formatting
Author: RJWadley
Latest version: 0.1.1

# eslint-format-gsap

better gsap formatting

## Installation

You'll first need to install [ESLint](https://eslint.org/):

```sh
npm i eslint --save-dev
```

Next, install `eslint-format-gsap`:

```sh
npm install eslint-format-gsap --save-dev
```

## Usage

Add `eslint-format-gsap` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:

```json
{
    "plugins": [
        "eslint-format-gsap"
    ]
}
```


Then configure the rules you want to use under the rules section.

```json
{
    "rules": {
        "eslint-format-gsap/rule-name": 2
    }
}
```

## Supported Rules

* Fill in provided rules here
npm package: @rjwadley/postcss-css-in-js
Description: PostCSS syntax for parsing CSS in JS literals
Author: gucong3000
Latest version: 0.39.2
Deprecated: https://stylelint.io/ now has much better support for css-in-js than this package provides

# PostCSS CSS-in-JS Syntax

[![NPM version](https://img.shields.io/npm/v/@stylelint/postcss-css-in-js.svg)](https://www.npmjs.org/package/@stylelint/postcss-css-in-js) [![Build Status](https://github.com/stylelint/postcss-css-in-js/workflows/CI/badge.svg)](https://github.com/stylelint/postcss-css-in-js/actions)

<img align="right" width="95" height="95"
	title="Philosopher’s stone, logo of PostCSS"
	src="https://api.postcss.org/logo.svg">

[PostCSS](https://github.com/postcss/postcss) syntax for parsing [CSS in JS](https://github.com/MicheleBertoli/css-in-js) literals:

- [aphrodite](https://github.com/Khan/aphrodite)
- [astroturf](https://github.com/4Catalyzer/astroturf)
- [csjs](https://github.com/rtsao/csjs)
- [css-light](https://github.com/streamich/css-light)
- [cssobj](https://github.com/cssobj/cssobj)
- [electron-css](https://github.com/azukaar/electron-css)
- [emotion](https://github.com/emotion-js/emotion)
- [freestyler](https://github.com/streamich/freestyler)
- [glamor](https://github.com/threepointone/glamor)
- [glamorous](https://github.com/paypal/glamorous)
- [j2c](https://github.com/j2css/j2c)
- [linaria](https://github.com/callstack/linaria)
- [lit-css](https://github.com/bashmish/lit-css)
- [react-native](https://github.com/necolas/react-native-web)
- [react-style](https://github.com/js-next/react-style)
- [reactcss](https://github.com/casesandberg/reactcss)
- [styled-components](https://github.com/styled-components/styled-components)
- [styletron-react](https://github.com/rtsao/styletron)
- [styling](https://github.com/andreypopp/styling)
- [typestyle](https://github.com/typestyle/typestyle)

## Getting Started

First thing's first, install the module:

```
npm install postcss-syntax @stylelint/postcss-css-in-js --save-dev
```

## Use Cases

```js
const postcss = require("postcss");
const stylelint = require("stylelint");
const syntax = require("postcss-syntax");
postcss([stylelint({ fix: true })])
  .process(source, { syntax: syntax })
  .then(function (result) {
    // An alias for the result.css property. Use it with syntaxes that generate non-CSS output.
    result.content;
  });
```

input:

```javascript
import glm from "glamorous";
const Component1 = glm.a({
  flexDirectionn: "row",
  display: "inline-block",
  color: "#fff"
});
```

output:

```javascript
import glm from "glamorous";
const Component1 = glm.a({
  color: "#fff",
  display: "inline-block",
  flexDirectionn: "row"
});
```

## Advanced Use Cases

Add support for more `css-in-js` package:

```js
const syntax = require("postcss-syntax")({
  "i-css": (index, namespace) => namespace[index + 1] === "addStyles",
  "styled-components": true
});
```

See: [postcss-syntax](https://github.com/gucong3000/postcss-syntax)

## Style Transformations

The main use case of this plugin is to apply PostCSS transformations to CSS code in template literals & styles as object literals.
npm package: @rjweb/runtime-bun
Description: rjweb-server runtime for bun
Author: 0x7d8
Latest version: 1.0.1

# `@rjweb/runtime-bun`

<img style="float: right;" alt="RJWEB Icon" height="104" src="https://cdn.rjns.dev/rjweb/icon.svg">

Bun Runtime using built-in features for [`rjweb-server`](https://npmjs.com/rjweb-server).

🏠 [Homepage](https://github.com/0x7d8/NPM_WEB-SERVER#readme)
🔍 [Documentation](https://server.rjweb.dev)

## Disclaimer

This Package is intended to be used in the backend. THIS PACKAGE WILL ONLY WORK WITH BUN.

- ✔️ ESM
- ✖️ CJS
- ✔️ Typescript

## Install

```sh
npm install @rjweb/runtime-bun
yarn add @rjweb/runtime-bun
pnpm add @rjweb/runtime-bun
bun install @rjweb/runtime-bun
```

## Example Usage

### Basic Server

```ts
import { Server } from "rjweb-server"
import { Runtime } from "@rjweb/runtime-bun"

const server = new Server(Runtime, {
  port: 8080 // https://server.rjweb.dev/types/ServerOptions
})

server.path('/', (path) => path
  .http('GET', '/', (http) => http
    .onRequest((ctr) => {
      return ctr.print('Hello World!')
    })
  )
)

server.start().then((port) => {
  console.log(`Server started on port ${port}!`)
})
```

[view more](https://npmjs.com/rjweb-server)

## Author

👤 **0x7d8**
🌐 [Website](https://rjansen.dev)
⭐ [GitHub](https://github.com/0x7d8)

## 🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/0x7d8/rjweb-runtime-bun/issues).

## Show your support

Give a ⭐️ if this project helps you!

## 📝 License

Copyright © 2024 [0x7d8](https://github.com/0x7d8).
This project is MIT licensed.
npm package: @rjweb/runtime-node
Description: rjweb-server runtime for node using http and ws
Author: 0x7d8
Latest version: 1.1.1

# `@rjweb/runtime-node`

<img style="float: right;" alt="RJWEB Icon" height="104" src="https://cdn.rjns.dev/rjweb/icon.svg">

Node Runtime using `http` library for [`rjweb-server`](https://npmjs.com/rjweb-server).

🏠 [Homepage](https://github.com/0x7d8/NPM_WEB-SERVER#readme)
🔍 [Documentation](https://server.rjweb.dev)

## Disclaimer

This Package is intended to be used in the backend. DO NOT USE THIS PACKAGE WITH BUN.

- ✔️ ESM
- ✔️ CJS
- ✔️ Typescript

## Install

```sh
npm install @rjweb/runtime-node
yarn add @rjweb/runtime-node
pnpm add @rjweb/runtime-node
bun install @rjweb/runtime-node # not recommended to run the code, installing is fine
```

## Example Usage

### Basic Server

```ts
import { Server } from "rjweb-server"
import { Runtime } from "@rjweb/runtime-node"

const server = new Server(Runtime, {
  port: 8080 // https://server.rjweb.dev/types/ServerOptions
})

server.path('/', (path) => path
  .http('GET', '/', (http) => http
    .onRequest((ctr) => {
      return ctr.print('Hello World!')
    })
  )
)

server.start().then((port) => {
  console.log(`Server started on port ${port}!`)
})
```

[view more](https://npmjs.com/rjweb-server)

## Author

👤 **0x7d8**
🌐 [Website](https://rjansen.dev)
⭐ [GitHub](https://github.com/0x7d8)

## 🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/0x7d8/rjweb-runtime-node/issues).

## Show your support

Give a ⭐️ if this project helps you!

## 📝 License

Copyright © 2024 [0x7d8](https://github.com/0x7d8).
This project is MIT licensed.
npm package: @rjweb/sentry
Description: Easy and Lightweight Way to add sentry to rjweb-server
Author: 0x4096
Latest version: 2.1.5

# `@rjweb/sentry`

<img style="float: right;" alt="RJWEB Icon" height="104" src="https://cdn.rjns.dev/rjweb/icon.svg">

Easy and Lightweight Web Server Library

🏠 [Homepage](https://github.com/0x7d8/rjweb-sentry#readme)
🔍 [Documentation](https://server.rjweb.dev)

![lines of code](https://tokei.rs/b1/github/0x7d8/rjweb-sentry?category=code)
![files](https://tokei.rs/b1/github/0x7d8/rjweb-sentry?category=files)

## Disclaimer

This Package is intended to be used in the backend.

- ✔️ ESM
- ✔️ CJS
- ✔️ Typescript

## Install

```sh
npm install @rjweb/sentry
yarn add @rjweb/sentry
pnpm install @rjweb/sentry
bun install @rjweb/sentry
```

## Usage

Initialize

```js
import { Server } from "rjweb-server"
import { Runtime } from "@rjweb/runtime-node"
import { sentry } from "@rjweb/sentry"

const server = new Server(Runtime, {
  port: 8000
}, [
  sentry.use({
    environment: 'production',
    dsn: 'https://hmmm@hmmm.ingest.sentry.io/hmmm',
    tracesSampleRate: 0.1
  }) // config is just the default node sentry sdk's config
])

// ...
```

## Author

👤 **0x7d8**

## Show your support

Give a Star if this project helped you!

## 📝 License

Copyright © 2023 0x7d8.
This project is MIT licensed.
npm package: @rjweb/utils
Description: Easy and Lightweight Utilities
Author: 0x7d8
Latest version: 1.12.29

# Welcome to `@rjweb/utils`

<img style="float: right;" alt="RJWEB Icon" height="104" src="https://cdn.rjns.dev/rjweb/icon.svg">

Easy and Lightweight Utilities

🏠 [Homepage](https://github.com/0x7d8/rjweb-utils#readme)
🔍 [Documentation](https://utils.rjweb.dev)

![lines of code](https://tokei.rs/b1/github/0x7d8/rjweb-utils?category=code)
![files](https://tokei.rs/b1/github/0x7d8/rjweb-utils?category=files)

## Disclaimer

This Package is intended to be used in the backend, however with polyfills (or even without) it should work fine in vite or webpack.

- ✅ ESM
- ✅ CJS
- ✅ Typescript

## Install

```sh
npm install @rjweb/utils
yarn add @rjweb/utils
pnpm add @rjweb/utils
bun install @rjweb/utils
```

## Example Usage

All Utilities and example are available in the [Documentation](https://utils.rjweb.dev).

## Author

👤 **0x7d8**
🌐 [Website](https://rjansen.dev)
⭐ [GitHub](https://github.com/0x7d8)

## 🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/0x7d8/rjweb-utils/issues).

## Show your support

Give a ⭐️ if this project helps you!

## 📝 License

Copyright © 2024 [0x7d8](https://github.com/0x7d8).
This project is MIT licensed.