@moxt-ai/mobius 0.0.56 → 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.56",
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: {
@@ -40449,8 +40449,19 @@ async function discoverModelEffort(command, agent, resolution, initialOptions, s
40449
40449
  }
40450
40450
  const selectedEffort2 = effortOption(selectedOptions);
40451
40451
  valuesByModel[command.model] = selectedEffort2?.type === "select" ? selectedEffort2.values : [];
40452
+ return {
40453
+ effortSettingId: selectedEffort2?.id ?? "",
40454
+ modelSettingId: model.id,
40455
+ resolution: "on_model_selection",
40456
+ valuesByModel
40457
+ };
40458
+ }
40459
+ const defaultModel = model.type === "select" ? model.currentValue : "";
40460
+ const reportedEffort = effortOption(selectedOptions);
40461
+ const selectedEffort = defaultModel.length > 0 && reportedEffort === void 0 ? effortOption(await inspectModel(defaultModel)) : reportedEffort;
40462
+ if (defaultModel.length > 0) {
40463
+ valuesByModel[defaultModel] = selectedEffort?.type === "select" ? selectedEffort.values : [];
40452
40464
  }
40453
- const selectedEffort = effortOption(selectedOptions);
40454
40465
  return {
40455
40466
  effortSettingId: selectedEffort?.id ?? "",
40456
40467
  modelSettingId: model.id,
@@ -41059,9 +41070,24 @@ async function installDetectedAgentIntegrations(config2, installations, signal)
41059
41070
  );
41060
41071
  }
41061
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
+ }
41062
41087
  async function refreshAgentCatalog(config2, resolveEnvironment, signal) {
41063
41088
  signal.throwIfAborted();
41064
- const environment = await resolveEnvironment(signal);
41089
+ const shellEnvironment = await resolveEnvironment(signal);
41090
+ const environment = new DaemonLocalContext(config2.localContext.stateDirectory, shellEnvironment).environment;
41065
41091
  signal.throwIfAborted();
41066
41092
  const inventory = await discoverLocalAgentInventory({
41067
41093
  defaultWorkspace: config2.defaultWorkspace,
@@ -41069,9 +41095,12 @@ async function refreshAgentCatalog(config2, resolveEnvironment, signal) {
41069
41095
  signal
41070
41096
  });
41071
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));
41072
41101
  config2.catalog.transition(
41073
- inventory.readyAgents().map((agent) => withDaemonEnvironment(agent, environment)),
41074
- inventory.installable
41102
+ agents,
41103
+ inventory.installable.filter((agent) => !verifiedIdentifiers.has(agent.id))
41075
41104
  );
41076
41105
  try {
41077
41106
  await publishAgentCatalog(config2, signal);