open-index/open-npm huggingface dataset:
npm package: @oomfware/cbr
Description: ask questions by browsing the web using Claude Code
Latest version: 0.1.2

# @oomfware/cbr

ask questions by browsing the web using Claude Code.

```sh
pnpm install -g @oomfware/cbr
```

## usage

```sh
# ask a question by browsing the web
cbr ask "What's the current top story on Hacker News?"

# specify a model (default: sonnet)
cbr ask -m opus "Find the API rate limits for the Bluesky firehose"

# start at a specific URL
cbr ask --url https://docs.python.org "How do I use match statements in Python 3.12?"

# show the browser window
cbr ask --headful "Log into my account and check my notifications"

# combine options
cbr ask --headful --url https://github.com/anthropics/claude-code -m opus "Summarize the latest release notes"
```

session data is cached at `~/.cache/cbr/sessions/`. use `cbr clean` to garbage collect orphaned
sessions:

```sh
cbr clean
```

## commands

```
cbr ask [-m opus|sonnet|haiku] [--headful] [--url <url>] <task>
cbr clean
```

| option        | description                                         |
| ------------- | --------------------------------------------------- |
| `-m, --model` | model to use: opus, sonnet, haiku (default: sonnet) |
| `--headful`   | show browser window (default: headless)             |
| `--url`       | starting URL to navigate to                         |

| command | description                                         |
| ------- | --------------------------------------------------- |
| `ask`   | ask a question by browsing the web with Claude Code |
| `clean` | garbage collect orphaned session data               |

## configuring CLAUDE.md

add this to your `~/.claude/CLAUDE.md` or project's `CLAUDE.md` to let Claude Code know about cbr:

```markdown
## cbr

If WebFetch fails (e.g. blocked by user agent, or the page relies on JS to render content), or the
answer requires looking at multiple pages, use `npx @oomfware/cbr ask <task>` instead.

- `npx @oomfware/cbr ask "What's the current top story on Hacker News?"`
- `npx @oomfware/cbr ask --url https://docs.python.org "How do I use match statements in Python 3.12?"`
- `npx @oomfware/cbr ask -m opus "Find the API rate limits for the Bluesky firehose"`
- `npx @oomfware/cbr ask --headful "Log into my account and check my notifications"`

Specific tasks with clear goals work best. Include a starting URL with `--url` when you know where
to look.

Run `npx @oomfware/cbr --help` for more options.
```
npm package: @oomfware/jsx
Description: server-side JSX renderer
Latest version: 0.1.8

# @oomfware/jsx

server-side JSX renderer with streaming support, Suspense, and context.

```sh
npm install @oomfware/jsx
```

configure your `tsconfig.json` to use this package as the JSX runtime:

```json
{
	"compilerOptions": {
		"jsx": "react-jsx",
		"jsxImportSource": "@oomfware/jsx"
	}
}
```

## usage

render JSX responses in your route handlers:

```tsx
import { createRouter, route } from '@oomfware/fetch-router';
import { render, Suspense, use } from '@oomfware/jsx';

const routes = route({
	home: '/',
	users: {
		index: '/users',
		show: '/users/:id',
	},
});

const router = createRouter();

router.map(routes, {
	home() {
		return render(<HomePage />);
	},
	users: {
		index() {
			return render(<UserList />);
		},
		show({ params }) {
			return render(<UserProfile userId={params.id} />);
		},
	},
});

function HomePage() {
	return (
		<html>
			<head>
				<title>my app</title>
			</head>
			<body>
				<h1>welcome</h1>
			</body>
		</html>
	);
}
```

### streaming with Suspense

the page shell streams immediately while async sections resolve in the background:

```tsx
import { render, Suspense, use } from '@oomfware/jsx';

interface User {
	name: string;
	posts: { title: string }[];
}

function UserPosts({ user }: { user: Promise<User> }) {
	const { posts } = use(user);
	return (
		<ul>
			{posts.map((post) => (
				<li>{post.title}</li>
			))}
		</ul>
	);
}

function UserPage({ user }: { user: Promise<User> }) {
	return (
		<html>
			<head>
				<title>user profile</title>
			</head>
			<body>
				<h1>posts</h1>
				<Suspense fallback={<div>loading posts...</div>}>
					<UserPosts user={user} />
				</Suspense>
			</body>
		</html>
	);
}

router.get('/users/:id', ({ params }) => {
	const user = fetch(`/api/users/${params.id}`).then((r) => r.json());
	return render(<UserPage user={user} />);
});
```

the promise is created in the handler and passed down - `use()` caches by promise identity, so the
same instance must be used across renders.

### error responses

render errors with custom status codes:

```tsx
router.get('/admin', ({ store }) => {
	const user = store.inject(userKey);
	if (!user) {
		return render(<LoginPage />, { status: 401 });
	}
	return render(<AdminDashboard user={user} />);
});
```

### context

share values across components without prop drilling:

```tsx
import { createContext, renderToString, use } from '@oomfware/jsx';

const ThemeContext = createContext('light');

function ThemedButton() {
	const theme = use(ThemeContext);
	return <button class={theme}>click me</button>;
}

const html = await renderToString(
	<ThemeContext.Provider value="dark">
		<ThemedButton />
	</ThemeContext.Provider>,
);
// <button class="dark">click me</button>
```

### head hoisting

`<title>`, `<meta>`, `<link>`, and `<style>` elements are automatically hoisted to `<head>`:

```tsx
function Page() {
	return (
		<div>
			<title>my page</title>
			<meta name="description" content="page description" />
			<h1>content</h1>
		</div>
	);
}
```
npm package: @oomfware/kysely-node-sqlite
Description: Kysely dialect for node:sqlite
Latest version: 1.0.0

# @oomfware/kysely-node-sqlite

[Kysely](https://kysely.dev/) dialect for Node.js built-in
[`node:sqlite`](https://nodejs.org/api/sqlite.html).

```sh
npm install @oomfware/kysely-node-sqlite
```

## usage

```ts
import { DatabaseSync } from 'node:sqlite';
import { Kysely } from 'kysely';
import { NodeSqliteDialect } from '@oomfware/kysely-node-sqlite';

interface Database {
	person: { id: number; name: string };
}

const db = new Kysely<Database>({
	dialect: new NodeSqliteDialect({
		database: new DatabaseSync('app.db'),
	}),
});

const people = await db.selectFrom('person').selectAll().execute();
```

### deferred initialization

the `database` option also accepts a function, which is called once when the first query is
executed:

```ts
const db = new Kysely<Database>({
	dialect: new NodeSqliteDialect({
		database: () => new DatabaseSync('app.db'),
	}),
});
```

this can be async if needed:

```ts
const db = new Kysely<Database>({
	dialect: new NodeSqliteDialect({
		database: async () => {
			const dbPath = await resolveDbPath();
			return new DatabaseSync(dbPath);
		},
	}),
});
```

### connection hook

use `onCreateConnection` to run setup logic after the connection is created, such as enabling WAL
mode or loading extensions:

```ts
const db = new Kysely<Database>({
	dialect: new NodeSqliteDialect({
		database: new DatabaseSync('app.db'),
		onCreateConnection: async (connection) => {
			await connection.executeQuery(CompiledQuery.raw('pragma journal_mode = WAL'));
			await connection.executeQuery(CompiledQuery.raw('pragma foreign_keys = ON'));
		},
	}),
});
```

### streaming

query results can be streamed row by row using Kysely's `.stream()`:

```ts
for await (const person of db.selectFrom('person').selectAll().stream()) {
	console.log(person.name);
}
```
npm package: @oomfware/lang-detect
Description: natural language detection library
Latest version: 0.2.0

# @oomfware/lang-detect

natural language detection library.

```sh
npm install @oomfware/lang-detect
```

## usage

call `initialize()` once to load model weights via `fetch()`, then use `detect()` synchronously on
any text. results are sorted by probability, highest first.

```ts
import { initialize, detect } from '@oomfware/lang-detect';

await initialize();

const results = detect('the quick brown fox jumps over the lazy dog');
console.log(results[0]); // -> ['eng', 0.98]
```

mixed-script text returns detections for each script present, with probabilities scaled by
proportion:

```ts
const results = detect('Hello Мир');
// -> [['eng', ...], ['rus', ...]]
```

### supported languages

50 languages across Latin, Cyrillic, Arabic, Devanagari, CJK, and unique-script families.

| code  | language         | code  | language         | code  | language   |
| ----- | ---------------- | ----- | ---------------- | ----- | ---------- |
| `afr` | Afrikaans        | `hau` | Hausa            | `por` | Portuguese |
| `ara` | Arabic           | `heb` | Hebrew           | `ron` | Romanian   |
| `aze` | Azerbaijani      | `hin` | Hindi            | `run` | Rundi      |
| `bel` | Belarusian       | `hrv` | Croatian         | `rus` | Russian    |
| `ben` | Bengali          | `hun` | Hungarian        | `slk` | Slovak     |
| `bul` | Bulgarian        | `hye` | Armenian         | `spa` | Spanish    |
| `cat` | Catalan          | `ind` | Indonesian       | `srp` | Serbian    |
| `ces` | Czech            | `isl` | Icelandic        | `swe` | Swedish    |
| `ckb` | Central Kurdish  | `ita` | Italian          | `tgl` | Tagalog    |
| `cmn` | Mandarin Chinese | `jpn` | Japanese         | `tur` | Turkish    |
| `dan` | Danish           | `kat` | Georgian         | `ukr` | Ukrainian  |
| `deu` | German           | `kaz` | Kazakh           | `vie` | Vietnamese |
| `ell` | Greek            | `kor` | Korean           |       |            |
| `eng` | English          | `lit` | Lithuanian       |       |            |
| `est` | Estonian         | `mar` | Marathi          |       |            |
| `eus` | Basque           | `mkd` | Macedonian       |       |            |
| `fin` | Finnish          | `nld` | Dutch            |       |            |
| `fra` | French           | `nob` | Norwegian Bokmål |       |            |
| `pes` | Persian          | `pol` | Polish           |       |            |
npm package: @oomfware/safe-idn
Description: detect IDN homograph spoofing
Latest version: 0.1.2

# @oomfware/safe-idn

detect IDN homograph spoofing.

```sh
npm install @oomfware/safe-idn
```

browsers and other user agents must decide whether to display internationalized domain names (IDN)
in their decoded Unicode form or keep them as punycode. showing Unicode unconditionally enables
phishing — for example, `xn--80ak6aa92e.com` decodes to `аррӏе.com`, which uses Cyrillic letters to
impersonate `apple.com`.

this library implements [Chromium's IDN display algorithm][chromium-idn] in TypeScript. it checks
each label of a domain for script mixing, confusable characters, dangerous patterns, and other
spoofing vectors, then returns either the safe Unicode form or the original punycode.

[chromium-idn]: https://chromium.googlesource.com/chromium/src/+/main/docs/idn.md

## usage

### quick check

use `safeDisplay()` to get the safe display form of a domain:

```ts
import { safeDisplay } from '@oomfware/safe-idn';

// safe domains decode to Unicode
safeDisplay('xn--nxasmq6b.com');
// -> "βόλος.com"

// spoofed domains stay as punycode
safeDisplay('xn--80ak6aa92e.com');
// -> "xn--80ak6aa92e.com" (Cyrillic "аррӏе" impersonating "apple")
```

### detailed results

use `checkDomain()` for per-label verdicts:

```ts
import { checkDomain } from '@oomfware/safe-idn';

const result = checkDomain('xn--80ak6aa92e.com');

console.log(result.display);
// -> "xn--80ak6aa92e.com"

console.log(result.labels[0]);
// -> { input: 'xn--80ak6aa92e', unicode: 'аррӏе', result: 'unsafe' }
```

each label result contains:

- `input` — the original label as it appeared in the domain
- `unicode` — the decoded Unicode form (even if unsafe)
- `result` — `'safe'`, `'unsafe'`, or `'invalid'`

## what it checks

the following safety checks are performed, matching Chromium's behavior:

- **script mixing** — blocks unsafe combinations of Unicode scripts (e.g., Latin + Cyrillic)
- **whole-script confusables** — detects labels where every character in a script has a Latin
  lookalike (e.g., Cyrillic "а" for Latin "a")
- **skeleton confusables** — compares [UTS #39][uts39] skeletons against a list of top domains to
  catch near-lookalikes
- **character blocklist** — blocks characters known to cause confusion (symbols, ligatures, IPA
  extensions, etc.)
- **dangerous patterns** — catches combining mark abuse, dot-after-i/j tricks, and RTL mark
  misplacement
- **mixed digit systems** — prevents mixing digits from different scripts
- **digit lookalikes** — detects non-digit characters that resemble ASCII digits
- **kana confusables** — catches Hiragana/Katakana interchange and context violations
- **TLD-specific rules** — restricts characters like þ, ð, ə, and · to their appropriate TLDs
- **deviation characters** — blocks ZWNJ and ZWJ
- **IDN TLD spoofing** — detects punycode TLDs whose skeletons match common ASCII TLDs

[uts39]: https://www.unicode.org/reports/tr39/