@attson/atwebpilot-mcp 0.0.36 → 0.0.38
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/dist/index.js +69 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -661,6 +661,18 @@ function capabilityForTool(tool, opts) {
|
|
|
661
661
|
case "highlightText":
|
|
662
662
|
return "read:dom";
|
|
663
663
|
// visual-only overlay
|
|
664
|
+
// Round 6 — common helpers
|
|
665
|
+
case "navigate":
|
|
666
|
+
return "nav:tab";
|
|
667
|
+
case "getPageInfo":
|
|
668
|
+
return "read:dom";
|
|
669
|
+
case "pressKey":
|
|
670
|
+
return "interact:form";
|
|
671
|
+
// Intentionally reuses read:storage — it's already in DANGEROUS_CAPABILITIES,
|
|
672
|
+
// so the access-control outcome is correct. A dedicated write:storage capability
|
|
673
|
+
// can be added later if a finer distinction is needed.
|
|
674
|
+
case "writeStorage":
|
|
675
|
+
return "read:storage";
|
|
664
676
|
default: {
|
|
665
677
|
const _exhaustive = tool;
|
|
666
678
|
throw new Error(`capabilityForTool: unknown tool ${_exhaustive}`);
|
|
@@ -1551,6 +1563,63 @@ var TOOL_DEFS = [
|
|
|
1551
1563
|
},
|
|
1552
1564
|
required: ["fields"]
|
|
1553
1565
|
}
|
|
1566
|
+
},
|
|
1567
|
+
// ─── Round 6 — common helpers ─────────────────────────────────
|
|
1568
|
+
{
|
|
1569
|
+
name: "navigate",
|
|
1570
|
+
description: "[ACT] \u9875\u9762\u5BFC\u822A\uFF1A\u540E\u9000 / \u524D\u8FDB / \u91CD\u8F7D / \u8DF3\u8F6C\u3002**\u4F18\u5148**\u7528\u672C\u5DE5\u5177\u800C\u4E0D\u662F runJS('location.href = ...')\u3002\n\u793A\u4F8B\uFF1A\n- \u540E\u9000\u4E00\u9875\uFF1A{ action: 'back' }\n- \u8DF3\u5230\u65B0 URL\uFF1A{ action: 'goto', url: 'https://example.com/page' }",
|
|
1571
|
+
input_schema: {
|
|
1572
|
+
type: "object",
|
|
1573
|
+
properties: {
|
|
1574
|
+
action: { type: "string", enum: ["back", "forward", "reload", "goto"] },
|
|
1575
|
+
url: { type: "string", description: "\u4EC5 action=goto \u65F6\u4F7F\u7528\uFF1B\u53EA\u5141\u8BB8 http/https/file/ftp" },
|
|
1576
|
+
tabId: TAB_ID_FIELD
|
|
1577
|
+
},
|
|
1578
|
+
required: ["action"]
|
|
1579
|
+
}
|
|
1580
|
+
},
|
|
1581
|
+
{
|
|
1582
|
+
name: "getPageInfo",
|
|
1583
|
+
description: "[FAST\xB7READ] \u8BFB\u5F53\u524D\u9875\u57FA\u672C\u4FE1\u606F\uFF1AURL / title / hostname / \u8BED\u8A00 / OpenGraph meta\u3002\n\u591A\u9875\u5BF9\u8BDD\u4E2D\u300C\u6211\u5728\u54EA\u4E2A\u9875\u9762\u300D\u7684\u9996\u9009\uFF1B\u6BD4 snapshotDOM \u4FBF\u5B9C\u5F97\u591A\u3002",
|
|
1584
|
+
input_schema: {
|
|
1585
|
+
type: "object",
|
|
1586
|
+
properties: {
|
|
1587
|
+
tabId: TAB_ID_FIELD
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
},
|
|
1591
|
+
{
|
|
1592
|
+
name: "pressKey",
|
|
1593
|
+
description: "[ACT] \u6A21\u62DF\u952E\u76D8\u4E8B\u4EF6\uFF08keydown + \u53EF\u6253\u5370\u5B57\u7B26 keypress + keyup\uFF09\u3002\n\u5E38\u7528\uFF1AEnter \u63D0\u4EA4\u65E0 form \u7684\u641C\u7D22\u6846 / Escape \u5173 modal / Tab \u5207\u7126\u70B9\u3002key \u7528 KeyboardEvent.key \u503C\u3002\n\u672C\u5DE5\u5177**\u4E0D**\u6539 input \u503C\u2014\u2014\u586B\u503C\u4ECD\u8D70 fillInput / fillByUid\u3002\n\u793A\u4F8B\uFF1A\n- \u63D0\u4EA4\u641C\u7D22\uFF1A{ selector: 'input[name=q]', key: 'Enter' }\n- \u5173 modal\uFF1A{ key: 'Escape' }",
|
|
1594
|
+
input_schema: {
|
|
1595
|
+
type: "object",
|
|
1596
|
+
properties: {
|
|
1597
|
+
key: { type: "string", description: "\u5982 'Enter' / 'Escape' / 'Tab' / 'ArrowDown' / 'a'" },
|
|
1598
|
+
selector: {
|
|
1599
|
+
type: "string",
|
|
1600
|
+
description: "\u53EF\u9009\uFF1B\u4E0D\u4F20\u5219\u6D3E\u53D1\u5230 document.activeElement \u6216 document.body"
|
|
1601
|
+
},
|
|
1602
|
+
tabId: TAB_ID_FIELD
|
|
1603
|
+
},
|
|
1604
|
+
required: ["key"]
|
|
1605
|
+
}
|
|
1606
|
+
},
|
|
1607
|
+
{
|
|
1608
|
+
name: "writeStorage",
|
|
1609
|
+
description: "[DANGER] \u5199 localStorage \u6216 sessionStorage\u3002\u6539\u7AD9\u70B9\u72B6\u6001\uFF0C\u9700\u8981\u5BA1\u9605\u3002",
|
|
1610
|
+
input_schema: {
|
|
1611
|
+
type: "object",
|
|
1612
|
+
properties: {
|
|
1613
|
+
store: { type: "string", enum: ["local", "session"] },
|
|
1614
|
+
key: { type: "string" },
|
|
1615
|
+
value: {
|
|
1616
|
+
type: "string",
|
|
1617
|
+
description: "\u5B57\u7B26\u4E32\u503C\uFF1B\u975E\u5B57\u7B26\u4E32\u8BF7\u81EA\u884C JSON.stringify"
|
|
1618
|
+
},
|
|
1619
|
+
tabId: TAB_ID_FIELD
|
|
1620
|
+
},
|
|
1621
|
+
required: ["store", "key", "value"]
|
|
1622
|
+
}
|
|
1554
1623
|
}
|
|
1555
1624
|
];
|
|
1556
1625
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@attson/atwebpilot-mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.38",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "MCP server for the atwebpilot browser extension — let Claude Code drive your browser.",
|
|
6
6
|
"homepage": "https://github.com/attson/atwebpilot#readme",
|