pi-agent-extensions 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,17 +2,48 @@
2
2
 
3
3
  A collection of extensions for the [pi coding agent](https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent).
4
4
 
5
+ ## Acknowledgments
6
+
7
+ This project includes extensions adapted from [mitsuhiko/agent-stuff](https://github.com/mitsuhiko/agent-stuff) (Apache 2.0 / MIT License).
8
+
9
+ **Special thanks to Armin Ronacher ([@mitsuhiko](https://github.com/mitsuhiko))** for creating and open-sourcing these excellent production-ready extensions:
10
+ - `notify.ts` - Desktop notifications via OSC 777
11
+ - `context.ts` - Context breakdown dashboard
12
+ - `files.ts` - Unified file browser with git integration
13
+ - `review.ts` - Code review system
14
+ - `loop.ts` - Iterative execution loop
15
+
16
+ Original repository: https://github.com/mitsuhiko/agent-stuff
17
+
5
18
  ## Extensions
6
19
 
7
20
  | Extension | Type | Description | Status |
8
21
  |-----------|------|-------------|--------|
9
- | **sessions** | Command | Quick session picker with `/sessions` command | ✅ Stable |
10
- | **ask_user** | Tool | LLM can ask structured questions with options | ⚙️ Beta (v0.1.0) |
11
- | **handoff** | Command | Transfer context to a new focused session with `/handoff` | ✅ Stable |
22
+ | **sessions** | Command | Quick session picker with `/sessions` | ✅ Stable |
23
+ | **ask_user** | Tool | LLM can ask structured questions | ⚙️ Beta |
24
+ | **handoff** | Command | Goal-driven context transfer `/handoff` | ✅ Stable |
25
+ | **whimsical** | UI | Context-aware loading messages & exit | ✅ Stable |
26
+ | **files** | Tool | Unified file browser & git integration | ✅ Stable |
27
+ | **notify** | Tool | Desktop notifications via OSC 777 | ✅ Stable |
28
+ | **context** | UI | Context breakdown dashboard | ✅ Stable |
29
+ | **review** | Tool | Interactive code review system | ✅ Stable |
30
+ | **loop** | Tool | Iterative execution loop | ✅ Stable |
31
+ | **todos** | Tool | File-based todo list management | ✅ Stable |
32
+ | **control** | RPC | Inter-session communication & control | ⚙️ Beta |
33
+ | **answer** | Tool | Structured Q&A for complex queries | ⚙️ Beta |
34
+ | **cwd_history** | Tracker | Tracks directory changes in context | ✅ Stable |
12
35
 
13
36
  ## Install
14
37
 
15
- ### From Source (Until Published)
38
+ ### From npm (Recommended)
39
+
40
+ ```bash
41
+ pi install npm:pi-agent-extensions
42
+ ```
43
+
44
+ All extensions will be available immediately after installation.
45
+
46
+ ### From Source (For Development)
16
47
 
17
48
  ```bash
18
49
  # Clone the repository
@@ -35,14 +66,6 @@ pi -e /path/to/pi-agent-extensions/extensions/sessions/index.ts \
35
66
  -e /path/to/pi-agent-extensions/extensions/handoff/index.ts
36
67
  ```
37
68
 
38
- ### From npm (When Published)
39
-
40
- ```bash
41
- pi install npm:pi-agent-extensions
42
- ```
43
-
44
- Both extensions will be available immediately after installation.
45
-
46
69
  ## Verify Installation
47
70
 
48
71
  After installing, start pi and look for the startup message:
@@ -169,6 +192,57 @@ Transfer context to a new focused session. Unlike `/compact` which summarizes ev
169
192
 
170
193
  See [docs/extensions/handoff.md](docs/extensions/handoff.md) for full documentation.
171
194
 
195
+ ### Whimsical
196
+
197
+ A personality engine for Pi that makes waiting fun.
198
+
199
+ **Usage:**
200
+
201
+ ```bash
202
+ /whimsy # Check status
203
+ /whimsy chaos # Enable chaos mode (Bollywood + Geek + Tips)
204
+ /exit # Graceful whimsical exit
205
+ ```
206
+
207
+ **Features:**
208
+ - **Context-Aware:** Messages change based on time of day (Morning/Night) and wait duration.
209
+ - **Personality Modes:**
210
+ - `chaos`: The full experience (50% Bollywood, 30% Tips, 20% Geek).
211
+ - `bollywood`: 100% Bollywood dialogues & Hinglish memes.
212
+ - `geek`: Sci-Fi & Dev humor ("Reticulating splines...").
213
+ - **Smart Exit:** `/exit` and `/bye` commands that ensure a clean terminal shutdown with a funny goodbye message.
214
+
215
+ See [extensions/whimsical/README.md](extensions/whimsical/README.md) for details.
216
+
217
+ ### Productivity Tools
218
+
219
+ **Files (`/files`)**
220
+ Unified file explorer with git integration. Adapted from `agent-stuff`.
221
+ - `/files` - Open file browser
222
+ - `Ctrl+Shift+F` - Open file picker
223
+
224
+ **Todos (`/todos`)**
225
+ File-based todo list management (stores in `.pi/todos/`).
226
+ - `/todos` - List and manage todos
227
+ - Tool: `todo` (create, update, claim, close tasks)
228
+
229
+ **Notify**
230
+ Allows the agent to send desktop notifications (via terminal OSC 777).
231
+ - Tool: `notify`
232
+
233
+ **Review**
234
+ Interactive code review system. The agent can request a review, and you can approve/reject/comment on specific files.
235
+ - Tool: `request_review`
236
+
237
+ **Loop**
238
+ Iterative execution loop for complex tasks.
239
+ - Tool: `run_loop`
240
+
241
+ **Control**
242
+ RPC-based session control. Allows sessions to talk to each other (e.g., a "manager" session spawning and controlling "worker" sessions).
243
+ - Flag: `--session-control`
244
+ - Tool: `send_to_session`
245
+
172
246
  ## Development
173
247
 
174
248
  ```bash
@@ -0,0 +1,63 @@
1
+ # Whimsical Extension Upgrade Proposal
2
+
3
+ ## Overview
4
+ Transform the `whimsical` extension from a simple random message picker into a context-aware, configurable "personality engine" for the Pi coding agent. The goal is to make waiting times feel shorter and more delightful by providing varied, relevant, and sometimes helpful feedback.
5
+
6
+ ## Core Features
7
+
8
+ ### 1. Categorized Message Banks
9
+ Instead of a single flat list, messages will be organized into distinct categories:
10
+
11
+ * **Gerunds (The "Claude" Style):** Single, delightful -ing verbs.
12
+ * *Examples:* "Schlepping...", "Combobulating...", "Flibbertigibbeting...", "Splines reticulating..."
13
+ * **Sci-Fi / Technical:** Jargon-heavy, futuristic, or retro-tech phrases.
14
+ * *Examples:* "Reversing the polarity...", "Engaging warp drive...", "Defragging the matrix...", "Consulting the oracle..."
15
+ * **Relatable / Dev Struggles:** Humorous takes on the developer experience.
16
+ * *Examples:* "Exiting Vim...", "Centering a div...", "Blaming the intern...", "It works on my machine..."
17
+ * **Bollywood Masala (New!):** Iconic dialogues reimagined for coding.
18
+ * *Examples:*
19
+ * "Picture abhi baaki hai mere dost..." (The movie/loading isn't over yet)
20
+ * "Kitne bugs the?" (How many bugs were there?)
21
+ * "Mere Karan Arjun aayenge..." (My results will come...)
22
+ * "Ek semicolon ki keemat tum kya jaano..." (You don't know the value of one semicolon...)
23
+ * "Utha le re baba... mereko nahi, is bug ko!" (Pick it up oh god... not me, this bug!)
24
+ * "Risk hai toh ishq hai..." (If there's risk/bugs, there's love/dev)
25
+ * **Helpful / Tips:** Occasional useful tips about Pi features.
26
+ * *Examples:* "Try /help for commands...", "Use /modes to switch models...", "Did you know? /diff shows changes..."
27
+
28
+ ### 2. Context Awareness
29
+ * **Time-of-Day:**
30
+ * *Morning (5 AM - 10 AM):* "Caffeinating...", "Waking up the pixels...", "Brewing logic..."
31
+ * *Late Night (12 AM - 4 AM):* "Burning the midnight oil...", "Compiling dream logic...", "Is it tomorrow yet?"
32
+ * **Long Wait Logic:**
33
+ * If a turn takes > 5 seconds, switch from a simple "Thinking..." to a more elaborate "story" or a "self-deprecating" message ("Still thinking, I promise...", "Downloading more RAM...").
34
+
35
+ ### 3. Configuration (Slash Command)
36
+ A new `/whimsy` command to control behavior:
37
+
38
+ * `/whimsy mode <mode>`:
39
+ * `chaos`: (Default) Random mix of all categories (Gerunds 40%, SciFi 20%, Bollywood 30%, Tips 10%).
40
+ * `classic`: Only short Gerunds.
41
+ * `bollywood`: Only Bollywood dialogues.
42
+ * `geek`: Only Sci-Fi/Dev jokes.
43
+ * `/whimsy level <0-10>`:
44
+ * `0`: Disable (Standard "Thinking..." only).
45
+ * `5`: Balanced (Mix of standard and whimsical).
46
+ * `10`: Maximum weirdness (Always show a whimsical message).
47
+
48
+ ## Implementation Plan
49
+
50
+ 1. **Refactor `extensions/whimsical/index.ts`:**
51
+ * Create a `MessageManager` class to handle categories and logic.
52
+ * Implement `pickMessage()` with context awareness (time, duration).
53
+ * Add `setTimeout` loop to update message dynamically during long turns.
54
+
55
+ 2. **Add Configuration:**
56
+ * Register `/whimsy` command using `pi.registerCommand`.
57
+ * Persist settings to `workspaceState` or similar if available (or just runtime memory for v1).
58
+
59
+ 3. **Expand Message Library:**
60
+ * Curate the lists based on the research (Claude, Discord, Sims, etc.).
61
+
62
+ ## Example "Story" Mode (Future)
63
+ * "Planting seeds..." -> (2s later) -> "Watering..." -> (2s later) -> "Harvesting results!"