troxy-cli 1.4.12 → 1.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "troxy-cli",
3
- "version": "1.4.12",
3
+ "version": "1.4.13",
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
@@ -13,6 +13,12 @@ export async function runMcp() {
13
13
  const apiKey = process.env.TROXY_API_KEY || config?.apiKey;
14
14
  const agentName = process.env.TROXY_AGENT_NAME || config?.agentName;
15
15
 
16
+ const notifyTelegramToken = process.env.TROXY_NOTIFY_TELEGRAM_TOKEN || config?.notify?.telegram?.botToken;
17
+ const notifyTelegramChatId = process.env.TROXY_NOTIFY_TELEGRAM_CHAT_ID || config?.notify?.telegram?.chatId;
18
+ const notifyConfig = (notifyTelegramToken && notifyTelegramChatId)
19
+ ? { type: 'telegram', bot_token: notifyTelegramToken, chat_id: notifyTelegramChatId }
20
+ : null;
21
+
16
22
  if (!apiKey) {
17
23
  process.stderr.write(
18
24
  'Troxy: no API key found. Run: npx troxy init --key txy-...\n',
@@ -140,6 +146,7 @@ export async function runMcp() {
140
146
  }
141
147
 
142
148
  if (agentName && !args.agent) args.agent = agentName;
149
+ if (notifyConfig && !args.notify) args.notify = notifyConfig;
143
150
  const result = await evaluatePayment(args, apiKey);
144
151
 
145
152
  if (result.error) {