@moxt-ai/mobius 0.0.57 → 0.0.58

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/cli.js CHANGED
@@ -11,7 +11,7 @@ import { mkdir as mkdir5 } from "node:fs/promises";
11
11
  // package.json
12
12
  var package_default = {
13
13
  name: "@moxt-ai/mobius",
14
- version: "0.0.57",
14
+ version: "0.0.58",
15
15
  description: "Mobius CLI for pairing and running local AI agent services.",
16
16
  type: "module",
17
17
  bin: {
@@ -41070,9 +41070,24 @@ async function installDetectedAgentIntegrations(config2, installations, signal)
41070
41070
  );
41071
41071
  }
41072
41072
  }
41073
+ async function retainStillInstalledAgents(previous2, refreshed, signal) {
41074
+ const refreshedIdentifiers = new Set(refreshed.map((agent) => agent.id));
41075
+ const retained = [];
41076
+ for (const agent of previous2) {
41077
+ if (refreshedIdentifiers.has(agent.id)) {
41078
+ continue;
41079
+ }
41080
+ signal.throwIfAborted();
41081
+ if (await revalidateExecutable(agent.agentIdentity)) {
41082
+ retained.push(agent);
41083
+ }
41084
+ }
41085
+ return Object.freeze([...refreshed, ...retained]);
41086
+ }
41073
41087
  async function refreshAgentCatalog(config2, resolveEnvironment, signal) {
41074
41088
  signal.throwIfAborted();
41075
- const environment = await resolveEnvironment(signal);
41089
+ const shellEnvironment = await resolveEnvironment(signal);
41090
+ const environment = new DaemonLocalContext(config2.localContext.stateDirectory, shellEnvironment).environment;
41076
41091
  signal.throwIfAborted();
41077
41092
  const inventory = await discoverLocalAgentInventory({
41078
41093
  defaultWorkspace: config2.defaultWorkspace,
@@ -41080,9 +41095,12 @@ async function refreshAgentCatalog(config2, resolveEnvironment, signal) {
41080
41095
  signal
41081
41096
  });
41082
41097
  const previousCatalog = config2.catalog.read();
41098
+ const refreshedAgents = inventory.readyAgents().map((agent) => withDaemonEnvironment(agent, environment));
41099
+ const agents = await retainStillInstalledAgents(previousCatalog.agents, refreshedAgents, signal);
41100
+ const verifiedIdentifiers = new Set(agents.map((agent) => agent.id));
41083
41101
  config2.catalog.transition(
41084
- inventory.readyAgents().map((agent) => withDaemonEnvironment(agent, environment)),
41085
- inventory.installable
41102
+ agents,
41103
+ inventory.installable.filter((agent) => !verifiedIdentifiers.has(agent.id))
41086
41104
  );
41087
41105
  try {
41088
41106
  await publishAgentCatalog(config2, signal);