omnius 1.0.184 → 1.0.185

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/dist/index.js CHANGED
@@ -574031,6 +574031,8 @@ var init_command_registry = __esm({
574031
574031
  ["/telegram", "Toggle Telegram bridge on/off (uses saved key)"],
574032
574032
  ["/telegram status", "Show Telegram bridge status"],
574033
574033
  ["/telegram stop", "Disconnect Telegram bridge"],
574034
+ ["/telegram disable", "Persistently disable Telegram long polling"],
574035
+ ["/telegram enable", "Re-enable Telegram long polling"],
574034
574036
  ["/telegram mode auto|chat|action", "Set Telegram interaction routing: auto, fast chat, or action sub-agent"],
574035
574037
  ["/telegram subagents <1-5>", "Set global Telegram work-slot limit across all chats/groups"],
574036
574038
  ["/telegram auth", "Show a TUI-only one-time code for Telegram admin authentication"],
@@ -609279,6 +609281,27 @@ sleep 1
609279
609281
  }
609280
609282
  return "handled";
609281
609283
  }
609284
+ if (parts[0] === "disable" || parts[0] === "disabled") {
609285
+ const hasGlobalFlagDisable = parts.includes("--global");
609286
+ const projectRootDisable = ctx3.repoRoot || process.cwd();
609287
+ const projectHasOmniusDisable = existsSync110(join122(projectRootDisable, ".omnius"));
609288
+ const wantsLocalDisable = hasGlobalFlagDisable ? false : isLocal || projectHasOmniusDisable;
609289
+ if (ctx3.isTelegramActive?.()) ctx3.telegramStop?.();
609290
+ ctx3.saveTelegramSettings?.({ enabled: false, local: wantsLocalDisable });
609291
+ renderInfo(`Telegram polling disabled${wantsLocalDisable ? " (project)" : " (global)"}.`);
609292
+ renderInfo("Use /telegram enable to allow polling again.");
609293
+ return "handled";
609294
+ }
609295
+ if (parts[0] === "enable" || parts[0] === "enabled") {
609296
+ const hasGlobalFlagEnable = parts.includes("--global");
609297
+ const projectRootEnable = ctx3.repoRoot || process.cwd();
609298
+ const projectHasOmniusEnable = existsSync110(join122(projectRootEnable, ".omnius"));
609299
+ const wantsLocalEnable = hasGlobalFlagEnable ? false : isLocal || projectHasOmniusEnable;
609300
+ ctx3.saveTelegramSettings?.({ enabled: true, local: wantsLocalEnable });
609301
+ renderInfo(`Telegram polling enabled${wantsLocalEnable ? " (project)" : " (global)"}.`);
609302
+ renderInfo("Use /telegram to start the bridge.");
609303
+ return "handled";
609304
+ }
609282
609305
  if (parts[0] === "status") {
609283
609306
  ctx3.telegramStatus?.();
609284
609307
  return "handled";
@@ -609633,8 +609656,9 @@ sleep 1
609633
609656
  "No .omnius/ in the current directory; this 'local' setting was written to ./.omnius/settings.json and only applies when omnius is invoked from this folder."
609634
609657
  );
609635
609658
  }
609659
+ const savedTelegramState = ctx3.getTelegramSettings?.(wantsLocal ? "project" : "global");
609636
609660
  if (!ctx3.isTelegramActive?.() && settings.key)
609637
- renderInfo("Use /telegram to start.");
609661
+ renderInfo(savedTelegramState?.enabled === false ? "Telegram polling is disabled; use /telegram enable before starting." : "Use /telegram to start.");
609638
609662
  return "handled";
609639
609663
  }
609640
609664
  if (parts.length === 1 && parts[0] === "--global") {
@@ -609648,6 +609672,11 @@ sleep 1
609648
609672
  renderInfo("Set one with /telegram --key <bot-token> --global, or use /telegram --key <bot-token> for this project.");
609649
609673
  return "handled";
609650
609674
  }
609675
+ if (settings.enabled === false) {
609676
+ renderWarning("Global Telegram polling is disabled.");
609677
+ renderInfo("Use /telegram enable --global before starting the shared bot.");
609678
+ return "handled";
609679
+ }
609651
609680
  try {
609652
609681
  await ctx3.telegramStart?.(settings.key, settings.admin, "global");
609653
609682
  } catch (err) {
@@ -609673,6 +609702,11 @@ sleep 1
609673
609702
  }
609674
609703
  return "handled";
609675
609704
  }
609705
+ if (settings.enabled === false) {
609706
+ renderWarning("Telegram polling is disabled.");
609707
+ renderInfo("Use /telegram enable to allow polling again.");
609708
+ return "handled";
609709
+ }
609676
609710
  try {
609677
609711
  const startProjectRoot = ctx3.repoRoot || process.cwd();
609678
609712
  if (existsSync110(join122(startProjectRoot, ".omnius"))) {
@@ -609707,6 +609741,8 @@ sleep 1
609707
609741
  renderInfo("Usage:");
609708
609742
  renderInfo(" /telegram --key <token> Save bot token (project-local when .omnius/ exists)");
609709
609743
  renderInfo(" /telegram --admin <id> Set admin filter (project-local by default)");
609744
+ renderInfo(" /telegram disable Disable long polling persistently");
609745
+ renderInfo(" /telegram enable Re-enable long polling");
609710
609746
  renderInfo(" /telegram revoke [--global] Revoke saved admin access");
609711
609747
  renderInfo(" /telegram Toggle on/off");
609712
609748
  renderInfo(" /telegram --global Start/stop legacy shared global token explicitly");
@@ -610513,7 +610549,9 @@ async function showPlatformOnboardingMenu(ctx3, id) {
610513
610549
  { key: "telegram-admin", label: "Set admin user id", detail: "Restricts remote admin controls" },
610514
610550
  { key: "telegram-mode", label: "Interaction mode", detail: ctx3.getTelegramSettings?.()?.mode ?? "auto" },
610515
610551
  { key: "telegram-start", label: "Start bridge", detail: "Uses saved token" },
610516
- { key: "telegram-stop", label: "Stop bridge", detail: "Disconnect long polling" }
610552
+ { key: "telegram-stop", label: "Stop bridge", detail: "Disconnect long polling" },
610553
+ { key: "telegram-disable", label: "Disable polling", detail: "Persistently block getUpdates" },
610554
+ { key: "telegram-enable", label: "Enable polling", detail: "Allow getUpdates again" }
610517
610555
  ] : [
610518
610556
  { key: "enable", label: "Enable adapter", detail: current.enabled ? "currently enabled" : "currently disabled" },
610519
610557
  { key: "disable", label: "Disable adapter", detail: current.enabled ? "currently enabled" : "currently disabled" },
@@ -610599,11 +610637,20 @@ async function showPlatformOnboardingMenu(ctx3, id) {
610599
610637
  } else if (result.key === "telegram-start") {
610600
610638
  const settings = ctx3.getTelegramSettings?.() ?? {};
610601
610639
  if (!settings.key) renderWarning("No Telegram bot token configured.");
610602
- else if (ctx3.isTelegramActive?.()) {
610640
+ else if (settings.enabled === false) {
610641
+ renderWarning("Telegram polling is disabled. Use /telegram enable first.");
610642
+ } else if (ctx3.isTelegramActive?.()) {
610603
610643
  renderWarning("Telegram bridge already active. Use /telegram stop before restarting.");
610604
610644
  } else await ctx3.telegramStart?.(settings.key, settings.admin, settings.keyScope ?? "project");
610605
610645
  } else if (result.key === "telegram-stop") {
610606
610646
  ctx3.telegramStop?.();
610647
+ } else if (result.key === "telegram-disable") {
610648
+ if (ctx3.isTelegramActive?.()) ctx3.telegramStop?.();
610649
+ ctx3.saveTelegramSettings?.({ enabled: false });
610650
+ renderInfo("Telegram polling disabled.");
610651
+ } else if (result.key === "telegram-enable") {
610652
+ ctx3.saveTelegramSettings?.({ enabled: true });
610653
+ renderInfo("Telegram polling enabled.");
610607
610654
  }
610608
610655
  return;
610609
610656
  }
@@ -663234,6 +663281,7 @@ async function handlePatchConfig(req2, res) {
663234
663281
  settingsUpdate.voiceMode = updates["voiceMode"];
663235
663282
  }
663236
663283
  if (typeof updates["telegramKey"] === "string") settingsUpdate.telegramKey = updates["telegramKey"];
663284
+ if (typeof updates["telegramEnabled"] === "boolean") settingsUpdate.telegramEnabled = updates["telegramEnabled"];
663237
663285
  if (typeof updates["telegramAdmin"] === "string") settingsUpdate.telegramAdmin = updates["telegramAdmin"];
663238
663286
  if (typeof updates["cohere"] === "boolean") settingsUpdate.cohere = updates["cohere"];
663239
663287
  if (updates["commandsMode"] === "auto" || updates["commandsMode"] === "manual") {
@@ -673099,6 +673147,7 @@ Log: ${nexusLogPath}`)
673099
673147
  const subAgents = typeof source.telegramSubAgents === "number" ? source.telegramSubAgents : typeof savedSettings.telegramSubAgents === "number" ? savedSettings.telegramSubAgents : 2;
673100
673148
  return {
673101
673149
  key: nonEmptyTelegramSetting(source.telegramKey),
673150
+ enabled: source.telegramEnabled ?? savedSettings.telegramEnabled ?? true,
673102
673151
  admin: nonEmptyTelegramSetting(source.telegramAdmin),
673103
673152
  mode,
673104
673153
  subAgents,
@@ -673680,6 +673729,20 @@ The user pasted a clipboard image saved at ${relPath}. Use the OCR, vision analy
673680
673729
  },
673681
673730
  // Telegram bridge
673682
673731
  async telegramStart(token, adminId, scope = "project") {
673732
+ if (process.env["OMNIUS_TELEGRAM_DISABLED"] === "1") {
673733
+ writeContent(
673734
+ () => renderWarning("Telegram bridge disabled by OMNIUS_TELEGRAM_DISABLED=1.")
673735
+ );
673736
+ showPrompt();
673737
+ return;
673738
+ }
673739
+ if (telegramSettingsForScope(scope).enabled === false) {
673740
+ writeContent(
673741
+ () => renderWarning(`Telegram polling disabled in ${scope} settings. Use /telegram enable${scope === "global" ? " --global" : ""} to allow it.`)
673742
+ );
673743
+ showPrompt();
673744
+ return;
673745
+ }
673683
673746
  if (telegramBridge?.isActive) {
673684
673747
  writeContent(
673685
673748
  () => renderWarning("Telegram bridge already active. Use /telegram stop before restarting.")
@@ -673888,6 +673951,9 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
673888
673951
  if (settings.key !== void 0) {
673889
673952
  target.telegramKey = settings.key;
673890
673953
  }
673954
+ if (settings.enabled !== void 0) {
673955
+ target.telegramEnabled = settings.enabled;
673956
+ }
673891
673957
  if (settings.admin !== void 0) {
673892
673958
  target.telegramAdmin = settings.admin === null ? "" : settings.admin;
673893
673959
  }
@@ -673899,6 +673965,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
673899
673965
  }
673900
673966
  const payload = {
673901
673967
  ...settings.key !== void 0 ? { telegramKey: settings.key } : {},
673968
+ ...settings.enabled !== void 0 ? { telegramEnabled: settings.enabled } : {},
673902
673969
  ...settings.admin !== void 0 ? { telegramAdmin: settings.admin === null ? "" : settings.admin } : {},
673903
673970
  ...settings.mode !== void 0 ? { telegramMode: settings.mode } : {},
673904
673971
  ...settings.subAgents !== void 0 ? { telegramSubAgents: settings.subAgents } : {}
@@ -673953,6 +674020,10 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
673953
674020
  queuedSubAgents
673954
674021
  )
673955
674022
  );
674023
+ const effectiveTelegramSettings = telegramSettingsForScope(activeTelegramSettingsScope ?? "project");
674024
+ if (effectiveTelegramSettings.enabled === false || process.env["OMNIUS_TELEGRAM_DISABLED"] === "1") {
674025
+ writeContent(() => renderInfo("Telegram polling is disabled; auto-start and manual start are blocked."));
674026
+ }
673956
674027
  },
673957
674028
  telegramBeginAdminAuth() {
673958
674029
  if (!telegramBridge?.isActive) return null;
@@ -675338,7 +675409,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
675338
675409
  }
675339
675410
  }
675340
675411
  const autoTelegramSettings = telegramSettingsForScope("project");
675341
- if (!isResumed && autoTelegramSettings.key) {
675412
+ if (!isResumed && autoTelegramSettings.key && autoTelegramSettings.enabled !== false && process.env["OMNIUS_TELEGRAM_DISABLED"] !== "1") {
675342
675413
  setTimeout(async () => {
675343
675414
  try {
675344
675415
  await commandCtx.telegramStart(
@@ -677569,6 +677640,7 @@ var init_config6 = __esm({
677569
677640
  updateMode: "Update behaviour: auto (after task completion) or manual (/update only)",
677570
677641
  // -- Integrations --
677571
677642
  telegramKey: "Telegram bot API token for /telegram bridge",
677643
+ telegramEnabled: "Enable Telegram long polling / bridge auto-start (true/false)",
677572
677644
  telegramAdmin: "Telegram admin user ID — only this user can interact with the bot"
677573
677645
  };
677574
677646
  SENSITIVE_KEYS = /* @__PURE__ */ new Set(["apiKey", "api_key", "secret", "password", "token", "telegramKey"]);
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.184",
3
+ "version": "1.0.185",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.184",
9
+ "version": "1.0.185",
10
10
  "bundleDependencies": [
11
11
  "image-to-ascii"
12
12
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.184",
3
+ "version": "1.0.185",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",