troxy-cli 1.4.9 → 1.4.11

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 CHANGED
@@ -342,7 +342,17 @@ switch (command) {
342
342
  console.log(`${current} → ${latest}`);
343
343
  process.stdout.write(' Installing... ');
344
344
  try {
345
- execSync('npm install -g troxy-cli@latest', { stdio: 'pipe' });
345
+ try {
346
+ execSync('npm install -g troxy-cli@latest', { stdio: 'pipe' });
347
+ } catch (err) {
348
+ const stderr = err.stderr?.toString() || '';
349
+ if (stderr.includes('ENOTEMPTY')) {
350
+ // npm bug on macOS: global package dir not empty during rename — uninstall first
351
+ execSync('npm uninstall -g troxy-cli && npm install -g troxy-cli@latest', { stdio: 'pipe', shell: true });
352
+ } else {
353
+ throw err;
354
+ }
355
+ }
346
356
  console.log(`✓\n\n Updated to ${latest}. Restart your terminal to use the new version.\n`);
347
357
  } catch (err) {
348
358
  const stderr = err.stderr?.toString() || err.message || '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "troxy-cli",
3
- "version": "1.4.9",
3
+ "version": "1.4.11",
4
4
  "description": "AI payment control — protect your agent's payments with policies",
5
5
  "type": "module",
6
6
  "bin": {
package/src/mcp-server.js CHANGED
@@ -160,7 +160,7 @@ export async function runMcp() {
160
160
  text = `✗ Payment blocked by policy "${policy}". Do not proceed with this payment. (audit: ${audit_id})`;
161
161
  break;
162
162
  case 'ESCALATE':
163
- text = `⏳ Payment requires human approval — a request has been sent to the account owner. Do not proceed until approved.\n\nApproval token: ${approval_token}\n\nOnce the owner approves, call evaluate_payment again with the same payment details and include approval_token: "${approval_token}" to proceed. (audit: ${audit_id})`;
163
+ text = `⏳ Payment requires human approval — a request has been sent to the account owner. Do not proceed until approved.\n\nApproval token: ${approval_token}\n\nWait for the owner to approve in the Troxy dashboard, then tell me "I approved it" or "continue" so I can proceed. Once you do, I will call evaluate_payment again with the same payment details and approval_token: "${approval_token}". (audit: ${audit_id})`;
164
164
  break;
165
165
  case 'NOTIFY':
166
166
  text = `✓ Payment approved with notification. Policy matched: "${policy}". (audit: ${audit_id})\n\nAfter the charge attempt completes, call confirm_payment with audit_id "${audit_id}" and status "success", "failed", or "cancelled".`;