comisai 1.0.10 → 1.0.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/README.md CHANGED
@@ -9,13 +9,13 @@
9
9
  <p align="center">
10
10
  <a href="https://www.npmjs.com/package/comisai"><img src="https://img.shields.io/npm/v/comisai" alt="npm version" /></a>
11
11
  <a href="https://github.com/comisai/comis/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-06B6D4?style=flat" alt="License" /></a>
12
- <a href="https://discord.gg/comis"><img src="https://img.shields.io/badge/discord-join-5865F2?style=flat&logo=discord&logoColor=white" alt="Discord" /></a>
12
+ <a href="https://discord.gg/FsqgJkpp"><img src="https://img.shields.io/badge/discord-join-5865F2?style=flat&logo=discord&logoColor=white" alt="Discord" /></a>
13
13
  <a href="https://nodejs.org"><img src="https://img.shields.io/node/v/comisai" alt="Node" /></a>
14
14
  </p>
15
15
 
16
16
  <p align="center">
17
17
  <a href="https://docs.comis.ai">Docs</a> &middot;
18
- <a href="https://discord.gg/comis">Discord</a> &middot;
18
+ <a href="https://discord.gg/FsqgJkpp">Discord</a> &middot;
19
19
  <a href="https://twitter.com/comis_ai">Twitter</a> &middot;
20
20
  <a href="#quick-start">Quick Start</a>
21
21
  </p>
@@ -168,7 +168,7 @@ shared (Result type, utilities)
168
168
  <p align="center">
169
169
  <a href="https://github.com/comisai/comis"><strong>GitHub</strong></a> &middot;
170
170
  <a href="https://docs.comis.ai"><strong>Docs</strong></a> &middot;
171
- <a href="https://discord.gg/comis"><strong>Discord</strong></a> &middot;
171
+ <a href="https://discord.gg/FsqgJkpp"><strong>Discord</strong></a> &middot;
172
172
  <a href="https://twitter.com/comis_ai"><strong>Twitter</strong></a> &middot;
173
173
  <a href="https://github.com/comisai/comis/issues"><strong>Issues</strong></a>
174
174
  </p>
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@comis/agent",
3
3
  "private": true,
4
- "version": "1.0.10",
4
+ "version": "1.0.11",
5
5
  "author": "Moshe Anconina",
6
6
  "license": "Apache-2.0",
7
7
  "description": "AI agent executor, budget control, and session management for Comis",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@comis/channels",
3
3
  "private": true,
4
- "version": "1.0.10",
4
+ "version": "1.0.11",
5
5
  "author": "Moshe Anconina",
6
6
  "license": "Apache-2.0",
7
7
  "description": "Chat platform adapters — Discord, Telegram, Slack, WhatsApp, Signal, iMessage, IRC, LINE",
@@ -130,6 +130,37 @@ async function validateLineLive(channelToken) {
130
130
  clearTimeout(timeout);
131
131
  }
132
132
  }
133
+ /**
134
+ * Fetch the most recent sender's user ID from the bot's getUpdates endpoint.
135
+ *
136
+ * Calls getUpdates with a short timeout. Returns the first message sender's
137
+ * user ID and name, or null if no messages are available.
138
+ */
139
+ async function fetchTelegramSenderId(token) {
140
+ const controller = new AbortController();
141
+ const timeout = setTimeout(() => controller.abort(), 5000);
142
+ try {
143
+ const response = await fetch(`https://api.telegram.org/bot${token}/getUpdates?limit=5&allowed_updates=["message"]`, { method: "GET", signal: controller.signal });
144
+ if (!response.ok)
145
+ return null;
146
+ const data = (await response.json());
147
+ if (!data.ok || !data.result.length)
148
+ return null;
149
+ for (const update of data.result.reverse()) {
150
+ const from = update.message?.from;
151
+ if (from) {
152
+ return { userId: from.id, firstName: from.first_name };
153
+ }
154
+ }
155
+ return null;
156
+ }
157
+ catch {
158
+ return null;
159
+ }
160
+ finally {
161
+ clearTimeout(timeout);
162
+ }
163
+ }
133
164
  // ---------- Per-Channel Handlers ----------
134
165
  /**
135
166
  * Collect Discord bot token and optional guild IDs with live validation.
@@ -456,17 +487,63 @@ export const channelsStep = {
456
487
  message: "Grant admin access to specific senders?",
457
488
  });
458
489
  if (wantTrust) {
459
- prompter.note(info("Enter YOUR user ID (not the bot ID).\nTelegram: message @userinfobot to get yours.\nDiscord: enable Developer Mode → right-click your name → Copy User ID."));
460
- const input = await prompter.text({
461
- message: "Your sender IDs (comma-separated)",
462
- placeholder: "e.g. 678314278",
463
- validate: (v) => v.trim().length === 0 ? "At least one sender ID required" : undefined,
464
- });
465
- const entries = input
466
- .split(",")
467
- .map((s) => s.trim())
468
- .filter((s) => s.length > 0)
469
- .map((senderId) => ({ senderId, level: "admin" }));
490
+ const telegramConfig = configs.find((c) => c.type === "telegram");
491
+ let detectedId = null;
492
+ if (telegramConfig?.botToken) {
493
+ const wantDetect = await prompter.confirm({
494
+ message: "Auto-detect your Telegram user ID? (send any message to your bot first)",
495
+ });
496
+ if (wantDetect) {
497
+ const spin = prompter.spinner();
498
+ spin.start("Checking for messages...");
499
+ const sender = await fetchTelegramSenderId(telegramConfig.botToken);
500
+ if (sender) {
501
+ spin.stop(`Found: ${sender.firstName} (${sender.userId})`);
502
+ const useIt = await prompter.confirm({
503
+ message: `Use ${sender.userId} as your admin sender ID?`,
504
+ });
505
+ if (useIt) {
506
+ detectedId = String(sender.userId);
507
+ }
508
+ }
509
+ else {
510
+ spin.stop("No messages found");
511
+ prompter.log.warn("Send a message to your bot in Telegram and try again, or enter your ID manually below.");
512
+ }
513
+ }
514
+ }
515
+ const hasOtherChannels = configs.some((c) => c.type !== "telegram" && c.type !== "whatsapp" && c.type !== "signal" && c.type !== "irc");
516
+ let senderIds;
517
+ if (detectedId && !hasOtherChannels) {
518
+ senderIds = [detectedId];
519
+ }
520
+ else {
521
+ if (detectedId) {
522
+ prompter.note(info("Add sender IDs for your other channels.\nDiscord: enable Developer Mode → right-click your name → Copy User ID."));
523
+ }
524
+ else {
525
+ prompter.note(info("Enter YOUR user ID (not the bot ID).\nTelegram: send a message to your bot, then re-run setup to auto-detect — or find it via Telegram API.\nDiscord: enable Developer Mode → right-click your name → Copy User ID."));
526
+ }
527
+ const input = await prompter.text({
528
+ message: "Your sender IDs (comma-separated)",
529
+ placeholder: detectedId ? `e.g. ${detectedId}, <discord-id>` : "e.g. 678314278",
530
+ defaultValue: detectedId ? `${detectedId}, ` : "",
531
+ validate: (v) => v.trim().length === 0 ? "At least one sender ID required" : undefined,
532
+ });
533
+ senderIds = input
534
+ .split(",")
535
+ .map((s) => s.trim())
536
+ .filter((s) => s.length > 0);
537
+ }
538
+ const entries = senderIds.map((senderId) => ({ senderId, level: "admin" }));
539
+ if (telegramConfig && senderIds.length > 0) {
540
+ const restrictBot = await prompter.confirm({
541
+ message: "Restrict Telegram bot to only respond to these senders?",
542
+ });
543
+ if (restrictBot) {
544
+ telegramConfig.allowFrom = senderIds;
545
+ }
546
+ }
470
547
  return updateState(state, { channels: configs, senderTrustEntries: entries });
471
548
  }
472
549
  }
@@ -131,6 +131,10 @@ function buildConfigObject(state) {
131
131
  if (ch.type === "discord" && ch.guildIds && ch.guildIds.length > 0) {
132
132
  entry.guildIds = ch.guildIds;
133
133
  }
134
+ // Sender allowlist
135
+ if (ch.allowFrom && ch.allowFrom.length > 0) {
136
+ entry.allowFrom = ch.allowFrom;
137
+ }
134
138
  channels[ch.type] = entry;
135
139
  }
136
140
  config.channels = channels;
@@ -49,6 +49,7 @@ export type ChannelConfig = {
49
49
  appToken?: string;
50
50
  channelSecret?: string;
51
51
  guildIds?: string[];
52
+ allowFrom?: string[];
52
53
  validated?: boolean;
53
54
  };
54
55
  /** Per-tool-provider collected credentials. */
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@comis/cli",
3
3
  "private": true,
4
- "version": "1.0.10",
4
+ "version": "1.0.11",
5
5
  "author": "Moshe Anconina",
6
6
  "license": "Apache-2.0",
7
7
  "description": "Command-line interface for the Comis AI agent platform",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@comis/core",
3
3
  "private": true,
4
- "version": "1.0.10",
4
+ "version": "1.0.11",
5
5
  "author": "Moshe Anconina",
6
6
  "license": "Apache-2.0",
7
7
  "description": "Core domain types, ports, event bus, security, and config for Comis",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@comis/daemon",
3
3
  "private": true,
4
- "version": "1.0.10",
4
+ "version": "1.0.11",
5
5
  "author": "Moshe Anconina",
6
6
  "license": "Apache-2.0",
7
7
  "description": "Background daemon and orchestrator for the Comis platform",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@comis/gateway",
3
3
  "private": true,
4
- "version": "1.0.10",
4
+ "version": "1.0.11",
5
5
  "author": "Moshe Anconina",
6
6
  "license": "Apache-2.0",
7
7
  "description": "HTTP, JSON-RPC, and WebSocket gateway for Comis",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@comis/infra",
3
3
  "private": true,
4
- "version": "1.0.10",
4
+ "version": "1.0.11",
5
5
  "author": "Moshe Anconina",
6
6
  "license": "Apache-2.0",
7
7
  "description": "Structured logging infrastructure for Comis",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@comis/memory",
3
3
  "private": true,
4
- "version": "1.0.10",
4
+ "version": "1.0.11",
5
5
  "author": "Moshe Anconina",
6
6
  "license": "Apache-2.0",
7
7
  "description": "SQLite memory, embeddings, and RAG storage for Comis agents",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@comis/scheduler",
3
3
  "private": true,
4
- "version": "1.0.10",
4
+ "version": "1.0.11",
5
5
  "author": "Moshe Anconina",
6
6
  "license": "Apache-2.0",
7
7
  "description": "Task scheduling and cron management for Comis",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@comis/shared",
3
3
  "private": true,
4
- "version": "1.0.10",
4
+ "version": "1.0.11",
5
5
  "author": "Moshe Anconina",
6
6
  "license": "Apache-2.0",
7
7
  "description": "Shared types and utilities for the Comis platform",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@comis/skills",
3
3
  "private": true,
4
- "version": "1.0.10",
4
+ "version": "1.0.11",
5
5
  "author": "Moshe Anconina",
6
6
  "license": "Apache-2.0",
7
7
  "description": "Skill system, MCP integration, and tool sandbox for Comis agents",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "comisai",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "author": "Moshe Anconina",
5
5
  "license": "Apache-2.0",
6
6
  "description": "Security-first AI agent platform — connects AI agents to Discord, Telegram, Slack, WhatsApp, and more",
@@ -115,17 +115,17 @@
115
115
  "@comis/daemon"
116
116
  ],
117
117
  "dependencies": {
118
- "@comis/shared": "1.0.10",
119
- "@comis/core": "1.0.10",
120
- "@comis/infra": "1.0.10",
121
- "@comis/memory": "1.0.10",
122
- "@comis/gateway": "1.0.10",
123
- "@comis/skills": "1.0.10",
124
- "@comis/scheduler": "1.0.10",
125
- "@comis/agent": "1.0.10",
126
- "@comis/channels": "1.0.10",
127
- "@comis/cli": "1.0.10",
128
- "@comis/daemon": "1.0.10",
118
+ "@comis/shared": "1.0.11",
119
+ "@comis/core": "1.0.11",
120
+ "@comis/infra": "1.0.11",
121
+ "@comis/memory": "1.0.11",
122
+ "@comis/gateway": "1.0.11",
123
+ "@comis/skills": "1.0.11",
124
+ "@comis/scheduler": "1.0.11",
125
+ "@comis/agent": "1.0.11",
126
+ "@comis/channels": "1.0.11",
127
+ "@comis/cli": "1.0.11",
128
+ "@comis/daemon": "1.0.11",
129
129
  "@agentclientprotocol/sdk": "^0.15.0",
130
130
  "@clack/core": "^1.1.0",
131
131
  "@clack/prompts": "^1.1.0",