open-agents-ai 0.184.17 → 0.184.18

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.
Files changed (2) hide show
  1. package/dist/index.js +41 -31
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -48019,53 +48019,63 @@ async function handleSlashCommand(input, ctx) {
48019
48019
  ollamaUrl: "http://localhost:11434",
48020
48020
  availableRows: ctx.availableContentRows?.(),
48021
48021
  onGoLive: async (config) => {
48022
- if (config.transport.libp2p) {
48023
- try {
48024
- const nexus = new NexusTool(projectDir);
48025
- renderInfo("Connecting to nexus P2P mesh...");
48026
- await nexus.execute({ action: "connect" });
48027
- await new Promise((r) => setTimeout(r, 3e3));
48028
- renderInfo("Nexus daemon connected.");
48029
- } catch (err) {
48030
- renderWarning(`Nexus auto-connect: ${err instanceof Error ? err.message : String(err)}`);
48031
- }
48032
- }
48022
+ const existingGateway = ctx.getExposeGateway?.();
48023
+ const tunnelAlreadyActive = existingGateway?.isActive && existingGateway?.tunnelUrl;
48024
+ const p2pAlreadyActive = ctx.isExposeActive?.() && !existingGateway?.tunnelUrl;
48033
48025
  if (config.transport.cloudflared && ctx.exposeStart) {
48034
- try {
48035
- const url = await ctx.exposeStart("ollama", void 0, "tunnel");
48036
- if (url) {
48037
- renderInfo(`Tunnel: ${url}`);
48038
- const gateway = ctx.getExposeGateway?.();
48039
- if (gateway && "setSponsorLimits" in gateway) {
48040
- gateway.setSponsorLimits(config.rateLimits);
48041
- renderInfo(`Rate limits active: ${config.rateLimits.maxRequestsPerMinute} req/min, ${config.rateLimits.maxTokensPerDay.toLocaleString()} tokens/day`);
48026
+ if (tunnelAlreadyActive) {
48027
+ renderInfo(`Tunnel already active: ${existingGateway.tunnelUrl}`);
48028
+ if ("setSponsorLimits" in existingGateway) {
48029
+ existingGateway.setSponsorLimits(config.rateLimits);
48030
+ }
48031
+ renderInfo(`Rate limits updated: ${config.rateLimits.maxRequestsPerMinute} req/min, ${config.rateLimits.maxTokensPerDay.toLocaleString()} tokens/day`);
48032
+ } else {
48033
+ try {
48034
+ const url = await ctx.exposeStart("ollama", void 0, "tunnel");
48035
+ if (url) {
48036
+ renderInfo(`Tunnel: ${url}`);
48037
+ const gw = ctx.getExposeGateway?.();
48038
+ if (gw && "setSponsorLimits" in gw) {
48039
+ gw.setSponsorLimits(config.rateLimits);
48040
+ renderInfo(`Rate limits active: ${config.rateLimits.maxRequestsPerMinute} req/min, ${config.rateLimits.maxTokensPerDay.toLocaleString()} tokens/day`);
48041
+ }
48042
48042
  }
48043
+ } catch (err) {
48044
+ renderError(`Tunnel start failed: ${err instanceof Error ? err.message : String(err)}`);
48043
48045
  }
48044
- } catch (err) {
48045
- renderError(`Tunnel start failed: ${err instanceof Error ? err.message : String(err)}`);
48046
48046
  }
48047
48047
  }
48048
48048
  if (config.transport.libp2p && ctx.exposeStart) {
48049
48049
  try {
48050
- const url = await ctx.exposeStart("ollama", void 0, "libp2p");
48051
- if (url) {
48052
- renderInfo(`P2P: ${url}`);
48053
- const gateway = ctx.getExposeGateway?.();
48054
- if (gateway && "setSponsorLimits" in gateway) {
48055
- gateway.setSponsorLimits(config.rateLimits);
48056
- }
48057
- }
48050
+ const nexus = new NexusTool(projectDir);
48051
+ renderInfo("Ensuring nexus daemon is connected...");
48052
+ await nexus.execute({ action: "connect" });
48053
+ await new Promise((r) => setTimeout(r, 2e3));
48058
48054
  } catch (err) {
48059
- renderError(`P2P start failed: ${err instanceof Error ? err.message : String(err)}`);
48055
+ renderWarning(`Nexus: ${err instanceof Error ? err.message : String(err)}`);
48056
+ }
48057
+ if (!p2pAlreadyActive) {
48058
+ try {
48059
+ const url = await ctx.exposeStart("ollama", void 0, "libp2p");
48060
+ if (url)
48061
+ renderInfo(`P2P: ${url}`);
48062
+ } catch (err) {
48063
+ renderError(`P2P start failed: ${err instanceof Error ? err.message : String(err)}`);
48064
+ }
48065
+ } else {
48066
+ renderInfo("P2P gateway already active.");
48060
48067
  }
48061
48068
  }
48069
+ const activeGw = ctx.getExposeGateway?.();
48070
+ if (activeGw && "setSponsorLimits" in activeGw) {
48071
+ activeGw.setSponsorLimits(config.rateLimits);
48072
+ }
48062
48073
  try {
48063
48074
  const nexus = new NexusTool(projectDir);
48064
48075
  try {
48065
48076
  await nexus.execute({ action: "connect" });
48066
48077
  } catch {
48067
48078
  }
48068
- await new Promise((r) => setTimeout(r, 2e3));
48069
48079
  const tunnelGw = ctx.getExposeGateway?.();
48070
48080
  const enabledEps = config.endpoints.filter((e) => e.enabled);
48071
48081
  const allModels = enabledEps.flatMap((e) => e.models || []);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.184.17",
3
+ "version": "0.184.18",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) \u2014 interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",