@midscene/shared 1.6.3 → 1.7.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.
@@ -43,6 +43,16 @@ const getModelDescription = (modelFamily, uiTarsModelVersion)=>{
43
43
  if (modelFamily) return `${modelFamily} mode`;
44
44
  return '';
45
45
  };
46
+ const normalizeOpenaiExtraConfig = (config)=>{
47
+ if (!config || 'object' != typeof config || Array.isArray(config)) return;
48
+ const { defaultHeaders, extra_headers, extraHeaders, ...rest } = config;
49
+ const headers = defaultHeaders ?? extra_headers ?? extraHeaders;
50
+ if (void 0 !== headers) return {
51
+ ...rest,
52
+ defaultHeaders: headers
53
+ };
54
+ return rest;
55
+ };
46
56
  const parseOpenaiSdkConfig = ({ keys, provider, useLegacyLogic = false })=>{
47
57
  initDebugConfig();
48
58
  const debugLog = getDebug('ai:config');
@@ -73,7 +83,7 @@ const parseOpenaiSdkConfig = ({ keys, provider, useLegacyLogic = false })=>{
73
83
  httpProxy,
74
84
  openaiBaseURL,
75
85
  openaiApiKey,
76
- openaiExtraConfig,
86
+ openaiExtraConfig: normalizeOpenaiExtraConfig(openaiExtraConfig),
77
87
  extraBody,
78
88
  modelFamily,
79
89
  uiTarsModelVersion,
@@ -193,6 +193,7 @@ const MODEL_FAMILY_VALUES = [
193
193
  'qwen2.5-vl',
194
194
  'qwen3-vl',
195
195
  'qwen3.5',
196
+ 'qwen3.6',
196
197
  'vlm-ui-tars',
197
198
  'vlm-ui-tars-doubao',
198
199
  'vlm-ui-tars-doubao-1.5',
@@ -75,6 +75,16 @@ const getModelDescription = (modelFamily, uiTarsModelVersion)=>{
75
75
  if (modelFamily) return `${modelFamily} mode`;
76
76
  return '';
77
77
  };
78
+ const normalizeOpenaiExtraConfig = (config)=>{
79
+ if (!config || 'object' != typeof config || Array.isArray(config)) return;
80
+ const { defaultHeaders, extra_headers, extraHeaders, ...rest } = config;
81
+ const headers = defaultHeaders ?? extra_headers ?? extraHeaders;
82
+ if (void 0 !== headers) return {
83
+ ...rest,
84
+ defaultHeaders: headers
85
+ };
86
+ return rest;
87
+ };
78
88
  const parseOpenaiSdkConfig = ({ keys, provider, useLegacyLogic = false })=>{
79
89
  (0, external_init_debug_js_namespaceObject.initDebugConfig)();
80
90
  const debugLog = (0, external_logger_js_namespaceObject.getDebug)('ai:config');
@@ -105,7 +115,7 @@ const parseOpenaiSdkConfig = ({ keys, provider, useLegacyLogic = false })=>{
105
115
  httpProxy,
106
116
  openaiBaseURL,
107
117
  openaiApiKey,
108
- openaiExtraConfig,
118
+ openaiExtraConfig: normalizeOpenaiExtraConfig(openaiExtraConfig),
109
119
  extraBody,
110
120
  modelFamily,
111
121
  uiTarsModelVersion,
@@ -312,6 +312,7 @@ const MODEL_FAMILY_VALUES = [
312
312
  'qwen2.5-vl',
313
313
  'qwen3-vl',
314
314
  'qwen3.5',
315
+ 'qwen3.6',
315
316
  'vlm-ui-tars',
316
317
  'vlm-ui-tars-doubao',
317
318
  'vlm-ui-tars-doubao-1.5',
@@ -128,7 +128,7 @@ export type TGlobalConfig = Record<TEnvKeys, string | undefined>;
128
128
  /**
129
129
  * valid Model family types
130
130
  */
131
- export type TModelFamily = 'qwen2.5-vl' | 'qwen3-vl' | 'qwen3.5' | 'doubao-vision' | 'doubao-seed' | 'gemini' | 'vlm-ui-tars' | 'vlm-ui-tars-doubao' | 'vlm-ui-tars-doubao-1.5' | 'glm-v' | 'auto-glm' | 'auto-glm-multilingual' | 'gpt-5';
131
+ export type TModelFamily = 'qwen2.5-vl' | 'qwen3-vl' | 'qwen3.5' | 'qwen3.6' | 'doubao-vision' | 'doubao-seed' | 'gemini' | 'vlm-ui-tars' | 'vlm-ui-tars-doubao' | 'vlm-ui-tars-doubao-1.5' | 'glm-v' | 'auto-glm' | 'auto-glm-multilingual' | 'gpt-5';
132
132
  export declare const MODEL_FAMILY_VALUES: TModelFamily[];
133
133
  export interface IModelConfigForInsight {
134
134
  [MIDSCENE_INSIGHT_MODEL_NAME]: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/shared",
3
- "version": "1.6.3",
3
+ "version": "1.7.0",
4
4
  "repository": "https://github.com/web-infra-dev/midscene",
5
5
  "homepage": "https://midscenejs.com/",
6
6
  "types": "./dist/types/index.d.ts",
@@ -136,6 +136,26 @@ const getModelDescription = (
136
136
  return '';
137
137
  };
138
138
 
139
+ const normalizeOpenaiExtraConfig = (
140
+ config: unknown,
141
+ ): Record<string, unknown> | undefined => {
142
+ if (!config || typeof config !== 'object' || Array.isArray(config)) {
143
+ return undefined;
144
+ }
145
+
146
+ const { defaultHeaders, extra_headers, extraHeaders, ...rest } =
147
+ config as Record<string, unknown>;
148
+
149
+ // Priority: defaultHeaders > extra_headers > extraHeaders
150
+ const headers = defaultHeaders ?? extra_headers ?? extraHeaders;
151
+
152
+ if (headers !== undefined) {
153
+ return { ...rest, defaultHeaders: headers };
154
+ }
155
+
156
+ return rest;
157
+ };
158
+
139
159
  /**
140
160
  * Parse OpenAI SDK config
141
161
  */
@@ -201,7 +221,7 @@ export const parseOpenaiSdkConfig = ({
201
221
  httpProxy,
202
222
  openaiBaseURL,
203
223
  openaiApiKey,
204
- openaiExtraConfig,
224
+ openaiExtraConfig: normalizeOpenaiExtraConfig(openaiExtraConfig),
205
225
  extraBody,
206
226
  modelFamily,
207
227
  uiTarsModelVersion,
package/src/env/types.ts CHANGED
@@ -293,6 +293,7 @@ export type TModelFamily =
293
293
  | 'qwen2.5-vl'
294
294
  | 'qwen3-vl'
295
295
  | 'qwen3.5'
296
+ | 'qwen3.6'
296
297
  | 'doubao-vision'
297
298
  | 'doubao-seed'
298
299
  | 'gemini'
@@ -311,6 +312,7 @@ export const MODEL_FAMILY_VALUES: TModelFamily[] = [
311
312
  'qwen2.5-vl',
312
313
  'qwen3-vl',
313
314
  'qwen3.5',
315
+ 'qwen3.6',
314
316
  'vlm-ui-tars',
315
317
  'vlm-ui-tars-doubao',
316
318
  'vlm-ui-tars-doubao-1.5',