@one2x/playwright 1.57.0-alpha.2 → 1.57.0-alpha.3

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.
Files changed (2) hide show
  1. package/lib/mcp/sdk/http.js +12 -12
  2. package/package.json +2 -2
@@ -79,6 +79,18 @@ async function installHttpTransport(httpServer, serverBackendFactory, unguessabl
79
79
  const sseSessions = /* @__PURE__ */ new Map();
80
80
  const streamableSessions = /* @__PURE__ */ new Map();
81
81
  httpServer.on("request", async (req, res) => {
82
+ const path = req.url?.slice(pathPrefix.length);
83
+ const url2 = new URL(`http://localhost${path}`);
84
+ if (url2.pathname === "/health") {
85
+ res.writeHead(200, { "Content-Type": "application/json" });
86
+ res.end(JSON.stringify({
87
+ status: "healthy",
88
+ version: serverBackendFactory.version,
89
+ service: serverBackendFactory.name,
90
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
91
+ }));
92
+ return;
93
+ }
82
94
  if (!allowAnyHost) {
83
95
  const host2 = req.headers.host?.toLowerCase();
84
96
  if (!host2) {
@@ -94,24 +106,12 @@ async function installHttpTransport(httpServer, serverBackendFactory, unguessabl
94
106
  res.statusCode = 404;
95
107
  return res.end("Not found");
96
108
  }
97
- const path = req.url?.slice(pathPrefix.length);
98
- const url2 = new URL(`http://localhost${path}`);
99
109
  if (url2.pathname === "/killkillkill" && req.method === "GET") {
100
110
  res.statusCode = 200;
101
111
  res.end("Killing process");
102
112
  process.emit("SIGINT");
103
113
  return;
104
114
  }
105
- if (url2.pathname === "/health") {
106
- res.writeHead(200, { "Content-Type": "application/json" });
107
- res.end(JSON.stringify({
108
- status: "healthy",
109
- version: serverBackendFactory.version,
110
- service: serverBackendFactory.name,
111
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
112
- }));
113
- return;
114
- }
115
115
  if (url2.pathname.startsWith("/sse"))
116
116
  await handleSSE(serverBackendFactory, req, res, url2, sseSessions);
117
117
  else
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@one2x/playwright",
3
- "version": "1.57.0-alpha.2",
3
+ "version": "1.57.0-alpha.3",
4
4
  "description": "A high-level API to automate web browsers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -65,7 +65,7 @@
65
65
  "license": "Apache-2.0",
66
66
  "dependencies": {
67
67
  "content-type": "^1.0.5",
68
- "playwright-core": "npm:@one2x/playwright-core@1.57.0-alpha.2",
68
+ "playwright-core": "npm:@one2x/playwright-core@1.57.0-alpha.3",
69
69
  "raw-body": "^2.5.2"
70
70
  },
71
71
  "optionalDependencies": {