# personal-pi

Personal extensions bundled into one Pi extension and loaded from:

```text
~/personal-pi
```

The package is enabled in `~/.pi/agent/settings.json`. Run `/reload` or restart Pi after changes.

## Included functionality

### Startup and session management

- **`always-default-model.ts`**
  - Selects `startupModel` from `~/.pi/agent/settings.json` on a fresh Pi launch.
  - Does not override an explicit `--model`, resumed conversation, `/new`, `/resume`, `/fork`, or `/reload` model.

- **`auto-session-title.ts`**
  - Uses the active model to generate a short title from the first user prompt.
  - Also titles a fresh fork from its first post-fork prompt.
  - Title generation is best-effort and does not block the main turn.

- **`copy-resume-command-on-exit.ts`**
  - On normal TUI exit, copies a `pi --session ...` command for the persisted session to the clipboard.

### Model controls

- **`codex-fast-mode.ts`**
  - Adds `/fast`, `/fast on`, `/fast off`, and `/fast status`.
  - When enabled, adds `service_tier=priority` to provider request payloads for faster Codex requests.
  - Priority mode may cost more credits.

- **`hide-built-in-models.ts`**
  - Hides built-in model catalogs for the `deepseek`, `google`, and `openai` providers.

### TUI

- **`model-name-footer.ts`**
  - Replaces the default footer with:
    - Working directory and Git branch
    - Session name and ID
    - Current provider, model, and thinking level
    - Context usage and estimated session cost
    - Extension status indicators

### Chrome control

- **`chrome-profile-bridge/index.ts`** (vendored `pi-chrome` 0.15.46)
  - Adds `chrome_*` tools for tabs, snapshots, inspection, navigation, evaluation, clicks, typing, form filling, keyboard input, scrolling, dragging, tapping, file uploads, screenshots, console logs, and network requests.
  - Uses the user's existing signed-in Chrome profile through the bundled unpacked companion extension in `chrome-profile-bridge/browser-extension/`.
  - Keeps implicit automation in a dedicated Pi session target and supports shared bridge clients across concurrent Pi sessions.
  - The local build starts every new/reloaded Pi session with indefinite Chrome authorization. `/chrome revoke` locks the current runtime; reloading or starting a new session restores indefinite authorization.
  - `/chrome onboard`, `/chrome doctor`, `/chrome status`, `/chrome authorize`, `/chrome revoke`, and `/chrome background ...` manage the bridge.
  - Disable the Pi-side integration globally with `"configure": { "pi-chrome": { "enabled": false } }` in `~/.pi/agent/settings.json`, then run `/reload`.
  - Upstream reference material is preserved in `pi-chrome.README.md`, `pi-chrome.SECURITY.md`, `pi-chrome.LICENSE`, `pi-chrome-docs/`, and `pi-chrome-test-suite/`.

### Conversation excursions

- **`pi-excursion.ts`**
  - `/excursion [goal]` — fork into a temporary exploratory conversation.
  - `/return <focus>` — reduce the excursion into an editable return packet and resume the parent.
  - `/return-exact [text]` — approve literal text without an LLM reducer.
  - `/discard` — resume the parent without returning context.
  - Supports nested excursions and persists metadata beside the session file.
  - Requires an interactive TUI and a persisted session.

### Fuzzy autocomplete

- **`frizbee-autocomplete/index.ts`**
  - Provides fuzzy word and existing-path completion from the active conversation.
  - Indexes user, assistant, and tool-result messages locally.
  - Uses the native Frizbee backend on supported platforms and falls back to a JavaScript matcher otherwise.
  - `Tab` and `Shift+Tab` cycle word suggestions.
  - Pi's slash-command, `@` file, `#`, and path completion remain delegated to the built-in provider.
  - The native Rust source and prebuilt backend are under `frizbee-autocomplete/native/` and `native-build/`.

## Layout

```text
personal-pi/
├── package.json
├── README.md
├── pi-excursion.README.md
├── pi-excursion.LICENSE
├── pi-chrome.README.md
├── pi-chrome.SECURITY.md
├── pi-chrome.LICENSE
├── pi-chrome-docs/
├── pi-chrome-test-suite/
└── extensions/
    ├── index.ts                  # Single Pi entry point
    ├── always-default-model.ts
    ├── auto-session-title.ts
    ├── chrome-profile-bridge/
    │   ├── index.ts
    │   └── browser-extension/
    ├── codex-fast-mode.ts
    ├── copy-resume-command-on-exit.ts
    ├── hide-built-in-models.ts
    ├── model-name-footer.ts
    ├── pi-excursion.ts
    └── frizbee-autocomplete/
        ├── index.ts
        ├── native/
        ├── native-build/
        ├── scripts/
        └── test/
```

The package has no runtime dependencies beyond Pi's bundled core packages.
