lyra-ai-agent 0.1.5 → 0.1.6

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": "lyra-ai-agent",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "description": "lyra CLI: a Sui-native, policy-bound AI finance agent. Real on-chain work gated by deterministic policy, simulation, and approval",
6
6
  "license": "MIT",
@@ -51,7 +51,7 @@
51
51
  "@opentui/core": "^0.1.97",
52
52
  "@opentui/solid": "^0.1.97",
53
53
  "lyra-core": "^0.1.2",
54
- "lyra-gateway": "^0.1.2",
54
+ "lyra-gateway": "^0.1.6",
55
55
  "lyra-plugin-onchain": "^0.1.5",
56
56
  "lyra-plugin-system": "^0.1.2",
57
57
  "lyra-plugin-telegram": "^0.1.2",
@@ -1,14 +1,13 @@
1
1
  import { cancel, intro, isCancel, note, outro, password, spinner, text } from '@clack/prompts'
2
2
  import { findAndLoadConfig } from '../config/load'
3
3
  import { writeConfigTs } from '../config/render'
4
+ import { setDotenvVar } from '../util/dotenv'
4
5
  import { fetchBotInfo, looksLikeBotToken, parseAllowedUserIds } from '../util/telegram-secrets'
5
6
 
6
7
  /**
7
- * `lyra telegram setup` — validate a bot token and print the env vars to set.
8
- *
9
- * On Sui the bot token is NOT stored on disk (there is no operator wallet to
10
- * encrypt it with). It lives only in the environment, so this command's job is
11
- * to validate the token + allowlist and hand back the exact `export` lines.
8
+ * `lyra telegram setup` — validate a bot token, enable the plugin, and persist
9
+ * the token to `~/.lyra/.env` (0600) so it's loaded automatically by `lyra` chat
10
+ * AND the `lyra gateway start` daemon no manual `export` needed.
12
11
  */
13
12
  export async function runTelegramSetup(): Promise<void> {
14
13
  intro('lyra telegram setup')
@@ -65,15 +64,20 @@ export async function runTelegramSetup(): Promise<void> {
65
64
  })
66
65
  }
67
66
 
67
+ // Persist to ~/.lyra/.env (0600) so both `lyra` and the gateway daemon load the
68
+ // token automatically — no manual export.
69
+ const envPath = setDotenvVar('TELEGRAM_BOT_TOKEN', String(token))
70
+ setDotenvVar('TELEGRAM_USERNAME', info.username)
71
+ if (chatId) setDotenvVar('TELEGRAM_CHAT_ID', String(chatId))
72
+
68
73
  note(
69
74
  [
70
- 'Set these in your environment (e.g. .env), then run `lyra`:',
75
+ `Saved to ${envPath} (loaded automatically).`,
76
+ chatId ? `Allowed user id: ${chatId}` : 'Open access (no allowlist).',
71
77
  '',
72
- ` export TELEGRAM_BOT_TOKEN=${token}`,
73
- ` export TELEGRAM_USERNAME=${info.username}`,
74
- ...(chatId
75
- ? [` export TELEGRAM_CHAT_ID=${chatId}`]
76
- : [' # TELEGRAM_CHAT_ID unset = open access']),
78
+ 'Run the bot:',
79
+ ' lyra — responds while the chat is open',
80
+ ' lyra gateway start — always-on daemon (responds 24/7)',
77
81
  '',
78
82
  `Then open https://t.me/${info.username} and send any message.`,
79
83
  ].join('\n'),