omnius 1.0.223 → 1.0.224

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
@@ -585609,6 +585609,10 @@ var init_command_registry = __esm({
585609
585609
  ["/telegram enable", "Re-enable Telegram long polling"],
585610
585610
  ["/telegram mode auto|chat|action", "Set Telegram interaction routing: auto, fast chat, or action sub-agent"],
585611
585611
  ["/telegram subagents <1-5>", "Set global Telegram work-slot limit across all chats/groups"],
585612
+ ["/telegram model", "Pick the Telegram-isolated model (model list from the Telegram endpoint)"],
585613
+ ["/telegram model <name|reset>", "Set or clear the Telegram-isolated model (separate from main agent)"],
585614
+ ["/telegram endpoint", "Pick the Telegram-isolated backend endpoint (same menu as /endpoint, bot-scoped)"],
585615
+ ["/telegram endpoint <url|reset> [--auth <t>]", "Set or clear the Telegram-isolated endpoint"],
585612
585616
  ["/telegram auth", "Show a TUI-only one-time code for Telegram admin authentication"],
585613
585617
  ["/telegram auth cancel", "Cancel the pending Telegram admin authentication code"],
585614
585618
  ["/telegram bot <username> <text>", "Send a Bot API bot-to-bot message by @username"],
@@ -611568,6 +611572,298 @@ var init_sponsor_wizard = __esm({
611568
611572
  }
611569
611573
  });
611570
611574
 
611575
+ // packages/cli/src/tui/telegram-inference.ts
611576
+ var telegram_inference_exports = {};
611577
+ __export(telegram_inference_exports, {
611578
+ handleTelegramEndpoint: () => handleTelegramEndpoint,
611579
+ showTelegramModelPicker: () => showTelegramModelPicker
611580
+ });
611581
+ function effectiveConfig(ctx3) {
611582
+ return ctx3.telegramGetEffectiveConfig?.();
611583
+ }
611584
+ async function showTelegramModelPicker(arg, ctx3, local = false) {
611585
+ const trimmed = arg.trim();
611586
+ if (/^(reset|main|default|clear|off)$/i.test(trimmed)) {
611587
+ ctx3.telegramApplyInference?.({ model: "" });
611588
+ ctx3.telegramSaveInference?.({ model: null, local });
611589
+ renderInfo("Telegram model override cleared — using the main agent model.");
611590
+ return;
611591
+ }
611592
+ const config = effectiveConfig(ctx3);
611593
+ if (!config) {
611594
+ renderError("Telegram inference context unavailable.");
611595
+ return;
611596
+ }
611597
+ if (trimmed) {
611598
+ await switchTelegramModel(trimmed, config, ctx3, local);
611599
+ return;
611600
+ }
611601
+ renderInfo(`Loading models from Telegram endpoint ${c3.dim(config.backendUrl)}...`);
611602
+ try {
611603
+ const fetchPromise = fetchModels(config.backendUrl, config.apiKey);
611604
+ const timeoutPromise = new Promise(
611605
+ (_, reject) => setTimeout(
611606
+ () => reject(
611607
+ new Error(
611608
+ `Timed out fetching models from ${config.backendUrl} (10s). The Telegram endpoint may be down. Use /telegram endpoint to switch.`
611609
+ )
611610
+ ),
611611
+ 1e4
611612
+ )
611613
+ );
611614
+ const models = await Promise.race([fetchPromise, timeoutPromise]);
611615
+ if (models.length === 0) {
611616
+ renderWarning("No models found on the Telegram endpoint.");
611617
+ return;
611618
+ }
611619
+ const items = [];
611620
+ const override = ctx3.telegramGetInferenceOverride?.() ?? {};
611621
+ if (!override.model) {
611622
+ items.push({
611623
+ key: "__use_main__",
611624
+ label: `${c3.cyan("↺")} Use main agent model`,
611625
+ detail: `Currently inheriting ${c3.dim(config.model)}`
611626
+ });
611627
+ } else {
611628
+ items.push({
611629
+ key: "__use_main__",
611630
+ label: `${c3.cyan("↺")} Use main agent model`,
611631
+ detail: "Clear the Telegram model override"
611632
+ });
611633
+ }
611634
+ for (const m2 of models) {
611635
+ const ctxLabel = m2.contextLength ? formatContextLength(m2.contextLength) : "";
611636
+ const capStr = m2.caps ? formatCaps(m2.caps) : "";
611637
+ items.push({
611638
+ key: m2.name,
611639
+ label: m2.name,
611640
+ detail: [m2.parameterSize, ctxLabel, capStr, m2.modified].filter(Boolean).join(" ")
611641
+ });
611642
+ }
611643
+ const result = await tuiSelect({
611644
+ items,
611645
+ activeKey: override.model ? stripLatest(override.model) : "__use_main__",
611646
+ title: "Select Telegram Model",
611647
+ rl: ctx3.rl,
611648
+ skipKeys: [],
611649
+ availableRows: ctx3.availableContentRows?.()
611650
+ });
611651
+ if (!result.confirmed || !result.key) {
611652
+ renderInfo("Telegram model selection cancelled.");
611653
+ return;
611654
+ }
611655
+ if (result.key === "__use_main__") {
611656
+ ctx3.telegramApplyInference?.({ model: "" });
611657
+ ctx3.telegramSaveInference?.({ model: null, local });
611658
+ renderInfo("Telegram model override cleared — using the main agent model.");
611659
+ return;
611660
+ }
611661
+ await switchTelegramModel(stripLatest(result.key), config, ctx3, local);
611662
+ } catch (err) {
611663
+ renderError(`Failed to fetch Telegram models: ${err instanceof Error ? err.message : String(err)}`);
611664
+ }
611665
+ }
611666
+ async function switchTelegramModel(query, config, ctx3, local) {
611667
+ let finalModel = query;
611668
+ try {
611669
+ const models = await fetchModels(config.backendUrl, config.apiKey);
611670
+ const match = findModel(models, query);
611671
+ if (match) {
611672
+ finalModel = match.name;
611673
+ } else {
611674
+ renderWarning(`Model "${query}" not found on the Telegram endpoint — setting it anyway.`);
611675
+ renderInfo("It may be pulled/available later, or pull it on that backend first.");
611676
+ }
611677
+ } catch {
611678
+ renderWarning("Could not verify the model against the Telegram endpoint — setting it anyway.");
611679
+ }
611680
+ ctx3.telegramApplyInference?.({ model: finalModel });
611681
+ ctx3.telegramSaveInference?.({ model: finalModel, local });
611682
+ recordUsage("model", finalModel, {
611683
+ repoRoot: local ? ctx3.repoRoot : void 0,
611684
+ local,
611685
+ meta: { endpoint: config.backendUrl }
611686
+ });
611687
+ renderInfo(
611688
+ `Telegram model set to ${c3.bold(finalModel)}${local ? " (project)" : ""} — isolated from the main agent.`
611689
+ );
611690
+ }
611691
+ async function handleTelegramEndpoint(arg, ctx3, local = false) {
611692
+ const trimmed = arg.trim();
611693
+ if (/^(reset|main|default|clear|stop|off)$/i.test(trimmed)) {
611694
+ ctx3.telegramApplyInference?.({ backendUrl: "", backendType: void 0, apiKey: "" });
611695
+ ctx3.telegramSaveInference?.({ backendUrl: null, backendType: null, apiKey: null, local });
611696
+ renderInfo("Telegram endpoint override cleared — using the main agent endpoint.");
611697
+ return;
611698
+ }
611699
+ if (!trimmed) {
611700
+ await showTelegramEndpointMenu(ctx3, local);
611701
+ return;
611702
+ }
611703
+ await setTelegramEndpoint(trimmed, ctx3, local);
611704
+ }
611705
+ async function showTelegramEndpointMenu(ctx3, local) {
611706
+ const config = effectiveConfig(ctx3);
611707
+ if (!config) {
611708
+ renderError("Telegram inference context unavailable.");
611709
+ return;
611710
+ }
611711
+ const override = ctx3.telegramGetInferenceOverride?.() ?? {};
611712
+ const history = loadUsageHistory("endpoint", ctx3.repoRoot);
611713
+ const items = [
611714
+ {
611715
+ key: "__use_main__",
611716
+ label: `${c3.cyan("↺")} Use main agent endpoint`,
611717
+ detail: override.backendUrl ? "Clear the Telegram endpoint override" : "Currently inheriting the main endpoint"
611718
+ }
611719
+ ];
611720
+ for (const h of history) {
611721
+ const provider = h.meta?.provider ?? detectProvider(h.value).label;
611722
+ const uses = h.localUses > 0 ? `${h.useCount} uses (${h.localUses} local)` : `${h.useCount} uses`;
611723
+ const auth = h.meta?.authHint ? ` Auth: ${h.meta.authHint}` : "";
611724
+ items.push({ key: h.value, label: h.value, detail: `${provider} ${uses}${auth}` });
611725
+ }
611726
+ items.push({
611727
+ key: "__add__",
611728
+ label: `${c3.green("+")} Add endpoint`,
611729
+ detail: "Type a URL to add a new Telegram endpoint"
611730
+ });
611731
+ let addedEndpoint = null;
611732
+ const result = await tuiSelect({
611733
+ items,
611734
+ activeKey: override.backendUrl ? override.backendUrl : "__use_main__",
611735
+ title: "Select Telegram Endpoint",
611736
+ rl: ctx3.rl,
611737
+ availableRows: ctx3.availableContentRows?.(),
611738
+ onDelete: (item, done) => {
611739
+ if (item.key.startsWith("__")) {
611740
+ done(false);
611741
+ return;
611742
+ }
611743
+ deleteUsageRecord("endpoint", item.key, ctx3.repoRoot);
611744
+ done(true);
611745
+ },
611746
+ onEnter: (item, { getInput, resolve: resolve64 }) => {
611747
+ if (item.key === "__add__") {
611748
+ getInput("URL", "http://").then(async (url) => {
611749
+ if (!url || !url.trim()) return;
611750
+ const authKey = await getInput("Auth key (optional)", "");
611751
+ const authArg = authKey?.trim() ? ` --auth ${authKey.trim()}` : "";
611752
+ addedEndpoint = `${url.trim()}${authArg}`;
611753
+ resolve64({ confirmed: true, key: "__add__", index: -1 });
611754
+ });
611755
+ return true;
611756
+ }
611757
+ return false;
611758
+ }
611759
+ });
611760
+ if (!result.confirmed || !result.key) {
611761
+ renderInfo("Telegram endpoint selection cancelled.");
611762
+ return;
611763
+ }
611764
+ if (result.key === "__use_main__") {
611765
+ ctx3.telegramApplyInference?.({ backendUrl: "", backendType: void 0, apiKey: "" });
611766
+ ctx3.telegramSaveInference?.({ backendUrl: null, backendType: null, apiKey: null, local });
611767
+ renderInfo("Telegram endpoint override cleared — using the main agent endpoint.");
611768
+ return;
611769
+ }
611770
+ if (result.key === "__add__" && addedEndpoint) {
611771
+ await setTelegramEndpoint(addedEndpoint, ctx3, local);
611772
+ return;
611773
+ }
611774
+ const record = history.find((h) => h.value === result.key);
611775
+ const savedAuth = record?.meta?.authKey;
611776
+ await setTelegramEndpoint(savedAuth ? `${result.key} --auth ${savedAuth}` : result.key, ctx3, local);
611777
+ }
611778
+ async function setTelegramEndpoint(arg, ctx3, local) {
611779
+ const normalizedArg = arg.replace(/—/g, "--").replace(/–/g, "--");
611780
+ const parts = normalizedArg.split(/\s+/);
611781
+ const url = parts[0];
611782
+ let apiKey;
611783
+ const authIdx = parts.indexOf("--auth") !== -1 ? parts.indexOf("--auth") : parts.indexOf("-auth");
611784
+ if (authIdx !== -1 && parts[authIdx + 1]) apiKey = parts[authIdx + 1];
611785
+ try {
611786
+ new URL(url);
611787
+ } catch {
611788
+ renderError(`Invalid URL: "${url}"`);
611789
+ return;
611790
+ }
611791
+ const normalizedUrl = normalizeBaseUrl(url);
611792
+ const provider = detectProvider(url);
611793
+ const backendType = provider.id === "ollama" ? "ollama" : "vllm";
611794
+ process.stdout.write(`
611795
+ ${c3.dim("Detected:")} ${c3.bold(provider.label)}
611796
+ `);
611797
+ process.stdout.write(` ${c3.dim("Testing connection...")} `);
611798
+ try {
611799
+ const headers = {};
611800
+ if (apiKey) {
611801
+ if (provider.id === "anthropic") {
611802
+ headers["x-api-key"] = apiKey;
611803
+ headers["anthropic-version"] = "2023-06-01";
611804
+ } else {
611805
+ headers["Authorization"] = `Bearer ${apiKey}`;
611806
+ }
611807
+ }
611808
+ const resp = await fetch(`${normalizedUrl}${provider.modelsPath}`, {
611809
+ headers,
611810
+ signal: AbortSignal.timeout(1e4)
611811
+ });
611812
+ if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
611813
+ process.stdout.write(`${c3.green("✔")} Connected
611814
+ `);
611815
+ } catch (err) {
611816
+ process.stdout.write(`${c3.yellow("⚠")} Could not verify
611817
+ `);
611818
+ renderWarning(`Endpoint may not be reachable: ${err instanceof Error ? err.message : String(err)}`);
611819
+ renderInfo("Setting the Telegram endpoint anyway — it may come online later.");
611820
+ }
611821
+ ctx3.telegramApplyInference?.({ backendUrl: normalizedUrl, backendType, apiKey: apiKey ?? "" });
611822
+ ctx3.telegramSaveInference?.({
611823
+ backendUrl: normalizedUrl,
611824
+ backendType,
611825
+ apiKey: apiKey ?? "",
611826
+ local
611827
+ });
611828
+ recordUsage("endpoint", normalizedUrl, {
611829
+ repoRoot: local ? ctx3.repoRoot : void 0,
611830
+ local,
611831
+ meta: {
611832
+ provider: provider.label,
611833
+ backendType,
611834
+ ...apiKey ? { authHint: apiKey.slice(0, 4) + "...", authKey: apiKey } : {}
611835
+ }
611836
+ });
611837
+ process.stdout.write(`
611838
+ ${c3.green("✔")} Telegram endpoint updated${local ? " (project)" : ""}:
611839
+ `);
611840
+ process.stdout.write(` ${c3.cyan("Provider".padEnd(12))} ${provider.label}
611841
+ `);
611842
+ process.stdout.write(` ${c3.cyan("URL".padEnd(12))} ${normalizedUrl}
611843
+ `);
611844
+ process.stdout.write(` ${c3.cyan("Type".padEnd(12))} ${backendType}
611845
+ `);
611846
+ process.stdout.write(
611847
+ ` ${c3.cyan("Auth".padEnd(12))} ${apiKey ? `Bearer ${apiKey.slice(0, 4)}...` : "none"}
611848
+ `
611849
+ );
611850
+ process.stdout.write(
611851
+ ` ${c3.dim("Isolated from the main agent. Set the model with /telegram model.")}
611852
+
611853
+ `
611854
+ );
611855
+ }
611856
+ var init_telegram_inference = __esm({
611857
+ "packages/cli/src/tui/telegram-inference.ts"() {
611858
+ "use strict";
611859
+ init_render();
611860
+ init_tui_select();
611861
+ init_model_picker();
611862
+ init_omnius_directory();
611863
+ init_dist();
611864
+ }
611865
+ });
611866
+
611571
611867
  // packages/cli/src/tui/image-ascii-preview.ts
611572
611868
  var image_ascii_preview_exports = {};
611573
611869
  __export(image_ascii_preview_exports, {
@@ -621652,6 +621948,26 @@ sleep 1
621652
621948
  );
621653
621949
  return "handled";
621654
621950
  }
621951
+ if (parts[0] === "model" || parts[0] === "models") {
621952
+ const hasGlobalFlagModel = parts.includes("--global");
621953
+ const projectRootTgModel = ctx3.repoRoot || process.cwd();
621954
+ const projectHasOmniusTgModel = existsSync117(join129(projectRootTgModel, ".omnius"));
621955
+ const wantsLocalTgModel = hasGlobalFlagModel ? false : isLocal || projectHasOmniusTgModel;
621956
+ const modelArg = parts.slice(1).filter((p2) => p2 !== "--global").join(" ");
621957
+ const { showTelegramModelPicker: showTelegramModelPicker2 } = await Promise.resolve().then(() => (init_telegram_inference(), telegram_inference_exports));
621958
+ await showTelegramModelPicker2(modelArg, ctx3, wantsLocalTgModel);
621959
+ return "handled";
621960
+ }
621961
+ if (parts[0] === "endpoint" || parts[0] === "ep") {
621962
+ const hasGlobalFlagEp = parts.includes("--global");
621963
+ const projectRootTgEp = ctx3.repoRoot || process.cwd();
621964
+ const projectHasOmniusTgEp = existsSync117(join129(projectRootTgEp, ".omnius"));
621965
+ const wantsLocalTgEp = hasGlobalFlagEp ? false : isLocal || projectHasOmniusTgEp;
621966
+ const epArg = parts.slice(1).filter((p2) => p2 !== "--global").join(" ");
621967
+ const { handleTelegramEndpoint: handleTelegramEndpoint2 } = await Promise.resolve().then(() => (init_telegram_inference(), telegram_inference_exports));
621968
+ await handleTelegramEndpoint2(epArg, ctx3, wantsLocalTgEp);
621969
+ return "handled";
621970
+ }
621655
621971
  if (parts[0] === "auth" || parts[0] === "authenticate") {
621656
621972
  if (parts[1] === "cancel") {
621657
621973
  const cancelled = ctx3.telegramCancelAdminAuth?.() ?? false;
@@ -622035,6 +622351,8 @@ sleep 1
622035
622351
  renderInfo(" /telegram status Show status");
622036
622352
  renderInfo(" /telegram mode auto|chat|action Set interaction routing profile");
622037
622353
  renderInfo(" /telegram subagents <1-5> Set global Telegram work-slot limit");
622354
+ renderInfo(" /telegram model [name|reset] Pick the Telegram-isolated model (separate from main agent)");
622355
+ renderInfo(" /telegram endpoint [url|reset] [--auth <key>] Pick the Telegram-isolated backend endpoint");
622038
622356
  renderInfo(" /telegram auth Show one-time admin auth code");
622039
622357
  renderInfo(" /telegram auth cancel Cancel pending admin auth code");
622040
622358
  renderInfo(" /telegram bot <username> <text> Send bot-to-bot message");
@@ -644624,6 +644942,7 @@ Telegram link integrity contract:
644624
644942
  this.telegramSqlitePath = resolve55(repoRoot || ".", ".omnius", "telegram.sqlite");
644625
644943
  this.telegramToolButtonDir = resolve55(repoRoot || ".", ".omnius", "telegram-tool-buttons");
644626
644944
  this.state.maxSubAgents = normalizeTelegramSubAgentLimit(resolveSettings(repoRoot || ".").telegramSubAgents);
644945
+ this.telegramBaseInferenceConfig = agentConfig ? { ...agentConfig } : void 0;
644627
644946
  this.hydrateTelegramCommandMap(buildTelegramBotCommands({ scope: "admin" }));
644628
644947
  }
644629
644948
  botToken;
@@ -644636,6 +644955,15 @@ Telegram link integrity contract:
644636
644955
  pollFatalNotified = false;
644637
644956
  lastUpdateId = 0;
644638
644957
  telegramRouterModelCache = null;
644958
+ /**
644959
+ * Snapshot of the main agent inference config captured at construction. The
644960
+ * effective `agentConfig` is this base overlaid with the Telegram-isolated
644961
+ * inference override (see {@link applyInferenceOverride}). Keeping the base
644962
+ * separate lets a later override that clears a field fall back to the main
644963
+ * value rather than to whatever the previous override left behind.
644964
+ */
644965
+ telegramBaseInferenceConfig;
644966
+ telegramInferenceOverride = {};
644639
644967
  state = {
644640
644968
  active: false,
644641
644969
  botUserId: void 0,
@@ -644838,6 +645166,45 @@ Telegram link integrity contract:
644838
645166
  channelReflectionState = /* @__PURE__ */ new Map();
644839
645167
  /** Public/group Telegram per-user quota buckets for expensive tools. */
644840
645168
  telegramPublicQuotaBuckets = /* @__PURE__ */ new Map();
645169
+ /**
645170
+ * Apply a Telegram-isolated inference override on top of the main agent
645171
+ * config. The router, fast-chat completions, and action sub-agents spawned by
645172
+ * the bridge all read `this.agentConfig`, so overlaying here isolates the
645173
+ * Telegram bot's model/endpoint from the main TUI agent.
645174
+ *
645175
+ * Pass an empty string (or undefined) for a field to clear that override and
645176
+ * fall back to the main agent value. Returns the resulting effective config.
645177
+ */
645178
+ applyInferenceOverride(override) {
645179
+ const next = { ...this.telegramInferenceOverride };
645180
+ for (const key of ["model", "backendUrl", "backendType", "apiKey"]) {
645181
+ if (key in override) {
645182
+ const value2 = override[key];
645183
+ if (value2 === void 0 || value2 === "") delete next[key];
645184
+ else next[key] = value2;
645185
+ }
645186
+ }
645187
+ this.telegramInferenceOverride = next;
645188
+ const base3 = this.telegramBaseInferenceConfig ?? this.agentConfig;
645189
+ if (!base3) return void 0;
645190
+ const effective = {
645191
+ ...base3,
645192
+ ...next.model ? { model: next.model } : {},
645193
+ ...next.backendUrl ? { backendUrl: next.backendUrl } : {},
645194
+ ...next.backendType ? { backendType: next.backendType } : {},
645195
+ // apiKey can legitimately be empty (no-auth endpoint). When the endpoint
645196
+ // is overridden we always take the override's apiKey (possibly "") so we
645197
+ // never leak the main endpoint's key to a different backend.
645198
+ ...next.backendUrl !== void 0 ? { apiKey: next.apiKey ?? "" } : {}
645199
+ };
645200
+ this.agentConfig = effective;
645201
+ this.telegramRouterModelCache = null;
645202
+ return effective;
645203
+ }
645204
+ /** The Telegram-isolated inference override currently in effect (if any). */
645205
+ getInferenceOverride() {
645206
+ return { ...this.telegramInferenceOverride };
645207
+ }
644841
645208
  /** Set admin user ID filter */
644842
645209
  setAdmin(userId) {
644843
645210
  this.adminUserId = userId;
@@ -688380,9 +688747,39 @@ Log: ${nexusLogPath}`)
688380
688747
  admin: nonEmptyTelegramSetting(source.telegramAdmin),
688381
688748
  mode,
688382
688749
  subAgents,
688750
+ // Telegram-isolated inference override (falls back to main config when unset).
688751
+ model: nonEmptyTelegramSetting(source.telegramModel),
688752
+ backendUrl: nonEmptyTelegramSetting(source.telegramBackendUrl),
688753
+ backendType: nonEmptyTelegramSetting(source.telegramBackendType),
688754
+ apiKey: typeof source.telegramApiKey === "string" ? source.telegramApiKey : void 0,
688383
688755
  keyScope: scope
688384
688756
  };
688385
688757
  };
688758
+ const telegramInferenceOverrideFromSettings = () => {
688759
+ const project = telegramSettingsForScope("project");
688760
+ const global2 = telegramSettingsForScope("global");
688761
+ const model = project.model ?? global2.model;
688762
+ const backendUrl2 = project.backendUrl ?? global2.backendUrl;
688763
+ const backendTypeRaw = project.backendType ?? global2.backendType;
688764
+ const apiKey = project.backendUrl ? project.apiKey : global2.backendUrl ? global2.apiKey : void 0;
688765
+ const backendType = backendTypeRaw === "ollama" || backendTypeRaw === "vllm" || backendTypeRaw === "fake" || backendTypeRaw === "nexus" ? backendTypeRaw : void 0;
688766
+ return {
688767
+ ...model ? { model } : {},
688768
+ ...backendUrl2 ? { backendUrl: backendUrl2 } : {},
688769
+ ...backendType ? { backendType } : {},
688770
+ ...backendUrl2 ? { apiKey: apiKey ?? "" } : {}
688771
+ };
688772
+ };
688773
+ const telegramEffectiveConfig = () => {
688774
+ const override = telegramInferenceOverrideFromSettings();
688775
+ return {
688776
+ ...currentConfig,
688777
+ ...override.model ? { model: override.model } : {},
688778
+ ...override.backendUrl ? { backendUrl: override.backendUrl } : {},
688779
+ ...override.backendType ? { backendType: override.backendType } : {},
688780
+ ...override.backendUrl !== void 0 ? { apiKey: override.apiKey ?? "" } : {}
688781
+ };
688782
+ };
688386
688783
  const commandCtx = {
688387
688784
  get config() {
688388
688785
  return currentConfig;
@@ -689018,6 +689415,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
689018
689415
  telegramBridge.setInteractionMode(savedSettings.telegramMode ?? "auto");
689019
689416
  telegramBridge.setSubAgentLimit(telegramSettingsForScope(scope).subAgents ?? 2);
689020
689417
  telegramBridge.setTelegramToolPolicy(savedSettings.telegramToolPolicy);
689418
+ telegramBridge.applyInferenceOverride(telegramInferenceOverrideFromSettings());
689021
689419
  telegramBridge.setMetricsProvider(() => statusBar?.getMetricsSnapshot());
689022
689420
  if (adminId) {
689023
689421
  telegramBridge.setAdmin(adminId);
@@ -689202,12 +689600,28 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
689202
689600
  if (settings.subAgents !== void 0) {
689203
689601
  target.telegramSubAgents = settings.subAgents;
689204
689602
  }
689603
+ if (settings.model !== void 0) {
689604
+ target.telegramModel = settings.model === null ? "" : settings.model;
689605
+ }
689606
+ if (settings.backendUrl !== void 0) {
689607
+ target.telegramBackendUrl = settings.backendUrl === null ? "" : settings.backendUrl;
689608
+ }
689609
+ if (settings.backendType !== void 0) {
689610
+ target.telegramBackendType = settings.backendType === null ? "" : settings.backendType;
689611
+ }
689612
+ if (settings.apiKey !== void 0) {
689613
+ target.telegramApiKey = settings.apiKey === null ? "" : settings.apiKey;
689614
+ }
689205
689615
  const payload = {
689206
689616
  ...settings.key !== void 0 ? { telegramKey: settings.key } : {},
689207
689617
  ...settings.enabled !== void 0 ? { telegramEnabled: settings.enabled } : {},
689208
689618
  ...settings.admin !== void 0 ? { telegramAdmin: settings.admin === null ? "" : settings.admin } : {},
689209
689619
  ...settings.mode !== void 0 ? { telegramMode: settings.mode } : {},
689210
- ...settings.subAgents !== void 0 ? { telegramSubAgents: settings.subAgents } : {}
689620
+ ...settings.subAgents !== void 0 ? { telegramSubAgents: settings.subAgents } : {},
689621
+ ...settings.model !== void 0 ? { telegramModel: settings.model === null ? "" : settings.model } : {},
689622
+ ...settings.backendUrl !== void 0 ? { telegramBackendUrl: settings.backendUrl === null ? "" : settings.backendUrl } : {},
689623
+ ...settings.backendType !== void 0 ? { telegramBackendType: settings.backendType === null ? "" : settings.backendType } : {},
689624
+ ...settings.apiKey !== void 0 ? { telegramApiKey: settings.apiKey === null ? "" : settings.apiKey } : {}
689211
689625
  };
689212
689626
  if (targetScope === "project") {
689213
689627
  saveProjectSettings(repoRoot, payload);
@@ -689241,6 +689655,18 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
689241
689655
  savedSettings.telegramSubAgents = limit;
689242
689656
  return telegramBridge?.setSubAgentLimit(limit) ?? Math.max(1, Math.min(5, Math.floor(limit)));
689243
689657
  },
689658
+ telegramGetEffectiveConfig() {
689659
+ return telegramEffectiveConfig();
689660
+ },
689661
+ telegramGetInferenceOverride() {
689662
+ return telegramInferenceOverrideFromSettings();
689663
+ },
689664
+ telegramApplyInference(override) {
689665
+ telegramBridge?.applyInferenceOverride(override);
689666
+ },
689667
+ telegramSaveInference(override) {
689668
+ commandCtx.saveTelegramSettings?.(override);
689669
+ },
689244
689670
  telegramStatus() {
689245
689671
  const active = telegramBridge?.isActive ?? false;
689246
689672
  const botUser = active ? telegramBridge?.botUsername : void 0;
@@ -689260,6 +689686,22 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
689260
689686
  )
689261
689687
  );
689262
689688
  const effectiveTelegramSettings = telegramSettingsForScope(activeTelegramSettingsScope ?? "project");
689689
+ const tgOverride = telegramInferenceOverrideFromSettings();
689690
+ const tgEffective = telegramEffectiveConfig();
689691
+ if (tgOverride.model || tgOverride.backendUrl) {
689692
+ writeContent(() => {
689693
+ renderInfo(
689694
+ `Telegram model: ${tgOverride.model ?? `${tgEffective.model} (inherited)`}` + (tgOverride.model ? " (isolated)" : "")
689695
+ );
689696
+ renderInfo(
689697
+ `Telegram endpoint: ${tgOverride.backendUrl ?? `${tgEffective.backendUrl} (inherited)`}` + (tgOverride.backendUrl ? " (isolated)" : "")
689698
+ );
689699
+ });
689700
+ } else {
689701
+ writeContent(
689702
+ () => renderInfo("Telegram inference: inheriting main agent model/endpoint (set with /telegram model | /telegram endpoint).")
689703
+ );
689704
+ }
689263
689705
  if (effectiveTelegramSettings.enabled === false || process.env["OMNIUS_TELEGRAM_DISABLED"] === "1") {
689264
689706
  writeContent(() => renderInfo("Telegram polling is disabled; auto-start and manual start are blocked."));
689265
689707
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.223",
3
+ "version": "1.0.224",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.223",
9
+ "version": "1.0.224",
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.223",
3
+ "version": "1.0.224",
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",