alishahryar1--free-claude-code
d98a6b0ca0
## Problem Free Claude Code currently has to remain attached to a terminal, so closing that window stops the proxy and users have no native way to reopen Admin or control the background server. The contributed Windows wrapper also would have introduced a second bundled server lifecycle instead of reusing FCC's cleanup and restart ownership. Fixes #1147. ## Changes | Before | After | | --- | --- | | Users keep `fcc-server` running in a terminal. | Windows and macOS users can launch a console-free FCC Desktop host from a desktop/application shortcut and control it from the tray or menu bar. | | A wrapper would need to spawn and terminate a child server. | The terminal and desktop paths share one in-process supervisor, one graceful runtime shutdown path, and an OS-held singleton lock. | | Installers manage only command entry points. | Windows installs desktop and Start-menu shortcuts; macOS installs a per-user app bundle and owned desktop link; uninstallers remove only those FCC artifacts. | | Desktop behavior had no contract coverage. | Lifecycle, duplicate launch, restart/quit, GUI packaging, Windows shortcuts, macOS bundle creation, quoting, and ownership boundaries are covered alongside the full CI suite. | <!-- greptile_comment --> <details open><summary><h3>Greptile Summary</h3></summary> This PR adds a native FCC desktop launcher for Windows and macOS. The main changes are: - A shared server supervisor for terminal and desktop launches. - A singleton desktop host with tray or menu-bar controls. - Windows shortcuts and a per-user macOS app bundle. - Ownership checks for launcher installation and removal. - Tests for lifecycle, packaging, shortcuts, and uninstall behavior. </details> <h3>Confidence Score: 5/5</h3> This looks safe to merge. Startup restart requests are reserved before the worker starts. macOS bundle operations verify ownership before modifying or deleting files. Windows shortcut operations verify their targets before replacement or removal. No blocking issues were found in the updated code. <details><summary><h3><a href="https://www.greptile.com/trex"><img alt="T-Rex" src="https://greptile-static-assets.s3.amazonaws.com/trex/trex_green.svg" height="20" align="absmiddle"></a> T-Rex Logs</h3></summary> **What T-Rex did** - Compared the pre-change contract test results against the parent commit f81af55630aa1adb518b748b9e6985c73c4c4775 and observed 3 failures and 4 passes, indicating the missing scheduled-startup lifecycle contract. - Executed the after-state contract validation with uv run pytest -n 0 tests/cli/test\_desktop.py -q and confirmed the run finished with 7 passes and an exit code of 0. - Verified that no real proxy or native GUI dependency was started during the after-state run. - Inspected the two log artifacts that accompany the proof to corroborate the test outcomes. <a href="https://app.greptile.com/trex/runs/15235588/artifacts"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewAllArtifactsDark.svg?v=4"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewAllArtifacts.svg?v=4"><img alt="View all artifacts" src="https://greptile-static-assets.s3.amazonaws.com/badges/ViewAllArtifacts.svg?v=4"></picture></a> <sub><a href="https://www.greptile.com/trex"><img alt="T-Rex" src="https://greptile-static-assets.s3.amazonaws.com/trex/trex_green.svg" height="14" align="absmiddle"></a> Ran code and verified through T-Rex</sub> </details> <details open><summary><h3>Important Files Changed</h3></summary> | Filename | Overview | |----------|----------| | src/free_claude_code/cli/commands.py | Adds the shared server supervisor and scheduled-run state for startup restart requests. | | src/free_claude_code/cli/desktop.py | Adds singleton locking and coordinates the tray loop with the server worker. | | scripts/install.sh | Creates the macOS app bundle only when an existing bundle is FCC-owned. | | scripts/uninstall.sh | Removes the macOS launcher only on macOS and only with the expected ownership marker. | | scripts/install.ps1 | Creates Windows shortcuts while preserving shortcuts with unrelated targets. | | scripts/uninstall.ps1 | Removes Windows shortcuts only when their targets match an FCC desktop entry point. | </details> <sub>Reviews (3): Last reviewed commit: ["fix: coalesce desktop startup restarts"](https://github.com/alishahryar1/free-claude-code/commit/b9554729770e08a58818d677de39757c751e760e) | [Re-trigger Greptile](https://app.greptile.com/api/retrigger?id=45925660)</sub> <!-- /greptile_comment -->
144 行
3.9 KiB
TOML
144 行
3.9 KiB
TOML
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[project]
|
|
name = "free-claude-code"
|
|
version = "4.12.0"
|
|
description = "Local proxy connecting coding agents to OpenAI-compatible AI providers"
|
|
readme = "README.md"
|
|
requires-python = ">=3.14.0"
|
|
dependencies = [
|
|
"fastapi[standard]>=0.139.2",
|
|
"uvicorn>=0.51.0",
|
|
"httpx[socks]>=0.28.1",
|
|
"markdown-it-py>=4.2.0",
|
|
"pydantic>=2.13.4",
|
|
"python-dotenv>=1.2.2",
|
|
"tiktoken>=0.13.0",
|
|
"python-telegram-bot>=22.8",
|
|
"discord.py>=2.7.1",
|
|
"pydantic-settings>=2.14.2",
|
|
"openai>=2.46.0",
|
|
"loguru>=0.7.0",
|
|
"aiohttp>=3.14.1",
|
|
"jsonschema>=4.25.0",
|
|
"google-auth[requests]>=2.40.0",
|
|
"requests[socks]>=2.32.0",
|
|
"pystray>=0.19.5; sys_platform == 'win32' or sys_platform == 'darwin'",
|
|
"Pillow>=12.0.0; sys_platform == 'win32' or sys_platform == 'darwin'",
|
|
]
|
|
|
|
[project.scripts]
|
|
fcc-server = "free_claude_code.cli.entrypoints:serve"
|
|
fcc-claude = "free_claude_code.cli.launchers.claude:launch"
|
|
fcc-codex = "free_claude_code.cli.launchers.codex:launch"
|
|
fcc-pi = "free_claude_code.cli.launchers.pi:launch"
|
|
|
|
[project.gui-scripts]
|
|
fcc-desktop = "free_claude_code.cli.desktop_entrypoint:launch"
|
|
|
|
[project.optional-dependencies]
|
|
voice = [
|
|
"grpcio>=1.82.1",
|
|
"grpcio-tools>=1.81.1",
|
|
"nvidia-riva-client>=2.26.0",
|
|
]
|
|
voice_local = [
|
|
"torch>=2.13.0",
|
|
"transformers>=5.14.1",
|
|
"accelerate>=1.14.0",
|
|
"librosa>=0.10.0",
|
|
]
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["src/free_claude_code"]
|
|
|
|
[tool.hatch.build.targets.wheel.force-include]
|
|
".env.example" = "free_claude_code/config/env.example"
|
|
|
|
[tool.uv]
|
|
required-version = ">=0.11.16"
|
|
|
|
[tool.uv.sources]
|
|
torch = { index = "pytorch-cu130" }
|
|
|
|
[[tool.uv.index]]
|
|
name = "pytorch-cu130"
|
|
url = "https://download.pytorch.org/whl/cu130"
|
|
explicit = true
|
|
|
|
[dependency-groups]
|
|
dev = [
|
|
"pytest>=9.1.1",
|
|
"pytest-asyncio>=1.4.0",
|
|
"pytest-cov>=7.1.0",
|
|
"ty>=0.0.60",
|
|
"ruff>=0.15.22",
|
|
"pytest-xdist>=3.8.0",
|
|
]
|
|
|
|
[tool.ruff]
|
|
target-version = "py314"
|
|
line-length = 88
|
|
|
|
[tool.ruff.lint]
|
|
select = [
|
|
"E", # pycodestyle errors
|
|
"W", # pycodestyle warnings
|
|
"F", # Pyflakes (undefined names, unused imports)
|
|
"I", # isort (import ordering)
|
|
"UP", # pyupgrade (modernise syntax for target Python version)
|
|
"B", # flake8-bugbear (common bugs and anti-patterns)
|
|
"C4", # flake8-comprehensions (idiomatic comprehensions)
|
|
"SIM", # flake8-simplify (simplifiable code patterns)
|
|
"PERF", # Perflint (performance anti-patterns)
|
|
"RUF", # Ruff-specific rules
|
|
]
|
|
ignore = [
|
|
"E501", # line too long — enforced by the formatter instead
|
|
"B008", # FastAPI Depends() in argument defaults is intentional
|
|
"RUF006", # fire-and-forget tasks intentionally not awaited
|
|
]
|
|
|
|
[tool.ruff.lint.isort]
|
|
known-first-party = ["free_claude_code", "smoke"]
|
|
|
|
[tool.ruff.format]
|
|
quote-style = "double"
|
|
indent-style = "space"
|
|
line-ending = "auto"
|
|
skip-magic-trailing-comma = false
|
|
|
|
[tool.pytest.ini_options]
|
|
pythonpath = ["src"]
|
|
addopts = "-n auto"
|
|
testpaths = ["tests"]
|
|
markers = [
|
|
"live: opt-in local smoke tests that can touch real services",
|
|
"interactive: smoke tests requiring manual user interaction",
|
|
"provider: live provider checks",
|
|
"messaging: live messaging platform checks",
|
|
"cli: CLI integration checks",
|
|
"clients: client compatibility checks",
|
|
"voice: voice transcription checks",
|
|
"contract: deterministic feature contract checks",
|
|
"smoke_target(name): route a smoke test behind FCC_SMOKE_TARGETS",
|
|
"xdist_group(name): group smoke provider items under pytest-xdist --dist=loadgroup",
|
|
]
|
|
|
|
[tool.ty.environment]
|
|
python-version = "3.14"
|
|
|
|
[tool.ty.analysis]
|
|
# Optional voice_local extra: torch, transformers, librosa for local whisper transcription
|
|
# Optional voice extra: nvidia-riva-client for nvidia_nim transcription provider
|
|
allowed-unresolved-imports = [
|
|
"torch",
|
|
"transformers",
|
|
"librosa",
|
|
"riva.client",
|
|
"pystray",
|
|
"PIL",
|
|
]
|