@attson/atwebpilot-mcp 0.0.28 → 0.0.29
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 +46 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1454,11 +1454,53 @@ async function handleBrowserTool(deps, gen, args) {
|
|
|
1454
1454
|
return result.return ?? null;
|
|
1455
1455
|
}
|
|
1456
1456
|
|
|
1457
|
+
// src/skill-bundle.ts
|
|
1458
|
+
import { readFileSync } from "fs";
|
|
1459
|
+
import { dirname, join } from "path";
|
|
1460
|
+
import { fileURLToPath } from "url";
|
|
1461
|
+
var SKILL_NAME = "atwebpilot-browser";
|
|
1462
|
+
var SKILL_DESCRIPTION = "Strategy + scenarios + safety rails for driving the AtWebPilot browser extension via MCP.";
|
|
1463
|
+
var cached = null;
|
|
1464
|
+
function locateSkillFile() {
|
|
1465
|
+
let here = dirname(fileURLToPath(import.meta.url));
|
|
1466
|
+
for (let i = 0; i < 6; i++) {
|
|
1467
|
+
const candidate = join(here, "skill", "SKILL.md");
|
|
1468
|
+
try {
|
|
1469
|
+
readFileSync(candidate, "utf-8");
|
|
1470
|
+
return candidate;
|
|
1471
|
+
} catch {
|
|
1472
|
+
}
|
|
1473
|
+
here = dirname(here);
|
|
1474
|
+
}
|
|
1475
|
+
return join(dirname(fileURLToPath(import.meta.url)), "../../../skill/SKILL.md");
|
|
1476
|
+
}
|
|
1477
|
+
function readSkillBundle() {
|
|
1478
|
+
if (cached == null) {
|
|
1479
|
+
try {
|
|
1480
|
+
cached = readFileSync(locateSkillFile(), "utf-8");
|
|
1481
|
+
} catch {
|
|
1482
|
+
cached = `# ${SKILL_NAME}
|
|
1483
|
+
|
|
1484
|
+
${SKILL_DESCRIPTION}
|
|
1485
|
+
|
|
1486
|
+
(Skill bundle not found at build time; see https://github.com/attson/atwebpilot)
|
|
1487
|
+
`;
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
return { name: SKILL_NAME, description: SKILL_DESCRIPTION, content: cached };
|
|
1491
|
+
}
|
|
1492
|
+
var SKILL_TOOL = {
|
|
1493
|
+
name: "atwebpilot_skill_read",
|
|
1494
|
+
description: "Return the `atwebpilot-browser` skill bundle \u2014 a recommended tool-usage flow, scenarios, and safety rails for driving AtWebPilot's browser tools.",
|
|
1495
|
+
inputSchema: { type: "object", properties: {}, required: [] }
|
|
1496
|
+
};
|
|
1497
|
+
|
|
1457
1498
|
// src/mcp-server.ts
|
|
1458
1499
|
var BROWSER_TOOLS = generateBrowserTools();
|
|
1459
1500
|
var BROWSER_BY_NAME = new Map(BROWSER_TOOLS.map((t) => [t.name, t]));
|
|
1460
1501
|
function buildToolList() {
|
|
1461
1502
|
return [
|
|
1503
|
+
{ name: SKILL_TOOL.name, description: SKILL_TOOL.description, inputSchema: SKILL_TOOL.inputSchema },
|
|
1462
1504
|
...CONTROL_TOOLS.map((t) => ({ name: t.name, description: t.description, inputSchema: t.inputSchema })),
|
|
1463
1505
|
...BROWSER_TOOLS.map((t) => ({ name: t.name, description: t.description, inputSchema: t.inputSchema }))
|
|
1464
1506
|
];
|
|
@@ -1467,6 +1509,10 @@ var ok = (data) => ({ content: [{ type: "text", text: JSON.stringify(data ?? nul
|
|
|
1467
1509
|
var fail2 = (message) => ({ content: [{ type: "text", text: message }], isError: true });
|
|
1468
1510
|
async function dispatchCall(deps, name, args) {
|
|
1469
1511
|
try {
|
|
1512
|
+
if (name === SKILL_TOOL.name) {
|
|
1513
|
+
const bundle = readSkillBundle();
|
|
1514
|
+
return { content: [{ type: "text", text: bundle.content }] };
|
|
1515
|
+
}
|
|
1470
1516
|
if (name === "list_tabs") return ok(handleListTabs(deps));
|
|
1471
1517
|
if (name === "open_session") return ok(handleOpenSession(deps, args));
|
|
1472
1518
|
if (name === "close_session") return ok(handleCloseSession(deps, args));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@attson/atwebpilot-mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.29",
|
|
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",
|