ccoding 0.1.0__py3-none-any.whl → 0.2.0__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.
- ccode/__init__.py +7 -2
- ccode/api.py +5 -1
- ccode/config.py +31 -0
- ccode/remote.py +673 -0
- ccode/remote_cli.py +182 -0
- ccode/ui.py +130 -9
- ccode/web/__init__.py +0 -0
- ccode/web/app.js +270 -0
- ccode/web/assets/addon-fit.js +2 -0
- ccode/web/assets/xterm-LICENSE +21 -0
- ccode/web/assets/xterm-addon-fit-LICENSE +19 -0
- ccode/web/assets/xterm.css +285 -0
- ccode/web/assets/xterm.js +2 -0
- ccode/web/index.html +39 -0
- ccode/web/style.css +170 -0
- {ccoding-0.1.0.dist-info → ccoding-0.2.0.dist-info}/METADATA +49 -4
- ccoding-0.2.0.dist-info/RECORD +24 -0
- {ccoding-0.1.0.dist-info → ccoding-0.2.0.dist-info}/entry_points.txt +1 -0
- ccoding-0.1.0.dist-info/RECORD +0 -13
- {ccoding-0.1.0.dist-info → ccoding-0.2.0.dist-info}/WHEEL +0 -0
- {ccoding-0.1.0.dist-info → ccoding-0.2.0.dist-info}/licenses/LICENSE +0 -0
ccode/__init__.py
CHANGED
ccode/api.py
CHANGED
|
@@ -125,6 +125,10 @@ def validate_launch_requirements(config: dict[str, Any]) -> str | None:
|
|
|
125
125
|
return None
|
|
126
126
|
|
|
127
127
|
|
|
128
|
+
def build_claude_command(args: list[str]) -> list[str]:
|
|
129
|
+
return ["claude", *args]
|
|
130
|
+
|
|
131
|
+
|
|
128
132
|
def launch_claude(config: dict[str, Any], args: list[str]) -> str | None:
|
|
129
133
|
base_url = config.get("base_url", "").strip()
|
|
130
134
|
api_key = config.get("api_key", "").strip()
|
|
@@ -132,7 +136,7 @@ def launch_claude(config: dict[str, Any], args: list[str]) -> str | None:
|
|
|
132
136
|
return "Missing base URL or API key."
|
|
133
137
|
env = build_env(config, masked=False)
|
|
134
138
|
try:
|
|
135
|
-
subprocess.run(
|
|
139
|
+
subprocess.run(build_claude_command(args), check=True, env=env)
|
|
136
140
|
except FileNotFoundError:
|
|
137
141
|
return "Could not find 'claude' on PATH."
|
|
138
142
|
except subprocess.CalledProcessError as exc:
|
ccode/config.py
CHANGED
|
@@ -21,6 +21,15 @@ DEFAULT_TOGGLES: dict[str, str] = {
|
|
|
21
21
|
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
DEFAULT_REMOTE: dict[str, Any] = {
|
|
25
|
+
"enabled": False,
|
|
26
|
+
"host": "127.0.0.1",
|
|
27
|
+
"port": 8765,
|
|
28
|
+
"token": "",
|
|
29
|
+
"session_name": "ccode-claude",
|
|
30
|
+
"reuse_session": True,
|
|
31
|
+
}
|
|
32
|
+
|
|
24
33
|
_ENV_SCHEMA: dict[str, Any] = {}
|
|
25
34
|
_SCHEMA_KEYS: list[str] = []
|
|
26
35
|
|
|
@@ -65,6 +74,7 @@ def default_config() -> dict[str, Any]:
|
|
|
65
74
|
"haiku": {"owned_by": None, "id": None},
|
|
66
75
|
},
|
|
67
76
|
"toggles": DEFAULT_TOGGLES.copy(),
|
|
77
|
+
"remote": DEFAULT_REMOTE.copy(),
|
|
68
78
|
}
|
|
69
79
|
|
|
70
80
|
|
|
@@ -114,6 +124,27 @@ def load_config() -> dict[str, Any]:
|
|
|
114
124
|
if new_toggles:
|
|
115
125
|
config["toggles"] = new_toggles
|
|
116
126
|
|
|
127
|
+
remote = data.get("remote")
|
|
128
|
+
if isinstance(remote, dict):
|
|
129
|
+
enabled = remote.get("enabled")
|
|
130
|
+
if isinstance(enabled, bool):
|
|
131
|
+
config["remote"]["enabled"] = enabled
|
|
132
|
+
host = remote.get("host")
|
|
133
|
+
if isinstance(host, str):
|
|
134
|
+
config["remote"]["host"] = host
|
|
135
|
+
port = remote.get("port")
|
|
136
|
+
if isinstance(port, int):
|
|
137
|
+
config["remote"]["port"] = port
|
|
138
|
+
token = remote.get("token")
|
|
139
|
+
if isinstance(token, str):
|
|
140
|
+
config["remote"]["token"] = token
|
|
141
|
+
session_name = remote.get("session_name")
|
|
142
|
+
if isinstance(session_name, str):
|
|
143
|
+
config["remote"]["session_name"] = session_name
|
|
144
|
+
reuse_session = remote.get("reuse_session")
|
|
145
|
+
if isinstance(reuse_session, bool):
|
|
146
|
+
config["remote"]["reuse_session"] = reuse_session
|
|
147
|
+
|
|
117
148
|
return config
|
|
118
149
|
|
|
119
150
|
|