omnius 1.0.156 → 1.0.157

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
@@ -11733,6 +11733,8 @@ function _envRole() {
11733
11733
  return role === 'light' || role === 'storage' || role === 'full' ? role : 'full';
11734
11734
  }
11735
11735
  var _nexusSignalingServer = process.env.OMNIUS_NEXUS_SIGNALING_SERVER || 'https://openagents.nexus';
11736
+ var _nexusDirectoryOrigin = (process.env.OMNIUS_NEXUS_DIRECTORY_ORIGIN || _nexusSignalingServer).replace(/\\/+$/, '');
11737
+ var _nexusSponsorsUrl = _nexusDirectoryOrigin + '/api/v1/sponsors';
11736
11738
  var _nexusNatsServers = _envList('OMNIUS_NEXUS_NATS_SERVERS');
11737
11739
  var _nexusManifestUrls = _envList('OMNIUS_NEXUS_MANIFEST_URLS');
11738
11740
  var nexusOpts = {
@@ -12348,10 +12350,11 @@ function _coherePersistEndpointCatalog() {
12348
12350
  source: m.source || _cohereEndpointCatalog.source,
12349
12351
  passthrough: !!m.passthrough,
12350
12352
  };
12351
- });
12352
- pub.pricingMenu = Array.isArray(_cohereEndpointCatalog.pricingMenu) ? _cohereEndpointCatalog.pricingMenu : [];
12353
- _writeJson(cohereEndpointCatalogFile, pub);
12354
- }
12353
+ });
12354
+ pub.pricingMenu = Array.isArray(_cohereEndpointCatalog.pricingMenu) ? _cohereEndpointCatalog.pricingMenu : [];
12355
+ pub.endpointAuth = String(_cohereEndpointCatalog.endpointAuth || '');
12356
+ _writeJson(cohereEndpointCatalogFile, pub);
12357
+ }
12355
12358
  function _cohereRememberEndpointCatalog(opts) {
12356
12359
  opts = opts || {};
12357
12360
  var passthrough = opts.passthrough === true;
@@ -12378,7 +12381,7 @@ function _cohereLoadPersistedEndpointCatalog() {
12378
12381
  source: String(stored.source || 'cached'),
12379
12382
  passthrough: stored.passthrough === true,
12380
12383
  endpointUrl: String(stored.endpointUrl || ''),
12381
- endpointAuth: '',
12384
+ endpointAuth: String(stored.endpointAuth || ''),
12382
12385
  models: _cohereAnnotateModels(stored.models, String(stored.source || 'cached'), stored.passthrough === true),
12383
12386
  pricingMenu: Array.isArray(stored.pricingMenu) ? stored.pricingMenu : [],
12384
12387
  updatedAt: Number(stored.updatedAt || 0) || 0,
@@ -12976,7 +12979,9 @@ async function handleCmd(cmd) {
12976
12979
  return;
12977
12980
  }
12978
12981
  // NX-07: Fetch per-model metadata from Ollama for capacity announcements
12979
- var _saModels = args.models || [];
12982
+ var _saModels = Array.isArray(args.models)
12983
+ ? args.models
12984
+ : String(args.models || '').split(',').map(function(m) { return m.trim(); }).filter(Boolean);
12980
12985
  var _saModelDetails = [];
12981
12986
  try {
12982
12987
  var _saOllamaUrl = process.env.OLLAMA_HOST || 'http://localhost:11434';
@@ -12997,11 +13002,13 @@ async function handleCmd(cmd) {
12997
13002
  } catch {}
12998
13003
  var sponsorLimitsArg = {};
12999
13004
  try { sponsorLimitsArg = args.limits ? JSON.parse(args.limits) : {}; } catch {}
13000
- var sponsorServicesArg = [];
13001
- try {
13002
- if (args.services) sponsorServicesArg = typeof args.services === 'string' ? JSON.parse(args.services) : args.services;
13003
- } catch {}
13004
- var sponsorData = {
13005
+ var sponsorServicesArg = [];
13006
+ try {
13007
+ if (args.services) sponsorServicesArg = typeof args.services === 'string' ? JSON.parse(args.services) : args.services;
13008
+ } catch {}
13009
+ var sponsorHeaderArg = {};
13010
+ try { sponsorHeaderArg = args.header ? (typeof args.header === 'string' ? JSON.parse(args.header) : args.header) : {}; } catch {}
13011
+ var sponsorData = {
13005
13012
  type: 'sponsor.announce',
13006
13013
  peerId: (connected ? nexus.peerId : 'unknown') || 'unknown',
13007
13014
  libp2pPeerId: (connected ? nexus.peerId : '') || '',
@@ -13012,15 +13019,17 @@ async function handleCmd(cmd) {
13012
13019
  mediaCapabilities: Array.isArray(sponsorServicesArg) ? sponsorServicesArg.filter(function(s) { return s && s.kind && s.kind !== 'llm'; }) : [],
13013
13020
  tunnelUrl: args.tunnel_url || null,
13014
13021
  authKey: args.auth_key || '',
13015
- limits: {
13016
- maxRequestsPerMinute: parseInt(args.rpm || sponsorLimitsArg.maxRequestsPerMinute || '60', 10),
13017
- maxTokensPerDay: parseInt(args.tpd || sponsorLimitsArg.maxTokensPerDay || '100000', 10),
13018
- maxConcurrent: parseInt(args.max_concurrent || sponsorLimitsArg.maxConcurrent || '1', 10),
13019
- },
13020
- banner: args.banner || null,
13021
- message: args.message || '',
13022
- linkUrl: args.link_url || '',
13023
- linkText: args.link_text || '',
13022
+ limits: {
13023
+ maxRequestsPerMinute: parseInt(args.rpm || sponsorLimitsArg.maxRequestsPerMinute || '60', 10),
13024
+ maxTokensPerDay: parseInt(args.tpd || sponsorLimitsArg.maxTokensPerDay || '100000', 10),
13025
+ maxConcurrent: parseInt(args.max_concurrent || sponsorLimitsArg.maxConcurrent || '1', 10),
13026
+ media: sponsorLimitsArg.media,
13027
+ },
13028
+ banner: args.banner || null,
13029
+ message: args.message || '',
13030
+ linkUrl: args.link_url || '',
13031
+ linkText: args.link_text || '',
13032
+ header: sponsorHeaderArg && typeof sponsorHeaderArg === 'object' ? sponsorHeaderArg : {},
13024
13033
  status: 'active',
13025
13034
  timestamp: Date.now(),
13026
13035
  };
@@ -13029,9 +13038,9 @@ async function handleCmd(cmd) {
13029
13038
  globalThis._activeSponsorData = sponsorData;
13030
13039
  dlog('sponsor_announce: published to nexus.sponsors.announce');
13031
13040
 
13032
- // Persist to KV-backed sponsor directory (omnius.nexus worker)
13041
+ // Persist to KV-backed sponsor directory (OpenAgents Nexus worker)
13033
13042
  try {
13034
- var kvResp = await fetch('https://omnius.nexus/api/v1/sponsors', {
13043
+ var kvResp = await fetch(_nexusSponsorsUrl, {
13035
13044
  method: 'POST',
13036
13045
  headers: { 'Content-Type': 'application/json' },
13037
13046
  body: JSON.stringify(sponsorData),
@@ -13174,9 +13183,9 @@ async function handleCmd(cmd) {
13174
13183
  var discoverTimeout = parseInt(args.timeout_ms || '5000', 10);
13175
13184
 
13176
13185
  // ── Source 1: KV-backed persistent directory (MOST RELIABLE) ──
13177
- // Query the omnius.nexus worker for persisted sponsor listings
13178
- try {
13179
- var kvResp = await fetch('https://omnius.nexus/api/v1/sponsors', { signal: AbortSignal.timeout(5000) });
13186
+ // Query the OpenAgents Nexus worker for persisted sponsor listings
13187
+ try {
13188
+ var kvResp = await fetch(_nexusSponsorsUrl, { signal: AbortSignal.timeout(5000) });
13180
13189
  if (kvResp.ok) {
13181
13190
  var kvText = await kvResp.text();
13182
13191
  var kvData = kvText.trim() ? JSON.parse(kvText) : { sponsors: [] };
@@ -593445,7 +593454,7 @@ async function stepCohere(config, rl, availableRows) {
593445
593454
  { key: "desc1", label: "" },
593446
593455
  { key: "desc2", label: " COHERE lets your node collaborate with other sponsors" },
593447
593456
  { key: "desc3", label: " on the Omnius meshnet. When someone asks a question" },
593448
- { key: "desc4", label: " on omnius.nexus, your node can:" },
593457
+ { key: "desc4", label: " on openagents.nexus, your node can:" },
593449
593458
  { key: "desc5", label: "" },
593450
593459
  { key: "desc6", label: " • Answer queries using your local models" },
593451
593460
  { key: "desc7", label: " • Bid on questions based on model fit + GPU load" },
@@ -597897,13 +597906,19 @@ import { basename as basename23, dirname as dirname35, relative as relative11, j
597897
597906
  async function parseJsonResponse(resp, source) {
597898
597907
  const body = await resp.text();
597899
597908
  const trimmed = body.trim();
597909
+ const status = resp.status ? ` (HTTP ${resp.status})` : "";
597910
+ const ok3 = typeof resp.ok === "boolean" ? resp.ok : !resp.status || resp.status >= 200 && resp.status < 300;
597911
+ if (!ok3) {
597912
+ const preview = trimmed ? `: ${trimmed.slice(0, 160)}` : "";
597913
+ throw new Error(`${source} request failed${status}${preview}`);
597914
+ }
597900
597915
  if (!trimmed) {
597901
- throw new Error(`${source} returned an empty response${resp.status ? ` (HTTP ${resp.status})` : ""}`);
597916
+ throw new Error(`${source} returned an empty response${status}`);
597902
597917
  }
597903
597918
  try {
597904
597919
  return JSON.parse(trimmed);
597905
597920
  } catch {
597906
- throw new Error(`${source} returned malformed JSON${resp.status ? ` (HTTP ${resp.status})` : ""}`);
597921
+ throw new Error(`${source} returned malformed JSON${status}`);
597907
597922
  }
597908
597923
  }
597909
597924
  async function _immediateReregister(newUrl) {
@@ -597911,7 +597926,7 @@ async function _immediateReregister(newUrl) {
597911
597926
  _lastRegisteredSponsorPayload.tunnelUrl = newUrl;
597912
597927
  _lastRegisteredSponsorPayload.status = "active";
597913
597928
  try {
597914
- await fetch("https://omnius.nexus/api/v1/sponsors", {
597929
+ await fetch(NEXUS_SPONSORS_URL, {
597915
597930
  method: "POST",
597916
597931
  headers: { "Content-Type": "application/json" },
597917
597932
  body: JSON.stringify(_lastRegisteredSponsorPayload),
@@ -597976,7 +597991,7 @@ function startSponsorHeartbeat(payload, getExposeGateway) {
597976
597991
  }
597977
597992
  }
597978
597993
  try {
597979
- await fetch("https://omnius.nexus/api/v1/sponsors", {
597994
+ await fetch(NEXUS_SPONSORS_URL, {
597980
597995
  method: "POST",
597981
597996
  headers: { "Content-Type": "application/json" },
597982
597997
  body: JSON.stringify(_lastRegisteredSponsorPayload),
@@ -602280,10 +602295,11 @@ sleep 1
602280
602295
  });
602281
602296
  }
602282
602297
  try {
602283
- await fetch("https://omnius.nexus/api/v1/sponsors", {
602298
+ await fetch(NEXUS_SPONSORS_URL, {
602284
602299
  method: "POST",
602285
602300
  headers: { "Content-Type": "application/json" },
602286
602301
  body: JSON.stringify({
602302
+ peerId: pauseGw?.peerId || existingConfig.header?.message || "unknown",
602287
602303
  name: existingConfig.header?.message || "unknown",
602288
602304
  status: "inactive",
602289
602305
  tunnelUrl: pauseGw?.tunnelUrl || ""
@@ -602323,11 +602339,12 @@ sleep 1
602323
602339
  );
602324
602340
  try {
602325
602341
  const retirePayload = {
602342
+ peerId: existingConfig.header?.message || "unknown",
602326
602343
  name: existingConfig.header?.message || "unknown",
602327
602344
  status: "inactive",
602328
602345
  tunnelUrl: ""
602329
602346
  };
602330
- await fetch("https://omnius.nexus/api/v1/sponsors", {
602347
+ await fetch(NEXUS_SPONSORS_URL, {
602331
602348
  method: "POST",
602332
602349
  headers: { "Content-Type": "application/json" },
602333
602350
  body: JSON.stringify(retirePayload),
@@ -602366,10 +602383,11 @@ sleep 1
602366
602383
  saveSponsorConfig2(projectDir2, existingConfig);
602367
602384
  stopSponsorHeartbeat();
602368
602385
  try {
602369
- await fetch("https://omnius.nexus/api/v1/sponsors", {
602386
+ await fetch(NEXUS_SPONSORS_URL, {
602370
602387
  method: "POST",
602371
602388
  headers: { "Content-Type": "application/json" },
602372
602389
  body: JSON.stringify({
602390
+ peerId: existingConfig.header?.message || "unknown",
602373
602391
  name: existingConfig.header?.message || "unknown",
602374
602392
  status: "inactive"
602375
602393
  }),
@@ -602386,17 +602404,19 @@ sleep 1
602386
602404
  if (resumeGw && "setSponsorLimits" in resumeGw) {
602387
602405
  resumeGw.setSponsorLimits(existingConfig.rateLimits);
602388
602406
  }
602389
- if (resumeGw?.tunnelUrl) {
602407
+ if (resumeGw?.tunnelUrl || resumeGw?.peerId) {
602390
602408
  const resumePayload = {
602409
+ peerId: resumeGw.peerId || existingConfig.header?.message || "unknown",
602410
+ libp2pPeerId: resumeGw.peerId || "",
602391
602411
  name: existingConfig.header?.message || "Omnius Sponsor",
602392
- tunnelUrl: resumeGw.tunnelUrl,
602412
+ tunnelUrl: resumeGw.tunnelUrl || "",
602393
602413
  authKey: resumeGw.authKey || "",
602394
602414
  models: [],
602395
602415
  status: "active"
602396
602416
  };
602397
602417
  startSponsorHeartbeat(resumePayload, ctx3.getExposeGateway);
602398
602418
  try {
602399
- await fetch("https://omnius.nexus/api/v1/sponsors", {
602419
+ await fetch(NEXUS_SPONSORS_URL, {
602400
602420
  method: "POST",
602401
602421
  headers: { "Content-Type": "application/json" },
602402
602422
  body: JSON.stringify(resumePayload),
@@ -602791,7 +602811,7 @@ sleep 1
602791
602811
  };
602792
602812
  try {
602793
602813
  const kvResp = await fetch(
602794
- "https://omnius.nexus/api/v1/sponsors",
602814
+ NEXUS_SPONSORS_URL,
602795
602815
  {
602796
602816
  method: "POST",
602797
602817
  headers: { "Content-Type": "application/json" },
@@ -606354,6 +606374,32 @@ function mapNumberRecord(value2) {
606354
606374
  }
606355
606375
  return out;
606356
606376
  }
606377
+ function cleanCohereModelName(value2) {
606378
+ const raw = String(value2 ?? "").replace(/\x1B\[[0-?]*[ -/]*[@-~]/g, "").trim();
606379
+ if (!raw) return null;
606380
+ const withoutBadge = raw.replace(/^\[(?:EXPOSED|HIDDEN)\]\s*/i, "").trim();
606381
+ const lower = withoutBadge.toLowerCase();
606382
+ if (lower.startsWith("allowlist:") || lower.startsWith("models exposed:") || lower.startsWith("models available:") || lower.startsWith("endpoint:") || lower.startsWith("source:") || lower.startsWith("url:") || lower.includes("downloaded models") || lower.includes("no filter active") || lower.includes("embed") || lower.includes("nomic-bert") || lower.includes("rerank") || lower.includes("whisper") || lower.includes("tts")) {
606383
+ return null;
606384
+ }
606385
+ const beforeMeta = withoutBadge.split(" (")[0]?.trim() || withoutBadge;
606386
+ if (!beforeMeta || beforeMeta.startsWith("──")) return null;
606387
+ return beforeMeta;
606388
+ }
606389
+ function uniqueCohereModelNames(values) {
606390
+ const out = [];
606391
+ const seen = /* @__PURE__ */ new Set();
606392
+ for (const value2 of values) {
606393
+ const pieces = typeof value2 === "string" && value2.includes(",") ? value2.split(",") : [value2];
606394
+ for (const piece of pieces) {
606395
+ const name10 = cleanCohereModelName(piece);
606396
+ if (!name10 || seen.has(name10)) continue;
606397
+ seen.add(name10);
606398
+ out.push(name10);
606399
+ }
606400
+ }
606401
+ return out;
606402
+ }
606357
606403
  function parseCohereStatsOutput(output, isActive = false) {
606358
606404
  try {
606359
606405
  const parsed = JSON.parse(output);
@@ -606374,7 +606420,7 @@ function parseCohereStatsOutput(output, isActive = false) {
606374
606420
  bytesOut: numberField(parsed.bytesOut),
606375
606421
  modelsUsed: mapNumberRecord(parsed.modelsUsed),
606376
606422
  peersServed: mapNumberRecord(parsed.peersServed),
606377
- allowedModels: Array.isArray(parsed.allowedModels) ? parsed.allowedModels.map(String) : null,
606423
+ allowedModels: Array.isArray(parsed.allowedModels) ? uniqueCohereModelNames(parsed.allowedModels) : null,
606378
606424
  endpoint: {
606379
606425
  source: String(endpointRaw.source ?? "unknown"),
606380
606426
  passthrough: endpointRaw.passthrough === true,
@@ -606411,9 +606457,18 @@ async function fetchCohereDashboardState(ctx3) {
606411
606457
  if (r2.success) {
606412
606458
  try {
606413
606459
  const parsed = JSON.parse(r2.output);
606414
- state.modelList = Array.isArray(parsed.models) ? parsed.models.map(String) : [];
606460
+ if (Array.isArray(parsed.modelDetails)) {
606461
+ const exposedDetails = parsed.modelDetails.filter((model) => model?.exposed !== false).map((model) => model?.name);
606462
+ state.modelList = uniqueCohereModelNames(exposedDetails);
606463
+ }
606464
+ if (state.modelList.length === 0 && Array.isArray(parsed.exposedModels)) {
606465
+ state.modelList = uniqueCohereModelNames(parsed.exposedModels);
606466
+ }
606467
+ if (state.modelList.length === 0 && Array.isArray(parsed.models)) {
606468
+ state.modelList = uniqueCohereModelNames(parsed.models);
606469
+ }
606415
606470
  } catch {
606416
- state.modelList = r2.output.split("\n").map((l2) => l2.trim()).filter(Boolean);
606471
+ state.modelList = uniqueCohereModelNames(r2.output.split("\n"));
606417
606472
  }
606418
606473
  }
606419
606474
  } catch {
@@ -606438,8 +606493,8 @@ function cohereStatusLines(stats, modelList) {
606438
606493
  `Data: in ${formatFileSize(stats.bytesIn)} · out ${formatFileSize(stats.bytesOut)}`,
606439
606494
  "",
606440
606495
  `Endpoint: ${stats.endpoint.source}${stats.endpoint.passthrough ? " passthrough" : ""}${stats.endpoint.endpointUrl ? ` · ${stats.endpoint.endpointUrl}` : ""}`,
606441
- `Models available: ${modelList.length || stats.endpoint.modelCount}${stats.endpoint.cachedOnly ? " (cached)" : ""}`,
606442
- `Allowlist: ${stats.allowedModels ? stats.allowedModels.join(", ") || "(empty)" : "all endpoint models"}`,
606496
+ `Models exposed: ${modelList.length || stats.endpoint.modelCount}${stats.endpoint.cachedOnly ? " (cached)" : ""}`,
606497
+ `Allowlist: ${stats.allowedModels ? stats.allowedModels.join(", ") || "(empty)" : "ALL (no filter active)"}`,
606443
606498
  `Top models: ${modelEntries.length ? modelEntries.slice(0, 5).map(([m2, n2]) => `${m2} (${n2})`).join(", ") : "none yet"}`,
606444
606499
  `Peers served: ${peerEntries.length ? peerEntries.slice(0, 5).map(([p2, n2]) => `${p2.slice(0, 20)} (${n2})`).join(", ") : "none yet"}`
606445
606500
  ];
@@ -608053,7 +608108,7 @@ async function discoverSponsorMediaCandidates(ctx3, modality) {
608053
608108
  } catch {
608054
608109
  }
608055
608110
  try {
608056
- const resp = await fetch("https://omnius.nexus/api/v1/sponsors", { signal: AbortSignal.timeout(5e3) });
608111
+ const resp = await fetch(NEXUS_SPONSORS_URL, { signal: AbortSignal.timeout(5e3) });
608057
608112
  if (resp.ok) {
608058
608113
  const data = await parseJsonResponse(resp, "Sponsor directory");
608059
608114
  rawSponsors.push(...(data.sponsors ?? []).filter((s2) => s2.status === "active"));
@@ -608441,7 +608496,7 @@ async function handleSponsoredEndpoint(ctx3, local) {
608441
608496
  }
608442
608497
  }
608443
608498
  try {
608444
- const kvResp = await fetch("https://omnius.nexus/api/v1/sponsors", {
608499
+ const kvResp = await fetch(NEXUS_SPONSORS_URL, {
608445
608500
  signal: AbortSignal.timeout(5e3)
608446
608501
  });
608447
608502
  if (kvResp.ok) {
@@ -608645,7 +608700,8 @@ async function handleSponsoredEndpoint(ctx3, local) {
608645
608700
  selected.peerId,
608646
608701
  selected.authKey || void 0,
608647
608702
  ctx3,
608648
- local
608703
+ local,
608704
+ selected.models
608649
608705
  );
608650
608706
  } else {
608651
608707
  renderError(
@@ -608676,7 +608732,7 @@ async function handleSponsoredEndpoint(ctx3, local) {
608676
608732
  }
608677
608733
  renderInfo(`Connected to sponsored endpoint: ${selected.name}`);
608678
608734
  }
608679
- async function handlePeerEndpoint(peerId, authKey, ctx3, local) {
608735
+ async function handlePeerEndpoint(peerId, authKey, ctx3, local, advertisedModels = []) {
608680
608736
  process.stdout.write(`
608681
608737
  ${c3.dim("Detected:")} ${c3.bold("libp2p peer")}
608682
608738
  `);
@@ -608751,8 +608807,17 @@ async function handlePeerEndpoint(peerId, authKey, ctx3, local) {
608751
608807
 
608752
608808
  `
608753
608809
  );
608810
+ let models = [];
608754
608811
  try {
608755
- const models = await fetchModels(peerUrl, authKey);
608812
+ models = await fetchModels(peerUrl, authKey);
608813
+ if (models.length === 0 && advertisedModels.length > 0) {
608814
+ models = advertisedModels.map((name10) => ({
608815
+ name: name10,
608816
+ size: "unknown",
608817
+ modified: "",
608818
+ sizeBytes: 0
608819
+ }));
608820
+ }
608756
608821
  if (models.length > 0) {
608757
608822
  try {
608758
608823
  const { writeFileSync: writeFileSync76, mkdirSync: mkdirSync84 } = await import("node:fs");
@@ -608827,9 +608892,48 @@ async function handlePeerEndpoint(peerId, authKey, ctx3, local) {
608827
608892
  );
608828
608893
  }
608829
608894
  } catch {
608830
- renderWarning(
608831
- "Could not discover models on peer. Use /models to try again later."
608832
- );
608895
+ if (advertisedModels.length > 0) {
608896
+ models = advertisedModels.map((name10) => ({
608897
+ name: name10,
608898
+ size: "unknown",
608899
+ modified: "",
608900
+ sizeBytes: 0
608901
+ }));
608902
+ renderWarning("Live model probe failed; using sponsor directory model advertisement.");
608903
+ try {
608904
+ const { writeFileSync: writeFileSync76, mkdirSync: mkdirSync84 } = await import("node:fs");
608905
+ const { join: join154, dirname: dirname44 } = await import("node:path");
608906
+ const cachePath = join154(
608907
+ ctx3.repoRoot || process.cwd(),
608908
+ ".omnius",
608909
+ "nexus",
608910
+ "peer-models-cache.json"
608911
+ );
608912
+ mkdirSync84(dirname44(cachePath), { recursive: true });
608913
+ writeFileSync76(
608914
+ cachePath,
608915
+ JSON.stringify({
608916
+ peerId,
608917
+ cachedAt: (/* @__PURE__ */ new Date()).toISOString(),
608918
+ models: models.map((m2) => ({ name: m2.name, size: m2.size, parameterSize: m2.parameterSize }))
608919
+ }, null, 2)
608920
+ );
608921
+ } catch {
608922
+ }
608923
+ const currentModel = ctx3.config.model;
608924
+ const found = findModel(models, currentModel);
608925
+ if (!found && models.length > 0) {
608926
+ const autoModel = models[0].name;
608927
+ ctx3.setModel(autoModel);
608928
+ if (local) ctx3.saveLocalSettings({ model: autoModel });
608929
+ else ctx3.saveSettings({ model: autoModel });
608930
+ renderModelSwitch(currentModel, autoModel);
608931
+ }
608932
+ } else {
608933
+ renderWarning(
608934
+ "Could not discover models on peer. Use /models to try again later."
608935
+ );
608936
+ }
608833
608937
  }
608834
608938
  ctx3.refreshModelCache?.();
608835
608939
  if (ctx3.hasActiveTask?.()) {
@@ -611312,7 +611416,7 @@ async function showExposeDashboard(gateway, rl, ctx3) {
611312
611416
  renderInfo("Expose gateway stopped.");
611313
611417
  }
611314
611418
  }
611315
- var _sponsorHeartbeatTimer, _lastRegisteredSponsorPayload, __COMMAND_REGISTRY, DASH_INTERNAL;
611419
+ var NEXUS_DIRECTORY_ORIGIN, NEXUS_SPONSORS_URL, _sponsorHeartbeatTimer, _lastRegisteredSponsorPayload, __COMMAND_REGISTRY, DASH_INTERNAL;
611316
611420
  var init_commands = __esm({
611317
611421
  "packages/cli/src/tui/commands.ts"() {
611318
611422
  "use strict";
@@ -611343,6 +611447,8 @@ var init_commands = __esm({
611343
611447
  init_audio_waveform();
611344
611448
  init_neovim_mode();
611345
611449
  init_daemon_registry();
611450
+ NEXUS_DIRECTORY_ORIGIN = (process.env["OMNIUS_NEXUS_DIRECTORY_ORIGIN"] || process.env["OMNIUS_NEXUS_SIGNALING_SERVER"] || "https://openagents.nexus").replace(/\/+$/, "");
611451
+ NEXUS_SPONSORS_URL = `${NEXUS_DIRECTORY_ORIGIN}/api/v1/sponsors`;
611346
611452
  _sponsorHeartbeatTimer = null;
611347
611453
  _lastRegisteredSponsorPayload = null;
611348
611454
  __COMMAND_REGISTRY = /* @__PURE__ */ new Map();
@@ -652024,7 +652130,7 @@ async function refreshEndpointRegistry() {
652024
652130
  });
652025
652131
  if (process.env["OMNIUS_SKIP_SPONSOR_DISCOVERY"] === "1") return;
652026
652132
  try {
652027
- const resp = await fetch("https://omnius.nexus/api/v1/sponsors", {
652133
+ const resp = await fetch(NEXUS_SPONSORS_URL2, {
652028
652134
  signal: AbortSignal.timeout(5e3)
652029
652135
  });
652030
652136
  if (resp.ok) {
@@ -659591,7 +659697,7 @@ function setTimerEnabled(name10, enabled2) {
659591
659697
  return false;
659592
659698
  }
659593
659699
  }
659594
- var require4, endpointRegistry, modelRouteMap, endpointUsage, _lastEndpointDiagnostics, BACKEND_TIMEOUT_DEFAULT_MS, BACKEND_TIMEOUT_MAX_MS, MODEL_LIST_TIMEOUT_DEFAULT_MS, metrics, startedAt, runningProcesses, perKeyUsage, CRON_MARKER2;
659700
+ var require4, NEXUS_DIRECTORY_ORIGIN2, NEXUS_SPONSORS_URL2, endpointRegistry, modelRouteMap, endpointUsage, _lastEndpointDiagnostics, BACKEND_TIMEOUT_DEFAULT_MS, BACKEND_TIMEOUT_MAX_MS, MODEL_LIST_TIMEOUT_DEFAULT_MS, metrics, startedAt, runningProcesses, perKeyUsage, CRON_MARKER2;
659595
659701
  var init_serve = __esm({
659596
659702
  "packages/cli/src/api/serve.ts"() {
659597
659703
  "use strict";
@@ -659622,6 +659728,8 @@ var init_serve = __esm({
659622
659728
  init_docker();
659623
659729
  init_typed_node_events();
659624
659730
  require4 = createRequire7(import.meta.url);
659731
+ NEXUS_DIRECTORY_ORIGIN2 = (process.env["OMNIUS_NEXUS_DIRECTORY_ORIGIN"] || process.env["OMNIUS_NEXUS_SIGNALING_SERVER"] || "https://openagents.nexus").replace(/\/+$/, "");
659732
+ NEXUS_SPONSORS_URL2 = `${NEXUS_DIRECTORY_ORIGIN2}/api/v1/sponsors`;
659625
659733
  endpointRegistry = [];
659626
659734
  modelRouteMap = /* @__PURE__ */ new Map();
659627
659735
  endpointUsage = /* @__PURE__ */ new Map();
@@ -664739,7 +664847,7 @@ Log: ${nexusLogPath}`)
664739
664847
  const { getNodeMnemonic: getNodeMnemonic2 } = await Promise.resolve().then(() => (init_banner(), banner_exports));
664740
664848
  agName = getNodeMnemonic2();
664741
664849
  }
664742
- fetch("https://omnius.nexus/api/v1/directory", {
664850
+ fetch(NEXUS_AGENT_DIRECTORY_URL, {
664743
664851
  method: "POST",
664744
664852
  headers: { "Content-Type": "application/json" },
664745
664853
  body: JSON.stringify({
@@ -664783,7 +664891,7 @@ Log: ${nexusLogPath}`)
664783
664891
  } catch {
664784
664892
  }
664785
664893
  const spResp = await fetch(
664786
- "https://omnius.nexus/api/v1/sponsors",
664894
+ NEXUS_SPONSORS_URL3,
664787
664895
  { signal: AbortSignal.timeout(8e3) }
664788
664896
  );
664789
664897
  if (spResp.ok) {
@@ -668647,7 +668755,7 @@ Rules:
668647
668755
  process.exit(1);
668648
668756
  }
668649
668757
  }
668650
- var _interactiveSessionActive, _interactiveSessionReason, _voiceChatSession2, taskManager, _apiCallbacks, _shellToolRef, _replToolRef, _fullSubAgentToolRef, _agentToolRef, _sendMessageToolRef, _agentLifecycleMgr, _activeRunnerRef, _parentRunnerForArchive, _wireSubAgentCallbacks, _wireAgentToolCallbacks, _wireSubAgentToolCallbacks, _autoUpdatedThisSession, _mcpManager, _pluginManager, _mcpTools, SELF_IMPROVE_INTERVAL, _tasksSinceImprove;
668758
+ var NEXUS_DIRECTORY_ORIGIN3, NEXUS_AGENT_DIRECTORY_URL, NEXUS_SPONSORS_URL3, _interactiveSessionActive, _interactiveSessionReason, _voiceChatSession2, taskManager, _apiCallbacks, _shellToolRef, _replToolRef, _fullSubAgentToolRef, _agentToolRef, _sendMessageToolRef, _agentLifecycleMgr, _activeRunnerRef, _parentRunnerForArchive, _wireSubAgentCallbacks, _wireAgentToolCallbacks, _wireSubAgentToolCallbacks, _autoUpdatedThisSession, _mcpManager, _pluginManager, _mcpTools, SELF_IMPROVE_INTERVAL, _tasksSinceImprove;
668651
668759
  var init_interactive = __esm({
668652
668760
  "packages/cli/src/tui/interactive.ts"() {
668653
668761
  "use strict";
@@ -668702,6 +668810,9 @@ var init_interactive = __esm({
668702
668810
  init_neovim_mode();
668703
668811
  init_task_manager_singleton();
668704
668812
  init_tui_tasks_renderer();
668813
+ NEXUS_DIRECTORY_ORIGIN3 = (process.env["OMNIUS_NEXUS_DIRECTORY_ORIGIN"] || process.env["OMNIUS_NEXUS_SIGNALING_SERVER"] || "https://openagents.nexus").replace(/\/+$/, "");
668814
+ NEXUS_AGENT_DIRECTORY_URL = `${NEXUS_DIRECTORY_ORIGIN3}/api/v1/directory`;
668815
+ NEXUS_SPONSORS_URL3 = `${NEXUS_DIRECTORY_ORIGIN3}/api/v1/sponsors`;
668705
668816
  _interactiveSessionActive = false;
668706
668817
  _interactiveSessionReason = "";
668707
668818
  _voiceChatSession2 = null;
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.156",
3
+ "version": "1.0.157",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.156",
9
+ "version": "1.0.157",
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.156",
3
+ "version": "1.0.157",
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",