@mearl/browser-core 3.0.0-beta.7 → 3.0.0-beta.9

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
@@ -6,6 +6,6 @@
6
6
 
7
7
  `@mearl/browser-core/appProfileRuntime` 的内置安装器只同步 UA、navigator.appVersion、navigator.platform 和触摸点,不安装 App 桥、业务全局变量、容器栈或授权处理。有 pageRuntime 绑定时,宿主必须先从已安装的能力包准备确切代码,再通过页面运行时派发器执行;不能调用基础安装器代替。资源准备和派发见 [能力包](../../docs/browser-bundles.md#页面运行时)。
8
8
 
9
- 默认代理授权地址只有 localhost 与 127.0.0.1。其余站点由宿主取得权限后传入授权列表;组织域名和员工身份不属于本包默认值。Aplus/RUM/ARMS 基础事件解析在核心内置;业务请求辅助、埋点内部查询与校验、测试账号登录及用户 Cookie 身份推导留在独立能力中。
9
+ 默认代理授权地址为 localhost 与 127.0.0.1。其余站点由宿主取得权限后传入授权列表。核心内置 Aplus/RUM/ARMS 事件解析;扩展解析器通过能力包注册。
10
10
 
11
11
  Agent 合同源在本包的 agentChat.ts、agentSkills.ts 和 pluginModels.ts;分别通过同名子路径导出,agent-runtime 使用这些合同,避免并行维护副本。可序列化的页面函数保持自包含,便于 Extension 与 CDP 共同使用。
@@ -116,11 +116,6 @@ export interface NetworkControlSelection {
116
116
  id: string;
117
117
  value: string;
118
118
  }
119
- /** Parameters are interpreted and validated by the installed request protocol. */
120
- export interface SendProtocolRequestParams {
121
- timeout?: number;
122
- [key: string]: unknown;
123
- }
124
119
  export type BrowserStatus = 'connected' | 'pairing' | 'running_disconnected' | 'stopped';
125
120
  export type BrowserTransport = 'extension' | 'cdp' | 'provider';
126
121
  export interface BrowserPairingInfo {
@@ -835,10 +830,6 @@ export interface BrowserActionMap {
835
830
  request: SendRequestParams;
836
831
  response: unknown;
837
832
  };
838
- send_protocol_request: {
839
- request: SendProtocolRequestParams;
840
- response: unknown;
841
- };
842
833
  browser_list: {
843
834
  request: BrowserListParams | undefined;
844
835
  response: BrowserListResult;
@@ -1000,7 +991,6 @@ export declare const BROWSER_ACTIONS: {
1000
991
  readonly get_rules: true;
1001
992
  readonly get_capabilities: true;
1002
993
  readonly send_request: true;
1003
- readonly send_protocol_request: true;
1004
994
  readonly browser_list: true;
1005
995
  readonly browser_select_browser: true;
1006
996
  readonly browser_release: true;
@@ -1047,7 +1037,6 @@ export declare const BROWSER_COMMAND_ACTIONS: {
1047
1037
  readonly get_rules: true;
1048
1038
  readonly get_capabilities: true;
1049
1039
  readonly send_request: true;
1050
- readonly send_protocol_request: true;
1051
1040
  readonly browser_list: true;
1052
1041
  readonly browser_release: true;
1053
1042
  readonly browser_control: true;
@@ -1093,7 +1082,6 @@ export declare const EXTENSION_BROWSER_ACTIONS: {
1093
1082
  readonly get_rules: true;
1094
1083
  readonly get_capabilities: true;
1095
1084
  readonly send_request: true;
1096
- readonly send_protocol_request: true;
1097
1085
  readonly browser_release: true;
1098
1086
  readonly page_screenshot: true;
1099
1087
  readonly tab_open: true;
@@ -1135,7 +1123,6 @@ export declare const BROWSER_CAPABILITY_ACTIONS: {
1135
1123
  readonly get_rules: true;
1136
1124
  readonly get_capabilities: true;
1137
1125
  readonly send_request: true;
1138
- readonly send_protocol_request: true;
1139
1126
  readonly browser_release: true;
1140
1127
  readonly page_screenshot: true;
1141
1128
  readonly tab_open: true;
@@ -122,7 +122,6 @@ export const BROWSER_ACTIONS = {
122
122
  get_rules: true,
123
123
  get_capabilities: true,
124
124
  send_request: true,
125
- send_protocol_request: true,
126
125
  browser_list: true,
127
126
  browser_select_browser: true,
128
127
  browser_release: true,
@@ -169,7 +168,6 @@ export const BROWSER_COMMAND_ACTIONS = {
169
168
  get_rules: true,
170
169
  get_capabilities: true,
171
170
  send_request: true,
172
- send_protocol_request: true,
173
171
  browser_list: true,
174
172
  browser_release: true,
175
173
  browser_control: true,
@@ -215,7 +213,6 @@ export const EXTENSION_BROWSER_ACTIONS = {
215
213
  get_rules: true,
216
214
  get_capabilities: true,
217
215
  send_request: true,
218
- send_protocol_request: true,
219
216
  browser_release: true,
220
217
  page_screenshot: true,
221
218
  tab_open: true,
@@ -302,7 +302,7 @@ export class PluginPageRuntimeHost {
302
302
  !isPluginPageInstanceId(instance.instanceId) ||
303
303
  !instance.host?.hostId ||
304
304
  !instance.host.epoch ||
305
- !/^[a-z][a-z0-9-]*$/.test(instance.plugin) ||
305
+ !/^[a-z][a-z0-9_-]*$/.test(instance.plugin) ||
306
306
  !data.runtime?.code ||
307
307
  !Array.isArray(data.runtime.matches))
308
308
  throw new Error('Invalid plugin page attachment');
@@ -614,7 +614,7 @@ export class PluginPageRuntimeHost {
614
614
  throw new Error('PLUGIN_PAGE_INVALIDATED: Page left its activation URL range');
615
615
  }
616
616
  async activation(data, preserveManual = false) {
617
- if (!/^[a-z][a-z0-9-]*$/.test(data.plugin))
617
+ if (!/^[a-z][a-z0-9_-]*$/.test(data.plugin))
618
618
  throw new Error('Invalid page activation plugin');
619
619
  if (data.enabled === undefined)
620
620
  return { activation: this.rules.get(data.plugin) ?? null };
@@ -87,7 +87,6 @@ export const ACTIONS_SKIP_DOMAIN_CHECK = new Set([
87
87
  'get_browser_info',
88
88
  'get_capabilities',
89
89
  '__export_cookies',
90
- 'send_protocol_request',
91
90
  'run_actions',
92
91
  'browser_release',
93
92
  '__control_cleanup',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mearl/browser-core",
3
- "version": "3.0.0-beta.7",
3
+ "version": "3.0.0-beta.9",
4
4
  "description": "Shared pure-logic utilities for Mearl — usable in both browser extension and Node.js environments",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",