pi-agent-extensions 0.2.0 ā 0.2.2
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 +52 -0
- package/extensions/whimsical/index.ts +9 -23
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -97,12 +97,64 @@ pi
|
|
|
97
97
|
|
|
98
98
|
You'll see a loader while context is extracted, then an editor to review the handoff prompt.
|
|
99
99
|
|
|
100
|
+
## Update
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Update to latest version
|
|
104
|
+
pi update pi-agent-extensions
|
|
105
|
+
|
|
106
|
+
# Or update all packages
|
|
107
|
+
pi --update-packages
|
|
108
|
+
```
|
|
109
|
+
|
|
100
110
|
## Uninstall
|
|
101
111
|
|
|
102
112
|
```bash
|
|
103
113
|
pi remove pi-agent-extensions
|
|
104
114
|
```
|
|
105
115
|
|
|
116
|
+
## Troubleshooting
|
|
117
|
+
|
|
118
|
+
### Extensions not showing after install
|
|
119
|
+
|
|
120
|
+
If you installed via `npm install` or `npm update`, the package won't be registered with Pi. You must use **Pi's package manager**:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
# Wrong (npm only - won't register with Pi)
|
|
124
|
+
npm install pi-agent-extensions
|
|
125
|
+
|
|
126
|
+
# Correct (registers with Pi)
|
|
127
|
+
pi install npm:pi-agent-extensions
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Verify installation
|
|
131
|
+
|
|
132
|
+
Check that the package appears in your settings:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
cat ~/.pi/agent/settings.json | grep pi-agent-extensions
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
You should see:
|
|
139
|
+
```json
|
|
140
|
+
"packages": [
|
|
141
|
+
"npm:pi-agent-extensions",
|
|
142
|
+
...
|
|
143
|
+
]
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Local development vs npm
|
|
147
|
+
|
|
148
|
+
When running Pi from the `pi-agent-extensions` directory, it loads **local** extensions (your development copy), not the npm-installed version. This is useful for development but can cause confusion.
|
|
149
|
+
|
|
150
|
+
To test the npm version, run Pi from a different directory:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
cd ~/some-other-project
|
|
154
|
+
pi
|
|
155
|
+
# Check: should show npm:pi-agent-extensions in [Extensions]
|
|
156
|
+
```
|
|
157
|
+
|
|
106
158
|
## Extensions
|
|
107
159
|
|
|
108
160
|
### Sessions
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExtensionAPI
|
|
1
|
+
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
2
2
|
import { BOLLYWOOD_MESSAGES, CONTEXT_MESSAGES, PI_TIPS, WHIMSICAL_VERBS, GOODBYE_MESSAGES } from "./messages.js";
|
|
3
3
|
|
|
4
4
|
type WhimsyMode = 'chaos' | 'classic' | 'bollywood' | 'geek';
|
|
@@ -86,30 +86,14 @@ export default function (pi: ExtensionAPI) {
|
|
|
86
86
|
});
|
|
87
87
|
|
|
88
88
|
// Register /exit and /bye
|
|
89
|
-
const performExit = (ctx: ExtensionContext) => {
|
|
90
|
-
// 1. Try official shutdown
|
|
91
|
-
ctx.shutdown();
|
|
92
|
-
|
|
93
|
-
// 2. Set a watchdog to force exit if graceful shutdown hangs
|
|
94
|
-
setTimeout(() => {
|
|
95
|
-
// Force manual cleanup in case Pi didn't get to it
|
|
96
|
-
if (process.stdin.isTTY) {
|
|
97
|
-
process.stdin.setRawMode(false);
|
|
98
|
-
}
|
|
99
|
-
// Reset cursor, disable mouse tracking, restore buffer
|
|
100
|
-
process.stdout.write('\x1b[?25h\x1b[?1000l\x1b[?1002l\x1b[?1015l\x1b[?1006l\x1b[?1049l');
|
|
101
|
-
|
|
102
|
-
// Force kill
|
|
103
|
-
process.exit(0);
|
|
104
|
-
}, 200);
|
|
105
|
-
};
|
|
106
|
-
|
|
107
89
|
pi.registerCommand("exit", {
|
|
108
90
|
description: "Exit Pi with a whimsical goodbye",
|
|
109
91
|
handler: async (_args, ctx) => {
|
|
110
92
|
const msg = GOODBYE_MESSAGES[Math.floor(Math.random() * GOODBYE_MESSAGES.length)];
|
|
111
|
-
|
|
112
|
-
|
|
93
|
+
if (ctx.hasUI) {
|
|
94
|
+
ctx.ui.notify(`š ${msg}`, "info");
|
|
95
|
+
}
|
|
96
|
+
ctx.shutdown();
|
|
113
97
|
},
|
|
114
98
|
});
|
|
115
99
|
|
|
@@ -117,8 +101,10 @@ export default function (pi: ExtensionAPI) {
|
|
|
117
101
|
description: "Exit Pi with a whimsical goodbye (alias)",
|
|
118
102
|
handler: async (_args, ctx) => {
|
|
119
103
|
const msg = GOODBYE_MESSAGES[Math.floor(Math.random() * GOODBYE_MESSAGES.length)];
|
|
120
|
-
|
|
121
|
-
|
|
104
|
+
if (ctx.hasUI) {
|
|
105
|
+
ctx.ui.notify(`š ${msg}`, "info");
|
|
106
|
+
}
|
|
107
|
+
ctx.shutdown();
|
|
122
108
|
},
|
|
123
109
|
});
|
|
124
110
|
|