Revert "docs: update README with pi install instructions and package info"
This reverts commit 8b5e6bc417.
This commit is contained in:
@@ -4,33 +4,21 @@ Emits a sound alert when the context window reaches or exceeds **100 000 tokens*
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
### Via `pi install` (recommended)
|
### Option 1: Auto-discovered (recommended)
|
||||||
|
|
||||||
```bash
|
|
||||||
pi install git:git.enne2.net/enne2/context-warn@main
|
|
||||||
```
|
|
||||||
|
|
||||||
Or pin to a specific tag:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pi install git:git.enne2.net/enne2/context-warn@v1.0.0
|
|
||||||
```
|
|
||||||
|
|
||||||
### Via `--extension` (test without installing)
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pi -e git:git.enne2.net/enne2/context-warn
|
|
||||||
```
|
|
||||||
|
|
||||||
### Manual install
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir -p ~/.pi/agent/extensions/context-warn
|
mkdir -p ~/.pi/agent/extensions/context-warn
|
||||||
cp -r ~/.pi/agent/git/git.enne2.net/enne2/context-warn/* ~/.pi/agent/extensions/context-warn/
|
cp -r /home/enne2/base/context-warn-extension/* ~/.pi/agent/extensions/context-warn/
|
||||||
```
|
```
|
||||||
|
|
||||||
Then reload pi with `/reload`.
|
Then reload pi with `/reload`.
|
||||||
|
|
||||||
|
### Option 2: One-off with --extension
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pi -e /home/enne2/base/context-warn-extension/index.ts
|
||||||
|
```
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- **Sound alert**: Plays a pre-bundled WAV alert sound via `aplay` (no runtime generation)
|
- **Sound alert**: Plays a pre-bundled WAV alert sound via `aplay` (no runtime generation)
|
||||||
@@ -47,7 +35,7 @@ Then reload pi with `/reload`.
|
|||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Edit these values at the top of `index.ts` in the installed package:
|
Edit these values at the top of `index.ts`:
|
||||||
|
|
||||||
| Constant | Default | Description |
|
| Constant | Default | Description |
|
||||||
|----------|---------|-------------|
|
|----------|---------|-------------|
|
||||||
@@ -58,10 +46,9 @@ Edit these values at the top of `index.ts` in the installed package:
|
|||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
- `aplay` (ALSA player) — for playing the WAV file
|
- `aplay` (ALSA player) — for playing the WAV file
|
||||||
- `sox` — only needed to **generate** a new `alert.wav` (optional)
|
- `sox` — only needed to **generate** a new alert.wav (optional)
|
||||||
|
|
||||||
Both are available on Fedora by default. On Ubuntu/Debian:
|
Both are available on Fedora by default. On Ubuntu/Debian:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo apt install alsa-utils sox libsox-fmt-all
|
sudo apt install alsa-utils sox libsox-fmt-all
|
||||||
```
|
```
|
||||||
@@ -70,7 +57,7 @@ sudo apt install alsa-utils sox libsox-fmt-all
|
|||||||
|
|
||||||
1. Listens to `turn_end` events (fired after every LLM response)
|
1. Listens to `turn_end` events (fired after every LLM response)
|
||||||
2. Calls `ctx.getContextUsage()` to check current token count
|
2. Calls `ctx.getContextUsage()` to check current token count
|
||||||
3. When tokens ≥ threshold, plays `alert.wav` via `aplay`
|
3. When tokens ≥ threshold, plays `alert.wav` via aplay
|
||||||
4. Shows a TUI notification and updates the status bar
|
4. Shows a TUI notification and updates the status bar
|
||||||
5. Resets alert state on `session_compact`
|
5. Resets alert state on `session_compact`
|
||||||
|
|
||||||
@@ -90,16 +77,4 @@ sox -n -t wav c.wav synth 0.55 sine 880 vol 0.65
|
|||||||
sox a.wav b.wav c.wav alert.wav
|
sox a.wav b.wav c.wav alert.wav
|
||||||
```
|
```
|
||||||
|
|
||||||
## Package
|
Customize the tone by changing the frequency and volume parameters.
|
||||||
|
|
||||||
This is a pi package. To update to the latest version:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pi update git:git.enne2.net/enne2/context-warn
|
|
||||||
```
|
|
||||||
|
|
||||||
To remove:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pi remove git:git.enne2.net/enne2/context-warn
|
|
||||||
```
|
|
||||||
|
|||||||
Reference in New Issue
Block a user