@iaforged/context-code 2.3.3 → 2.3.5

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 (70) hide show
  1. package/context-bootstrap.js +7 -5
  2. package/dist/src/commands/login/login.js +1 -1
  3. package/dist/src/components/BaseTextInput.js +1 -1
  4. package/dist/src/components/LogoV2/AnimatedClawd.js +1 -1
  5. package/dist/src/components/LogoV2/Clawd.js +1 -1
  6. package/dist/src/components/LogoV2/LogoV2.js +1 -1
  7. package/dist/src/components/LogoV2/WelcomeV2.js +1 -1
  8. package/dist/src/components/PromptInput/PromptInputFooterLeftSide.js +1 -1
  9. package/dist/src/components/SessionTokenFooter.js +1 -1
  10. package/dist/src/components/Spinner.js +1 -1
  11. package/dist/src/components/Stats.js +1 -1
  12. package/dist/src/components/TeleportProgress.js +1 -1
  13. package/dist/src/components/TextInput.js +1 -1
  14. package/dist/src/components/design-system/ThemeProvider.js +1 -1
  15. package/dist/src/components/permissions/AskUserQuestionPermissionRequest/AskUserQuestionPermissionRequest.js +1 -1
  16. package/dist/src/main.js +1 -1
  17. package/dist/src/query/stopHooks.js +1 -1
  18. package/dist/src/screens/REPL.js +1 -1
  19. package/dist/src/services/PromptSuggestion/promptSuggestion.js +1 -1
  20. package/dist/src/services/analytics/config.js +1 -1
  21. package/dist/src/services/analytics/datadog.js +1 -1
  22. package/dist/src/services/mcp/config.js +1 -1
  23. package/dist/src/services/tips/tipRegistry.js +1 -1
  24. package/dist/src/services/toolUseSummary/toolUseSummaryGenerator.js +1 -1
  25. package/dist/src/tools/BriefTool/UI.js +1 -1
  26. package/dist/src/utils/computerControlMcp/mcpServer.js +1 -1
  27. package/dist/src/utils/computerControlMcp/server/.gitattributes +18 -0
  28. package/dist/src/utils/computerControlMcp/server/Dockerfile +25 -0
  29. package/dist/src/utils/computerControlMcp/server/LICENSE +21 -0
  30. package/dist/src/utils/computerControlMcp/server/MANIFEST.in +10 -0
  31. package/dist/src/utils/computerControlMcp/server/README.md +193 -0
  32. package/dist/src/utils/computerControlMcp/server/demonstration.gif +0 -0
  33. package/dist/src/utils/computerControlMcp/server/icon.png +0 -0
  34. package/dist/src/utils/computerControlMcp/server/pyproject.toml +52 -0
  35. package/dist/src/utils/computerControlMcp/server/smithery.yaml +13 -0
  36. package/dist/src/utils/computerControlMcp/server/src/README.md +12 -0
  37. package/dist/src/utils/computerControlMcp/server/src/computer_control_mcp/FZYTK.TTF +0 -0
  38. package/dist/src/utils/computerControlMcp/server/src/computer_control_mcp/__init__.py +11 -0
  39. package/dist/src/utils/computerControlMcp/server/src/computer_control_mcp/__main__.py +21 -0
  40. package/dist/src/utils/computerControlMcp/server/src/computer_control_mcp/cli.py +128 -0
  41. package/dist/src/utils/computerControlMcp/server/src/computer_control_mcp/core.py +1008 -0
  42. package/dist/src/utils/computerControlMcp/server/src/computer_control_mcp/gui.py +126 -0
  43. package/dist/src/utils/computerControlMcp/server/src/computer_control_mcp/server.py +15 -0
  44. package/dist/src/utils/computerControlMcp/server/src/computer_control_mcp/test.py +346 -0
  45. package/dist/src/utils/computerControlMcp/server/src/computer_control_mcp/test_image.png +0 -0
  46. package/dist/src/utils/computerControlMcp/server/tests/README.md +22 -0
  47. package/dist/src/utils/computerControlMcp/server/tests/conftest.py +10 -0
  48. package/dist/src/utils/computerControlMcp/server/tests/rapidocr_test.py +21 -0
  49. package/dist/src/utils/computerControlMcp/server/tests/run_cli.py +9 -0
  50. package/dist/src/utils/computerControlMcp/server/tests/run_server.py +15 -0
  51. package/dist/src/utils/computerControlMcp/server/tests/setup.py +16 -0
  52. package/dist/src/utils/computerControlMcp/server/tests/test_computer_control.py +161 -0
  53. package/dist/src/utils/computerControlMcp/server/tests/test_screenshot.py +14 -0
  54. package/dist/src/utils/computerControlMcp/server/tests/test_wgc_env_var.py +42 -0
  55. package/dist/src/utils/computerControlMcp/server/tests/test_wgc_screenshot.py +67 -0
  56. package/dist/src/utils/computerControlMcp/server/uv.lock +4986 -0
  57. package/dist/src/utils/computerControlMcp/setup.js +1 -1
  58. package/dist/src/utils/logoV2Utils.js +1 -1
  59. package/dist/src/utils/model/configs.js +1 -1
  60. package/dist/src/utils/model/model.js +1 -1
  61. package/dist/src/utils/model/modelOptions.js +1 -1
  62. package/dist/src/utils/model/providerModels.js +1 -1
  63. package/dist/src/utils/sembleMcp/setup.js +1 -1
  64. package/dist/src/utils/theme.js +1 -1
  65. package/dist/src/utils/themes/bootstrap.js +1 -1
  66. package/dist/src/utils/themes/opencodeMapper.js +1 -1
  67. package/dist/webapp/chunk-VAB2VXFI.js +1 -1
  68. package/dist/webapp/ngsw.json +1 -1
  69. package/dist/webapp/polyfills-7R4CRVNH.js +1 -1
  70. package/package.json +1 -1
@@ -0,0 +1,128 @@
1
+ """
2
+ Command-line interface for Computer Control MCP.
3
+
4
+ This module provides a command-line interface for interacting with the Computer Control MCP.
5
+ """
6
+
7
+ import argparse
8
+ import sys
9
+ from computer_control_mcp.core import mcp, main as run_server
10
+
11
+ def parse_args():
12
+ """Parse command-line arguments."""
13
+ parser = argparse.ArgumentParser(description="Computer Control MCP CLI")
14
+
15
+ subparsers = parser.add_subparsers(dest="command", help="Command to run")
16
+
17
+ # Server command
18
+ server_parser = subparsers.add_parser("server", help="Run the MCP server")
19
+
20
+ # Click command
21
+ click_parser = subparsers.add_parser("click", help="Click at specified coordinates")
22
+ click_parser.add_argument("x", type=int, help="X coordinate")
23
+ click_parser.add_argument("y", type=int, help="Y coordinate")
24
+
25
+ # Type text command
26
+ type_parser = subparsers.add_parser("type", help="Type text at current cursor position")
27
+ type_parser.add_argument("text", help="Text to type")
28
+
29
+ # Screenshot command
30
+ screenshot_parser = subparsers.add_parser("screenshot", help="Take a screenshot")
31
+ screenshot_parser.add_argument("--mode", choices=["all_windows", "single_window", "whole_screen"],
32
+ default="whole_screen", help="Screenshot mode")
33
+ screenshot_parser.add_argument("--title", help="Window title pattern (for single_window mode)")
34
+ screenshot_parser.add_argument("--regex", action="store_true", help="Use regex for title matching")
35
+ screenshot_parser.add_argument("--output", help="Output file path (if not provided, saves to downloads directory)")
36
+ screenshot_parser.add_argument("--no-save", action="store_true", help="Don't save images to downloads directory")
37
+
38
+ # List windows command
39
+ subparsers.add_parser("list-windows", help="List all open windows")
40
+
41
+ # GUI command
42
+ subparsers.add_parser("gui", help="Launch the GUI test harness")
43
+
44
+ return parser.parse_args()
45
+
46
+ def main():
47
+ """Main entry point for the CLI."""
48
+ args = parse_args()
49
+
50
+ if args.command == "server":
51
+ run_server()
52
+
53
+ elif args.command == "click":
54
+ # Call the tool using the call_tool method
55
+ import asyncio
56
+ result = asyncio.run(mcp.call_tool("click_screen", {"x": args.x, "y": args.y}))
57
+ print(result)
58
+
59
+ elif args.command == "type":
60
+ # Call the tool using the call_tool method
61
+ import asyncio
62
+ result = asyncio.run(mcp.call_tool("type_text", {"text": args.text}))
63
+ print(result)
64
+
65
+ elif args.command == "screenshot":
66
+ if args.mode == "single_window" and not args.title:
67
+ print("Error: --title is required for single_window mode")
68
+ sys.exit(1)
69
+
70
+ # Call the tool using the call_tool method
71
+ import asyncio
72
+ result = asyncio.run(mcp.call_tool("take_screenshot", {
73
+ "mode": args.mode,
74
+ "title_pattern": args.title,
75
+ "use_regex": args.regex,
76
+ "save_to_downloads": not args.no_save
77
+ }))
78
+
79
+ if args.output:
80
+ # Save the screenshot to a specific file path provided by user
81
+ with open(args.output, "wb") as f:
82
+ f.write(result.image.data)
83
+ print(f"Screenshot saved to {args.output}")
84
+ elif hasattr(result, 'file_path'):
85
+ # If image was saved to downloads, show the path
86
+ print(f"Screenshot saved to {result.file_path}")
87
+ else:
88
+ print("Screenshot taken successfully")
89
+
90
+ # If we have multiple results (all_windows mode)
91
+ if args.mode == "all_windows" and isinstance(result, list):
92
+ print("\nAll screenshots:")
93
+ for i, item in enumerate(result):
94
+ if hasattr(item, 'file_path'):
95
+ window_title = item.window_info.title if hasattr(item, 'window_info') else f"Window {i+1}"
96
+ print(f"{i+1}. {window_title}: {item.file_path}")
97
+
98
+ elif args.command == "list-windows":
99
+ # Call the tool using the call_tool method
100
+ import asyncio
101
+ result = asyncio.run(mcp.call_tool("list_windows", {}))
102
+
103
+ # Parse the result
104
+ windows = []
105
+ for item in result:
106
+ if hasattr(item, 'text'):
107
+ try:
108
+ import json
109
+ window_info = json.loads(item.text)
110
+ windows.append(window_info)
111
+ except json.JSONDecodeError:
112
+ print(f"Failed to parse window info: {item.text}")
113
+
114
+ # Display the windows
115
+ for i, window in enumerate(windows):
116
+ print(f"{i+1}. {window.get('title')} ({window.get('width')}x{window.get('height')})")
117
+
118
+ elif args.command == "gui":
119
+ from computer_control_mcp.gui import main as run_gui
120
+ run_gui()
121
+
122
+ else:
123
+ # When no command is specified, run the server by default
124
+ print("MCP server started!")
125
+ run_server()
126
+
127
+ if __name__ == "__main__":
128
+ main()