@solongate/proxy 0.81.79 → 0.81.80
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 +8 -32
- package/dist/tui/index.js +2 -24
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6562,7 +6562,7 @@ __export(self_update_exports, {
|
|
|
6562
6562
|
tuiUpdateFlow: () => tuiUpdateFlow
|
|
6563
6563
|
});
|
|
6564
6564
|
import { execFile, spawn } from "child_process";
|
|
6565
|
-
import { mkdirSync as mkdirSync3, openSync, readFileSync as readFileSync4,
|
|
6565
|
+
import { mkdirSync as mkdirSync3, openSync, readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "fs";
|
|
6566
6566
|
import { homedir as homedir2 } from "os";
|
|
6567
6567
|
import { dirname, join as join4 } from "path";
|
|
6568
6568
|
import { fileURLToPath } from "url";
|
|
@@ -6614,28 +6614,6 @@ async function fetchLatest() {
|
|
|
6614
6614
|
return null;
|
|
6615
6615
|
}
|
|
6616
6616
|
}
|
|
6617
|
-
function npmGlobalRoot() {
|
|
6618
|
-
return new Promise((resolve10) => {
|
|
6619
|
-
try {
|
|
6620
|
-
execFile("npm", ["root", "-g"], { timeout: 5e3, windowsHide: true, shell: process.platform === "win32" }, (err2, stdout) => {
|
|
6621
|
-
resolve10(err2 ? null : stdout.trim() || null);
|
|
6622
|
-
});
|
|
6623
|
-
} catch {
|
|
6624
|
-
resolve10(null);
|
|
6625
|
-
}
|
|
6626
|
-
});
|
|
6627
|
-
}
|
|
6628
|
-
async function isGlobalInstall() {
|
|
6629
|
-
try {
|
|
6630
|
-
const script = realpathSync(process.argv[1] ?? "");
|
|
6631
|
-
if (!script) return false;
|
|
6632
|
-
const root = await npmGlobalRoot();
|
|
6633
|
-
if (!root) return false;
|
|
6634
|
-
return script.startsWith(realpathSync(root));
|
|
6635
|
-
} catch {
|
|
6636
|
-
return false;
|
|
6637
|
-
}
|
|
6638
|
-
}
|
|
6639
6617
|
function spawnGlobalInstall(version) {
|
|
6640
6618
|
try {
|
|
6641
6619
|
mkdirSync3(join4(homedir2(), ".solongate"), { recursive: true });
|
|
@@ -6687,7 +6665,7 @@ async function tuiUpdateFlow(onStatus) {
|
|
|
6687
6665
|
if (!latest || !newerThan(latest, current)) return;
|
|
6688
6666
|
const attempts = readState().attempts ?? {};
|
|
6689
6667
|
const canRetry = Date.now() - (attempts[latest] ?? 0) >= ATTEMPT_EVERY_MS;
|
|
6690
|
-
if (
|
|
6668
|
+
if (canRetry) {
|
|
6691
6669
|
writeState({ ...readState(), attempts: { [latest]: Date.now() } });
|
|
6692
6670
|
onStatus({ kind: "updating", version: latest });
|
|
6693
6671
|
if (await runGlobalInstall(latest)) {
|
|
@@ -6713,16 +6691,14 @@ function maybeSelfUpdate(notify = (l) => process.stderr.write(l + "\n")) {
|
|
|
6713
6691
|
}
|
|
6714
6692
|
if (!latest || !newerThan(latest, current)) return;
|
|
6715
6693
|
const attempts = readState().attempts ?? {};
|
|
6716
|
-
if (
|
|
6717
|
-
|
|
6718
|
-
|
|
6719
|
-
|
|
6720
|
-
notify(`${c.dim}\u2191 solongate v${latest} available (running v${current}) \u2014 updating in the background, next run uses it${c.reset}`);
|
|
6721
|
-
return;
|
|
6722
|
-
}
|
|
6723
|
-
} else {
|
|
6694
|
+
if (now - (attempts[latest] ?? 0) >= ATTEMPT_EVERY_MS) {
|
|
6695
|
+
writeState({ ...readState(), attempts: { [latest]: now } });
|
|
6696
|
+
if (spawnGlobalInstall(latest)) {
|
|
6697
|
+
notify(`${c.dim}\u2191 solongate v${latest} available (running v${current}) \u2014 updating in the background, next run uses it${c.reset}`);
|
|
6724
6698
|
return;
|
|
6725
6699
|
}
|
|
6700
|
+
} else {
|
|
6701
|
+
return;
|
|
6726
6702
|
}
|
|
6727
6703
|
notify(`${c.dim}\u2191 solongate v${latest} available (running v${current}) \u2014 update: ${c.reset}${c.cyan}npm i -g ${PKG}@latest${c.reset}`);
|
|
6728
6704
|
} catch {
|
package/dist/tui/index.js
CHANGED
|
@@ -3952,7 +3952,7 @@ function SettingsPanel({
|
|
|
3952
3952
|
|
|
3953
3953
|
// src/self-update.ts
|
|
3954
3954
|
import { execFile, spawn as spawn4 } from "child_process";
|
|
3955
|
-
import { mkdirSync as mkdirSync6, openSync as openSync3, readFileSync as readFileSync6,
|
|
3955
|
+
import { mkdirSync as mkdirSync6, openSync as openSync3, readFileSync as readFileSync6, writeFileSync as writeFileSync7 } from "fs";
|
|
3956
3956
|
import { homedir as homedir8 } from "os";
|
|
3957
3957
|
import { dirname as dirname3, join as join8 } from "path";
|
|
3958
3958
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
@@ -4009,28 +4009,6 @@ async function fetchLatest() {
|
|
|
4009
4009
|
return null;
|
|
4010
4010
|
}
|
|
4011
4011
|
}
|
|
4012
|
-
function npmGlobalRoot() {
|
|
4013
|
-
return new Promise((resolve3) => {
|
|
4014
|
-
try {
|
|
4015
|
-
execFile("npm", ["root", "-g"], { timeout: 5e3, windowsHide: true, shell: process.platform === "win32" }, (err, stdout) => {
|
|
4016
|
-
resolve3(err ? null : stdout.trim() || null);
|
|
4017
|
-
});
|
|
4018
|
-
} catch {
|
|
4019
|
-
resolve3(null);
|
|
4020
|
-
}
|
|
4021
|
-
});
|
|
4022
|
-
}
|
|
4023
|
-
async function isGlobalInstall() {
|
|
4024
|
-
try {
|
|
4025
|
-
const script = realpathSync(process.argv[1] ?? "");
|
|
4026
|
-
if (!script) return false;
|
|
4027
|
-
const root = await npmGlobalRoot();
|
|
4028
|
-
if (!root) return false;
|
|
4029
|
-
return script.startsWith(realpathSync(root));
|
|
4030
|
-
} catch {
|
|
4031
|
-
return false;
|
|
4032
|
-
}
|
|
4033
|
-
}
|
|
4034
4012
|
function runGlobalInstall(version) {
|
|
4035
4013
|
return new Promise((resolve3) => {
|
|
4036
4014
|
try {
|
|
@@ -4064,7 +4042,7 @@ async function tuiUpdateFlow(onStatus) {
|
|
|
4064
4042
|
if (!latest || !newerThan(latest, current)) return;
|
|
4065
4043
|
const attempts = readState2().attempts ?? {};
|
|
4066
4044
|
const canRetry = Date.now() - (attempts[latest] ?? 0) >= ATTEMPT_EVERY_MS;
|
|
4067
|
-
if (
|
|
4045
|
+
if (canRetry) {
|
|
4068
4046
|
writeState2({ ...readState2(), attempts: { [latest]: Date.now() } });
|
|
4069
4047
|
onStatus({ kind: "updating", version: latest });
|
|
4070
4048
|
if (await runGlobalInstall(latest)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solongate/proxy",
|
|
3
|
-
"version": "0.81.
|
|
3
|
+
"version": "0.81.80",
|
|
4
4
|
"description": "AI tool security proxy: protect any AI tool server with customizable policies, path/command constraints, rate limiting, and audit logging. No code changes required.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|