navcli 0.2.1__tar.gz → 0.2.2__tar.gz
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.
- {navcli-0.2.1 → navcli-0.2.2}/PKG-INFO +1 -1
- {navcli-0.2.1 → navcli-0.2.2}/navcli/server/__init__.py +16 -3
- {navcli-0.2.1 → navcli-0.2.2}/navcli/server/browser.py +4 -1
- {navcli-0.2.1 → navcli-0.2.2}/navcli.egg-info/PKG-INFO +1 -1
- {navcli-0.2.1 → navcli-0.2.2}/pyproject.toml +1 -1
- {navcli-0.2.1 → navcli-0.2.2}/README.md +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/docs/README.md +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/cli/__init__.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/cli/app.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/cli/client.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/cli/commands/__init__.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/cli/commands/base.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/cli/commands/control.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/cli/commands/explore.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/cli/commands/interaction.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/cli/commands/navigation.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/cli/commands/query.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/core/__init__.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/core/models/__init__.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/core/models/dom.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/core/models/element.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/core/models/feedback.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/core/models/state.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/server/app.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/server/middleware/__init__.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/server/routes/__init__.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/server/routes/control.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/server/routes/explore.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/server/routes/interaction.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/server/routes/navigation.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/server/routes/query.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/server/routes/session.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/utils/__init__.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/utils/image.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/utils/js.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/utils/selector.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/utils/text.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/utils/time.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli/utils/url.py +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli.egg-info/SOURCES.txt +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli.egg-info/dependency_links.txt +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli.egg-info/entry_points.txt +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli.egg-info/requires.txt +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/navcli.egg-info/top_level.txt +0 -0
- {navcli-0.2.1 → navcli-0.2.2}/setup.cfg +0 -0
|
@@ -22,13 +22,15 @@ _NAVCLI_SESSIONS_DIR = os.path.join(_NAVCLI_HOME, "sessions")
|
|
|
22
22
|
_server: Optional[uvicorn.Server] = None
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
async def start_server(host: str = "127.0.0.1", port: int = 8765, headless: bool = True
|
|
25
|
+
async def start_server(host: str = "127.0.0.1", port: int = 8765, headless: bool = True,
|
|
26
|
+
browser_args: Optional[list] = None) -> uvicorn.Server:
|
|
26
27
|
"""Start the browser server.
|
|
27
28
|
|
|
28
29
|
Args:
|
|
29
30
|
host: Host to bind
|
|
30
31
|
port: Port to listen
|
|
31
32
|
headless: Run browser in headless mode (default: True)
|
|
33
|
+
browser_args: Additional browser launch arguments
|
|
32
34
|
|
|
33
35
|
Returns:
|
|
34
36
|
Uvicorn server instance
|
|
@@ -36,7 +38,7 @@ async def start_server(host: str = "127.0.0.1", port: int = 8765, headless: bool
|
|
|
36
38
|
global _server
|
|
37
39
|
|
|
38
40
|
# Start browser
|
|
39
|
-
await start_browser(headless=headless)
|
|
41
|
+
await start_browser(headless=headless, args=browser_args)
|
|
40
42
|
|
|
41
43
|
# Create app
|
|
42
44
|
app = create_app()
|
|
@@ -80,9 +82,20 @@ def main():
|
|
|
80
82
|
help="Run in headless mode (default)")
|
|
81
83
|
parser.add_argument("--no-headless", dest="headless", action="store_false",
|
|
82
84
|
help="Run with GUI (non-headless)")
|
|
85
|
+
parser.add_argument("--memory-limit", type=int, default=None,
|
|
86
|
+
help="Browser memory limit in MB (e.g., --memory-limit 512)")
|
|
83
87
|
|
|
84
88
|
args = parser.parse_args()
|
|
85
89
|
|
|
90
|
+
# Build browser args for memory limit
|
|
91
|
+
browser_args = None
|
|
92
|
+
if args.memory_limit:
|
|
93
|
+
browser_args = [
|
|
94
|
+
f"--js-flags=--max-old-space-size={args.memory_limit}",
|
|
95
|
+
"--disable-dev-shm-usage",
|
|
96
|
+
]
|
|
97
|
+
print(f"Memory limit: {args.memory_limit}MB")
|
|
98
|
+
|
|
86
99
|
print(f"Starting NavCLI Browser Server on {args.host}:{args.port}...")
|
|
87
100
|
print(f"Headless: {args.headless}")
|
|
88
101
|
print("-" * 60)
|
|
@@ -117,7 +130,7 @@ def main():
|
|
|
117
130
|
print("-" * 60)
|
|
118
131
|
|
|
119
132
|
try:
|
|
120
|
-
asyncio.run(start_server(args.host, args.port, headless=args.headless))
|
|
133
|
+
asyncio.run(start_server(args.host, args.port, headless=args.headless, browser_args=browser_args))
|
|
121
134
|
except KeyboardInterrupt:
|
|
122
135
|
print("\nShutting down...")
|
|
123
136
|
sys.exit(0)
|
|
@@ -25,11 +25,12 @@ _NAVCLI_SESSIONS_DIR = os.path.join(_NAVCLI_HOME, "sessions")
|
|
|
25
25
|
_storage_state_path: str = os.path.join(_NAVCLI_SESSIONS_DIR, "session.json") # Default session file
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
async def start_browser(headless: bool = True):
|
|
28
|
+
async def start_browser(headless: bool = True, args: Optional[list] = None):
|
|
29
29
|
"""Start the browser.
|
|
30
30
|
|
|
31
31
|
Args:
|
|
32
32
|
headless: Whether to run in headless mode (default: True)
|
|
33
|
+
args: Additional browser launch arguments
|
|
33
34
|
"""
|
|
34
35
|
global _browser, _context, _page
|
|
35
36
|
|
|
@@ -43,6 +44,8 @@ async def start_browser(headless: bool = True):
|
|
|
43
44
|
user_data_dir = os.environ.get("NAVCLI_USER_DATA_DIR")
|
|
44
45
|
|
|
45
46
|
launch_kwargs = {"headless": headless}
|
|
47
|
+
if args:
|
|
48
|
+
launch_kwargs["args"] = args
|
|
46
49
|
if executable_path:
|
|
47
50
|
launch_kwargs["executable_path"] = executable_path
|
|
48
51
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|