troxy-cli 1.29.19 → 1.29.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/bin/troxy.js +27 -16
- package/package.json +1 -1
- package/src/proxy.js +6 -0
package/bin/troxy.js
CHANGED
|
@@ -484,22 +484,16 @@ switch (command) {
|
|
|
484
484
|
process.stdout.write(` DB: ${health.db}\n`);
|
|
485
485
|
process.stdout.write(` Env: ${health.env}\n`);
|
|
486
486
|
|
|
487
|
-
|
|
488
|
-
const
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
Active policies: ${account.active_policies}
|
|
496
|
-
MCPs total: ${account.total_mcps} (${account.connected_mcps} connected)
|
|
497
|
-
Requests 24h: ${account.requests_24h}
|
|
498
|
-
Default action: ${account.default_action}
|
|
499
|
-
`);
|
|
500
|
-
} catch { console.log(); }
|
|
487
|
+
const { proxyState } = await import('../src/proxy.js');
|
|
488
|
+
const { INTERCEPTOR_PORT } = await import('../src/daemon.js');
|
|
489
|
+
const proxy = await proxyState();
|
|
490
|
+
console.log();
|
|
491
|
+
if (proxy === 'on') {
|
|
492
|
+
console.log(` Proxy: ✓ on (Claude traffic routed through Troxy, 127.0.0.1:${INTERCEPTOR_PORT})`);
|
|
493
|
+
} else if (proxy === 'down') {
|
|
494
|
+
console.log(` Proxy: ⚠ configured, but nothing is listening on 127.0.0.1:${INTERCEPTOR_PORT}. Run: troxy restart`);
|
|
501
495
|
} else {
|
|
502
|
-
console.log('
|
|
496
|
+
console.log(' Proxy: off (turn on: troxy proxy enable --experimental)');
|
|
503
497
|
}
|
|
504
498
|
|
|
505
499
|
// MCP connection info from local config (set by troxy init)
|
|
@@ -519,7 +513,24 @@ switch (command) {
|
|
|
519
513
|
} catch {
|
|
520
514
|
process.stdout.write('\n');
|
|
521
515
|
}
|
|
522
|
-
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
// Login only unlocks account commands; protection runs off the key + proxy above.
|
|
519
|
+
const session = loadSession();
|
|
520
|
+
if (session?.jwt) {
|
|
521
|
+
try {
|
|
522
|
+
const data = await api.agentStatus(session.jwt);
|
|
523
|
+
const { account } = data;
|
|
524
|
+
console.log(`
|
|
525
|
+
Account
|
|
526
|
+
Active policies: ${account.active_policies}
|
|
527
|
+
MCPs total: ${account.total_mcps} (${account.connected_mcps} connected)
|
|
528
|
+
Requests 24h: ${account.requests_24h}
|
|
529
|
+
Default action: ${account.default_action}
|
|
530
|
+
`);
|
|
531
|
+
} catch { console.log(); }
|
|
532
|
+
} else {
|
|
533
|
+
console.log(' Account: not signed in. Run `troxy login` to manage policies and view activity from the CLI.\n');
|
|
523
534
|
}
|
|
524
535
|
|
|
525
536
|
// Version check
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "troxy-cli",
|
|
3
|
-
"version": "1.29.
|
|
3
|
+
"version": "1.29.20",
|
|
4
4
|
"description": "A secure control layer for AI agents: policies across payments, messages, logins, destructive actions, model usage, and secrets, all enforceable from the CLI",
|
|
5
5
|
"homepage": "https://troxy.io",
|
|
6
6
|
"bugs": {
|
package/src/proxy.js
CHANGED
|
@@ -40,6 +40,12 @@ export function probePort(port, timeoutMs = 800) {
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
// 'on' | 'down' (settings point at the interceptor but nothing is listening) | 'off'
|
|
44
|
+
export async function proxyState() {
|
|
45
|
+
if (!interceptionIsConfigured(claudeCodeSettingsPath())) return 'off';
|
|
46
|
+
return (await probePort(INTERCEPTOR_PORT)) ? 'on' : 'down';
|
|
47
|
+
}
|
|
48
|
+
|
|
43
49
|
function _readCert(certPath) {
|
|
44
50
|
try { return fs.readFileSync(certPath, 'utf8'); } catch { return null; }
|
|
45
51
|
}
|