open-agents-ai 0.184.19 → 0.184.20
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/dist/index.js +18 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -48049,6 +48049,24 @@ async function handleSlashCommand(input, ctx) {
|
|
|
48049
48049
|
availableRows: ctx.availableContentRows?.(),
|
|
48050
48050
|
onGoLive: async (config) => {
|
|
48051
48051
|
const existingGateway = ctx.getExposeGateway?.();
|
|
48052
|
+
const managedPid = existingGateway?._cloudflaredPid || null;
|
|
48053
|
+
if (!existingGateway?.isActive) {
|
|
48054
|
+
try {
|
|
48055
|
+
const { execSync: execSync34 } = __require("child_process");
|
|
48056
|
+
const orphanPids = execSync34("pgrep -f 'cloudflared tunnel --url http://127.0.0.1'", { encoding: "utf8", timeout: 3e3 }).trim().split("\n").map((s) => parseInt(s, 10)).filter((p) => p > 0 && p !== managedPid);
|
|
48057
|
+
for (const pid of orphanPids) {
|
|
48058
|
+
try {
|
|
48059
|
+
process.kill(pid, "SIGTERM");
|
|
48060
|
+
} catch {
|
|
48061
|
+
}
|
|
48062
|
+
}
|
|
48063
|
+
if (orphanPids.length > 0) {
|
|
48064
|
+
renderInfo(`Cleaned up ${orphanPids.length} orphaned tunnel(s) from previous session.`);
|
|
48065
|
+
await new Promise((r) => setTimeout(r, 2e3));
|
|
48066
|
+
}
|
|
48067
|
+
} catch {
|
|
48068
|
+
}
|
|
48069
|
+
}
|
|
48052
48070
|
const tunnelAlreadyActive = existingGateway?.isActive && existingGateway?.tunnelUrl;
|
|
48053
48071
|
const p2pAlreadyActive = ctx.isExposeActive?.() && !existingGateway?.tunnelUrl;
|
|
48054
48072
|
if (config.transport.cloudflared && ctx.exposeStart) {
|
package/package.json
CHANGED