troxy-cli 1.8.0 → 1.8.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/init.js +10 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "troxy-cli",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "AI payment control — protect your agent's payments with policies",
5
5
  "type": "module",
6
6
  "bin": {
package/src/init.js CHANGED
@@ -4,7 +4,7 @@ import path from 'path';
4
4
  import readline from 'readline';
5
5
  import { execSync, execFileSync } from 'child_process';
6
6
  import { saveConfig } from './config.js';
7
- import { evaluatePayment } from './api.js';
7
+ import { evaluatePayment, api } from './api.js';
8
8
 
9
9
  function prompt(question) {
10
10
  const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
@@ -103,6 +103,15 @@ export async function runInit({ key } = {}) {
103
103
  saveConfig({ apiKey: key, agentName });
104
104
  console.log(' Config saved (~/.troxy/config.json) ✓');
105
105
 
106
+ // Push the name to the dashboard immediately (force: this is a deliberate
107
+ // user action, not a routine heartbeat, so it should overwrite any existing
108
+ // agent_name rather than waiting on the daemon's next non-forcing heartbeat).
109
+ try {
110
+ await api.mcpHeartbeat(key, agentName, true);
111
+ } catch {
112
+ // Non-fatal: the daemon's own heartbeat will retry this later.
113
+ }
114
+
106
115
  // Detect and patch MCP clients
107
116
  const platform = process.platform;
108
117
  const detected = MCP_CLIENTS.filter(c => {