@midscene/shared 1.9.3 → 1.9.4-beta-20260610083147.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.
|
@@ -5,7 +5,7 @@ import { assert } from "../utils.mjs";
|
|
|
5
5
|
import { maskConfig, parseJson } from "./helper.mjs";
|
|
6
6
|
import { initDebugConfig } from "./init-debug.mjs";
|
|
7
7
|
const MODEL_CONFIG_DOC_URL = 'https://midscenejs.com/model-common-config.html';
|
|
8
|
-
const getCurrentVersion = ()=>"1.9.
|
|
8
|
+
const getCurrentVersion = ()=>"1.9.4-beta-20260610083147.0";
|
|
9
9
|
const getInvalidModelFamilyMessage = (modelFamily)=>`Invalid MIDSCENE_MODEL_FAMILY value: ${modelFamily}. Current version v${getCurrentVersion()} accepts the following model families: ${MODEL_FAMILY_VALUES.join(', ')}. You can also visit ${MODEL_CONFIG_DOC_URL} for the latest configuration information.`;
|
|
10
10
|
const KEYS_MAP = {
|
|
11
11
|
insight: INSIGHT_MODEL_CONFIG_KEYS,
|
|
@@ -120,6 +120,7 @@ const parseOpenaiSdkConfig = ({ keys, provider, useLegacyLogic = false })=>{
|
|
|
120
120
|
const val = provider[keys.reasoningEnabled]?.trim()?.toLowerCase();
|
|
121
121
|
if ('true' === val || '1' === val) return true;
|
|
122
122
|
if ('false' === val || '0' === val) return false;
|
|
123
|
+
if ('default' === val) return 'default';
|
|
123
124
|
})(),
|
|
124
125
|
reasoningBudget: (()=>{
|
|
125
126
|
const val = provider[keys.reasoningBudget]?.trim();
|
|
@@ -37,7 +37,7 @@ const external_utils_js_namespaceObject = require("../utils.js");
|
|
|
37
37
|
const external_helper_js_namespaceObject = require("./helper.js");
|
|
38
38
|
const external_init_debug_js_namespaceObject = require("./init-debug.js");
|
|
39
39
|
const MODEL_CONFIG_DOC_URL = 'https://midscenejs.com/model-common-config.html';
|
|
40
|
-
const getCurrentVersion = ()=>"1.9.
|
|
40
|
+
const getCurrentVersion = ()=>"1.9.4-beta-20260610083147.0";
|
|
41
41
|
const getInvalidModelFamilyMessage = (modelFamily)=>`Invalid MIDSCENE_MODEL_FAMILY value: ${modelFamily}. Current version v${getCurrentVersion()} accepts the following model families: ${external_types_js_namespaceObject.MODEL_FAMILY_VALUES.join(', ')}. You can also visit ${MODEL_CONFIG_DOC_URL} for the latest configuration information.`;
|
|
42
42
|
const KEYS_MAP = {
|
|
43
43
|
insight: external_constants_js_namespaceObject.INSIGHT_MODEL_CONFIG_KEYS,
|
|
@@ -152,6 +152,7 @@ const parseOpenaiSdkConfig = ({ keys, provider, useLegacyLogic = false })=>{
|
|
|
152
152
|
const val = provider[keys.reasoningEnabled]?.trim()?.toLowerCase();
|
|
153
153
|
if ('true' === val || '1' === val) return true;
|
|
154
154
|
if ('false' === val || '0' === val) return false;
|
|
155
|
+
if ('default' === val) return 'default';
|
|
155
156
|
})(),
|
|
156
157
|
reasoningBudget: (()=>{
|
|
157
158
|
const val = provider[keys.reasoningBudget]?.trim();
|
|
@@ -22,6 +22,7 @@ export declare const MIDSCENE_MODEL_RETRY_INTERVAL = "MIDSCENE_MODEL_RETRY_INTER
|
|
|
22
22
|
export declare const MIDSCENE_MODEL_REASONING_EFFORT = "MIDSCENE_MODEL_REASONING_EFFORT";
|
|
23
23
|
export declare const MIDSCENE_MODEL_REASONING_ENABLED = "MIDSCENE_MODEL_REASONING_ENABLED";
|
|
24
24
|
export declare const MIDSCENE_MODEL_REASONING_BUDGET = "MIDSCENE_MODEL_REASONING_BUDGET";
|
|
25
|
+
export type TModelReasoningEnabled = boolean | 'default';
|
|
25
26
|
/**
|
|
26
27
|
* @deprecated Use MIDSCENE_MODEL_API_KEY instead. This is kept for backward compatibility.
|
|
27
28
|
*/
|
|
@@ -274,8 +275,9 @@ export interface IModelConfig {
|
|
|
274
275
|
/**
|
|
275
276
|
* Enable/disable reasoning for the model.
|
|
276
277
|
* Passed through to model-family-specific parameters (e.g., enable_thinking for qwen, thinking.type for doubao/glm-v).
|
|
278
|
+
* "default" means following the model provider's default without sending reasoning controls.
|
|
277
279
|
*/
|
|
278
|
-
reasoningEnabled?:
|
|
280
|
+
reasoningEnabled?: TModelReasoningEnabled;
|
|
279
281
|
/**
|
|
280
282
|
* Reasoning token budget for the model.
|
|
281
283
|
* Passed through to model-family-specific parameters (e.g., thinking_budget for qwen).
|
package/package.json
CHANGED
|
@@ -279,6 +279,7 @@ export const parseOpenaiSdkConfig = ({
|
|
|
279
279
|
const val = provider[keys.reasoningEnabled]?.trim()?.toLowerCase();
|
|
280
280
|
if (val === 'true' || val === '1') return true;
|
|
281
281
|
if (val === 'false' || val === '0') return false;
|
|
282
|
+
if (val === 'default') return 'default';
|
|
282
283
|
return undefined;
|
|
283
284
|
})(),
|
|
284
285
|
reasoningBudget: (() => {
|
package/src/env/types.ts
CHANGED
|
@@ -35,6 +35,8 @@ export const MIDSCENE_MODEL_REASONING_ENABLED =
|
|
|
35
35
|
export const MIDSCENE_MODEL_REASONING_BUDGET =
|
|
36
36
|
'MIDSCENE_MODEL_REASONING_BUDGET';
|
|
37
37
|
|
|
38
|
+
export type TModelReasoningEnabled = boolean | 'default';
|
|
39
|
+
|
|
38
40
|
/**
|
|
39
41
|
* @deprecated Use MIDSCENE_MODEL_API_KEY instead. This is kept for backward compatibility.
|
|
40
42
|
*/
|
|
@@ -380,7 +382,7 @@ export interface IModelConfigForDefault {
|
|
|
380
382
|
[MIDSCENE_MODEL_TEMPERATURE]?: string;
|
|
381
383
|
// reasoning effort
|
|
382
384
|
[MIDSCENE_MODEL_REASONING_EFFORT]?: string;
|
|
383
|
-
// enable reasoning (boolean as string)
|
|
385
|
+
// enable reasoning (boolean/default as string)
|
|
384
386
|
[MIDSCENE_MODEL_REASONING_ENABLED]?: string;
|
|
385
387
|
// reasoning budget (number as string)
|
|
386
388
|
[MIDSCENE_MODEL_REASONING_BUDGET]?: string;
|
|
@@ -499,8 +501,9 @@ export interface IModelConfig {
|
|
|
499
501
|
/**
|
|
500
502
|
* Enable/disable reasoning for the model.
|
|
501
503
|
* Passed through to model-family-specific parameters (e.g., enable_thinking for qwen, thinking.type for doubao/glm-v).
|
|
504
|
+
* "default" means following the model provider's default without sending reasoning controls.
|
|
502
505
|
*/
|
|
503
|
-
reasoningEnabled?:
|
|
506
|
+
reasoningEnabled?: TModelReasoningEnabled;
|
|
504
507
|
/**
|
|
505
508
|
* Reasoning token budget for the model.
|
|
506
509
|
* Passed through to model-family-specific parameters (e.g., thinking_budget for qwen).
|