@victor-software-house/pi-openai-proxy 0.3.0 → 0.3.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/extensions/proxy.ts +4 -5
- package/package.json +1 -1
package/extensions/proxy.ts
CHANGED
|
@@ -50,7 +50,6 @@ interface ProxyConfig {
|
|
|
50
50
|
interface RuntimeStatus {
|
|
51
51
|
reachable: boolean;
|
|
52
52
|
models: number;
|
|
53
|
-
managed: boolean;
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
// ---------------------------------------------------------------------------
|
|
@@ -329,7 +328,7 @@ export default function proxyExtension(pi: ExtensionAPI): void {
|
|
|
329
328
|
ctx.ui.setStatus("proxy", "proxy: starting...");
|
|
330
329
|
|
|
331
330
|
try {
|
|
332
|
-
const proxyEnv =
|
|
331
|
+
const proxyEnv = configToEnv(config);
|
|
333
332
|
|
|
334
333
|
if (config.lifetime === "detached") {
|
|
335
334
|
await startDetached(ctx, proxyEnv);
|
|
@@ -355,11 +354,11 @@ export default function proxyExtension(pi: ExtensionAPI): void {
|
|
|
355
354
|
}
|
|
356
355
|
}
|
|
357
356
|
|
|
358
|
-
async function startDetached(
|
|
357
|
+
async function startDetached(_ctx: ExtensionContext, env: Record<string, string>): Promise<void> {
|
|
359
358
|
const child = spawn("bun", ["run", proxyEntry], {
|
|
360
359
|
stdio: ["ignore", "ignore", "ignore"],
|
|
361
360
|
detached: true,
|
|
362
|
-
env,
|
|
361
|
+
env: { ...process.env, ...env },
|
|
363
362
|
});
|
|
364
363
|
|
|
365
364
|
if (child.pid === undefined) {
|
|
@@ -379,7 +378,7 @@ export default function proxyExtension(pi: ExtensionAPI): void {
|
|
|
379
378
|
sessionProcess = spawn("bun", ["run", proxyEntry], {
|
|
380
379
|
stdio: ["ignore", "pipe", "pipe"],
|
|
381
380
|
detached: false,
|
|
382
|
-
env,
|
|
381
|
+
env: { ...process.env, ...env },
|
|
383
382
|
});
|
|
384
383
|
|
|
385
384
|
sessionProcess.on("exit", (code) => {
|