@kenkaiiii/gg-ai 5.55.1 → 5.56.0

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/index.cjs CHANGED
@@ -1052,7 +1052,7 @@ function toOpenAIMessages(messages, options) {
1052
1052
  (part) => {
1053
1053
  if (part.type === "text") return { type: "text", text: part.text };
1054
1054
  if (part.type === "video") {
1055
- const videoUrl = part.fileId ? { url: `ms://${part.fileId}`, id: part.fileId } : { url: `data:${part.mediaType};base64,${part.data}` };
1055
+ const videoUrl = options?.provider === "moonshot" && part.fileId ? { url: `ms://${part.fileId}`, id: part.fileId } : { url: `data:${part.mediaType};base64,${part.data}` };
1056
1056
  return {
1057
1057
  type: "video_url",
1058
1058
  video_url: videoUrl
@@ -1990,7 +1990,7 @@ async function* runStream2(options) {
1990
1990
  const k3Effort = options.thinking ? toKimiK3Effort(options.thinking) : void 0;
1991
1991
  const isKimiK27 = options.provider === "moonshot" && options.model.startsWith("kimi-k2.7-code");
1992
1992
  const hasFixedKimiSampling = isKimiK3 || isKimiK27;
1993
- const usesThinkingParam = options.provider === "glm" || options.provider === "moonshot" && !isKimiK3 && !isKimiK27 || options.provider === "xiaomi";
1993
+ const usesThinkingParam = options.provider === "deepseek" || options.provider === "glm" || options.provider === "moonshot" && !isKimiK3 && !isKimiK27 || options.provider === "xiaomi";
1994
1994
  const downgradedImages = downgradeUnsupportedImages(options.messages, options.supportsImages);
1995
1995
  const downgradedMessages = downgradeUnsupportedVideos(downgradedImages, options.supportsVideo);
1996
1996
  if (options.provider === "moonshot") {
@@ -2016,7 +2016,7 @@ async function* runStream2(options) {
2016
2016
  model: options.model,
2017
2017
  messages,
2018
2018
  stream: useStreaming,
2019
- ...options.maxTokens ? { max_completion_tokens: options.maxTokens } : {},
2019
+ ...options.maxTokens ? options.provider === "deepseek" || options.provider === "glm" || options.provider === "moonshot" ? { max_tokens: options.maxTokens } : { max_completion_tokens: options.maxTokens } : {},
2020
2020
  ...effectiveTemp != null && !options.thinking && !hasFixedKimiSampling ? { temperature: effectiveTemp } : {},
2021
2021
  ...options.topP != null && !hasFixedKimiSampling ? { top_p: options.topP } : {},
2022
2022
  ...options.stop ? { stop: options.stop } : {},
@@ -2039,6 +2039,9 @@ async function* runStream2(options) {
2039
2039
  options.thinking
2040
2040
  );
2041
2041
  }
2042
+ if (options.provider === "sakana" && options.model === "fugu-ultra" && (options.thinking === "max" || options.thinking === "ultra")) {
2043
+ params.reasoning_effort = "max";
2044
+ }
2042
2045
  if (options.provider === "openai" && options.serviceTier) {
2043
2046
  params.service_tier = options.serviceTier;
2044
2047
  }
@@ -2055,7 +2058,9 @@ async function* runStream2(options) {
2055
2058
  if (usesThinkingParam) {
2056
2059
  if (options.thinking) {
2057
2060
  params.thinking = { type: "enabled" };
2058
- if (options.provider === "glm") {
2061
+ if (options.provider === "deepseek") {
2062
+ params.reasoning_effort = options.thinking === "low" ? "low" : options.thinking === "medium" || options.thinking === "high" ? "high" : "max";
2063
+ } else if (options.provider === "glm") {
2059
2064
  params.reasoning_effort = toGlmReasoningEffort(
2060
2065
  options.thinking
2061
2066
  );
@@ -3038,6 +3043,8 @@ var CODE_ASSIST_SUPPORTED_MODELS = /* @__PURE__ */ new Set([
3038
3043
  "gemini-3-flash",
3039
3044
  "gemini-3.1-flash-lite",
3040
3045
  "gemini-3.7-flash",
3046
+ "gemini-3.8-flash",
3047
+ "gemini-3.5-flash-lite",
3041
3048
  "gemini-2.5-pro",
3042
3049
  "gemini-2.5-flash",
3043
3050
  "gemma-4-31b-it",
@@ -3061,12 +3068,20 @@ var ACCOUNT_GATED_MODELS = /* @__PURE__ */ new Set([
3061
3068
  "gemini-3.5-flash",
3062
3069
  "gemini-3.1-pro-preview",
3063
3070
  "gemini-3.1-pro-preview-customtools",
3064
- "gemini-3.7-flash"
3071
+ "gemini-3.7-flash",
3072
+ "gemini-3.8-flash",
3073
+ "gemini-3.5-flash-lite"
3065
3074
  ]);
3066
3075
  function accountGatedMessage(model) {
3076
+ if (model === "gemini-3.8-flash" || model === "gemini-3.5-flash-lite") {
3077
+ return `${model} is not available through Code Assist for this account. Public Gemini API availability does not guarantee Code Assist OAuth access.`;
3078
+ }
3067
3079
  return `Your Google account isn't entitled to "${model}" over Gemini Code Assist OAuth, so the API reports it as not found. This is an account-access limit, not a ggcoder bug.`;
3068
3080
  }
3069
- function accountGatedHint() {
3081
+ function accountGatedHint(model) {
3082
+ if (model === "gemini-3.8-flash" || model === "gemini-3.5-flash-lite") {
3083
+ return "Use /model to select Gemini 3.1 Flash Lite, or retry once Google enables this model through Code Assist for your account.";
3084
+ }
3070
3085
  return `Newer Gemini models (3.7 Flash, 3.5 Flash, 3.1 Pro Preview) are available only to Code Assist Standard/Enterprise accounts with preview/GA access enabled by a cloud admin \u2014 free/personal accounts usually can't call them. Switch to Gemini 3.1 Flash Lite (it works on this account) with /model, or sign in with a Code Assist Standard/Enterprise account that has preview access.`;
3071
3086
  }
3072
3087
  function formatErrorMessage(status, body, model) {
@@ -3392,7 +3407,7 @@ async function fetchCodeAssist(plan, options) {
3392
3407
  throw new ProviderError("gemini", message, {
3393
3408
  statusCode: response.status,
3394
3409
  ...resetsAt !== void 0 ? { resetsAt } : {},
3395
- ...accountGated ? { hint: accountGatedHint() } : {}
3410
+ ...accountGated ? { hint: accountGatedHint(options.model) } : {}
3396
3411
  });
3397
3412
  }
3398
3413
  return response;