@mutagent/cli 0.1.141 → 0.1.142

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/bin/cli.js CHANGED
@@ -6058,20 +6058,28 @@ ${chalk16.bold("Hit a bug or unexpected result?")}
6058
6058
  try {
6059
6059
  const providers = await client.listProviders();
6060
6060
  if (providers.data && providers.data.length > 0) {
6061
- const configuredTypes = [...new Set(providers.data.map((p) => p.type))];
6062
- const modelFamilies = getModelFamiliesForProviderTypes(configuredTypes);
6063
- const modelLower = options.model.toLowerCase();
6064
- const matchedFamily = modelFamilies.find(({ prefixes }) => prefixes.some((prefix) => modelLower.startsWith(prefix)));
6065
- if (!matchedFamily) {
6066
- const supportedModels = modelFamilies.flatMap((f) => f.examples).join(", ");
6067
- const errorMsg = `Model '${options.model}' is not supported by any configured provider. ` + `Your providers: [${configuredTypes.join(", ")}]. ` + `Supported models: ${supportedModels || "(unknown — check mutagent providers list --json)"}. ` + `Run: mutagent providers list --json`;
6068
- if (isJson) {
6069
- output.output({ success: false, error: errorMsg, code: "MODEL_NOT_SUPPORTED" });
6061
+ const configuredTypes = [
6062
+ ...new Set(providers.data.map((p) => p.type).filter(Boolean))
6063
+ ];
6064
+ if (configuredTypes.length === 0) {
6065
+ if (!isJson) {
6066
+ output.warn(`Provider type info unavailable in listProviders response — skipping client-side model validation. Server will enforce whitelist.`);
6067
+ }
6068
+ } else {
6069
+ const modelFamilies = getModelFamiliesForProviderTypes(configuredTypes);
6070
+ const modelLower = options.model.toLowerCase();
6071
+ const matchedFamily = modelFamilies.find(({ prefixes }) => prefixes.some((prefix) => modelLower.startsWith(prefix)));
6072
+ if (!matchedFamily) {
6073
+ const supportedModels = modelFamilies.flatMap((f) => f.examples).join(", ");
6074
+ const errorMsg = `Model '${options.model}' is not supported by any configured provider. ` + `Your providers: [${configuredTypes.join(", ")}]. ` + `Supported models: ${supportedModels || "(unknown — check mutagent providers list --json)"}. ` + `Run: mutagent providers list --json`;
6075
+ if (isJson) {
6076
+ output.output({ success: false, error: errorMsg, code: "MODEL_NOT_SUPPORTED" });
6077
+ return;
6078
+ }
6079
+ output.error(errorMsg);
6080
+ process.exitCode = 1;
6070
6081
  return;
6071
6082
  }
6072
- output.error(errorMsg);
6073
- process.exitCode = 1;
6074
- return;
6075
6083
  }
6076
6084
  }
6077
6085
  } catch {}
@@ -12010,5 +12018,5 @@ if (isInteractive && !isSkillCommand) {
12010
12018
  }
12011
12019
  program.parse();
12012
12020
 
12013
- //# debugId=9845BF283636AD6E64756E2164756E21
12021
+ //# debugId=7B63A61BDC73994664756E2164756E21
12014
12022
  //# sourceMappingURL=cli.js.map