@mearl/app-profiles 3.0.11 → 3.1.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 +11 -5
- package/README.md +11 -5
- package/package.json +2 -2
package/README.en.md
CHANGED
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
[简体中文](README.md) | [English](README.en.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Install an App Profile to emulate a client’s user agent, version, bridge objects, settings, scheme routes, business responses, and container behavior. This package validates and compiles Profiles and applies setting overrides.
|
|
6
|
+
|
|
7
|
+
## Develop an App Profile
|
|
8
|
+
|
|
9
|
+
Use [App Profile Creator](../../skills/mearl-profile-creator/SKILL.md) to build a profile from an existing definition, a sample of client behavior, or documentation. Register it under `contributions.appProfiles` in the [resource manifest](../../docs/browser-bundles.en.md), then open a fresh tab in a test browser to verify the initial page and bridge behavior.
|
|
10
|
+
|
|
11
|
+
## Compile a Profile
|
|
6
12
|
|
|
7
13
|
```ts
|
|
8
14
|
import { resolveAppProfileDefinition, type AppProfile } from '@mearl/app-profiles';
|
|
@@ -14,17 +20,17 @@ export function compileInstalledApp(definition: AppProfile) {
|
|
|
14
20
|
|
|
15
21
|
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
22
|
|
|
17
|
-
resolveAppProfileUpdate, rebuildAppProfileConfig, and updateAppProfileSetting preserve the precedence of explicit options, device appearance, and method overrides.
|
|
23
|
+
resolveAppProfileUpdate, rebuildAppProfileConfig, and updateAppProfileSetting preserve the precedence of explicit options, device appearance, and method overrides. The host passes Preset defaults, and existing user selections take priority. After installing a Profile, you can apply its recommended settings as needed.
|
|
18
24
|
|
|
19
|
-
|
|
25
|
+
Profiles declare the App behavior to emulate in controlled pages. The resource manifest links page runtimes and host handlers. See the [runtime contracts](../../docs/capability-model.en.md).
|
|
20
26
|
|
|
21
|
-
Profiles in the same
|
|
27
|
+
Profiles listed in the same resource manifest 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
28
|
|
|
23
29
|
## Agent capability discovery
|
|
24
30
|
|
|
25
31
|
`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
32
|
|
|
27
|
-
Each
|
|
33
|
+
Each Profile may declare optional `usage` metadata. Browser bundles and Node/Skill plugins use the same format:
|
|
28
34
|
|
|
29
35
|
```json
|
|
30
36
|
{
|
package/README.md
CHANGED
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
[简体中文](README.md) | [English](README.en.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
安装 App Profile 后即可模拟指定客户端的 UA、版本、桥对象、设置、scheme 路由、业务响应和容器行为。本包校验和编译 Profile,并应用设置覆盖。
|
|
6
|
+
|
|
7
|
+
## 开发 App Profile
|
|
8
|
+
|
|
9
|
+
用 [App Profile Creator](../../skills/mearl-profile-creator/SKILL.md) 根据已有配置、客户端行为样本或文档创建配置。在[资源清单](../../docs/browser-bundles.md)的 `contributions.appProfiles` 中登记 Profile,再在测试浏览器打开新标签页验证首屏和桥接行为。
|
|
10
|
+
|
|
11
|
+
## 编译 Profile
|
|
6
12
|
|
|
7
13
|
```ts
|
|
8
14
|
import { resolveAppProfileDefinition, type AppProfile } from '@mearl/app-profiles';
|
|
@@ -14,17 +20,17 @@ export function compileInstalledApp(definition: AppProfile) {
|
|
|
14
20
|
|
|
15
21
|
宿主可以向 resolveAppProfile 或 resolveAppProfileDefinition 提供已校验的动态定义;编译器保留桥、设置及 pageRuntime 描述,不执行能力代码。定义与选项被复制并绑定 revision,插件升级不直接改写活动文档。
|
|
16
22
|
|
|
17
|
-
resolveAppProfileUpdate、rebuildAppProfileConfig 和 updateAppProfileSetting 保持显式选项、设备外观及方法覆盖的优先级。
|
|
23
|
+
resolveAppProfileUpdate、rebuildAppProfileConfig 和 updateAppProfileSetting 保持显式选项、设备外观及方法覆盖的优先级。Preset 默认值由宿主传入,用户已有选择优先。安装 Profile 后,可按需应用其推荐配置。
|
|
18
24
|
|
|
19
|
-
App
|
|
25
|
+
Profile 声明在受控页面模拟的 App 行为。资源清单关联页面运行时和宿主处理器。详见[运行时合同](../../docs/capability-model.md)。
|
|
20
26
|
|
|
21
|
-
|
|
27
|
+
同一份资源清单中的 Profile 可以共用 `settingsGroup`,以便在设备外壳的底部手势条配置页切换。每种环境也可通过独立的 Profile ID 选用。
|
|
22
28
|
|
|
23
29
|
## Agent 能力发现
|
|
24
30
|
|
|
25
31
|
`mearl get_capabilities`、SDK `getCapabilities()`、MCP `browser_get_capabilities` 查询当前目标浏览器,沿用 browser/session 路由。默认返回动作、设备预设和 App 摘要;传 `{ "app": "package/app" }` 按需展开桥方法、可调设置和默认版本。目录为 partial 或 unsupported 时不能据此断言 App 未安装,available=false 的条目不可启用。方法按声明组分类:responses 为固定回包,noop 为成功空实现,behaviors 为模拟行为;这些都不证明真实业务操作可用。
|
|
26
32
|
|
|
27
|
-
|
|
33
|
+
每个 Profile 可声明可选的 `usage`,浏览器包与 Node/Skill 插件共用同一格式:
|
|
28
34
|
|
|
29
35
|
```json
|
|
30
36
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mearl/app-profiles",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Declarative App profile compilation for installed capabilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
],
|
|
26
26
|
"license": "Apache-2.0",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@mearl/browser-core": "3.0
|
|
28
|
+
"@mearl/browser-core": "3.1.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"typescript": "^5.8.3"
|