<!--
SPDX-FileCopyrightText: Amolith <amolith@secluded.site>

SPDX-License-Identifier: CC0-1.0
-->

# pi-extensions

A collection of [Pi](https://github.com/badlogic/pi-mono) extensions. They're
all quite rough currently, having just been imported to this repo from ad-hoc,
vibed individual scripts created by saying "go change
`~/.config/pi/extensions/foo.ts` so it bars".

## Packages

### `@amolith/pi-handoff`

[![npm](https://img.shields.io/npm/v/@amolith/pi-handoff)](https://www.npmjs.com/package/@amolith/pi-handoff)

Get to the end of the thing you're doing, then use a lightweight subagent to
extract particular bits from the current session and create a new one from those
bits with `/handoff thorough goal description`. You can also tell Pi to hand
something off (it has a tool).

```sh
pi install npm:@amolith/pi-handoff
```

> Based on [handoff.ts](https://github.com/pasky/pi-amplike/blob/main/extensions/handoff.ts)
> and [session-query.ts](https://github.com/pasky/pi-amplike/blob/main/extensions/session-query.ts)
> by Petr Baudis, licensed MIT accordingly. Reworked so the subagent calls a
> tool instead of expecting it to produce well-formed JSON, added an auto-submit
> countdown, and make the extraction model configurable via `PI_HANDOFF_MODEL`.

### `@amolith/pi-personas`

[![npm](https://img.shields.io/npm/v/@amolith/pi-personas)](https://www.npmjs.com/package/@amolith/pi-personas)

Drop markdown files in `$PI_CODING_AGENT_DIR/personas/` and switch between them
with `/persona`. Lets your agent be a grumpy senior today and a patient tutor
tomorrow. The active persona gets injected into the system prompt and persists
across sessions until you change it.

```sh
pi install npm:@amolith/pi-personas
```

> All mine :)

## Development

Prerequisites: [mise](https://mise.jdx.dev/) (installs bun automatically).

```sh
# Install dependencies
bun install

# Format, lint, and type-check everything
mise run check
```
