@victor-software-house/pi-openai-proxy 0.2.2 → 0.2.3
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 +0 -10
- package/extensions/proxy.ts +1 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -231,16 +231,6 @@ pi install npm:@victor-software-house/pi-openai-proxy
|
|
|
231
231
|
|
|
232
232
|
`/proxy` (or `/proxy config`) opens an interactive settings panel where you can configure the bind address, port, auth token, remote images, body size limit, and upstream timeout. Changes are saved to `~/.pi/agent/proxy-config.json` immediately. Restart the proxy to apply changes.
|
|
233
233
|
|
|
234
|
-
### Auto-start with a pi session
|
|
235
|
-
|
|
236
|
-
```bash
|
|
237
|
-
pi --proxy
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
The proxy starts automatically on session start and stops when the session ends. A status indicator in the footer shows the proxy URL and model count.
|
|
241
|
-
|
|
242
|
-
Note: the `--proxy` flag is registered by the extension at runtime and does not appear in `pi --help`.
|
|
243
|
-
|
|
244
234
|
### Standalone (background) mode
|
|
245
235
|
|
|
246
236
|
For a proxy that outlives pi sessions, run the binary directly:
|
package/extensions/proxy.ts
CHANGED
|
@@ -11,9 +11,6 @@
|
|
|
11
11
|
* /proxy path Show config file location
|
|
12
12
|
* /proxy reset Restore default settings
|
|
13
13
|
* /proxy help Usage line
|
|
14
|
-
*
|
|
15
|
-
* Flag:
|
|
16
|
-
* --proxy Auto-start on session start
|
|
17
14
|
*/
|
|
18
15
|
|
|
19
16
|
import {
|
|
@@ -156,23 +153,11 @@ export default function proxyExtension(pi: ExtensionAPI): void {
|
|
|
156
153
|
return `http://${config.host}:${String(config.port)}`;
|
|
157
154
|
}
|
|
158
155
|
|
|
159
|
-
// --- Flag ---
|
|
160
|
-
|
|
161
|
-
pi.registerFlag("proxy", {
|
|
162
|
-
description: "Start the OpenAI proxy on session start",
|
|
163
|
-
type: "boolean",
|
|
164
|
-
default: false,
|
|
165
|
-
});
|
|
166
|
-
|
|
167
156
|
// --- Lifecycle ---
|
|
168
157
|
|
|
169
158
|
pi.on("session_start", async (_event, ctx) => {
|
|
170
159
|
config = loadConfig();
|
|
171
|
-
|
|
172
|
-
await startProxy(ctx);
|
|
173
|
-
} else {
|
|
174
|
-
await refreshStatus(ctx);
|
|
175
|
-
}
|
|
160
|
+
await refreshStatus(ctx);
|
|
176
161
|
});
|
|
177
162
|
|
|
178
163
|
pi.on("session_shutdown", async () => {
|