@midscene/shared 1.18.1 → 1.18.2-beta-20261120024247.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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  An AI-powered automation SDK can control the page, perform assertions, and extract data in JSON format using natural language.
4
4
 
5
- See https://midscenejs.com/ for details.
5
+ See https://www.midscenejs.com/ for details.
6
6
 
7
7
  ## License
8
8
 
@@ -18,7 +18,7 @@ class ModelConfigManager {
18
18
  configMap = this.normalizeModelConfig(this.modelConfig);
19
19
  } else configMap = this.globalConfigManager?.getAllEnvConfig() || {};
20
20
  const defaultConfig = decideModelConfigFromIntentConfig('default', configMap);
21
- if (!defaultConfig) throw new Error('Model configuration is incomplete: model name (MIDSCENE_MODEL_NAME) is required. See https://midscenejs.com/model-api-setup');
21
+ if (!defaultConfig) throw new Error('Model configuration is incomplete: model name (MIDSCENE_MODEL_NAME) is required. See https://www.midscenejs.com/model-api-setup');
22
22
  const insightConfig = decideModelConfigFromIntentConfig('insight', configMap);
23
23
  const planningConfig = decideModelConfigFromIntentConfig('planning', configMap);
24
24
  const locateConfig = decideModelConfigFromIntentConfig('locate', configMap);
@@ -76,7 +76,7 @@ class ModelConfigManager {
76
76
  }
77
77
  throwErrorIfNonVLModel() {
78
78
  const modelConfig = this.getModelConfig('locate');
79
- if (!modelConfig.modelFamily) throw new Error(`${'locate' === modelConfig.slot ? 'MIDSCENE_LOCATE_MODEL_FAMILY' : 'MIDSCENE_MODEL_FAMILY'} is not set to a multimodal model with UI localization, so element localization cannot be achieved. Check your model configuration. See https://midscenejs.com/model-api-setup`);
79
+ if (!modelConfig.modelFamily) throw new Error(`${'locate' === modelConfig.slot ? 'MIDSCENE_LOCATE_MODEL_FAMILY' : 'MIDSCENE_MODEL_FAMILY'} is not set to a multimodal model with UI localization, so element localization cannot be achieved. Check your model configuration. See https://www.midscenejs.com/model-api-setup`);
80
80
  }
81
81
  constructor(modelConfig, createOpenAIClientFn){
82
82
  _define_property(this, "modelConfigMap", void 0);
@@ -4,8 +4,8 @@ import { getDebug } from "../logger.mjs";
4
4
  import { assert } from "../utils.mjs";
5
5
  import { maskConfig, parseJson } from "./helper.mjs";
6
6
  import { initDebugConfig } from "./init-debug.mjs";
7
- const MODEL_CONFIG_DOC_URL = 'https://midscenejs.com/model-api-setup.html';
8
- const getCurrentVersion = ()=>"1.18.1";
7
+ const MODEL_CONFIG_DOC_URL = 'https://www.midscenejs.com/model-api-setup.html';
8
+ const getCurrentVersion = ()=>"1.18.2-beta-20261120024247.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
  locate: LOCATE_MODEL_CONFIG_KEYS,
@@ -179,8 +179,8 @@ const decideModelConfigFromIntentConfig = (intent, configMap)=>{
179
179
  debugLog('decideModelConfig result by agent.modelConfig() with intent', intent, maskConfig({
180
180
  ...finalResult
181
181
  }));
182
- assert('siwc' === finalResult.authMode || finalResult.endpoint || finalResult.openaiBaseURL, `failed to get base URL or System One endpoint of model (intent=${intent}). See https://midscenejs.com/model-api-setup`);
183
- if (!finalResult.modelName) console.warn(`modelName is not set for intent ${intent}, this may cause unexpected behavior. See https://midscenejs.com/model-api-setup`);
182
+ assert('siwc' === finalResult.authMode || finalResult.endpoint || finalResult.openaiBaseURL, `failed to get base URL or System One endpoint of model (intent=${intent}). See https://www.midscenejs.com/model-api-setup`);
183
+ if (!finalResult.modelName) console.warn(`modelName is not set for intent ${intent}, this may cause unexpected behavior. See https://www.midscenejs.com/model-api-setup`);
184
184
  return finalResult;
185
185
  };
186
186
  export { decideModelConfigFromIntentConfig, getUITarsModelVersion, legacyConfigToModelFamily, parseOpenaiSdkConfig, validateModelFamily };
@@ -46,7 +46,7 @@ class ModelConfigManager {
46
46
  configMap = this.normalizeModelConfig(this.modelConfig);
47
47
  } else configMap = this.globalConfigManager?.getAllEnvConfig() || {};
48
48
  const defaultConfig = (0, external_parse_model_config_js_namespaceObject.decideModelConfigFromIntentConfig)('default', configMap);
49
- if (!defaultConfig) throw new Error('Model configuration is incomplete: model name (MIDSCENE_MODEL_NAME) is required. See https://midscenejs.com/model-api-setup');
49
+ if (!defaultConfig) throw new Error('Model configuration is incomplete: model name (MIDSCENE_MODEL_NAME) is required. See https://www.midscenejs.com/model-api-setup');
50
50
  const insightConfig = (0, external_parse_model_config_js_namespaceObject.decideModelConfigFromIntentConfig)('insight', configMap);
51
51
  const planningConfig = (0, external_parse_model_config_js_namespaceObject.decideModelConfigFromIntentConfig)('planning', configMap);
52
52
  const locateConfig = (0, external_parse_model_config_js_namespaceObject.decideModelConfigFromIntentConfig)('locate', configMap);
@@ -104,7 +104,7 @@ class ModelConfigManager {
104
104
  }
105
105
  throwErrorIfNonVLModel() {
106
106
  const modelConfig = this.getModelConfig('locate');
107
- if (!modelConfig.modelFamily) throw new Error(`${'locate' === modelConfig.slot ? 'MIDSCENE_LOCATE_MODEL_FAMILY' : 'MIDSCENE_MODEL_FAMILY'} is not set to a multimodal model with UI localization, so element localization cannot be achieved. Check your model configuration. See https://midscenejs.com/model-api-setup`);
107
+ if (!modelConfig.modelFamily) throw new Error(`${'locate' === modelConfig.slot ? 'MIDSCENE_LOCATE_MODEL_FAMILY' : 'MIDSCENE_MODEL_FAMILY'} is not set to a multimodal model with UI localization, so element localization cannot be achieved. Check your model configuration. See https://www.midscenejs.com/model-api-setup`);
108
108
  }
109
109
  constructor(modelConfig, createOpenAIClientFn){
110
110
  _define_property(this, "modelConfigMap", void 0);
@@ -36,8 +36,8 @@ const external_logger_js_namespaceObject = require("../logger.js");
36
36
  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
- const MODEL_CONFIG_DOC_URL = 'https://midscenejs.com/model-api-setup.html';
40
- const getCurrentVersion = ()=>"1.18.1";
39
+ const MODEL_CONFIG_DOC_URL = 'https://www.midscenejs.com/model-api-setup.html';
40
+ const getCurrentVersion = ()=>"1.18.2-beta-20261120024247.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
  locate: external_constants_js_namespaceObject.LOCATE_MODEL_CONFIG_KEYS,
@@ -211,8 +211,8 @@ const decideModelConfigFromIntentConfig = (intent, configMap)=>{
211
211
  debugLog('decideModelConfig result by agent.modelConfig() with intent', intent, (0, external_helper_js_namespaceObject.maskConfig)({
212
212
  ...finalResult
213
213
  }));
214
- (0, external_utils_js_namespaceObject.assert)('siwc' === finalResult.authMode || finalResult.endpoint || finalResult.openaiBaseURL, `failed to get base URL or System One endpoint of model (intent=${intent}). See https://midscenejs.com/model-api-setup`);
215
- if (!finalResult.modelName) console.warn(`modelName is not set for intent ${intent}, this may cause unexpected behavior. See https://midscenejs.com/model-api-setup`);
214
+ (0, external_utils_js_namespaceObject.assert)('siwc' === finalResult.authMode || finalResult.endpoint || finalResult.openaiBaseURL, `failed to get base URL or System One endpoint of model (intent=${intent}). See https://www.midscenejs.com/model-api-setup`);
215
+ if (!finalResult.modelName) console.warn(`modelName is not set for intent ${intent}, this may cause unexpected behavior. See https://www.midscenejs.com/model-api-setup`);
216
216
  return finalResult;
217
217
  };
218
218
  exports.decideModelConfigFromIntentConfig = __webpack_exports__.decideModelConfigFromIntentConfig;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@midscene/shared",
3
- "version": "1.18.1",
3
+ "version": "1.18.2-beta-20261120024247.0",
4
4
  "repository": "https://github.com/web-infra-dev/midscene",
5
- "homepage": "https://midscenejs.com/",
5
+ "homepage": "https://www.midscenejs.com/",
6
6
  "types": "./dist/types/index.d.ts",
7
7
  "main": "./dist/lib/index.js",
8
8
  "module": "./dist/es/index.mjs",
@@ -49,7 +49,7 @@ export class ModelConfigManager {
49
49
  );
50
50
  if (!defaultConfig) {
51
51
  throw new Error(
52
- 'Model configuration is incomplete: model name (MIDSCENE_MODEL_NAME) is required. See https://midscenejs.com/model-api-setup',
52
+ 'Model configuration is incomplete: model name (MIDSCENE_MODEL_NAME) is required. See https://www.midscenejs.com/model-api-setup',
53
53
  );
54
54
  }
55
55
 
@@ -156,7 +156,7 @@ export class ModelConfigManager {
156
156
 
157
157
  if (!modelConfig.modelFamily) {
158
158
  throw new Error(
159
- `${modelConfig.slot === 'locate' ? 'MIDSCENE_LOCATE_MODEL_FAMILY' : 'MIDSCENE_MODEL_FAMILY'} is not set to a multimodal model with UI localization, so element localization cannot be achieved. Check your model configuration. See https://midscenejs.com/model-api-setup`,
159
+ `${modelConfig.slot === 'locate' ? 'MIDSCENE_LOCATE_MODEL_FAMILY' : 'MIDSCENE_MODEL_FAMILY'} is not set to a multimodal model with UI localization, so element localization cannot be achieved. Check your model configuration. See https://www.midscenejs.com/model-api-setup`,
160
160
  );
161
161
  }
162
162
  }
@@ -32,7 +32,7 @@ import { initDebugConfig } from './init-debug';
32
32
 
33
33
  declare const __VERSION__: string | undefined;
34
34
 
35
- const MODEL_CONFIG_DOC_URL = 'https://midscenejs.com/model-api-setup.html';
35
+ const MODEL_CONFIG_DOC_URL = 'https://www.midscenejs.com/model-api-setup.html';
36
36
 
37
37
  const getCurrentVersion = (): string => {
38
38
  if (typeof __VERSION__ !== 'undefined' && __VERSION__) {
@@ -391,12 +391,12 @@ export const decideModelConfigFromIntentConfig = (
391
391
  finalResult.authMode === 'siwc' ||
392
392
  finalResult.endpoint ||
393
393
  finalResult.openaiBaseURL,
394
- `failed to get base URL or System One endpoint of model (intent=${intent}). See https://midscenejs.com/model-api-setup`,
394
+ `failed to get base URL or System One endpoint of model (intent=${intent}). See https://www.midscenejs.com/model-api-setup`,
395
395
  );
396
396
 
397
397
  if (!finalResult.modelName) {
398
398
  console.warn(
399
- `modelName is not set for intent ${intent}, this may cause unexpected behavior. See https://midscenejs.com/model-api-setup`,
399
+ `modelName is not set for intent ${intent}, this may cause unexpected behavior. See https://www.midscenejs.com/model-api-setup`,
400
400
  );
401
401
  }
402
402