comisai 1.0.7 → 1.0.9

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@comis/agent",
3
3
  "private": true,
4
- "version": "1.0.7",
4
+ "version": "1.0.9",
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.7",
4
+ "version": "1.0.9",
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",
@@ -190,7 +190,7 @@ async function execSystemctl(manager, ...args) {
190
190
  // System-scope systemd requires root; escalate via sudo if we're not root
191
191
  // eslint-disable-next-line no-restricted-syntax -- CLI bootstrap before SecretManager
192
192
  if (manager === "systemd" && process.getuid?.() !== 0) {
193
- return exec("sudo", ["systemctl", ...fullArgs], { timeout: 15_000 });
193
+ return exec("sudo", ["-n", "systemctl", ...fullArgs], { timeout: 15_000 });
194
194
  }
195
195
  return exec("systemctl", fullArgs, { timeout: 15_000 });
196
196
  }
@@ -264,13 +264,32 @@ async function handleDaemonStart() {
264
264
  case "systemd":
265
265
  case "systemd-user": {
266
266
  if (await isSystemdActive(manager)) {
267
- success("Daemon is already running (systemd)");
267
+ // Verify the CLI can actually talk to the daemon
268
+ try {
269
+ await withClient(async (client) => client.call("system.ping", {}));
270
+ success("Daemon is already running (systemd)");
271
+ }
272
+ catch {
273
+ warn("Daemon is running (systemd) but CLI cannot connect");
274
+ if (!existsSync(safePath(os.homedir(), ".comis", "config.yaml"))) {
275
+ info("Run 'comis init' to configure the daemon");
276
+ }
277
+ else {
278
+ info("Try restarting: sudo systemctl restart comis");
279
+ }
280
+ }
268
281
  return;
269
282
  }
270
283
  const scope = manager === "systemd-user" ? "systemd (user scope)" : "systemd";
271
284
  info(`Starting daemon via ${scope}...`);
272
- await execSystemctl(manager, "start", "comis");
273
- success("Daemon started");
285
+ try {
286
+ await execSystemctl(manager, "start", "comis");
287
+ success("Daemon started");
288
+ }
289
+ catch {
290
+ error("Cannot start daemon: insufficient permissions");
291
+ info("Run as root: sudo systemctl start comis");
292
+ }
274
293
  return;
275
294
  }
276
295
  case "pm2": {
@@ -304,8 +323,14 @@ async function handleDaemonStop() {
304
323
  }
305
324
  const scope = manager === "systemd-user" ? "systemd (user scope)" : "systemd";
306
325
  info(`Stopping daemon via ${scope}...`);
307
- await execSystemctl(manager, "stop", "comis");
308
- success("Daemon stopped");
326
+ try {
327
+ await execSystemctl(manager, "stop", "comis");
328
+ success("Daemon stopped");
329
+ }
330
+ catch {
331
+ error("Cannot stop daemon: insufficient permissions");
332
+ info("Run as root: sudo systemctl stop comis");
333
+ }
309
334
  return;
310
335
  }
311
336
  case "pm2": {
@@ -218,7 +218,6 @@ async function restartViaSystemd(manager) {
218
218
  const args = manager === "systemd-user"
219
219
  ? ["--user", "restart", "comis"]
220
220
  : ["restart", "comis"];
221
- // System-scope requires root; try sudo for non-root users
222
221
  if (manager === "systemd" && process.getuid?.() !== 0) {
223
222
  await exec("sudo", ["systemctl", ...args], { timeout: 15_000 });
224
223
  }
@@ -227,6 +226,27 @@ async function restartViaSystemd(manager) {
227
226
  }
228
227
  return true;
229
228
  }
229
+ catch {
230
+ // sudo failed (comis user has no sudo) — fall back to SIGUSR2.
231
+ // The daemon traps SIGUSR2 and exits with code 42; systemd respawns
232
+ // it via RestartForceExitStatus=42, picking up the new config.
233
+ return restartViaSigusr2(manager);
234
+ }
235
+ }
236
+ async function restartViaSigusr2(manager) {
237
+ try {
238
+ const pidArgs = manager === "systemd-user"
239
+ ? ["--user", "show", "comis", "--property=MainPID", "--value"]
240
+ : ["show", "comis", "--property=MainPID", "--value"];
241
+ const { stdout } = await exec("systemctl", pidArgs, { timeout: 5_000 });
242
+ const pid = Number(stdout.trim());
243
+ if (isNaN(pid) || pid <= 0)
244
+ return false;
245
+ process.kill(pid, "SIGUSR2");
246
+ // Wait for systemd to respawn the process
247
+ await new Promise((r) => setTimeout(r, 3000));
248
+ return true;
249
+ }
230
250
  catch {
231
251
  return false;
232
252
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@comis/cli",
3
3
  "private": true,
4
- "version": "1.0.7",
4
+ "version": "1.0.9",
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.7",
4
+ "version": "1.0.9",
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.7",
4
+ "version": "1.0.9",
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.7",
4
+ "version": "1.0.9",
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.7",
4
+ "version": "1.0.9",
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.7",
4
+ "version": "1.0.9",
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.7",
4
+ "version": "1.0.9",
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.7",
4
+ "version": "1.0.9",
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.7",
4
+ "version": "1.0.9",
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.7",
3
+ "version": "1.0.9",
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.7",
119
- "@comis/core": "1.0.7",
120
- "@comis/infra": "1.0.7",
121
- "@comis/memory": "1.0.7",
122
- "@comis/gateway": "1.0.7",
123
- "@comis/skills": "1.0.7",
124
- "@comis/scheduler": "1.0.7",
125
- "@comis/agent": "1.0.7",
126
- "@comis/channels": "1.0.7",
127
- "@comis/cli": "1.0.7",
128
- "@comis/daemon": "1.0.7",
118
+ "@comis/shared": "1.0.9",
119
+ "@comis/core": "1.0.9",
120
+ "@comis/infra": "1.0.9",
121
+ "@comis/memory": "1.0.9",
122
+ "@comis/gateway": "1.0.9",
123
+ "@comis/skills": "1.0.9",
124
+ "@comis/scheduler": "1.0.9",
125
+ "@comis/agent": "1.0.9",
126
+ "@comis/channels": "1.0.9",
127
+ "@comis/cli": "1.0.9",
128
+ "@comis/daemon": "1.0.9",
129
129
  "@agentclientprotocol/sdk": "^0.15.0",
130
130
  "@clack/core": "^1.1.0",
131
131
  "@clack/prompts": "^1.1.0",