@midscene/shared 1.2.1-beta-20260113073450.0 → 1.2.1-beta-20260115021413.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.
@@ -153,7 +153,8 @@ const VL_MODE_RAW_VALID_VALUES = [
153
153
  'qwen3-vl',
154
154
  'vlm-ui-tars',
155
155
  'vlm-ui-tars-doubao',
156
- 'vlm-ui-tars-doubao-1.5'
156
+ 'vlm-ui-tars-doubao-1.5',
157
+ 'glm-v'
157
158
  ];
158
159
  const MODEL_FAMILY_VALUES = [
159
160
  ...VL_MODE_RAW_VALID_VALUES
package/dist/es/utils.mjs CHANGED
@@ -62,4 +62,7 @@ const antiEscapeScriptTag = (html)=>{
62
62
  function replaceIllegalPathCharsAndSpace(str) {
63
63
  return str.replace(/[:*?"<>|# ]/g, '-');
64
64
  }
65
- export { antiEscapeScriptTag, assert, escapeScriptTag, generateHashId, getGlobalScope, ifInBrowser, ifInNode, ifInWorker, logMsg, repeat, replaceIllegalPathCharsAndSpace, setIsMcp, uuid };
65
+ function isPlainObject(value) {
66
+ return 'object' == typeof value && null !== value && !Array.isArray(value);
67
+ }
68
+ export { antiEscapeScriptTag, assert, escapeScriptTag, generateHashId, getGlobalScope, ifInBrowser, ifInNode, ifInWorker, isPlainObject, logMsg, repeat, replaceIllegalPathCharsAndSpace, setIsMcp, uuid };
@@ -253,7 +253,8 @@ const VL_MODE_RAW_VALID_VALUES = [
253
253
  'qwen3-vl',
254
254
  'vlm-ui-tars',
255
255
  'vlm-ui-tars-doubao',
256
- 'vlm-ui-tars-doubao-1.5'
256
+ 'vlm-ui-tars-doubao-1.5',
257
+ 'glm-v'
257
258
  ];
258
259
  const MODEL_FAMILY_VALUES = [
259
260
  ...VL_MODE_RAW_VALID_VALUES
package/dist/lib/utils.js CHANGED
@@ -27,6 +27,7 @@ __webpack_require__.d(__webpack_exports__, {
27
27
  setIsMcp: ()=>setIsMcp,
28
28
  escapeScriptTag: ()=>escapeScriptTag,
29
29
  logMsg: ()=>logMsg,
30
+ isPlainObject: ()=>isPlainObject,
30
31
  replaceIllegalPathCharsAndSpace: ()=>replaceIllegalPathCharsAndSpace,
31
32
  uuid: ()=>uuid,
32
33
  ifInBrowser: ()=>ifInBrowser,
@@ -102,6 +103,9 @@ const antiEscapeScriptTag = (html)=>{
102
103
  function replaceIllegalPathCharsAndSpace(str) {
103
104
  return str.replace(/[:*?"<>|# ]/g, '-');
104
105
  }
106
+ function isPlainObject(value) {
107
+ return 'object' == typeof value && null !== value && !Array.isArray(value);
108
+ }
105
109
  exports.antiEscapeScriptTag = __webpack_exports__.antiEscapeScriptTag;
106
110
  exports.assert = __webpack_exports__.assert;
107
111
  exports.escapeScriptTag = __webpack_exports__.escapeScriptTag;
@@ -110,6 +114,7 @@ exports.getGlobalScope = __webpack_exports__.getGlobalScope;
110
114
  exports.ifInBrowser = __webpack_exports__.ifInBrowser;
111
115
  exports.ifInNode = __webpack_exports__.ifInNode;
112
116
  exports.ifInWorker = __webpack_exports__.ifInWorker;
117
+ exports.isPlainObject = __webpack_exports__.isPlainObject;
113
118
  exports.logMsg = __webpack_exports__.logMsg;
114
119
  exports.repeat = __webpack_exports__.repeat;
115
120
  exports.replaceIllegalPathCharsAndSpace = __webpack_exports__.replaceIllegalPathCharsAndSpace;
@@ -124,6 +129,7 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
124
129
  "ifInBrowser",
125
130
  "ifInNode",
126
131
  "ifInWorker",
132
+ "isPlainObject",
127
133
  "logMsg",
128
134
  "repeat",
129
135
  "replaceIllegalPathCharsAndSpace",
@@ -105,8 +105,8 @@ export declare const MODEL_ENV_KEYS: readonly ["MIDSCENE_MODEL_NAME", "MIDSCENE_
105
105
  export declare const ALL_ENV_KEYS: readonly [...string[], "MIDSCENE_DEBUG_MODE", "MIDSCENE_DEBUG_MODEL_PROFILE", "MIDSCENE_DEBUG_MODEL_RESPONSE", "MIDSCENE_RUN_DIR", "MIDSCENE_CACHE", "MIDSCENE_FORCE_DEEP_THINK", "MIDSCENE_MCP_USE_PUPPETEER_MODE", "MIDSCENE_MCP_ANDROID_MODE", "MIDSCENE_LANGSMITH_DEBUG", "MIDSCENE_LANGFUSE_DEBUG", "MIDSCENE_MODEL_MAX_TOKENS", "MIDSCENE_CACHE_MAX_FILENAME_LENGTH", "MIDSCENE_REPLANNING_CYCLE_LIMIT", "MIDSCENE_MODEL_MAX_TOKENS", "OPENAI_MAX_TOKENS", "MIDSCENE_ADB_PATH", "MIDSCENE_ADB_REMOTE_HOST", "MIDSCENE_ADB_REMOTE_PORT", "MIDSCENE_ANDROID_IME_STRATEGY", "MIDSCENE_IOS_DEVICE_UDID", "MIDSCENE_IOS_SIMULATOR_UDID", "MIDSCENE_REPORT_TAG_NAME", "MIDSCENE_PREFERRED_LANGUAGE", "MATCH_BY_POSITION", "MIDSCENE_MCP_CHROME_PATH", "DOCKER_CONTAINER", "MIDSCENE_MODEL_NAME", "MIDSCENE_MODEL_INIT_CONFIG_JSON", "MIDSCENE_MODEL_API_KEY", "MIDSCENE_MODEL_BASE_URL", "MIDSCENE_MODEL_SOCKS_PROXY", "MIDSCENE_MODEL_HTTP_PROXY", "MIDSCENE_MODEL_TIMEOUT", "MIDSCENE_MODEL_TEMPERATURE", "MIDSCENE_USE_VLM_UI_TARS", "MIDSCENE_USE_QWEN_VL", "MIDSCENE_USE_QWEN3_VL", "MIDSCENE_USE_DOUBAO_VISION", "MIDSCENE_USE_GEMINI", "MIDSCENE_USE_VL_MODEL", "OPENAI_API_KEY", "OPENAI_BASE_URL", "MIDSCENE_OPENAI_INIT_CONFIG_JSON", "MIDSCENE_OPENAI_HTTP_PROXY", "MIDSCENE_OPENAI_SOCKS_PROXY", "MIDSCENE_INSIGHT_MODEL_NAME", "MIDSCENE_INSIGHT_MODEL_SOCKS_PROXY", "MIDSCENE_INSIGHT_MODEL_HTTP_PROXY", "MIDSCENE_INSIGHT_MODEL_BASE_URL", "MIDSCENE_INSIGHT_MODEL_API_KEY", "MIDSCENE_INSIGHT_MODEL_INIT_CONFIG_JSON", "MIDSCENE_INSIGHT_MODEL_TIMEOUT", "MIDSCENE_INSIGHT_MODEL_TEMPERATURE", "MIDSCENE_PLANNING_MODEL_NAME", "MIDSCENE_PLANNING_MODEL_SOCKS_PROXY", "MIDSCENE_PLANNING_MODEL_HTTP_PROXY", "MIDSCENE_PLANNING_MODEL_BASE_URL", "MIDSCENE_PLANNING_MODEL_API_KEY", "MIDSCENE_PLANNING_MODEL_INIT_CONFIG_JSON", "MIDSCENE_PLANNING_MODEL_TIMEOUT", "MIDSCENE_PLANNING_MODEL_TEMPERATURE", "MIDSCENE_MODEL_FAMILY"];
106
106
  export type TEnvKeys = (typeof ALL_ENV_KEYS)[number];
107
107
  export type TGlobalConfig = Record<TEnvKeys, string | undefined>;
108
- export type TVlModeValues = 'qwen2.5-vl' | 'qwen3-vl' | 'doubao-vision' | 'gemini' | 'vlm-ui-tars' | 'vlm-ui-tars-doubao' | 'vlm-ui-tars-doubao-1.5';
109
- export type TVlModeTypes = 'qwen2.5-vl' | 'qwen3-vl' | 'doubao-vision' | 'gemini' | 'vlm-ui-tars';
108
+ export type TVlModeValues = 'qwen2.5-vl' | 'qwen3-vl' | 'doubao-vision' | 'gemini' | 'vlm-ui-tars' | 'vlm-ui-tars-doubao' | 'vlm-ui-tars-doubao-1.5' | 'glm-v';
109
+ export type TVlModeTypes = 'qwen2.5-vl' | 'qwen3-vl' | 'doubao-vision' | 'gemini' | 'vlm-ui-tars' | 'glm-v';
110
110
  export declare const VL_MODE_RAW_VALID_VALUES: TVlModeValues[];
111
111
  /**
112
112
  * Model family values - unified model configuration approach
@@ -152,6 +152,7 @@ export interface IModelConfigForPlanning {
152
152
  * - 'vlm-ui-tars'
153
153
  * - 'vlm-ui-tars-doubao'
154
154
  * - 'vlm-ui-tars-doubao-1.5'
155
+ * - 'glm-v'
155
156
  */
156
157
  export interface IModelConfigForDefault {
157
158
  [MIDSCENE_MODEL_NAME]: string;
@@ -19,4 +19,8 @@ export declare function repeat(times: number, fn: (index: number) => Promise<voi
19
19
  export declare const escapeScriptTag: (html: string) => string;
20
20
  export declare const antiEscapeScriptTag: (html: string) => string;
21
21
  export declare function replaceIllegalPathCharsAndSpace(str: string): string;
22
+ /**
23
+ * Check if a value is a plain object (not null, not array, not other types)
24
+ */
25
+ export declare function isPlainObject(value: unknown): value is Record<string, any>;
22
26
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/shared",
3
- "version": "1.2.1-beta-20260113073450.0",
3
+ "version": "1.2.1-beta-20260115021413.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",
package/src/env/types.ts CHANGED
@@ -238,14 +238,16 @@ export type TVlModeValues =
238
238
  | 'gemini'
239
239
  | 'vlm-ui-tars'
240
240
  | 'vlm-ui-tars-doubao'
241
- | 'vlm-ui-tars-doubao-1.5';
241
+ | 'vlm-ui-tars-doubao-1.5'
242
+ | 'glm-v';
242
243
 
243
244
  export type TVlModeTypes =
244
245
  | 'qwen2.5-vl'
245
246
  | 'qwen3-vl'
246
247
  | 'doubao-vision'
247
248
  | 'gemini'
248
- | 'vlm-ui-tars';
249
+ | 'vlm-ui-tars'
250
+ | 'glm-v';
249
251
 
250
252
  export const VL_MODE_RAW_VALID_VALUES: TVlModeValues[] = [
251
253
  'doubao-vision',
@@ -255,6 +257,7 @@ export const VL_MODE_RAW_VALID_VALUES: TVlModeValues[] = [
255
257
  'vlm-ui-tars',
256
258
  'vlm-ui-tars-doubao',
257
259
  'vlm-ui-tars-doubao-1.5',
260
+ 'glm-v',
258
261
  ];
259
262
 
260
263
  /**
@@ -317,6 +320,7 @@ export interface IModelConfigForPlanning {
317
320
  * - 'vlm-ui-tars'
318
321
  * - 'vlm-ui-tars-doubao'
319
322
  * - 'vlm-ui-tars-doubao-1.5'
323
+ * - 'glm-v'
320
324
  */
321
325
  export interface IModelConfigForDefault {
322
326
  // model name
package/src/utils.ts CHANGED
@@ -125,3 +125,10 @@ export function replaceIllegalPathCharsAndSpace(str: string) {
125
125
  // Only replace characters that are illegal in filenames, but preserve path separators
126
126
  return str.replace(/[:*?"<>|# ]/g, '-');
127
127
  }
128
+
129
+ /**
130
+ * Check if a value is a plain object (not null, not array, not other types)
131
+ */
132
+ export function isPlainObject(value: unknown): value is Record<string, any> {
133
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
134
+ }