troxy-cli 1.29.20 → 1.29.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "troxy-cli",
3
- "version": "1.29.20",
3
+ "version": "1.29.22",
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/init.js CHANGED
@@ -115,10 +115,12 @@ export async function reprovisionKeyConsumers(key, agentName, proxyOptIn = null,
115
115
  const entry = JSON.stringify({ command: 'npx', args: ['troxy-cli', 'mcp'], env: { TROXY_API_KEY: key } });
116
116
  // execFileSync passes args directly to the process (no shell), so the
117
117
  // key can't break out of a quoted string and inject shell commands.
118
- execFileSync('openclaw', ['mcp', 'set', 'troxy', entry], { stdio: 'ignore' });
118
+ execFileSync('openclaw', ['mcp', 'set', 'troxy', entry], { stdio: ['ignore', 'ignore', 'pipe'] });
119
119
  console.log(` • OpenClaw ✓`);
120
120
  } catch (err) {
121
- console.log(` • OpenClaw ✗ (${err.message})`);
121
+ // err.message embeds the full argv, key included: never print it.
122
+ const reason = err.stderr?.toString().trim().split('\n').pop() || `exit code ${err.status}`;
123
+ console.log(` • OpenClaw ✗ (${reason.replaceAll(key, key.substring(0, 12) + '...')})`);
122
124
  }
123
125
  }
124
126
  // Claude Desktop's Code tab runs the same Claude Code engine under the
@@ -949,10 +951,20 @@ async function maybeEnableTroxyInterception(proxyOptIn, hasDesktop, configPath =
949
951
 
950
952
  if (interceptionIsConfigured(configPath)) return; // already set up correctly, nothing to ask
951
953
 
954
+ // No auto-started background service on Windows yet (installService throws
955
+ // there), so pointing Claude Code at 127.0.0.1 would break every call
956
+ // after a reboot. Policies still work; the engine waits for Windows support.
957
+ if (process.platform === 'win32') {
958
+ console.log('\n The Troxy engine (lighter Claude Code requests) is not available on');
959
+ console.log(' Windows yet. Policies work. Mac and Linux get the engine today.');
960
+ return;
961
+ }
962
+
952
963
  let enable = proxyOptIn === true;
953
964
  if (proxyOptIn === null && process.stdin.isTTY) {
954
- console.log("\n Route Claude Code's model calls through Troxy for automatic cost");
955
- console.log(' optimization? Your normal Claude login (subscription or API key) still');
965
+ console.log("\n Turn on the Troxy engine? Claude Code's requests go through Troxy and");
966
+ console.log(' are made lighter, so your usage goes further. Your normal Claude login');
967
+ console.log(' (subscription or API key) still');
956
968
  console.log(' pays - Troxy never substitutes its own credential. Troxy does see your');
957
969
  console.log(' real credential in transit, forwarded upstream to actually make the');
958
970
  console.log(' call to Anthropic on your behalf.');
@@ -69,7 +69,7 @@ describe('reprovisionKeyConsumers: desktop detection gate', () => {
69
69
  it('maybeEnableTroxyInterception runs migration before the enable/proxyOptIn decision, so it always fires', () => {
70
70
  const fnStart = initSrc.indexOf('async function maybeEnableTroxyInterception');
71
71
  assert.ok(fnStart !== -1, 'maybeEnableTroxyInterception not found');
72
- const fnBody = initSrc.slice(fnStart, fnStart + 1000);
72
+ const fnBody = initSrc.slice(fnStart, fnStart + 2000);
73
73
  const migrateIdx = fnBody.indexOf('migrateBaseUrlProxyToInterception(');
74
74
  const optInIdx = fnBody.indexOf('proxyOptIn === true');
75
75
  assert.ok(migrateIdx !== -1, 'migrateBaseUrlProxyToInterception call not found in function body');