vcorp-chrome 1.7.0 → 1.8.1
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/extension/background.js +123 -0
- package/extension/cloud-policy.js +407 -390
- package/extension/cloud.js +1005 -972
- package/extension/load.js +58 -0
- package/extension/loads/eda/LICENSE +41 -0
- package/extension/loads/eda/NOTICE +38 -0
- package/extension/loads/eda/agent.js +19301 -0
- package/extension/loads/index.js +200 -0
- package/extension/manifest.json +38 -38
- package/extension/mark.js +10 -3
- package/package.json +49 -44
- package/src/mcp-server.js +32 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
// 由 scripts/build-loads.mjs 生成,不要手改。数据源是 loads/<name>/load.json。
|
|
2
|
+
// 纯数据:cloud-policy.js 在 Node 里也要能 import 它。
|
|
3
|
+
export const LOADS = {
|
|
4
|
+
"eda": {
|
|
5
|
+
"name": "eda",
|
|
6
|
+
"title": "嘉立创EDA 专业版",
|
|
7
|
+
"description": "在嘉立创EDA/EasyEDA 专业版网页编辑器里调用有类型、带核对的原理图与 PCB 操作(来自 easyeda-agent 的 actions 层)。",
|
|
8
|
+
"version": "1.15.0+7a73a68.f00c96",
|
|
9
|
+
"hosts": [
|
|
10
|
+
"pro.lceda.cn",
|
|
11
|
+
"pro.easyeda.com"
|
|
12
|
+
],
|
|
13
|
+
"waitFor": "_EXTAPI_ROOT_",
|
|
14
|
+
"files": [
|
|
15
|
+
"loads/eda/agent.js"
|
|
16
|
+
],
|
|
17
|
+
"limits": {
|
|
18
|
+
"payloadMax": 262144,
|
|
19
|
+
"timeoutMs": 120000,
|
|
20
|
+
"timeoutMaxMs": 600000
|
|
21
|
+
},
|
|
22
|
+
"actions": {
|
|
23
|
+
"read": [
|
|
24
|
+
"project.current",
|
|
25
|
+
"project.find",
|
|
26
|
+
"document.current",
|
|
27
|
+
"document.source.get",
|
|
28
|
+
"document.open",
|
|
29
|
+
"document.close",
|
|
30
|
+
"editor.panels",
|
|
31
|
+
"view.fit",
|
|
32
|
+
"view.zoom",
|
|
33
|
+
"view.region",
|
|
34
|
+
"board.list",
|
|
35
|
+
"board.current",
|
|
36
|
+
"schematic.pages.list",
|
|
37
|
+
"schematic.page.open",
|
|
38
|
+
"schematic.titleblock.get",
|
|
39
|
+
"schematic.components.list",
|
|
40
|
+
"schematic.attribute.inspect",
|
|
41
|
+
"schematic.designators.list",
|
|
42
|
+
"schematic.image.list",
|
|
43
|
+
"schematic.text.list",
|
|
44
|
+
"schematic.visible_text.bboxes",
|
|
45
|
+
"schematic.read",
|
|
46
|
+
"schematic.drc.check",
|
|
47
|
+
"schematic.check",
|
|
48
|
+
"schematic.bridgeCheck",
|
|
49
|
+
"schematic.export.netlist",
|
|
50
|
+
"schematic.export.image",
|
|
51
|
+
"schematic.export.bom",
|
|
52
|
+
"schematic.library.search",
|
|
53
|
+
"schematic.library.get_by_lcsc",
|
|
54
|
+
"library.list",
|
|
55
|
+
"library.common.list",
|
|
56
|
+
"library.footprint.get",
|
|
57
|
+
"library.symbol.get",
|
|
58
|
+
"library.symbol.export_source",
|
|
59
|
+
"library.device.get",
|
|
60
|
+
"pcb.documents.list",
|
|
61
|
+
"pcb.board.info",
|
|
62
|
+
"pcb.components.list",
|
|
63
|
+
"pcb.layers.list",
|
|
64
|
+
"pcb.layers.set_current",
|
|
65
|
+
"pcb.layers.visibility",
|
|
66
|
+
"pcb.view.side",
|
|
67
|
+
"pcb.view.filter.get",
|
|
68
|
+
"pcb.silk.list",
|
|
69
|
+
"pcb.image.list",
|
|
70
|
+
"pcb.nets.list",
|
|
71
|
+
"pcb.net_class.list",
|
|
72
|
+
"pcb.constraint.list",
|
|
73
|
+
"pcb.report",
|
|
74
|
+
"pcb.drc.check",
|
|
75
|
+
"pcb.drc.rules",
|
|
76
|
+
"pcb.config.get",
|
|
77
|
+
"pcb.line.list",
|
|
78
|
+
"pcb.via.list",
|
|
79
|
+
"pcb.pour.list",
|
|
80
|
+
"pcb.poured.list",
|
|
81
|
+
"pcb.region.list",
|
|
82
|
+
"pcb.fill.list",
|
|
83
|
+
"pcb.outline.get",
|
|
84
|
+
"pcb.origin.get",
|
|
85
|
+
"pcb.snapshot",
|
|
86
|
+
"pcb.export.dsn"
|
|
87
|
+
],
|
|
88
|
+
"write": [
|
|
89
|
+
"project.create",
|
|
90
|
+
"project.open",
|
|
91
|
+
"board.create",
|
|
92
|
+
"board.new",
|
|
93
|
+
"board.new_pcb",
|
|
94
|
+
"board.rename",
|
|
95
|
+
"board.copy",
|
|
96
|
+
"board.rebind",
|
|
97
|
+
"schematic.rename",
|
|
98
|
+
"schematic.page.create",
|
|
99
|
+
"schematic.page.rename",
|
|
100
|
+
"schematic.titleblock.modify",
|
|
101
|
+
"schematic.component.place",
|
|
102
|
+
"schematic.component.modify",
|
|
103
|
+
"schematic.component.delete",
|
|
104
|
+
"schematic.component.replace",
|
|
105
|
+
"schematic.component.resolve_lcsc",
|
|
106
|
+
"schematic.rebind.footprint",
|
|
107
|
+
"schematic.rebind.symbol",
|
|
108
|
+
"schematic.attribute.move",
|
|
109
|
+
"schematic.text.move",
|
|
110
|
+
"schematic.group.move",
|
|
111
|
+
"schematic.primitives.delete",
|
|
112
|
+
"schematic.wire.create",
|
|
113
|
+
"schematic.netflag.create",
|
|
114
|
+
"schematic.power.connect_pin",
|
|
115
|
+
"schematic.pin.set_no_connect",
|
|
116
|
+
"schematic.pin.disconnect",
|
|
117
|
+
"schematic.image.create",
|
|
118
|
+
"schematic.image.modify",
|
|
119
|
+
"schematic.save",
|
|
120
|
+
"library.footprint.create",
|
|
121
|
+
"library.footprint.copy",
|
|
122
|
+
"library.footprint.build",
|
|
123
|
+
"library.footprint.region_create",
|
|
124
|
+
"library.symbol.create",
|
|
125
|
+
"library.symbol.build",
|
|
126
|
+
"library.device.create",
|
|
127
|
+
"pcb.import_changes",
|
|
128
|
+
"pcb.add_component",
|
|
129
|
+
"pcb.component.attrs_backfill",
|
|
130
|
+
"pcb.component.modify",
|
|
131
|
+
"pcb.component.lock",
|
|
132
|
+
"pcb.component.delete",
|
|
133
|
+
"pcb.components.move",
|
|
134
|
+
"pcb.components.arrange",
|
|
135
|
+
"pcb.align",
|
|
136
|
+
"pcb.distribute",
|
|
137
|
+
"pcb.grid_snap",
|
|
138
|
+
"pcb.stackup.set",
|
|
139
|
+
"pcb.drc.rules.set",
|
|
140
|
+
"pcb.config.set",
|
|
141
|
+
"pcb.net.color.set",
|
|
142
|
+
"pcb.net_class.create",
|
|
143
|
+
"pcb.differential_pair.create",
|
|
144
|
+
"pcb.differential_pair.delete",
|
|
145
|
+
"pcb.differential_pair.rename",
|
|
146
|
+
"pcb.equal_length_group.create",
|
|
147
|
+
"pcb.equal_length_group.add_nets",
|
|
148
|
+
"pcb.equal_length_group.delete",
|
|
149
|
+
"pcb.outline.set",
|
|
150
|
+
"pcb.outline.clear",
|
|
151
|
+
"pcb.origin.set",
|
|
152
|
+
"pcb.line.create",
|
|
153
|
+
"pcb.via.create",
|
|
154
|
+
"pcb.route.rip_up",
|
|
155
|
+
"pcb.route.delete",
|
|
156
|
+
"pcb.route.via_hop",
|
|
157
|
+
"pcb.track.lock",
|
|
158
|
+
"pcb.clear_routing",
|
|
159
|
+
"pcb.route.auto",
|
|
160
|
+
"pcb.import_autoroute",
|
|
161
|
+
"pcb.pour.create",
|
|
162
|
+
"pcb.pour.delete",
|
|
163
|
+
"pcb.pour.rebuild",
|
|
164
|
+
"pcb.region.create",
|
|
165
|
+
"pcb.region.delete",
|
|
166
|
+
"pcb.fill.create",
|
|
167
|
+
"pcb.fill.delete",
|
|
168
|
+
"pcb.silk.add",
|
|
169
|
+
"pcb.silk.set",
|
|
170
|
+
"pcb.silk.align",
|
|
171
|
+
"pcb.silk.netnames",
|
|
172
|
+
"pcb.silk.label_pads",
|
|
173
|
+
"pcb.silk.import_svg",
|
|
174
|
+
"pcb.image.create",
|
|
175
|
+
"pcb.image.modify",
|
|
176
|
+
"pcb.image.delete",
|
|
177
|
+
"pcb.beautify",
|
|
178
|
+
"pcb.save"
|
|
179
|
+
]
|
|
180
|
+
},
|
|
181
|
+
"confirm": {
|
|
182
|
+
"schematic.component.delete": "删除原理图里的元件",
|
|
183
|
+
"schematic.primitives.delete": "删除原理图里的图元(导线、标识、文字等)",
|
|
184
|
+
"pcb.import_changes": "把原理图的改动导入 PCB(可能增删封装和飞线)",
|
|
185
|
+
"pcb.add_component": "往 PCB 上加封装",
|
|
186
|
+
"pcb.component.delete": "删除 PCB 上的封装",
|
|
187
|
+
"pcb.outline.set": "重画板框",
|
|
188
|
+
"pcb.outline.clear": "清掉板框",
|
|
189
|
+
"pcb.route.rip_up": "拆掉布线",
|
|
190
|
+
"pcb.route.delete": "删除布线",
|
|
191
|
+
"pcb.clear_routing": "清空全部布线",
|
|
192
|
+
"pcb.route.auto": "自动布线(会整片重做走线)",
|
|
193
|
+
"pcb.pour.delete": "删除铺铜",
|
|
194
|
+
"pcb.region.delete": "删除禁止区域",
|
|
195
|
+
"pcb.fill.delete": "删除填充"
|
|
196
|
+
},
|
|
197
|
+
"sha256": "2702ea1be226305aaaeda5e188139d4acc8d596f86d5d7165e26de95cb5914f8",
|
|
198
|
+
"bytes": 942689
|
|
199
|
+
}
|
|
200
|
+
};
|
package/extension/manifest.json
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
{
|
|
2
|
-
"manifest_version": 3,
|
|
3
|
-
"name": "vcorp-chrome",
|
|
4
|
-
"version": "1.
|
|
5
|
-
"description": "让 AI agent 操控你已登录的 Chrome。基于花叔的 huashu-chrome(MIT)修改。",
|
|
6
|
-
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq6xRqEwG4yTuHRG1Zah3j//T3B72XnazyZ+9fOCa5P4bBLPmNBN7YAGL5WnjtPVJefXT9r2Ol0qvNztayDG3dMjK6AZoWccgKa5rhxcvWgFUjanXtmBBQ0qgYwNhuEJSkdinLLtyUg6YmK7Mn72NWpfa/NfqNHdK5AHslvvtJ50iQAYmabl2Nd3vOJ9DxtLBt8a2DfoGPWizgEB3+gkqm2PB8LywwwoiGKd7acr1wZEWmWK9/s0YWdzIstjlvk5AO5XFn6EtEzW8tAAOwBka9239pcyj0kEogWctHLJn7p9VFru38r+I1USyGn6u9XQ68n9edWddxBYokETCqEMT9QIDAQAB",
|
|
7
|
-
"minimum_chrome_version": "116",
|
|
8
|
-
"background": {
|
|
9
|
-
"service_worker": "background.js",
|
|
10
|
-
"type": "module"
|
|
11
|
-
},
|
|
12
|
-
"action": {
|
|
13
|
-
"default_title": "vcorp-chrome"
|
|
14
|
-
},
|
|
15
|
-
"permissions": [
|
|
16
|
-
"tabs",
|
|
17
|
-
"tabGroups",
|
|
18
|
-
"scripting",
|
|
19
|
-
"storage",
|
|
20
|
-
"alarms",
|
|
21
|
-
"offscreen",
|
|
22
|
-
"downloads",
|
|
23
|
-
"sidePanel",
|
|
24
|
-
"notifications",
|
|
25
|
-
"debugger"
|
|
26
|
-
],
|
|
27
|
-
"host_permissions": [
|
|
28
|
-
"<all_urls>"
|
|
29
|
-
],
|
|
30
|
-
"icons": {
|
|
31
|
-
"16": "icons/icon16.png",
|
|
32
|
-
"48": "icons/icon48.png",
|
|
33
|
-
"128": "icons/icon128.png"
|
|
34
|
-
},
|
|
35
|
-
"side_panel": {
|
|
36
|
-
"default_path": "panel.html"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"manifest_version": 3,
|
|
3
|
+
"name": "vcorp-chrome",
|
|
4
|
+
"version": "1.8.1",
|
|
5
|
+
"description": "让 AI agent 操控你已登录的 Chrome。基于花叔的 huashu-chrome(MIT)修改。",
|
|
6
|
+
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq6xRqEwG4yTuHRG1Zah3j//T3B72XnazyZ+9fOCa5P4bBLPmNBN7YAGL5WnjtPVJefXT9r2Ol0qvNztayDG3dMjK6AZoWccgKa5rhxcvWgFUjanXtmBBQ0qgYwNhuEJSkdinLLtyUg6YmK7Mn72NWpfa/NfqNHdK5AHslvvtJ50iQAYmabl2Nd3vOJ9DxtLBt8a2DfoGPWizgEB3+gkqm2PB8LywwwoiGKd7acr1wZEWmWK9/s0YWdzIstjlvk5AO5XFn6EtEzW8tAAOwBka9239pcyj0kEogWctHLJn7p9VFru38r+I1USyGn6u9XQ68n9edWddxBYokETCqEMT9QIDAQAB",
|
|
7
|
+
"minimum_chrome_version": "116",
|
|
8
|
+
"background": {
|
|
9
|
+
"service_worker": "background.js",
|
|
10
|
+
"type": "module"
|
|
11
|
+
},
|
|
12
|
+
"action": {
|
|
13
|
+
"default_title": "vcorp-chrome"
|
|
14
|
+
},
|
|
15
|
+
"permissions": [
|
|
16
|
+
"tabs",
|
|
17
|
+
"tabGroups",
|
|
18
|
+
"scripting",
|
|
19
|
+
"storage",
|
|
20
|
+
"alarms",
|
|
21
|
+
"offscreen",
|
|
22
|
+
"downloads",
|
|
23
|
+
"sidePanel",
|
|
24
|
+
"notifications",
|
|
25
|
+
"debugger"
|
|
26
|
+
],
|
|
27
|
+
"host_permissions": [
|
|
28
|
+
"<all_urls>"
|
|
29
|
+
],
|
|
30
|
+
"icons": {
|
|
31
|
+
"16": "icons/icon16.png",
|
|
32
|
+
"48": "icons/icon48.png",
|
|
33
|
+
"128": "icons/icon128.png"
|
|
34
|
+
},
|
|
35
|
+
"side_panel": {
|
|
36
|
+
"default_path": "panel.html"
|
|
37
|
+
}
|
|
38
|
+
}
|
package/extension/mark.js
CHANGED
|
@@ -242,7 +242,13 @@
|
|
|
242
242
|
// ---------- host ----------
|
|
243
243
|
|
|
244
244
|
function ensureHost() {
|
|
245
|
-
|
|
245
|
+
// document.open() 会换掉整棵 <html>,window 和这里的状态却原样留着(嘉立创EDA 的
|
|
246
|
+
// 加载器就是 document.open + writeln 整页)。只认 host 变量,浮条和边框就会一直
|
|
247
|
+
// 画在一个已经脱离文档的节点里,谁也看不见;ask 干等到超时。
|
|
248
|
+
if (host) {
|
|
249
|
+
if (!host.isConnected) document.documentElement.appendChild(host);
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
246
252
|
// z-index 顶格:ask 并进来之后这个 host 不再是纯装饰层——「需要确认」的
|
|
247
253
|
// 浮条绝不能被页面自己的最高层弹窗盖住(支付确认被遮住=没有确认)。
|
|
248
254
|
// 边框和光标跟着顶格没有代价,它们 pointer-events:none。
|
|
@@ -561,9 +567,10 @@
|
|
|
561
567
|
}
|
|
562
568
|
|
|
563
569
|
function showAsk(msg) {
|
|
564
|
-
|
|
565
|
-
//
|
|
570
|
+
// 上一轮还开着就先结算掉,否则两个浮条叠在一起,旧的永远没人回应。
|
|
571
|
+
// 结算要在 ensureHost 之前:页面没有主时 closeAsk 会顺手拆掉 host。
|
|
566
572
|
if (askSettle) closeAsk('cancelled', '被新的请求取代');
|
|
573
|
+
ensureHost();
|
|
567
574
|
askOutcome = null;
|
|
568
575
|
askSettle = true;
|
|
569
576
|
|
package/package.json
CHANGED
|
@@ -1,44 +1,49 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "vcorp-chrome",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "让任何 AI agent 操控你自己的 Chrome——带着全部登录态。MCP + Chrome 扩展,Claude Code / Codex / Cursor / Gemini CLI 通用。",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"vcorp-chrome": "src/cli.js"
|
|
8
|
-
},
|
|
9
|
-
"files": [
|
|
10
|
-
"src",
|
|
11
|
-
"extension",
|
|
12
|
-
"docs",
|
|
13
|
-
"README.md"
|
|
14
|
-
],
|
|
15
|
-
"engines": {
|
|
16
|
-
"node": ">=20"
|
|
17
|
-
},
|
|
18
|
-
"scripts": {
|
|
19
|
-
"mcp": "node src/cli.js mcp",
|
|
20
|
-
"bridge": "node src/cli.js bridge --foreground",
|
|
21
|
-
"doctor": "node src/cli.js doctor",
|
|
22
|
-
"
|
|
23
|
-
"test
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "vcorp-chrome",
|
|
3
|
+
"version": "1.8.1",
|
|
4
|
+
"description": "让任何 AI agent 操控你自己的 Chrome——带着全部登录态。MCP + Chrome 扩展,Claude Code / Codex / Cursor / Gemini CLI 通用。",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"vcorp-chrome": "src/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"src",
|
|
11
|
+
"extension",
|
|
12
|
+
"docs",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=20"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"mcp": "node src/cli.js mcp",
|
|
20
|
+
"bridge": "node src/cli.js bridge --foreground",
|
|
21
|
+
"doctor": "node src/cli.js doctor",
|
|
22
|
+
"build:loads": "node scripts/build-loads.mjs",
|
|
23
|
+
"test": "node --test test/protocol.test.js test/mcp.test.js test/fetch-pages.test.js test/liveness.test.js test/redact.test.js test/audit-redact.test.js test/learnings.test.js test/risk.test.js test/identity.test.js test/host.test.js test/presence.test.js test/act-script.test.js test/multi-instance.test.js test/compat.test.js test/cloud-policy.test.js test/loads.test.js",
|
|
24
|
+
"test:live": "node --test test/scenarios.test.js"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@modelcontextprotocol/sdk": "^1.22.0",
|
|
28
|
+
"ws": "^8.18.3"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"mcp",
|
|
32
|
+
"chrome",
|
|
33
|
+
"browser-automation",
|
|
34
|
+
"claude-code",
|
|
35
|
+
"codex",
|
|
36
|
+
"cursor",
|
|
37
|
+
"ai-agent"
|
|
38
|
+
],
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"author": "Wizard",
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "git+https://github.com/wizd/huashu-chrome.git"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"esbuild": "^0.24.2",
|
|
47
|
+
"jszip": "^3.10.1"
|
|
48
|
+
}
|
|
49
|
+
}
|
package/src/mcp-server.js
CHANGED
|
@@ -10,6 +10,7 @@ import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprot
|
|
|
10
10
|
import { BridgeClient } from './lib/rpc.js';
|
|
11
11
|
import { resolveHost } from './lib/host.js';
|
|
12
12
|
import { flatCount } from '../extension/script.js';
|
|
13
|
+
import { LOADS } from '../extension/loads/index.js';
|
|
13
14
|
import { getLearnings, saveLearnings, saveDraft, adoptDraft } from './lib/learnings.js';
|
|
14
15
|
import { audit } from './lib/paths.js';
|
|
15
16
|
import fs from 'node:fs';
|
|
@@ -457,6 +458,31 @@ const TOOLS = [
|
|
|
457
458
|
required: ['expr'],
|
|
458
459
|
},
|
|
459
460
|
},
|
|
461
|
+
{
|
|
462
|
+
name: 'load',
|
|
463
|
+
description:
|
|
464
|
+
'Install a capability pack bundled with the extension into the tab (e.g. "eda" on pro.lceda.cn / pro.easyeda.com). ' +
|
|
465
|
+
'Returns its read/write action list. Use `call` afterwards instead of eval.',
|
|
466
|
+
inputSchema: {
|
|
467
|
+
type: 'object',
|
|
468
|
+
properties: { name: { type: 'string' }, reload: { type: 'boolean' }, tabId: TAB },
|
|
469
|
+
required: ['name'],
|
|
470
|
+
},
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
name: 'call',
|
|
474
|
+
description:
|
|
475
|
+
'Call one action of a loaded pack with a JSON payload; result is JSON. Re-loads by itself after a page refresh. ' +
|
|
476
|
+
'timeout ms defaults to the pack limit (eda: 120000, max 600000).',
|
|
477
|
+
inputSchema: {
|
|
478
|
+
type: 'object',
|
|
479
|
+
properties: {
|
|
480
|
+
name: { type: 'string' }, action: { type: 'string' }, payload: { type: 'object' },
|
|
481
|
+
timeout: { type: 'number' }, tabId: TAB,
|
|
482
|
+
},
|
|
483
|
+
required: ['name', 'action'],
|
|
484
|
+
},
|
|
485
|
+
},
|
|
460
486
|
{
|
|
461
487
|
name: 'learnings',
|
|
462
488
|
description:
|
|
@@ -627,6 +653,12 @@ export async function startMcpServer({ client = 'unknown' } = {}) {
|
|
|
627
653
|
// 扩展侧的执行预算同源(extension/script.js),否则预算会判死一个
|
|
628
654
|
// 还在老实跑的剧本,「已经在做」被报成「没做,去重试」。
|
|
629
655
|
if (n === 'act') return cap(Math.min(flatCount(a.steps) || 1, 60) * 8000 + 20000);
|
|
656
|
+
// 能力包:load 要等编辑器加载(最多 30 秒)再等 ready();call 的上限由参数和包的 limits 决定
|
|
657
|
+
if (n === 'load') return 80000;
|
|
658
|
+
if (n === 'call') {
|
|
659
|
+
const lim = LOADS[a.name]?.limits;
|
|
660
|
+
return cap(Math.min(Number(a.timeout) || lim?.timeoutMs || 120000, lim?.timeoutMaxMs || 600000) + 15000);
|
|
661
|
+
}
|
|
630
662
|
return undefined; // 其余维持默认,它们的真实耗时离墙还很远
|
|
631
663
|
};
|
|
632
664
|
|