kl-mcp-client 2.1.9__py3-none-any.whl → 2.1.10__py3-none-any.whl

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.
@@ -1 +1 @@
1
- __VERSION__ = "2.1.9"
1
+ __VERSION__ = "2.1.10"
@@ -354,3 +354,51 @@ class MCPTools:
354
354
  },
355
355
  )
356
356
  return res.get("structuredContent", {})
357
+ # ======================================================
358
+ # VIEWPORT (Playwright-style, ASYNC)
359
+ # ======================================================
360
+
361
+ async def get_viewport(self, sessionId: str) -> Dict[str, Any]:
362
+ """
363
+ Get current browser viewport.
364
+ Equivalent to Playwright page.viewportSize().
365
+ """
366
+ res = await self.client.call_tool(
367
+ "viewport",
368
+ {
369
+ "sessionId": sessionId,
370
+ },
371
+ )
372
+ return res.get("structuredContent", {})
373
+
374
+ async def set_viewport(
375
+ self,
376
+ sessionId: str,
377
+ *,
378
+ width: int,
379
+ height: int,
380
+ deviceScaleFactor: float = 1.0,
381
+ mobile: bool = False,
382
+ ) -> Dict[str, Any]:
383
+ """
384
+ Set browser viewport (Playwright-like).
385
+
386
+ Args:
387
+ width: viewport width
388
+ height: viewport height
389
+ deviceScaleFactor: default 1.0
390
+ mobile: mobile emulation flag
391
+ """
392
+ res = await self.client.call_tool(
393
+ "viewport",
394
+ {
395
+ "sessionId": sessionId,
396
+ "viewport": {
397
+ "width": int(width),
398
+ "height": int(height),
399
+ "deviceScaleFactor": float(deviceScaleFactor),
400
+ "mobile": bool(mobile),
401
+ },
402
+ },
403
+ )
404
+ return res.get("structuredContent", {})
kl_mcp_client/tools.py CHANGED
@@ -589,3 +589,51 @@ class MCPTools:
589
589
  "pod_name": pop_name
590
590
  },
591
591
  ).get("structuredContent", {})
592
+ # ======================================================
593
+ # VIEWPORT (Playwright-style)
594
+ # ======================================================
595
+
596
+ @_ensure_client
597
+ def get_viewport(self, sessionId: str) -> Dict[str, Any]:
598
+ """
599
+ Get current browser viewport.
600
+ Equivalent to Playwright page.viewportSize().
601
+ """
602
+ return self.client.call_tool(
603
+ "viewport",
604
+ {
605
+ "sessionId": sessionId,
606
+ },
607
+ ).get("structuredContent", {})
608
+
609
+ @_ensure_client
610
+ def set_viewport(
611
+ self,
612
+ sessionId: str,
613
+ *,
614
+ width: int,
615
+ height: int,
616
+ deviceScaleFactor: float = 1.0,
617
+ mobile: bool = False,
618
+ ) -> Dict[str, Any]:
619
+ """
620
+ Set browser viewport (Playwright-like).
621
+
622
+ Args:
623
+ width: viewport width
624
+ height: viewport height
625
+ deviceScaleFactor: default 1.0
626
+ mobile: mobile emulation flag
627
+ """
628
+ return self.client.call_tool(
629
+ "viewport",
630
+ {
631
+ "sessionId": sessionId,
632
+ "viewport": {
633
+ "width": int(width),
634
+ "height": int(height),
635
+ "deviceScaleFactor": float(deviceScaleFactor),
636
+ "mobile": bool(mobile),
637
+ },
638
+ },
639
+ ).get("structuredContent", {})
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kl-mcp-client
3
- Version: 2.1.9
3
+ Version: 2.1.10
4
4
  Summary: MCP Client for Python
5
5
  Author-email: Kyle <hngan.it@gmail.com>
6
6
  License: MIT
@@ -0,0 +1,11 @@
1
+ kl_mcp_client/__init__.py,sha256=pdJdBcEH5HaRuHSe2B7VUyRgH5ad3u1dDc4euZMDRMY,106
2
+ kl_mcp_client/__version__.py,sha256=Uq-M9LFtR8tnGSaOR2w76lZ0qh5z5wwReA5I7feMj0k,23
3
+ kl_mcp_client/client.py,sha256=ujhRp0zC5GJKnBYziIPMdKZqrhv8K2t6tBAuwYw7q_k,4513
4
+ kl_mcp_client/tools.py,sha256=eLxWEIh0u72ao8jpkylbP2-1TpYHdPpCDISrq2H5WvA,20212
5
+ kl_mcp_client/asyncio/__init__.py,sha256=pdJdBcEH5HaRuHSe2B7VUyRgH5ad3u1dDc4euZMDRMY,106
6
+ kl_mcp_client/asyncio/client.py,sha256=5CpPf1YGOTzYfbG1mAK9s-vhKQULjdlSJnhXm3Th-1s,4413
7
+ kl_mcp_client/asyncio/tools.py,sha256=t-3iQnYzOCKjuPqhMlHh7XTbsSgyhcfnJNPrZff5X-c,13510
8
+ kl_mcp_client-2.1.10.dist-info/METADATA,sha256=jhYWCn9UZZStwF_J3eQNhfY-LCMleFjgXhykLaExei0,4444
9
+ kl_mcp_client-2.1.10.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
10
+ kl_mcp_client-2.1.10.dist-info/top_level.txt,sha256=wd_HFFyGjiKavwACuj8Ny0svtVyNsrxCSVU48EkoQ7c,14
11
+ kl_mcp_client-2.1.10.dist-info/RECORD,,
@@ -1,11 +0,0 @@
1
- kl_mcp_client/__init__.py,sha256=pdJdBcEH5HaRuHSe2B7VUyRgH5ad3u1dDc4euZMDRMY,106
2
- kl_mcp_client/__version__.py,sha256=lHY_4G8nwWSMGPN0-F9H-SQTd3QxVLaugr1Kn5GfttM,22
3
- kl_mcp_client/client.py,sha256=ujhRp0zC5GJKnBYziIPMdKZqrhv8K2t6tBAuwYw7q_k,4513
4
- kl_mcp_client/tools.py,sha256=_rBsqKVnX__do6XAO5eraW7405EHyCqez8ggv2peQtM,18803
5
- kl_mcp_client/asyncio/__init__.py,sha256=pdJdBcEH5HaRuHSe2B7VUyRgH5ad3u1dDc4euZMDRMY,106
6
- kl_mcp_client/asyncio/client.py,sha256=5CpPf1YGOTzYfbG1mAK9s-vhKQULjdlSJnhXm3Th-1s,4413
7
- kl_mcp_client/asyncio/tools.py,sha256=yly5jo9gVZ8MIMtFf-_ftqnjkBqhBNonniaaarSfKVU,12074
8
- kl_mcp_client-2.1.9.dist-info/METADATA,sha256=29rpL25q1c7EOJanfxDqEUuQ-wzQzwau-04ExGrwpdQ,4443
9
- kl_mcp_client-2.1.9.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
10
- kl_mcp_client-2.1.9.dist-info/top_level.txt,sha256=wd_HFFyGjiKavwACuj8Ny0svtVyNsrxCSVU48EkoQ7c,14
11
- kl_mcp_client-2.1.9.dist-info/RECORD,,