open-agents-ai 0.141.4 → 0.141.6

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 +71 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -42482,6 +42482,26 @@ async function handleSlashCommand(input, ctx) {
42482
42482
  const ipfsSubCmd = (arg || "").trim().split(/\s+/);
42483
42483
  const ipfsAction = ipfsSubCmd[0]?.toLowerCase() || "";
42484
42484
  const ipfsArg = ipfsSubCmd.slice(1).join(" ");
42485
+ const ensureDaemon = async () => {
42486
+ try {
42487
+ const { NexusTool: NexusTool2 } = __require("@open-agents/execution");
42488
+ const nexus = new NexusTool2(ctx.repoRoot);
42489
+ const statusResult = await nexus.execute({ action: "status" });
42490
+ if (statusResult.success && statusResult.output.includes("connected"))
42491
+ return true;
42492
+ renderInfo("Starting nexus daemon for IPFS...");
42493
+ const connectResult = await nexus.execute({ action: "connect" });
42494
+ if (connectResult.success) {
42495
+ await new Promise((r) => setTimeout(r, 2e3));
42496
+ return true;
42497
+ }
42498
+ renderWarning("Could not start nexus daemon. IPFS operations require /connect first.");
42499
+ return false;
42500
+ } catch {
42501
+ renderWarning("Nexus daemon unavailable. Run /connect to enable IPFS.");
42502
+ return false;
42503
+ }
42504
+ };
42485
42505
  if (ipfsAction === "pin" && ipfsArg) {
42486
42506
  const cidToPin = ipfsArg.trim();
42487
42507
  if (!cidToPin.startsWith("bafy") && !cidToPin.startsWith("bafk") && !cidToPin.startsWith("Qm")) {
@@ -42489,6 +42509,8 @@ async function handleSlashCommand(input, ctx) {
42489
42509
  return "handled";
42490
42510
  }
42491
42511
  try {
42512
+ if (!await ensureDaemon())
42513
+ return "handled";
42492
42514
  const { NexusTool: NexusTool2 } = __require("@open-agents/execution");
42493
42515
  const nexus = new NexusTool2(ctx.repoRoot);
42494
42516
  const result = await nexus.execute({ action: "ipfs_pin", cid: cidToPin, source: "user-pin" });
@@ -42640,6 +42662,7 @@ async function handleSlashCommand(input, ctx) {
42640
42662
  }
42641
42663
  return "handled";
42642
42664
  }
42665
+ await ensureDaemon();
42643
42666
  const lines = [];
42644
42667
  lines.push(`
42645
42668
  ${c2.bold("IPFS / Helia Status")}
@@ -43332,8 +43355,17 @@ async function handleSlashCommand(input, ctx) {
43332
43355
  const cohereAction = cohereSubCmd[0]?.toLowerCase() || "";
43333
43356
  if (cohereAction === "stats") {
43334
43357
  try {
43335
- const { NexusTool: NexusTool2 } = __require("../../execution/dist/tools/nexus.js");
43358
+ const { NexusTool: NexusTool2 } = __require("@open-agents/execution");
43336
43359
  const nexusTool = new NexusTool2(ctx.repoRoot || process.cwd());
43360
+ try {
43361
+ const st = await nexusTool.execute({ action: "status" });
43362
+ if (!st.success || !st.output.includes("connected")) {
43363
+ renderInfo("Connecting to nexus daemon...");
43364
+ await nexusTool.execute({ action: "connect" });
43365
+ await new Promise((r) => setTimeout(r, 1e3));
43366
+ }
43367
+ } catch {
43368
+ }
43337
43369
  const result = await nexusTool.execute({ action: "cohere_stats" });
43338
43370
  if (result.success) {
43339
43371
  renderInfo(result.output);
@@ -43385,11 +43417,13 @@ async function handleSlashCommand(input, ctx) {
43385
43417
  if (ctx.cohereToggle) {
43386
43418
  const active = ctx.cohereToggle();
43387
43419
  if (active) {
43388
- renderInfo("COHERE enabled \u2014 participating in distributed cognitive commons");
43389
- renderInfo("Your identity kernel and memory deltas will be shared with the mesh");
43390
- renderInfo("Use /cohere again to disconnect, /cohere stats for network info");
43420
+ renderInfo("COHERE enabled \u2014 joining distributed cognitive commons");
43421
+ renderInfo(`Forwarding inference: ${ctx.config.backendUrl} (${ctx.config.model})`);
43422
+ renderInfo("Auto-connecting to nexus mesh + exposing local inference...");
43423
+ renderInfo("Use /cohere stats for network info, /cohere again to disconnect");
43391
43424
  } else {
43392
43425
  renderInfo("COHERE disabled \u2014 disconnected from cognitive commons");
43426
+ renderInfo("Local inference no longer forwarded to mesh");
43393
43427
  }
43394
43428
  } else {
43395
43429
  renderWarning("COHERE not available \u2014 requires nexus connection (/expose or /p2p)");
@@ -58443,12 +58477,39 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
58443
58477
  statusBar.setCohereActive(cohereEnabled);
58444
58478
  saveProjectSettings(repoRoot, { cohere: cohereEnabled });
58445
58479
  saveGlobalSettings({ cohere: cohereEnabled });
58446
- try {
58447
- const { NexusTool: NexusTool2 } = __require("../../execution/dist/tools/nexus.js");
58448
- const nexusTool = new NexusTool2(repoRoot);
58449
- nexusTool.execute({ action: cohereEnabled ? "cohere_enable" : "cohere_disable" }).catch(() => {
58450
- });
58451
- } catch {
58480
+ if (cohereEnabled) {
58481
+ (async () => {
58482
+ try {
58483
+ const { NexusTool: NexusTool2 } = __require("@open-agents/execution");
58484
+ const nexusTool = new NexusTool2(repoRoot);
58485
+ try {
58486
+ const st = await nexusTool.execute({ action: "status" });
58487
+ if (!st.success || !st.output.includes("connected")) {
58488
+ await nexusTool.execute({ action: "connect" });
58489
+ await new Promise((r) => setTimeout(r, 1500));
58490
+ }
58491
+ } catch {
58492
+ }
58493
+ await nexusTool.execute({ action: "cohere_enable" }).catch(() => {
58494
+ });
58495
+ } catch {
58496
+ }
58497
+ try {
58498
+ if (!commandCtx.isExposeActive?.()) {
58499
+ writeContent(() => renderInfo("COHERE: exposing local inference to mesh..."));
58500
+ await commandCtx.exposeStart?.("passthrough");
58501
+ }
58502
+ } catch {
58503
+ }
58504
+ })();
58505
+ } else {
58506
+ try {
58507
+ const { NexusTool: NexusTool2 } = __require("@open-agents/execution");
58508
+ const nexusTool = new NexusTool2(repoRoot);
58509
+ nexusTool.execute({ action: "cohere_disable" }).catch(() => {
58510
+ });
58511
+ } catch {
58512
+ }
58452
58513
  }
58453
58514
  return cohereEnabled;
58454
58515
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.141.4",
3
+ "version": "0.141.6",
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",