@adityaaria/agent-os 1.0.0 → 1.0.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.
- package/package.json +2 -2
- package/scripts/setup-wizard.mjs +39 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adityaaria/agent-os",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Portable Agent OS for skill-based coding workflows across IDEs and projects.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -25,4 +25,4 @@
|
|
|
25
25
|
"sync:runtime": "node scripts/sync-runtime.mjs",
|
|
26
26
|
"setup": "node scripts/setup-wizard.mjs"
|
|
27
27
|
}
|
|
28
|
-
}
|
|
28
|
+
}
|
package/scripts/setup-wizard.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import fs from 'node:fs';
|
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { spawnSync } from 'node:child_process';
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
|
+
import readline from 'node:readline/promises';
|
|
6
7
|
import { wantsHelp, showHelp } from './lib/cli-utils.mjs';
|
|
7
8
|
|
|
8
9
|
if (wantsHelp(process.argv)) {
|
|
@@ -107,7 +108,44 @@ if (result.status !== 0) {
|
|
|
107
108
|
process.exit(1);
|
|
108
109
|
}
|
|
109
110
|
|
|
110
|
-
// Step 3:
|
|
111
|
+
// Step 3: Telegram Integration
|
|
112
|
+
log('');
|
|
113
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
114
|
+
const answer = await rl.question(' Do you want to configure Telegram bot integration? (y/N): ');
|
|
115
|
+
if (answer.trim().toLowerCase() === 'y') {
|
|
116
|
+
const token = await rl.question(' Enter your Telegram Bot Token: ');
|
|
117
|
+
const chatId = await rl.question(' Enter your Telegram Chat ID (Admin): ');
|
|
118
|
+
|
|
119
|
+
if (token && chatId) {
|
|
120
|
+
const envPath = path.join(cwd, '.env');
|
|
121
|
+
let envContent = '';
|
|
122
|
+
if (fs.existsSync(envPath)) {
|
|
123
|
+
envContent = fs.readFileSync(envPath, 'utf8') + '\n';
|
|
124
|
+
}
|
|
125
|
+
envContent += `AGENT_OS_TELEGRAM_BOT_TOKEN="${token.trim()}"\n`;
|
|
126
|
+
envContent += `AGENT_OS_TELEGRAM_CHAT_ID="${chatId.trim()}"\n`;
|
|
127
|
+
fs.writeFileSync(envPath, envContent);
|
|
128
|
+
log(`✓ Wrote Telegram credentials to ${envPath}`);
|
|
129
|
+
|
|
130
|
+
const configPath = path.join(cwd, 'telegram-config.json');
|
|
131
|
+
let config = { allowed_chats: [], roles: { admin: [] } };
|
|
132
|
+
if (fs.existsSync(configPath)) {
|
|
133
|
+
config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
134
|
+
if (!config.roles) config.roles = { admin: [] };
|
|
135
|
+
if (!config.roles.admin) config.roles.admin = [];
|
|
136
|
+
}
|
|
137
|
+
const cleanChatId = chatId.trim();
|
|
138
|
+
if (!config.allowed_chats.includes(cleanChatId)) config.allowed_chats.push(cleanChatId);
|
|
139
|
+
if (!config.roles.admin.includes(cleanChatId)) config.roles.admin.push(cleanChatId);
|
|
140
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + '\n');
|
|
141
|
+
log(`✓ Added ${cleanChatId} as admin to ${configPath}`);
|
|
142
|
+
} else {
|
|
143
|
+
log('⚠ Missing token or chat ID. Skipping Telegram configuration.');
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
rl.close();
|
|
147
|
+
|
|
148
|
+
// Step 4: Print summary
|
|
111
149
|
console.log('\n=== Setup Complete ===\n');
|
|
112
150
|
log('✓ Agent OS installed successfully');
|
|
113
151
|
log('');
|