@solongate/proxy 0.83.11 → 0.83.13
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/commands/index.js +50 -4
- package/dist/global-install.js +6 -6
- package/dist/index.js +32 -10
- package/dist/tui/index.js +39 -10
- package/package.json +1 -1
package/dist/commands/index.js
CHANGED
|
@@ -131,6 +131,20 @@ function codexHooksStatus() {
|
|
|
131
131
|
}
|
|
132
132
|
return { registered, trusted, disabled };
|
|
133
133
|
}
|
|
134
|
+
function isOpencodeGuardInstalled() {
|
|
135
|
+
try {
|
|
136
|
+
return readFileSync(globalPaths().opencodePluginPath, "utf-8").includes("tool.execute.before");
|
|
137
|
+
} catch {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
function opencodeDetected() {
|
|
142
|
+
try {
|
|
143
|
+
return existsSync(globalPaths().opencodeDir);
|
|
144
|
+
} catch {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
134
148
|
function installedGuardVersion() {
|
|
135
149
|
try {
|
|
136
150
|
const p = globalPaths();
|
|
@@ -141,6 +155,16 @@ function installedGuardVersion() {
|
|
|
141
155
|
return null;
|
|
142
156
|
}
|
|
143
157
|
}
|
|
158
|
+
function isGuardInstalled() {
|
|
159
|
+
try {
|
|
160
|
+
const p = globalPaths();
|
|
161
|
+
if (!existsSync(p.settingsPath)) return false;
|
|
162
|
+
const s = JSON.parse(readFileSync(p.settingsPath, "utf-8"));
|
|
163
|
+
return !!s.hooks && JSON.stringify(s.hooks).includes(".solongate");
|
|
164
|
+
} catch {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
144
168
|
|
|
145
169
|
// src/api-client/client.ts
|
|
146
170
|
var DEFAULT_API_URL = "https://api.solongate.com";
|
|
@@ -1245,18 +1269,40 @@ async function collectChecks() {
|
|
|
1245
1269
|
} catch {
|
|
1246
1270
|
}
|
|
1247
1271
|
}
|
|
1272
|
+
const claudeReg = isGuardInstalled();
|
|
1273
|
+
checks.push({
|
|
1274
|
+
name: "Claude hooks",
|
|
1275
|
+
ok: claudeReg,
|
|
1276
|
+
detail: claudeReg ? "guard registered" : "guard NOT registered - run `solongate repair`"
|
|
1277
|
+
});
|
|
1278
|
+
if (existsSync4(globalPaths().antigravityDir)) {
|
|
1279
|
+
const reg = existsSync4(globalPaths().antigravityHooksPath);
|
|
1280
|
+
checks.push({
|
|
1281
|
+
name: "Antigravity hooks",
|
|
1282
|
+
ok: reg,
|
|
1283
|
+
detail: reg ? "guard registered" : "guard NOT registered - run `solongate repair`"
|
|
1284
|
+
});
|
|
1285
|
+
}
|
|
1248
1286
|
if (codexDetected()) {
|
|
1249
1287
|
const cx = codexHooksStatus();
|
|
1250
1288
|
if (!cx.registered) {
|
|
1251
|
-
checks.push({ name: "
|
|
1289
|
+
checks.push({ name: "Codex hooks", ok: false, detail: "guard NOT registered - run `solongate repair`" });
|
|
1252
1290
|
} else if (cx.disabled) {
|
|
1253
|
-
checks.push({ name: "
|
|
1291
|
+
checks.push({ name: "Codex hooks", ok: false, detail: "hooks disabled in ~/.codex/config.toml ([features] hooks = false)" });
|
|
1254
1292
|
} else if (!cx.trusted) {
|
|
1255
|
-
checks.push({ name: "
|
|
1293
|
+
checks.push({ name: "Codex hooks", ok: "warn", detail: "registered - run `/hooks` in Codex once and trust them (Codex skips untrusted hooks)" });
|
|
1256
1294
|
} else {
|
|
1257
|
-
checks.push({ name: "
|
|
1295
|
+
checks.push({ name: "Codex hooks", ok: true, detail: "registered + trusted" });
|
|
1258
1296
|
}
|
|
1259
1297
|
}
|
|
1298
|
+
if (opencodeDetected()) {
|
|
1299
|
+
const reg = isOpencodeGuardInstalled();
|
|
1300
|
+
checks.push({
|
|
1301
|
+
name: "OpenCode hooks",
|
|
1302
|
+
ok: reg,
|
|
1303
|
+
detail: reg ? "guard registered (not active under `opencode --pure`)" : "guard NOT registered - run `solongate repair`"
|
|
1304
|
+
});
|
|
1305
|
+
}
|
|
1260
1306
|
try {
|
|
1261
1307
|
const raw = readFileSync5(join4(homedir4(), ".solongate", ".key-rejected.json"), "utf-8");
|
|
1262
1308
|
const m = JSON.parse(raw);
|
package/dist/global-install.js
CHANGED
|
@@ -439,19 +439,19 @@ function repairQuiet() {
|
|
|
439
439
|
const before = [
|
|
440
440
|
line("guard hook file", has(guardFile), "present", "MISSING"),
|
|
441
441
|
line("cloud credential", has(p.configPath), "present", "MISSING"),
|
|
442
|
-
line("Claude
|
|
443
|
-
line("Antigravity hooks", has(p.antigravityHooksPath), "
|
|
442
|
+
line("Claude hooks", isGuardInstalled(), "guard registered", "guard NOT registered"),
|
|
443
|
+
line("Antigravity hooks", has(p.antigravityHooksPath), "guard registered", "guard NOT registered"),
|
|
444
444
|
line("Codex hooks", isCodexGuardInstalled(), "guard registered", "guard NOT registered"),
|
|
445
|
-
line("OpenCode
|
|
445
|
+
line("OpenCode hooks", isOpencodeGuardInstalled(), "guard registered", "guard NOT registered")
|
|
446
446
|
];
|
|
447
447
|
const r = installGlobalQuiet();
|
|
448
448
|
if (!r.ok) return { ok: false, message: r.message, before, after: [], notes: [] };
|
|
449
449
|
const after = [
|
|
450
450
|
{ label: "guard hook file", ok: true, detail: `present (v${installedGuardVersion() ?? "?"})` },
|
|
451
|
-
line("Claude
|
|
452
|
-
line("Antigravity hooks", has(p.antigravityHooksPath), "
|
|
451
|
+
line("Claude hooks", isGuardInstalled(), "guard registered", "NOT registered"),
|
|
452
|
+
line("Antigravity hooks", has(p.antigravityHooksPath), "guard registered", "NOT registered"),
|
|
453
453
|
line("Codex hooks", isCodexGuardInstalled(), "guard registered", "NOT registered"),
|
|
454
|
-
line("OpenCode
|
|
454
|
+
line("OpenCode hooks", isOpencodeGuardInstalled(), "guard registered", "NOT registered")
|
|
455
455
|
];
|
|
456
456
|
const notes = [];
|
|
457
457
|
const cx = codexHooksStatus();
|
package/dist/index.js
CHANGED
|
@@ -6648,19 +6648,19 @@ function repairQuiet() {
|
|
|
6648
6648
|
const before = [
|
|
6649
6649
|
line("guard hook file", has(guardFile), "present", "MISSING"),
|
|
6650
6650
|
line("cloud credential", has(p.configPath), "present", "MISSING"),
|
|
6651
|
-
line("Claude
|
|
6652
|
-
line("Antigravity hooks", has(p.antigravityHooksPath), "
|
|
6651
|
+
line("Claude hooks", isGuardInstalled(), "guard registered", "guard NOT registered"),
|
|
6652
|
+
line("Antigravity hooks", has(p.antigravityHooksPath), "guard registered", "guard NOT registered"),
|
|
6653
6653
|
line("Codex hooks", isCodexGuardInstalled(), "guard registered", "guard NOT registered"),
|
|
6654
|
-
line("OpenCode
|
|
6654
|
+
line("OpenCode hooks", isOpencodeGuardInstalled(), "guard registered", "guard NOT registered")
|
|
6655
6655
|
];
|
|
6656
6656
|
const r = installGlobalQuiet();
|
|
6657
6657
|
if (!r.ok) return { ok: false, message: r.message, before, after: [], notes: [] };
|
|
6658
6658
|
const after = [
|
|
6659
6659
|
{ label: "guard hook file", ok: true, detail: `present (v${installedGuardVersion() ?? "?"})` },
|
|
6660
|
-
line("Claude
|
|
6661
|
-
line("Antigravity hooks", has(p.antigravityHooksPath), "
|
|
6660
|
+
line("Claude hooks", isGuardInstalled(), "guard registered", "NOT registered"),
|
|
6661
|
+
line("Antigravity hooks", has(p.antigravityHooksPath), "guard registered", "NOT registered"),
|
|
6662
6662
|
line("Codex hooks", isCodexGuardInstalled(), "guard registered", "NOT registered"),
|
|
6663
|
-
line("OpenCode
|
|
6663
|
+
line("OpenCode hooks", isOpencodeGuardInstalled(), "guard registered", "NOT registered")
|
|
6664
6664
|
];
|
|
6665
6665
|
const notes = [];
|
|
6666
6666
|
const cx = codexHooksStatus();
|
|
@@ -11607,18 +11607,40 @@ async function collectChecks() {
|
|
|
11607
11607
|
} catch {
|
|
11608
11608
|
}
|
|
11609
11609
|
}
|
|
11610
|
+
const claudeReg = isGuardInstalled();
|
|
11611
|
+
checks.push({
|
|
11612
|
+
name: "Claude hooks",
|
|
11613
|
+
ok: claudeReg,
|
|
11614
|
+
detail: claudeReg ? "guard registered" : "guard NOT registered - run `solongate repair`"
|
|
11615
|
+
});
|
|
11616
|
+
if (existsSync6(globalPaths().antigravityDir)) {
|
|
11617
|
+
const reg = existsSync6(globalPaths().antigravityHooksPath);
|
|
11618
|
+
checks.push({
|
|
11619
|
+
name: "Antigravity hooks",
|
|
11620
|
+
ok: reg,
|
|
11621
|
+
detail: reg ? "guard registered" : "guard NOT registered - run `solongate repair`"
|
|
11622
|
+
});
|
|
11623
|
+
}
|
|
11610
11624
|
if (codexDetected()) {
|
|
11611
11625
|
const cx = codexHooksStatus();
|
|
11612
11626
|
if (!cx.registered) {
|
|
11613
|
-
checks.push({ name: "
|
|
11627
|
+
checks.push({ name: "Codex hooks", ok: false, detail: "guard NOT registered - run `solongate repair`" });
|
|
11614
11628
|
} else if (cx.disabled) {
|
|
11615
|
-
checks.push({ name: "
|
|
11629
|
+
checks.push({ name: "Codex hooks", ok: false, detail: "hooks disabled in ~/.codex/config.toml ([features] hooks = false)" });
|
|
11616
11630
|
} else if (!cx.trusted) {
|
|
11617
|
-
checks.push({ name: "
|
|
11631
|
+
checks.push({ name: "Codex hooks", ok: "warn", detail: "registered - run `/hooks` in Codex once and trust them (Codex skips untrusted hooks)" });
|
|
11618
11632
|
} else {
|
|
11619
|
-
checks.push({ name: "
|
|
11633
|
+
checks.push({ name: "Codex hooks", ok: true, detail: "registered + trusted" });
|
|
11620
11634
|
}
|
|
11621
11635
|
}
|
|
11636
|
+
if (opencodeDetected()) {
|
|
11637
|
+
const reg = isOpencodeGuardInstalled();
|
|
11638
|
+
checks.push({
|
|
11639
|
+
name: "OpenCode hooks",
|
|
11640
|
+
ok: reg,
|
|
11641
|
+
detail: reg ? "guard registered (not active under `opencode --pure`)" : "guard NOT registered - run `solongate repair`"
|
|
11642
|
+
});
|
|
11643
|
+
}
|
|
11622
11644
|
try {
|
|
11623
11645
|
const raw = readFileSync10(join12(homedir10(), ".solongate", ".key-rejected.json"), "utf-8");
|
|
11624
11646
|
const m = JSON.parse(raw);
|
package/dist/tui/index.js
CHANGED
|
@@ -385,6 +385,13 @@ function isOpencodeGuardInstalled() {
|
|
|
385
385
|
return false;
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
|
+
function opencodeDetected() {
|
|
389
|
+
try {
|
|
390
|
+
return existsSync2(globalPaths().opencodeDir);
|
|
391
|
+
} catch {
|
|
392
|
+
return false;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
388
395
|
function repairQuiet() {
|
|
389
396
|
const p = globalPaths();
|
|
390
397
|
const has = (f) => existsSync2(f);
|
|
@@ -393,19 +400,19 @@ function repairQuiet() {
|
|
|
393
400
|
const before = [
|
|
394
401
|
line("guard hook file", has(guardFile), "present", "MISSING"),
|
|
395
402
|
line("cloud credential", has(p.configPath), "present", "MISSING"),
|
|
396
|
-
line("Claude
|
|
397
|
-
line("Antigravity hooks", has(p.antigravityHooksPath), "
|
|
403
|
+
line("Claude hooks", isGuardInstalled(), "guard registered", "guard NOT registered"),
|
|
404
|
+
line("Antigravity hooks", has(p.antigravityHooksPath), "guard registered", "guard NOT registered"),
|
|
398
405
|
line("Codex hooks", isCodexGuardInstalled(), "guard registered", "guard NOT registered"),
|
|
399
|
-
line("OpenCode
|
|
406
|
+
line("OpenCode hooks", isOpencodeGuardInstalled(), "guard registered", "guard NOT registered")
|
|
400
407
|
];
|
|
401
408
|
const r = installGlobalQuiet();
|
|
402
409
|
if (!r.ok) return { ok: false, message: r.message, before, after: [], notes: [] };
|
|
403
410
|
const after = [
|
|
404
411
|
{ label: "guard hook file", ok: true, detail: `present (v${installedGuardVersion() ?? "?"})` },
|
|
405
|
-
line("Claude
|
|
406
|
-
line("Antigravity hooks", has(p.antigravityHooksPath), "
|
|
412
|
+
line("Claude hooks", isGuardInstalled(), "guard registered", "NOT registered"),
|
|
413
|
+
line("Antigravity hooks", has(p.antigravityHooksPath), "guard registered", "NOT registered"),
|
|
407
414
|
line("Codex hooks", isCodexGuardInstalled(), "guard registered", "NOT registered"),
|
|
408
|
-
line("OpenCode
|
|
415
|
+
line("OpenCode hooks", isOpencodeGuardInstalled(), "guard registered", "NOT registered")
|
|
409
416
|
];
|
|
410
417
|
const notes = [];
|
|
411
418
|
const cx = codexHooksStatus();
|
|
@@ -4469,18 +4476,40 @@ async function collectChecks() {
|
|
|
4469
4476
|
} catch {
|
|
4470
4477
|
}
|
|
4471
4478
|
}
|
|
4479
|
+
const claudeReg = isGuardInstalled();
|
|
4480
|
+
checks.push({
|
|
4481
|
+
name: "Claude hooks",
|
|
4482
|
+
ok: claudeReg,
|
|
4483
|
+
detail: claudeReg ? "guard registered" : "guard NOT registered - run `solongate repair`"
|
|
4484
|
+
});
|
|
4485
|
+
if (existsSync4(globalPaths().antigravityDir)) {
|
|
4486
|
+
const reg = existsSync4(globalPaths().antigravityHooksPath);
|
|
4487
|
+
checks.push({
|
|
4488
|
+
name: "Antigravity hooks",
|
|
4489
|
+
ok: reg,
|
|
4490
|
+
detail: reg ? "guard registered" : "guard NOT registered - run `solongate repair`"
|
|
4491
|
+
});
|
|
4492
|
+
}
|
|
4472
4493
|
if (codexDetected()) {
|
|
4473
4494
|
const cx = codexHooksStatus();
|
|
4474
4495
|
if (!cx.registered) {
|
|
4475
|
-
checks.push({ name: "
|
|
4496
|
+
checks.push({ name: "Codex hooks", ok: false, detail: "guard NOT registered - run `solongate repair`" });
|
|
4476
4497
|
} else if (cx.disabled) {
|
|
4477
|
-
checks.push({ name: "
|
|
4498
|
+
checks.push({ name: "Codex hooks", ok: false, detail: "hooks disabled in ~/.codex/config.toml ([features] hooks = false)" });
|
|
4478
4499
|
} else if (!cx.trusted) {
|
|
4479
|
-
checks.push({ name: "
|
|
4500
|
+
checks.push({ name: "Codex hooks", ok: "warn", detail: "registered - run `/hooks` in Codex once and trust them (Codex skips untrusted hooks)" });
|
|
4480
4501
|
} else {
|
|
4481
|
-
checks.push({ name: "
|
|
4502
|
+
checks.push({ name: "Codex hooks", ok: true, detail: "registered + trusted" });
|
|
4482
4503
|
}
|
|
4483
4504
|
}
|
|
4505
|
+
if (opencodeDetected()) {
|
|
4506
|
+
const reg = isOpencodeGuardInstalled();
|
|
4507
|
+
checks.push({
|
|
4508
|
+
name: "OpenCode hooks",
|
|
4509
|
+
ok: reg,
|
|
4510
|
+
detail: reg ? "guard registered (not active under `opencode --pure`)" : "guard NOT registered - run `solongate repair`"
|
|
4511
|
+
});
|
|
4512
|
+
}
|
|
4484
4513
|
try {
|
|
4485
4514
|
const raw = readFileSync5(join7(homedir7(), ".solongate", ".key-rejected.json"), "utf-8");
|
|
4486
4515
|
const m = JSON.parse(raw);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solongate/proxy",
|
|
3
|
-
"version": "0.83.
|
|
3
|
+
"version": "0.83.13",
|
|
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": {
|