@mearl/client 2.20.3 → 2.20.5

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.
@@ -157,14 +157,16 @@ try:
157
157
  raise TypeError("入口的 description 必须为字符串")
158
158
  if plugin_toolbox is not None and not isinstance(plugin_toolbox, dict):
159
159
  raise TypeError("入口的 toolbox 必须为对象")
160
+ plugin_app_profiles = getattr(module, "appProfiles", None)
160
161
  register = getattr(module, "register", None)
161
- if not callable(register):
162
+ if not callable(register) and plugin_app_profiles is None:
162
163
  raise TypeError("入口必须导出 register(app) 函数")
163
164
 
164
165
  app = _App(options)
165
- _resolve(register(app))
166
+ if callable(register):
167
+ _resolve(register(app))
166
168
  app.registering = False
167
- if not app.commands:
169
+ if not app.commands and plugin_app_profiles is None:
168
170
  raise RuntimeError("入口未注册任何命令")
169
171
 
170
172
  descriptor = {
@@ -180,6 +182,8 @@ try:
180
182
  descriptor["description"] = plugin_description
181
183
  if plugin_toolbox is not None:
182
184
  descriptor["toolbox"] = plugin_toolbox
185
+ if plugin_app_profiles is not None:
186
+ descriptor["appProfiles"] = plugin_app_profiles
183
187
  _send(descriptor)
184
188
 
185
189
  if mode == "run":
@@ -251,6 +255,7 @@ function parseDescriptor(message) {
251
255
  ...(typeof message.name === 'string' ? { name: message.name } : {}),
252
256
  ...(typeof message.description === 'string' ? { description: message.description } : {}),
253
257
  ...(message.toolbox !== undefined ? { toolbox: message.toolbox } : {}),
258
+ ...(message.appProfiles !== undefined ? { appProfiles: message.appProfiles } : {}),
254
259
  };
255
260
  }
256
261
  function bridgedError(message) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mearl/client",
3
- "version": "2.20.3",
3
+ "version": "2.20.5",
4
4
  "description": "Unified Mearl SDK & CLI for local and remote browsers",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -26,6 +26,10 @@
26
26
  "types": "./dist/check.d.ts",
27
27
  "import": "./dist/check.js"
28
28
  },
29
+ "./native-host": {
30
+ "types": "./dist/nativeHost.d.ts",
31
+ "import": "./dist/nativeHost.js"
32
+ },
29
33
  "./cli": {
30
34
  "types": "./dist/cli.d.ts",
31
35
  "import": "./dist/cli.js"
@@ -59,8 +63,8 @@
59
63
  "commander": "^15.0.0",
60
64
  "fastest-levenshtein": "^1.0.16",
61
65
  "ws": "^8.18.0",
62
- "@mearl/cloud-types": "2.20.3",
63
- "@mearl/provider": "2.20.3"
66
+ "@mearl/cloud-types": "2.20.5",
67
+ "@mearl/provider": "2.20.5"
64
68
  },
65
69
  "devDependencies": {
66
70
  "@types/node": "^24.9.1",