@unity-china/codely-cli 1.0.0-beta.42 → 1.0.0-beta.43

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/bundle/gemini.js +30 -50
  2. package/package.json +1 -1
package/bundle/gemini.js CHANGED
@@ -72954,7 +72954,7 @@ var init_models = __esm({
72954
72954
  "packages/core/dist/src/config/models.js"() {
72955
72955
  "use strict";
72956
72956
  init_esbuild_polyfill();
72957
- DEFAULT_QWEN_MODEL = "qwen3-coder-480b-a35b-instruct-fp8";
72957
+ DEFAULT_QWEN_MODEL = "qwen3-flash";
72958
72958
  DEFAULT_QWEN_FLASH_MODEL = "qwen3-flash";
72959
72959
  DEFAULT_CODELY_MODEL = "glm-4.7-fp8";
72960
72960
  DEFAULT_GEMINI_MODEL = DEFAULT_CODELY_MODEL;
@@ -269948,13 +269948,18 @@ var init_codelyContentGenerator = __esm({
269948
269948
 
269949
269949
  // packages/core/dist/src/core/contentGenerator.js
269950
269950
  function createContentGeneratorConfig(config4, authType) {
269951
- const geminiApiKey = process.env.GEMINI_API_KEY || void 0;
269952
- const googleApiKey = process.env.GOOGLE_API_KEY || void 0;
269953
- const googleCloudProject = process.env.GOOGLE_CLOUD_PROJECT || void 0;
269954
- const googleCloudLocation = process.env.GOOGLE_CLOUD_LOCATION || void 0;
269955
- const openaiApiKey = process.env.OPENAI_API_KEY;
269956
- const openaiBaseUrl = process.env.OPENAI_BASE_URL || "https://codely-litellm.tuanjie.cn/v1";
269957
- const openaiModel = process.env.OPENAI_MODEL || DEFAULT_QWEN_MODEL;
269951
+ const CODELY_DEFAULT_OPENAI_COMPAT_BASE_URL = "https://codely-litellm.tuanjie.cn/v1";
269952
+ const customAuthEnabled = !!process.env.CUSTOM_AUTH;
269953
+ const allowGeminiEnv = customAuthEnabled && authType === AuthType3.USE_GEMINI;
269954
+ const allowVertexEnv = customAuthEnabled && authType === AuthType3.USE_VERTEX_AI;
269955
+ const allowOpenAIEnv = customAuthEnabled && authType === AuthType3.USE_OPENAI;
269956
+ const geminiApiKey = allowGeminiEnv ? process.env.GEMINI_API_KEY : void 0;
269957
+ const googleApiKey = allowVertexEnv ? process.env.GOOGLE_API_KEY : void 0;
269958
+ const googleCloudProject = allowVertexEnv ? process.env.GOOGLE_CLOUD_PROJECT : void 0;
269959
+ const googleCloudLocation = allowVertexEnv ? process.env.GOOGLE_CLOUD_LOCATION : void 0;
269960
+ const openaiApiKey = allowOpenAIEnv ? process.env.OPENAI_API_KEY : void 0;
269961
+ const openaiBaseUrl = allowOpenAIEnv ? process.env.OPENAI_BASE_URL || CODELY_DEFAULT_OPENAI_COMPAT_BASE_URL : CODELY_DEFAULT_OPENAI_COMPAT_BASE_URL;
269962
+ const openaiModel = allowOpenAIEnv ? process.env.OPENAI_MODEL || DEFAULT_QWEN_MODEL : void 0;
269958
269963
  const configModel = config4.getModel();
269959
269964
  const effectiveModel = configModel && typeof configModel === "string" ? configModel : DEFAULT_GEMINI_MODEL;
269960
269965
  const mergedSamplingParams = config4.getContentGeneratorSamplingParams();
@@ -270002,10 +270007,9 @@ function createContentGeneratorConfig(config4, authType) {
270002
270007
  return contentGeneratorConfig;
270003
270008
  }
270004
270009
  if (authType === AuthType3.CODELY_OAUTH) {
270005
- contentGeneratorConfig.apiKey = openaiApiKey || "CODELY_OAUTH_DYNAMIC_TOKEN";
270006
- contentGeneratorConfig.baseUrl = openaiBaseUrl;
270010
+ contentGeneratorConfig.apiKey = "CODELY_OAUTH_DYNAMIC_TOKEN";
270011
+ contentGeneratorConfig.baseUrl = CODELY_DEFAULT_OPENAI_COMPAT_BASE_URL;
270007
270012
  contentGeneratorConfig.model = config4.getModel() || // Use the model from config (e.g. from --model CLI arg)
270008
- openaiModel || // Fall back to OPENAI_MODEL env var
270009
270013
  DEFAULT_QWEN_MODEL;
270010
270014
  return contentGeneratorConfig;
270011
270015
  }
@@ -419214,7 +419218,7 @@ async function getPackageJson2() {
419214
419218
  // packages/cli/src/utils/version.ts
419215
419219
  async function getCliVersion() {
419216
419220
  const pkgJson = await getPackageJson2();
419217
- return "1.0.0-beta.42";
419221
+ return "1.0.0-beta.43";
419218
419222
  }
419219
419223
 
419220
419224
  // packages/cli/src/ui/commands/types.ts
@@ -419747,7 +419751,7 @@ import process30 from "node:process";
419747
419751
 
419748
419752
  // packages/cli/src/generated/git-commit.ts
419749
419753
  init_esbuild_polyfill();
419750
- var GIT_COMMIT_INFO = "9ad807a5";
419754
+ var GIT_COMMIT_INFO = "92247f00";
419751
419755
 
419752
419756
  // packages/cli/src/ui/commands/bugCommand.ts
419753
419757
  var bugCommand = {
@@ -485846,6 +485850,12 @@ init_esbuild_polyfill();
485846
485850
  init_dist6();
485847
485851
  var validateAuthMethod = (authMethod) => {
485848
485852
  loadEnvironment();
485853
+ if (!Object.values(AuthType3).includes(authMethod)) {
485854
+ return "Invalid auth method selected.";
485855
+ }
485856
+ if (!process.env.CUSTOM_AUTH && authMethod !== AuthType3.CODELY_OAUTH && authMethod !== AuthType3.LOGIN_WITH_GOOGLE && authMethod !== AuthType3.CLOUD_SHELL) {
485857
+ return "CUSTOM_AUTH is required for non-default authentication providers.";
485858
+ }
485849
485859
  if (authMethod === AuthType3.LOGIN_WITH_GOOGLE || authMethod === AuthType3.CLOUD_SHELL) {
485850
485860
  return null;
485851
485861
  }
@@ -486031,12 +486041,6 @@ function OpenAIKeyPrompt({
486031
486041
 
486032
486042
  // packages/cli/src/ui/components/AuthDialog.tsx
486033
486043
  var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
486034
- function parseDefaultAuthType(defaultAuthType) {
486035
- if (defaultAuthType && Object.values(AuthType3).includes(defaultAuthType)) {
486036
- return defaultAuthType;
486037
- }
486038
- return null;
486039
- }
486040
486044
  function AuthDialog({
486041
486045
  onSelect,
486042
486046
  settings,
@@ -486061,19 +486065,7 @@ function AuthDialog({
486061
486065
  if (settings.merged.selectedAuthType) {
486062
486066
  return item.value === settings.merged.selectedAuthType;
486063
486067
  }
486064
- const defaultAuthType = parseDefaultAuthType(
486065
- process.env.GEMINI_DEFAULT_AUTH_TYPE
486066
- );
486067
- if (defaultAuthType) {
486068
- return item.value === defaultAuthType;
486069
- }
486070
- if (process.env.GEMINI_API_KEY) {
486071
- return item.value === AuthType3.USE_GEMINI;
486072
- }
486073
- if (process.env.QWEN_OAUTH_TOKEN) {
486074
- return item.value === AuthType3.QWEN_OAUTH;
486075
- }
486076
- return item.value === AuthType3.LOGIN_WITH_GOOGLE;
486068
+ return item.value === AuthType3.CODELY_OAUTH;
486077
486069
  })
486078
486070
  );
486079
486071
  const handleAuthSelect = (authMethod) => {
@@ -493170,29 +493162,17 @@ init_dist6();
493170
493162
  // packages/cli/src/validateNonInterActiveAuth.ts
493171
493163
  init_esbuild_polyfill();
493172
493164
  init_dist6();
493173
- function getAuthTypeFromEnv() {
493174
- if (process.env.GOOGLE_GENAI_USE_GCA === "true") {
493175
- return AuthType3.LOGIN_WITH_GOOGLE;
493176
- }
493177
- if (process.env.GOOGLE_GENAI_USE_VERTEXAI === "true") {
493178
- return AuthType3.USE_VERTEX_AI;
493179
- }
493180
- if (process.env.GEMINI_API_KEY) {
493181
- return AuthType3.USE_GEMINI;
493182
- }
493183
- if (process.env.OPENAI_API_KEY) {
493184
- return AuthType3.USE_OPENAI;
493185
- }
493186
- if (process.env.QWEN_OAUTH_TOKEN) {
493187
- return AuthType3.QWEN_OAUTH;
493165
+ function resolveEffectiveAuthType(configuredAuthType) {
493166
+ if (!process.env.CUSTOM_AUTH) {
493167
+ return AuthType3.CODELY_OAUTH;
493188
493168
  }
493189
- return void 0;
493169
+ return configuredAuthType || AuthType3.CODELY_OAUTH;
493190
493170
  }
493191
493171
  async function validateNonInteractiveAuth(configuredAuthType, useExternalAuth, nonInteractiveConfig) {
493192
- const effectiveAuthType = configuredAuthType || getAuthTypeFromEnv() || AuthType3.CODELY_OAUTH;
493172
+ const effectiveAuthType = resolveEffectiveAuthType(configuredAuthType);
493193
493173
  if (!effectiveAuthType) {
493194
493174
  console.error(
493195
- `Please set an Auth method in your ${USER_SETTINGS_PATH} or specify one of the following environment variables before running: GEMINI_API_KEY, OPENAI_API_KEY, GOOGLE_GENAI_USE_VERTEXAI, GOOGLE_GENAI_USE_GCA`
493175
+ `Please set an Auth method in your ${USER_SETTINGS_PATH} (or pass --auth-type).`
493196
493176
  );
493197
493177
  process.exit(1);
493198
493178
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unity-china/codely-cli",
3
- "version": "1.0.0-beta.42",
3
+ "version": "1.0.0-beta.43",
4
4
  "engines": {
5
5
  "node": ">=20.0.0"
6
6
  },