open-index/open-npm huggingface dataset:
npm package: @penname/routepath
Description: Convenient API route interface.
Author: Penname.me
Latest version: 1.0.3

`npm install --save @penname/routepath`

# routepath

Convenient API route interface.

```javascript
const RoutePath = require('@penname/routepath')
const route = RoutePath.instance({ path: '/article/:id', baseUrl: 'example.com' })

const url = route.buildUrl({
	params: { id: 'abc123' },
	query: { position: 'middle', ref: 'twitter' },
})
console.log(url)
// prints: example.com/article/abc123?position=middle&ref=twitter

const path = route.buildPath({
	params: { id: 'abc123' },
	query: { position: 'middle', ref: 'twitter' },
})
console.log(path)
// prints: /article/abc123?position=middle&ref=twitter
```

# Methods

## `#instance()`

Create a route path instance with a minimum of `baseUrl`, `path`:

```javascript
const route = RoutePath.instance({ path: '/article/:id', baseUrl: 'https://example.com' })
```

## `#buildUrl()`

Builds the url from the route path with the provided `params` and `query`

```javascript
const route = RoutePath.instance({ path: '/article/:id', baseUrl: 'localhost:3000/api/' })

const url = route.buildUrl({
	params: { id: 'abc123' },
	query: { position: 'middle', ref: 'twitter' },
})

console.log(url)
// prints: localhost:3000/api/article/abc123?position=middle&ref=twitter
```

## `#buildPath()`

Builds the url path, no host, from the route path with the provided `params` and `query`

```javascript
const route = RoutePath.instance({
	path: '/user/:userId/article/:articleId',
	baseUrl: 'http://www.example.com',
})

const path = route.buildPath({
	params: { userId: 'u1cba', articleId: 'abc123' },
	query: { position: 'middle', date: 1609036608349 },
})

console.log(path)
// prints: /user/u1cba/article/abc123?position=middle&date=1609036608349
```

# `#fromSerialized()`

```javascript
const routeFromJsonString = RoutePath.fromSerialized(
	`{path: "/user/:id/articles", "baseUrl": 'example.com/api/' }`,
)

const url = route.buildUrl({
	params: { id: 'u1cba' },
	query: { from: 'abc456', limit: 15 },
})

console.log(url)
// prints: example.com/api/user/u1cba/articles?from=abc456&limit=15
```
npm package: @penname/slimgoose
Description: A convenient, slim Mongoose interface to MongoDB for getting your data layer up and running quickly and cleanly.
Author: Penname.me
Latest version: 0.9.0

# slimgoose

A convenient, slim [Mongoose](https://www.npmjs.com/package/mongoose) interface to [MongoDB](https://www.mongodb.com/) for getting your data layer up and running quickly and cleanly. Leverages a clonable schema builder.

### Still Under Development

This module is still under development, but it's well tested, so feel free to take it for a spin.

# Easy Usage

The following is a simple example of how to initiate your mongoose via slimgoose, connect to your mongodb database, create a mongoose model via slimgoose, and use your model.

### Configure mongoose and connect

```javascript
// index.js
// Setup your mongoose
const slimgoose = require('slimgoose')
const Q = require('q')

slimgoose.use(require('mongoose')) // Optional
slimgoose.usePromiseClass(Q) // Optional

// Connect to your mongodb
slimgoose.connect(mongoDbUri, { mongooseOptionA: 'bar' })
```

### Create mongoose model

```javascript
// models/userModel.js

const slimgoose = require('slimgoose')

// Create a mongoose model from a schema
const User = slimgoose
	.schema({
		name: String,
		email: { type: String, require: true },
		username: { type: String, index: true },
	})
	.staticMethods({
		insertNew(data) {
			return new User(data).save()
		},
		findByUsername(username) {
			return this.find({ username })
		},
		load({ from, limit }) {
			const query = { username: { $gte: from } }
			return this.find(query).limit(limit).exec()
		},
	})
	.toModel('user')

module.exports = User
```

### Use mongoose model

Use your model in an operation file to interface with your mongodb data.

```javascript
// operations/User.js
const User = require('../models/userModel')

module.exports = {
	getUserByUsername(username) {
		return User.findByUsername(username)
	},
}
```

### Still under development

We're still in the process of adding documentation, so please reference the tests for more functionality.

# Roadmap

- Need to add slimPlugin™ support
- Need to add cachegoose support
- Need to add more documentation to the README

# Contribute

Contributions are welcomed. This is how you get started:

- Clone this repository
- Run `npm install`
- Start a new branch
- Make improvements
- Add tests
- Run `npm test`
- Open a pull request
npm package: @penneo/pvutils
Description: Common utilities for products from Peculiar Ventures
Author: Yury Strozhevsky
Latest version: 1.0.17

# pvutils

[![CircleCI](https://circleci.com/gh/PeculiarVentures/pvutils.svg?style=svg)](https://circleci.com/gh/PeculiarVentures/pvutils) [![Coverage Status](https://coveralls.io/repos/github/PeculiarVentures/pvutils/badge.svg?branch=master)](https://coveralls.io/github/PeculiarVentures/pvutils?branch=master)

`pvutils` is a set of common utility functions used in various Peculiar Ventures Javascript based projects. 

Some example capabilities included in `pvutils` include:
- Converting dates into UTC,
- Converting an "ArrayBuffer" into a hexdecimal string,
- Converting a number from 2^base to 2^10,
- Converting a number from 2^10 to 2^base,
- Concatenate two ArrayBuffers,
- And more...
npm package: @pennions/jess
Description: Regular Stylesheet based on Fluent UI from Microsoft
Author: Jelmer Veen
Latest version: 3.1.5

# Welcome to Jelmer's Easy Style system!

I have written this Style System
so you can quickly make any webpage look consistent and good without
having an overkill on features. Keeping its footprint low. And I
separated theming. Which means colours, borders, box-shadows, fonts and
the like can be adjusted super easy.

## Features

- Out-of-the-box responsive
- A lot of layout variations
- Makes use of HTML5 elements
- Based on Microsoft Fluent Design.
- Allows for easy theming.
- Built with Less, so you can easily modify inside a webbrowser.

## Goal
My goal is to make the life of fullstack webapplication developers easier by providing a lot of things out-of-the-box <br />
so they can focus on the business logic and add value instantly.

# Documentation
[Go to the full documentation](https://pennions.github.io/JESS/)


> If you are using this for paid products and services please consider:
> - Becoming a supporter on [Patreon.com](https://patreon.com/pennions)
> - Doing a one time donation on [Ko-Fi](https://ko-fi.com/pennions). 
> - If you want to donate but are not able to do so on these platforms, please contact us at www.pennions.com so we can provide an iDeal link.
npm package: @pennions/jet-framework
Description: Is a reactive framework based on JET which you can use to not only build and interpolate your template, but also update the it on-the-fly in the browser!
Author: Jelmer Veen
Latest version: 1.0.1

# JET-Framework
Is a reactive framework based on JET which you can use to not only build and interpolate your template, but also update the it on-the-fly in the browser!

You have only need two commands.

One for the initialization. It takes two required arguments: 
```
jet.init('app', vm);
```

You can also pass a function as a third argument. This will be called after everything has been initialized.

*'app'* is an element id, in which you did all your templating and vm is a viewmodel.

> example viewmodel:
```
const vm = {
    shoppingList: {
        groceryStore: ['Carrot', 'Melon', 'Potato']
    },
    a: {
        b: {
            c: 1337
        }
    },
    message: 'Hello world!',
    hello_world: '<div>{{ message }}</div>'
};
```

After you initialized the framework, you can use the following command to update the template with a new value:

```
jet.update('a.b.c', 42);
``` 

*'a.b.c* is the complete path in the vm, so in this example, *c* is nested under *b* which is nested under *a*.

Another valid example would be:

```
jet.update('hello_world', '<h1>{{ message }}</h1>')
```

It works just like you would access a property from a JSON object.

In the above example you are setting a new template. Which will now be rendered. This is useful for having router functionality. 

You could write your own router to fetch a new template on demand and update your viewmodel. All the properties inside will also become reactive!


## 8.1. Get value
You can use the following command to retrieve the current value of a property inside the reactive viewmodel:

```
jet.get('a.b.c');
```

Where *a.b.c* is the complete property path.

## 8.2. Watchers
You can do a function when a value changes, it will pass the new value as an argument:

```
jet.watch('a.b.c', myFunction(newValue) => console.log(newValue));
```

**N.B.** if the value is nested and you update it like ```'a.b.c'``` it will only trigger when you watch it with ```'a.b.c'``` parameter and *not* for instance if you do ```jet.update('a.b', { c: 'newString' } );```

## 8.3. Adding event listeners
Shorthand for ```document.getElementById(id).addEventListener(event, eventFunction, options?)```:
 
```
jet.addEvent(id, event, eventFunction, options?);
```

Shorthand for ```document.getElementById(id).removeEventListener(event, eventFunction, options?)```:
 
```
jet.removeEvent(id, event, eventFunction, options?);
```
npm package: @pennlabs/kraken
Description: cdkactions construct abstractions built for Penn Labs
Author: Penn Labs
Latest version: 0.8.12

# kraken

A cdk library for [cdkactions](https://github.com/ArmaanT/cdkactions/).

## Documentation

See [Kraken documentation](https://kraken.pennlabs.org/).

## Getting started

When creating a new project, do the following:

* Follow the [cdkactions getting started guide](https://github.com/ArmaanT/cdkactions/blob/master/docs/getting-started/typescript.md) to initialize the cdkactions project.
* Run `yarn install @pennlabs/kraken`
* Configure cdkactions (See the following subjections)
* Finally, run `yarn build` within the `.github/cdk` folder and commit your changes.

### Django + React Project

Most Penn Labs products follow the mold of a Django project in the `backend` directory and a React project in the `frontend` directory.

Since this is a common use-case, kraken provides an `LabsApplicationStack` that can easily configure the CI for this type of project.

To use an `LabsApplicationStack` stack, just replace the generated stack with:

``` javascript
new LabsApplicationStack(app, {
  djangoProjectName: 'exampleDjangoProject',
  dockerImageBaseName: 'example-product',
});
```

This configuration will lint, test, build, publish docker images for, and deploy both the Django project and a React project. The published docker images will be named: `$dockerImageBaseName-backend` and `$dockerImageBaseName-frontend`

### Different Configuration

If your repo is different from the normal 1 Django and 1 React project per repo, you can utilize the `DjangoProject` and `ReactProject` classes. For example, if you had a single Django project with multiple frontends, you could add something like the following inside of the generated Stack:

``` javascript
const workflow = new Workflow(this, 'workflow', {
  name: 'Workflow',
  on: 'push',
});

const django = new DjangoProject(workflow,
  {
    projectName: 'djangoProject',
    path: 'backend',
    imageName: 'project-backend',
  });

const reactOne = new ReactProject(workflow,
  {
    id: 'one',
    path: 'frontendOne',
    imageName: 'project-frontendOne',
  });

const reactTwo = new ReactProject(workflow,
  {
    id: 'two',
    path: 'frontendTwo',
    imageName: 'project-frontendTwo',
  });

new DeployJob(workflow, {},
  {
    needs: [django.publishJobId, reactOne.publishJobId, reactTwo.publishJobId],
  });
```

This configuration will lint, test, build, publish docker images for the Django project as well as the two React projects and then finally deploy the application.
npm package: @pennlabs/rest-live-hooks
Description: React hooks for seamlessly integrating django-rest-live.
Author: Penn Labs
Latest version: 2.0.2-alpha.0

# REST Live Hooks

React hooks built to handle CRUD through RESTful APIs and realtime updates through websockets.

This package exposes two hooks, `useRealtimeResource` and `useRealtimeResourceList`. Both hooks
have identical semantics to the respective hooks found
in [`@pennlabs/rest-hooks`](https://github.com/pennlabs/frontend-core/tree/master/packages/rest-hooks),
with one important distinction. These realtime hooks enable realtime updates via subscriptions
based on the asynchronous websocket API defined by [`django-rest-live`](https://github.com/pennlabs/django-rest-live).

Because these hooks return the exact same values as the base `rest-hooks`, they can be used as drop-in replacements
when you want to add realtime features to your React/Django app.

## Documentation

### Prior Reading
This library relies heavily on [`django-rest-live`](https://github.com/pennlabs/django-rest-live/blob/master/README.md#usage)
and [`rest-hooks`](https://github.com/pennlabs/frontend-core/blob/master/packages/rest-hooks/README.md#documentation)
for its functionality. It would be helpful to read through the README documentation for each of
those libraries before moving on to this package.

### Usage
The realtime hooks differ from the base REST hooks mostly in a `subscribeRequest`
object that's added to every hook call. The object's structure is as follows:

```js
const subscribeRequest = {
  model: "app.Model",
  property: "id",
  value: 5
}
```
- `model` is a string label referring to the django model to subscribe to.
- `property` is the optional "group key" discussed in the [django-rest-live](https://github.com/pennlabs/django-rest-live/blob/master/README.md#subscribe-to-groups)
documentation. If it is not present, it defaults to the `id` field on the model, which is unique,
so no grouping will occur. Make sure to add a group key for useResourceList. 
- `value` is the value match on for updates, generally an ID, either of the entity
(for `useRealtimeResource`) or the grouped related object (for `useRealtimeResource`).

Here are the signatures for the two functions:
- `{data, error, isValidating, mutate } = useResource(url, subscribeRequest, configOptions)`
- `{data, error, isValidating, mutate } = useResourceList(listUrl, getResourceUrl, subscribeRequest, configOptions)`
    - `configOptions` takes in one additional optional property, `sortBy`, which will sort newly created elements that are
    added to the list. This is some code duplication from any ordering enforced on the back-end, but is necessary
    since the websocket subscription does not include all elements in the list, but only the new one.
npm package: @pennockprojects/sitemap-diff
Description: Finds the differences between two sitemap.xml files located on a local file system, at a web http server, or on an Amazon AWS S3 storage bucket
Author: John Pennock
Latest version: 0.8.0

# sitemap-diff
A set of utilities for fetching sitemap.xml files and comparing the routes and paths between the two. It will output commonalities and differences.

One use case is to validate a change in the sitemap before updating it.

## Installing
To install `@pennockprojects/sitemap-diff` use your favorite package manager, instructions for using npm are:

```bash
npm install @pennockprojects/sitemap-diff --save-dev
```

## Fetching Sitemap Files
As of 0.6.2, the three locations it can import a sitemap.xml file are:
1. Local File System
2. http or https URL
3. AWS S3 Bucket

The sitemap.xml file must have a `.xml` extension in all cases.

### Local File System
Uses the node.js `fs` module to call `readFileSync` and `writeFileSync` functions to read and write local files. A relative file path contains the relative location of file, for example 
- `./some/dir/local-sitemap.xml`.  

### HTTP or HTTPS URL
Uses the node.js `node-fetch` module to call `fetch` function to get a sitemap from an http url.  The url must be resolvable from the context of the call and contain the full url., i.e. 
- `https://pennockprojects.com/sitemap.xml`

### AWS S3 Bucket URL
Uses the node.js `@aws-sdk/client-s3` to call `S3Client`, `GetObjectCommand` functions. 

The AWS S3 bucket URL access credentials are inherited from the local configured AWS CLI context.  Using this method without configured AWS credentials will not work.

The AWS S3 URL has the format of:
  - prefixed with "s3://"
  - contains the bucket name and key: "bucket-name/sitemap.xml"
  - optionally, the end can contain a suffix region: ":region://us-west-2", where "us-west-2" is replaced by your specific region string of the bucket.

Examples:
  - `s3://bucket-name/sitemap.xml`
  - `s3://bucket-name/key-name/sitemap.xml:region://us-west-2`

## Functions
### 1. fetchParsePaths
**Process a sitemap file: read, parse, and extract paths**

  - `@param` sitemapFile - the location (file, URL, S3) the sitemap file
  - `@param` options - Optional parameters for additional configurations (e.g., logLevel)
  - `@returns` An array of paths extracted from the sitemap

### 2. pathsDiff
**Compare two sitemaps and return the differences**

  - `@param` sitemap1 - The location (file, URL, S3) to first sitemap file
  - `@param` sitemap2 - The location (file, URL, S3) to second sitemap file
  - `@param` options - Optional parameters for additional configurations (e.g., logLevel)
 
  - `@returns` An object containing the comparison results

## TODO
- url diff including `loc`, `lastmode`, and `priority`
- sitemap validation
- sitemap index diff
- sitemap index with sitemap recursive diff
npm package: @pennyclaw/auto-compact
Description: Idle + threshold based transcript compaction with optional aggressive tool pruning.
Latest version: 1.0.0

# auto-compact

Idle + threshold based transcript compaction with optional aggressive tool pruning.

## Install

```bash
openclaw plugins install @pennyclaw/auto-compact
```

## Update

```bash
openclaw plugins update auto-compact
```

## Requires
- `gateway.http.endpoints.chatCompletions.enabled = true`

## Config

```json5
plugins: {
  entries: {
    "auto-compact": {
      enabled: true,
      config: {
        idleMinutes: 15,
        contextTokensThreshold: 100000,
        triggerMode: "or",       // "or" | "and"
        keepTurns: 5,
        aggressive: false,        // true = prune tool_result before summary
        modelOverride: null       // null = default model
      }
    }
  }
}
```

## Behavior
- Keeps the last N turns intact (user + assistant + tool calls).
- Summarizes everything before that into a single assistant message prefixed with `[context_summary]`.
- Uses rolling summary (previous summary is used as base).
- Chunking + fallback to avoid overflow.
- When `aggressive=true`, prunes all tool_result content before summary.
- Credentials are **never included**; only `/secrets` file paths are referenced.
- Native compaction compat (no custom prefix, tree safe, rolling disabled)
npm package: @pennyclaw/idle-prune
Description: OpenClaw plugin to prune tool_result content after idle
Latest version: 0.1.4

# Idle Prune

Prunes old `tool_result` payloads after idle time by replacing content with a placeholder.

## Install

```bash
openclaw plugins install @pennyclaw/idle-prune
```

## Update

```bash
openclaw plugins update idle-prune
```

## Config

```json5
plugins: {
  entries: {
    "idle-prune": {
      enabled: true,
      config: {
        idleMinutes: 15,
        placeholder: "[pruned due to idle]"
      }
    }
  }
}
```

### Defaults
If `config` is omitted, the plugin uses:
- `idleMinutes`: **15**
- `placeholder`: **"[pruned due to idle]"**

## Notes
- Runs on `message_received` to avoid extra LLM calls.
- Keeps tool call IDs and metadata intact.
- Only rewrites the content of tool-result messages.
npm package: @penpad/plugin-logger
Description: Logger plugin for Penpad
Author: Rico Sta. Cruz
Latest version: 0.4.0-alpha.0

# @penpad/plugin-logger

Logger plugin for Penpad

## Usage

Add `<LoggerPlugin />` to your Penpad component.

```js
import { LoggerPlugin } from '@penpad/plugin-logger'
```

```js
<Penpad>
  <LoggerPlugin />

  {/* other Penpad definitioms here */}
</Penpad>
```

### Logging entries

Use the `useLogger()` React hook to return a logging function.

```js
import { useLogger } from '@penpad/plugin-logger'

const YourComponent = () => {
  const log = useLogger()

  return (
    <button
      onClick={() => {
        log('Clicked!')
      }}
    >
      Click me!
    </button>
  )
}
```

### Logging entries in class components

There is also a `<UseLogger>` render prop component.

```js
import { UseLogger } from '@penpad/plugin-logger'
```

```jsx
<UseLogger>
  {({ log }) => (
    <Specimen id='Another specimen'>
      <button
        onClick={() => {
          log('Hello, I was clicked on ' + new Date().toString())
        }}
      >
        Click me
      </button>
    </Specimen>
  )}
</UseLogger>
```
npm package: @penpad/rollup-config
Description: Builds a Rollup configuration for use in Penpad plugins. The `buildConfig` function gets you a Rollup config with some basic necessities:
Author: Rico Sta. Cruz
Latest version: 0.4.0-alpha.0

# @penpad/rollup-config

Builds a Rollup configuration for use in Penpad plugins. The `buildConfig` function gets you a Rollup config with some basic necessities:

- [rollup-plugin-typescript2] for TypeScript support
- [rollup-plugin-react-svg] for loading icons
- [rollup-plugin-postcss-modules] for CSS modules support with PostCSS
- [postcss-import] for `@import` support in CSS
- [postcss-preset-env] for auto-prefixing and other new CSS features
- [postcss-apply] for `@apply` support

[rollup-plugin-node-resolve]: https://yarn.pm/rollup-plugin-node-resolve
[rollup-plugin-typescript2]: https://yarn.pm/rollup-plugin-typescript2
[rollup-plugin-commonjs]: https://yarn.pm/rollup-plugin-commonjs
[rollup-plugin-postcss-modules]: https://yarn.pm/rollup-plugin-postcss-modules
[rollup-plugin-react-svg]: https://yarn.pm/rollup-plugin-react-svg
[postcss-import]: https://yarn.pm/postcss-import
[postcss-apply]: https://yarn.pm/postcss-apply
[postcss-preset-env]: https://yarn.pm/postcss-preset-env

## Usage

Write a `rollup.config.js` for your plugin:

```js
// rollup.config.js
import buildConfig from '@penpad/rollup-config'
import pkg from './package.json'

export default buildConfig({
  // Entry point
  input: 'src/index.tsx',
  pkg
})
```

Configure npm scripts for `scripts.prepare`:

```js
/* package.json */
{
  "scripts": {
    "prepare": "rollup --config"
  }
}
```