@mearl/app-profiles 3.0.0-beta.9 → 3.0.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.en.md +40 -0
- package/README.md +5 -1
- package/package.json +3 -2
package/README.en.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# @mearl/app-profiles
|
|
2
|
+
|
|
3
|
+
[简体中文](README.md) | [English](README.en.md)
|
|
4
|
+
|
|
5
|
+
The core includes no built-in App profiles. Installed capability packages supply App UAs, versions, bridge objects, settings, scheme routes, business responses, and container implementations. This package validates and compiles declarative profiles and applies setting overrides.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { resolveAppProfileDefinition, type AppProfile } from '@mearl/app-profiles';
|
|
9
|
+
|
|
10
|
+
export function compileInstalledApp(definition: AppProfile) {
|
|
11
|
+
return resolveAppProfileDefinition(definition, { os: 'android' });
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Hosts can pass validated dynamic definitions to resolveAppProfile or resolveAppProfileDefinition. The compiler preserves bridge, settings, and pageRuntime descriptors without executing capability code. Definitions and options are copied and bound to a revision; plugin upgrades do not directly alter active documents.
|
|
16
|
+
|
|
17
|
+
resolveAppProfileUpdate, rebuildAppProfileConfig, and updateAppProfileSetting preserve the precedence of explicit options, device appearance, and method overrides. Hosts pass preset defaults; existing user selections take priority. Installing a capability package does not mean its default configuration has been applied.
|
|
18
|
+
|
|
19
|
+
Capability packages declare App behavior and install it into controlled pages. Page code and host handlers are linked through the [capability model](../../docs/capability-model.en.md).
|
|
20
|
+
|
|
21
|
+
Profiles in the same browser capability package can share a `settingsGroup` to appear together in the device shell's gesture-bar settings. Each environment remains selectable by its own profile ID.
|
|
22
|
+
|
|
23
|
+
## Agent capability discovery
|
|
24
|
+
|
|
25
|
+
`mearl get_capabilities`, SDK `getCapabilities()`, and MCP `browser_get_capabilities` query the target browser through the existing browser/session routing. By default they return actions, device presets, and App summaries. Pass `{ "app": "package/app" }` to expand bridge methods, adjustable settings, and default versions. A partial or unsupported catalog does not establish that an App is absent; entries with available=false cannot be enabled. Methods are grouped by declaration: responses are fixed replies, noop methods succeed without an implementation, and behaviors simulate behavior. None establishes that a real business operation is available.
|
|
26
|
+
|
|
27
|
+
Each App definition may declare optional `usage` metadata. Browser bundles and Node/Skill plugins use the same format:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"usage": {
|
|
32
|
+
"description": "WebView and bridge behavior simulation",
|
|
33
|
+
"limitations": ["Real device authorization requires the corresponding host capability"],
|
|
34
|
+
"skills": ["example-skill"],
|
|
35
|
+
"documentation": [{ "title": "Usage guide", "url": "https://example.com/docs" }]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
usage is limited to 4 KiB; description to 512 characters; and limitations, skills, and documentation to 8 entries each. Documentation URLs must use HTTPS without credentials. Queries read installed metadata only: they do not refresh plugins, open documentation, install or load Skills, or expose bridge scripts, global variable values, or fixed response contents. Skill names are author-provided entry points and do not imply installation. Use set_app_profile/tab_open for general operations and consult companion instructions for specialized workflows.
|
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# @mearl/app-profiles
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[简体中文](README.md) | [English](README.en.md)
|
|
4
|
+
|
|
5
|
+
核心不内置具体客户端的端模拟配置。App UA、版本、桥对象、设置、scheme 路由、业务响应和容器实现均由安装的能力包提供;本包负责声明式端模拟配置校验、编译与设置覆盖。
|
|
4
6
|
|
|
5
7
|
```ts
|
|
6
8
|
import { resolveAppProfileDefinition, type AppProfile } from '@mearl/app-profiles';
|
|
@@ -16,6 +18,8 @@ resolveAppProfileUpdate、rebuildAppProfileConfig 和 updateAppProfileSetting
|
|
|
16
18
|
|
|
17
19
|
App 行为由能力包声明并安装到受控页面;页面代码和宿主处理器通过 [能力包模型](../../docs/capability-model.md) 关联。
|
|
18
20
|
|
|
21
|
+
同一个浏览器能力包里的端模拟配置可以共用 `settingsGroup`,以便在设备外壳的底部手势条配置页切换。每种环境也可通过独立的配置 ID 选用。
|
|
22
|
+
|
|
19
23
|
## Agent 能力发现
|
|
20
24
|
|
|
21
25
|
`mearl get_capabilities`、SDK `getCapabilities()`、MCP `browser_get_capabilities` 查询当前目标浏览器,沿用 browser/session 路由。默认返回动作、设备预设和 App 摘要;传 `{ "app": "package/app" }` 按需展开桥方法、可调设置和默认版本。目录为 partial 或 unsupported 时不能据此断言 App 未安装,available=false 的条目不可启用。方法按声明组分类:responses 为固定回包,noop 为成功空实现,behaviors 为模拟行为;这些都不证明真实业务操作可用。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mearl/app-profiles",
|
|
3
|
-
"version": "3.0.0
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Declarative App profile compilation for installed capabilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
|
+
"README.en.md",
|
|
19
20
|
"dist",
|
|
20
21
|
"!dist/**/*.map"
|
|
21
22
|
],
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
],
|
|
25
26
|
"license": "Apache-2.0",
|
|
26
27
|
"dependencies": {
|
|
27
|
-
"@mearl/browser-core": "3.0.0
|
|
28
|
+
"@mearl/browser-core": "3.0.0"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"typescript": "^5.8.3"
|