open-index/open-npm huggingface dataset:
npm package: @isaackd/annotationlib
Description: YouTube annotation parser and renderer
Author: isaackd
Latest version: 2.0.0

# annotationlib

****annotationlib is intended for other projects looking to support annotations. 
If you're instead looking to view YouTube annotations again, 
check out [AnnotationsRestored](https://github.com/isaackd/AnnotationsRestored) and https://invidio.us.***

## Usage
Import the renderer and/or the parser.

```html
<script type="text/javascript" src="renderer.js"></script>
<script type="text/javascript" src="parser.js"></script>
```

or

```js
import { parseFromXml } from "parser.js";
import { AnnotationRenderer } from "renderer.js";
```

Then parse the XML and begin rendering annotations

```javascript
const annotations = parseFromXml(xmlData);

const videoContainer = document.getElementById("video-container");
// `video` is a <video> element
const video = document.getElementById("video");
const renderer = new AnnotationRenderer(annotations, videoContainer, {
    getVideoTime() {
        return video.currentTime;
    },
    seekTo(seconds) {
        video.currentTime = seconds;
    },
    getOriginalVideoWidth() {
        return video.videoWidth;
    },
    getOriginalVideoHeight() {
        return video.videoHeight;
    }
});
renderer.start();

window.addEventListener("resize", e => {
    renderer.updateAllAnnotationSizes();
});
```

### Click Events

Each time an annotation that has a link attached to it is clicked, the event `__ar_annotation_click` is fired on `window`, with `e.detail.url` set to the url.

`e.detail` also includes `seconds` if the link that was clicked on is a video with a timestamp hash (e.g. `#t=38s`).
```javascript
window.addEventListener("__ar_annotation_click", e => {
    const url = e.detail.url;
    // redirect to the url
    window.location.href = url;
    // or provide a custom redirect
    // window.location.href = `www.example.com/redirect?url=${url}`;
});
```

## Building
1. Run `npm install` to install the dev dependencies
2. Make changes and run `npm run build`

## Testing

Vitest is used for testing. Run `vitest` in the root directory to run all tests.
npm package: @isaacraja/pi-vertex-claude
Description: Google Vertex AI Claude provider for Pi coding agent
Author: Isaac Raja
Latest version: 0.1.4

# Vertex Claude Provider for Pi

Access Claude models via Google Vertex AI.

## Installation

```bash
pi install npm:@isaacraja/pi-vertex-claude
```

## Setup

Authenticate with Google Cloud:

```bash
gcloud auth application-default login
```

Set your project:

```bash
export GOOGLE_CLOUD_PROJECT=your-project-id
```

Use the provider:

```bash
pi --provider google-vertex-claude --model claude-sonnet-4@20250514
```

## Shell Helper

Add to `~/.bashrc` or `~/.zshrc`:

```bash
piv() {
  GOOGLE_CLOUD_PROJECT=your-project-id \
  pi --provider google-vertex-claude --model claude-sonnet-4@20250514 "$@"
}
```

## Available Models

| Model | Context | Output |
|-------|---------|--------|
| `claude-opus-4-6` | 200K | 32K |
| `claude-opus-4-5@20251101` | 200K | 32K |
| `claude-opus-4-1@20250805` | 200K | 32K |
| `claude-opus-4@20250514` | 200K | 32K |
| `claude-sonnet-4-5@20250929` | 200K | 64K |
| `claude-sonnet-4@20250514` | 200K | 64K |
| `claude-3-7-sonnet@20250219` | 200K | 64K |
| `claude-haiku-4-5@20251001` | 200K | 64K |
| `claude-3-5-sonnet-v2@20241022` | 200K | 8K |
| `claude-3-5-haiku@20241022` | 200K | 8K |

## Prerequisites

- Google Cloud project with Vertex AI API enabled
- Claude models enabled in [Model Garden](https://console.cloud.google.com/vertex-ai/model-garden)
- `gcloud` CLI installed

## License

MIT
npm package: @isaacs/balanced-match
Description: Match balanced character pairs, like "{" and "}"
Latest version: 4.0.1

# @isaacs/balanced-match

A hybrid CJS/ESM TypeScript fork of
[balanced-match](http://npm.im/balanced-match).

Match balanced string pairs, like `{` and `}` or `<b>` and `</b>`. Supports regular expressions as well!

[![CI](https://github.com/juliangruber/balanced-match/actions/workflows/ci.yml/badge.svg)](https://github.com/juliangruber/balanced-match/actions/workflows/ci.yml)
[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match)

## Example

Get the first matching pair of braces:

```js
import { balanced } from '@isaacs/balanced-match'

console.log(balanced('{', '}', 'pre{in{nested}}post'))
console.log(balanced('{', '}', 'pre{first}between{second}post'))
console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre  {   in{nest}   }  post'))
```

The matches are:

```bash
$ node example.js
{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }
{ start: 3,
  end: 9,
  pre: 'pre',
  body: 'first',
  post: 'between{second}post' }
{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' }
```

## API

### const m = balanced(a, b, str)

For the first non-nested matching pair of `a` and `b` in `str`, return an
object with those keys:

- **start** the index of the first match of `a`
- **end** the index of the matching `b`
- **pre** the preamble, `a` and `b` not included
- **body** the match, `a` and `b` not included
- **post** the postscript, `a` and `b` not included

If there's no match, `undefined` will be returned.

If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`.

### const r = balanced.range(a, b, str)

For the first non-nested matching pair of `a` and `b` in `str`, return an
array with indexes: `[ <a index>, <b index> ]`.

If there's no match, `undefined` will be returned.

If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`.
npm package: @isaacs/brace-expansion
Description: Brace expansion as known from sh/bash
Latest version: 5.0.1

# @isaacs/brace-expansion

A hybrid CJS/ESM TypeScript fork of
[brace-expansion](http://npm.im/brace-expansion).

[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html),
as known from sh/bash, in JavaScript.

[![CI](https://github.com/juliangruber/brace-expansion/actions/workflows/ci.yml/badge.svg)](https://github.com/juliangruber/brace-expansion/actions/workflows/ci.yml)
[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion)

## Example

```js
import { expand } from '@isaacs/brace-expansion'

expand('file-{a,b,c}.jpg')
// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']

expand('-v{,,}')
// => ['-v', '-v', '-v']

expand('file{0..2}.jpg')
// => ['file0.jpg', 'file1.jpg', 'file2.jpg']

expand('file-{a..c}.jpg')
// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']

expand('file{2..0}.jpg')
// => ['file2.jpg', 'file1.jpg', 'file0.jpg']

expand('file{0..4..2}.jpg')
// => ['file0.jpg', 'file2.jpg', 'file4.jpg']

expand('file-{a..e..2}.jpg')
// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg']

expand('file{00..10..5}.jpg')
// => ['file00.jpg', 'file05.jpg', 'file10.jpg']

expand('{{A..C},{a..c}}')
// => ['A', 'B', 'C', 'a', 'b', 'c']

expand('ppp{,config,oe{,conf}}')
// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf']
```

## API

```js
import { expand } from '@isaacs/brace-expansion'
```

### const expanded = expand(str, [options])

Return an array of all possible and valid expansions of `str`. If
none are found, `[str]` is returned.

The `options` object can provide a `max` value to cap the number
of expansions allowed. This is limited to `100_000` by default,
to prevent DoS attacks.

```js
const expansions = expand('{1..100}'.repeat(5), {
  max: 100,
})
// expansions.length will be 100, not 100^5
```

Valid expansions are:

```js
;/^(.*,)+(.+)?$/
// {a,b,...}
```

A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`.

```js
;/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
// {x..y[..incr]}
```

A numeric sequence from `x` to `y` inclusive, with optional increment.
If `x` or `y` start with a leading `0`, all the numbers will be padded
to have equal length. Negative numbers and backwards iteration work too.

```js
;/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
// {x..y[..incr]}
```

An alphabetic sequence from `x` to `y` inclusive, with optional increment.
`x` and `y` must be exactly one character, and if given, `incr` must be a
number.

For compatibility reasons, the string `${` is not eligible for brace expansion.