codex-telegram-bridge 0.6.2__tar.gz → 0.6.3__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.
- {codex_telegram_bridge-0.6.2/codex_telegram_bridge.egg-info → codex_telegram_bridge-0.6.3}/PKG-INFO +13 -9
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/README.md +12 -8
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/bridge_setup.py +50 -9
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/bridge_watchdog.py +128 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3/codex_telegram_bridge.egg-info}/PKG-INFO +13 -9
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/pyproject.toml +1 -1
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/LICENSE +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/agent_runtime/__init__.py +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/agent_runtime/adapters/__init__.py +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/agent_runtime/adapters/base.py +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/agent_runtime/adapters/codex_repl.py +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/agent_runtime/approvals.py +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/agent_runtime/capabilities.py +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/agent_runtime/locks.py +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/agent_runtime/transport.py +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/agent_runtime/types.py +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/codex_audio_transcribe.py +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/codex_repl_bridge.py +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/codex_telegram_bridge.egg-info/SOURCES.txt +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/codex_telegram_bridge.egg-info/dependency_links.txt +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/codex_telegram_bridge.egg-info/entry_points.txt +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/codex_telegram_bridge.egg-info/requires.txt +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/codex_telegram_bridge.egg-info/top_level.txt +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/setup.cfg +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/telegram_agent_bridge.py +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/tests/test_agent_runtime.py +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/tests/test_bridge.py +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/tests/test_public_export.py +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/tests/test_repl_bridge.py +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/tests/test_setup_wizard.py +0 -0
- {codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/tests/test_watchdog.py +0 -0
{codex_telegram_bridge-0.6.2/codex_telegram_bridge.egg-info → codex_telegram_bridge-0.6.3}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codex-telegram-bridge
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.3
|
|
4
4
|
Summary: Control a live Codex CLI session from Telegram.
|
|
5
5
|
Author: Kang Daejong
|
|
6
6
|
License: MIT
|
|
@@ -132,7 +132,7 @@ Answer media attachments
|
|
|
132
132
|
-> send the actual media with sendPhoto/sendVideo/sendVoice/sendAudio
|
|
133
133
|
|
|
134
134
|
Service restart
|
|
135
|
-
-> run a local watchdog every 60 seconds
|
|
135
|
+
-> run a local watchdog every 60 seconds
|
|
136
136
|
-> restart or kickstart the bridge if the user service is inactive
|
|
137
137
|
-> load a persistent JSONL cursor and final-answer dedup ring
|
|
138
138
|
-> resume from the cursor when it still matches the current session file
|
|
@@ -219,8 +219,8 @@ The wizard will:
|
|
|
219
219
|
- install `~/.local/bin/telegram-agent-bridge-run`
|
|
220
220
|
- install and start a user service with systemd on Linux/WSL, launchd on macOS,
|
|
221
221
|
or a per-user Windows Startup launcher
|
|
222
|
-
- install a watchdog timer/LaunchAgent
|
|
223
|
-
|
|
222
|
+
- install a watchdog timer/LaunchAgent/Scheduled Task that recovers an inactive
|
|
223
|
+
bridge service
|
|
224
224
|
- send a setup-complete test message
|
|
225
225
|
|
|
226
226
|
Default setup mode is `repl`, which supports the visible Codex CLI transcript,
|
|
@@ -504,8 +504,8 @@ service was restarting.
|
|
|
504
504
|
|
|
505
505
|
## Service Watchdog
|
|
506
506
|
|
|
507
|
-
When the setup wizard installs a background service
|
|
508
|
-
|
|
507
|
+
When the setup wizard installs a background service, it also installs a small
|
|
508
|
+
watchdog.
|
|
509
509
|
|
|
510
510
|
On Windows, the wizard writes a per-user Startup launcher at
|
|
511
511
|
`%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\telegram-agent-bridge.bat`.
|
|
@@ -513,9 +513,13 @@ This does not require administrator rights. Setup also starts that launcher once
|
|
|
513
513
|
immediately so you can send `/ping` without logging out and back in. If an older
|
|
514
514
|
per-user `telegram-agent-bridge` Scheduled Task exists, `doctor` still reports
|
|
515
515
|
its `schtasks /query` status; otherwise it reports whether the Startup launcher
|
|
516
|
-
is installed.
|
|
517
|
-
|
|
518
|
-
|
|
516
|
+
is installed.
|
|
517
|
+
|
|
518
|
+
The Windows watchdog is a separate per-user Scheduled Task named
|
|
519
|
+
`telegram-agent-bridge-watchdog`. It runs `bridge_watchdog.py` every minute
|
|
520
|
+
without administrator rights. If the bridge process is missing, it first restarts
|
|
521
|
+
an older service Scheduled Task when present, otherwise it re-runs the Startup
|
|
522
|
+
launcher and writes the same status file.
|
|
519
523
|
|
|
520
524
|
On Linux and WSL, the wizard writes:
|
|
521
525
|
|
|
@@ -105,7 +105,7 @@ Answer media attachments
|
|
|
105
105
|
-> send the actual media with sendPhoto/sendVideo/sendVoice/sendAudio
|
|
106
106
|
|
|
107
107
|
Service restart
|
|
108
|
-
-> run a local watchdog every 60 seconds
|
|
108
|
+
-> run a local watchdog every 60 seconds
|
|
109
109
|
-> restart or kickstart the bridge if the user service is inactive
|
|
110
110
|
-> load a persistent JSONL cursor and final-answer dedup ring
|
|
111
111
|
-> resume from the cursor when it still matches the current session file
|
|
@@ -192,8 +192,8 @@ The wizard will:
|
|
|
192
192
|
- install `~/.local/bin/telegram-agent-bridge-run`
|
|
193
193
|
- install and start a user service with systemd on Linux/WSL, launchd on macOS,
|
|
194
194
|
or a per-user Windows Startup launcher
|
|
195
|
-
- install a watchdog timer/LaunchAgent
|
|
196
|
-
|
|
195
|
+
- install a watchdog timer/LaunchAgent/Scheduled Task that recovers an inactive
|
|
196
|
+
bridge service
|
|
197
197
|
- send a setup-complete test message
|
|
198
198
|
|
|
199
199
|
Default setup mode is `repl`, which supports the visible Codex CLI transcript,
|
|
@@ -477,8 +477,8 @@ service was restarting.
|
|
|
477
477
|
|
|
478
478
|
## Service Watchdog
|
|
479
479
|
|
|
480
|
-
When the setup wizard installs a background service
|
|
481
|
-
|
|
480
|
+
When the setup wizard installs a background service, it also installs a small
|
|
481
|
+
watchdog.
|
|
482
482
|
|
|
483
483
|
On Windows, the wizard writes a per-user Startup launcher at
|
|
484
484
|
`%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\telegram-agent-bridge.bat`.
|
|
@@ -486,9 +486,13 @@ This does not require administrator rights. Setup also starts that launcher once
|
|
|
486
486
|
immediately so you can send `/ping` without logging out and back in. If an older
|
|
487
487
|
per-user `telegram-agent-bridge` Scheduled Task exists, `doctor` still reports
|
|
488
488
|
its `schtasks /query` status; otherwise it reports whether the Startup launcher
|
|
489
|
-
is installed.
|
|
490
|
-
|
|
491
|
-
|
|
489
|
+
is installed.
|
|
490
|
+
|
|
491
|
+
The Windows watchdog is a separate per-user Scheduled Task named
|
|
492
|
+
`telegram-agent-bridge-watchdog`. It runs `bridge_watchdog.py` every minute
|
|
493
|
+
without administrator rights. If the bridge process is missing, it first restarts
|
|
494
|
+
an older service Scheduled Task when present, otherwise it re-runs the Startup
|
|
495
|
+
launcher and writes the same status file.
|
|
492
496
|
|
|
493
497
|
On Linux and WSL, the wizard writes:
|
|
494
498
|
|
|
@@ -27,6 +27,7 @@ APP_NAME = "telegram-agent-bridge"
|
|
|
27
27
|
SERVICE_NAME = "telegram-agent-bridge.service"
|
|
28
28
|
LAUNCHD_LABEL = "com.user.telegram-agent-bridge"
|
|
29
29
|
WINDOWS_TASK_NAME = APP_NAME
|
|
30
|
+
WINDOWS_WATCHDOG_TASK_NAME = f"{APP_NAME}-watchdog"
|
|
30
31
|
WATCHDOG_SERVICE_NAME = "telegram-agent-bridge-watchdog.service"
|
|
31
32
|
WATCHDOG_TIMER_NAME = "telegram-agent-bridge-watchdog.timer"
|
|
32
33
|
WATCHDOG_LAUNCHD_LABEL = "com.user.telegram-agent-bridge-watchdog"
|
|
@@ -834,6 +835,44 @@ def install_windows_scheduled_task(
|
|
|
834
835
|
return f"Scheduled Task: {task_name}"
|
|
835
836
|
|
|
836
837
|
|
|
838
|
+
def windows_watchdog_task_action() -> str:
|
|
839
|
+
python_bin = sys.executable or shutil.which("python") or shutil.which("python3") or "python"
|
|
840
|
+
return " ".join(windows_command_quote(part) for part in [str(python_bin), str(WATCHDOG_SCRIPT)])
|
|
841
|
+
|
|
842
|
+
|
|
843
|
+
def install_windows_watchdog_task(
|
|
844
|
+
*,
|
|
845
|
+
start: bool,
|
|
846
|
+
task_name: str,
|
|
847
|
+
run: Callable[..., subprocess.CompletedProcess[str]],
|
|
848
|
+
) -> str | None:
|
|
849
|
+
create = run(
|
|
850
|
+
[
|
|
851
|
+
"schtasks",
|
|
852
|
+
"/Create",
|
|
853
|
+
"/TN",
|
|
854
|
+
task_name,
|
|
855
|
+
"/SC",
|
|
856
|
+
"MINUTE",
|
|
857
|
+
"/MO",
|
|
858
|
+
"1",
|
|
859
|
+
"/TR",
|
|
860
|
+
windows_watchdog_task_action(),
|
|
861
|
+
"/F",
|
|
862
|
+
]
|
|
863
|
+
)
|
|
864
|
+
if create.returncode != 0:
|
|
865
|
+
detail = command_output(create) or "unknown error"
|
|
866
|
+
warn(f"failed to create Windows watchdog Scheduled Task {task_name}: {detail}")
|
|
867
|
+
return None
|
|
868
|
+
|
|
869
|
+
if start:
|
|
870
|
+
started = run(["schtasks", "/Run", "/TN", task_name])
|
|
871
|
+
if started.returncode != 0:
|
|
872
|
+
warn(f"could not start Windows watchdog Scheduled Task {task_name}: {command_output(started)}")
|
|
873
|
+
return f"Scheduled Task: {task_name}"
|
|
874
|
+
|
|
875
|
+
|
|
837
876
|
def powershell_invoke_command(executable: str, args: list[str]) -> str:
|
|
838
877
|
return " ".join(["&", powershell_single_quote(executable), *[powershell_single_quote(arg) for arg in args]])
|
|
839
878
|
|
|
@@ -1035,11 +1074,11 @@ def install_watchdog(
|
|
|
1035
1074
|
return plist_file
|
|
1036
1075
|
|
|
1037
1076
|
if os_name == "Windows":
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1077
|
+
return install_windows_watchdog_task(
|
|
1078
|
+
start=start,
|
|
1079
|
+
task_name=WINDOWS_WATCHDOG_TASK_NAME,
|
|
1080
|
+
run=run,
|
|
1041
1081
|
)
|
|
1042
|
-
return None
|
|
1043
1082
|
|
|
1044
1083
|
warn(f"watchdog install is not automated for {os_name}")
|
|
1045
1084
|
return None
|
|
@@ -1107,6 +1146,11 @@ def uninstall_watchdog(
|
|
|
1107
1146
|
pass
|
|
1108
1147
|
return
|
|
1109
1148
|
|
|
1149
|
+
if os_name == "Windows":
|
|
1150
|
+
run(["schtasks", "/End", "/TN", WINDOWS_WATCHDOG_TASK_NAME])
|
|
1151
|
+
run(["schtasks", "/Delete", "/TN", WINDOWS_WATCHDOG_TASK_NAME, "/F"])
|
|
1152
|
+
return
|
|
1153
|
+
|
|
1110
1154
|
warn(f"watchdog uninstall is not automated for {os_name}")
|
|
1111
1155
|
|
|
1112
1156
|
|
|
@@ -1141,7 +1185,7 @@ def watchdog_status(
|
|
|
1141
1185
|
*,
|
|
1142
1186
|
os_name: str | None = None,
|
|
1143
1187
|
run: Callable[..., subprocess.CompletedProcess[str]] = run_command,
|
|
1144
|
-
task_name: str =
|
|
1188
|
+
task_name: str = WINDOWS_WATCHDOG_TASK_NAME,
|
|
1145
1189
|
) -> str:
|
|
1146
1190
|
os_name = os_name or platform.system()
|
|
1147
1191
|
if os_name == "Linux":
|
|
@@ -1509,10 +1553,7 @@ def doctor(config_file: Path, runner_file: Path, api_call: ApiCall = telegram_ca
|
|
|
1509
1553
|
warn(f"watchdog status: {wd_status}")
|
|
1510
1554
|
if wd_status == "not-installed":
|
|
1511
1555
|
if current_os == "Windows":
|
|
1512
|
-
|
|
1513
|
-
"Windows watchdog install is not automated; "
|
|
1514
|
-
"the Startup launcher covers logon autostart but not periodic recovery."
|
|
1515
|
-
)
|
|
1556
|
+
add_next_step(f"Run setup again to install Windows watchdog: {setup_command_hint()}")
|
|
1516
1557
|
else:
|
|
1517
1558
|
add_next_step(f"Run setup again to install service/watchdog: {setup_command_hint()}")
|
|
1518
1559
|
warnings += 1
|
|
@@ -15,6 +15,7 @@ from typing import Callable
|
|
|
15
15
|
APP_NAME = "telegram-agent-bridge"
|
|
16
16
|
SERVICE_NAME = "telegram-agent-bridge.service"
|
|
17
17
|
LAUNCHD_LABEL = "com.user.telegram-agent-bridge"
|
|
18
|
+
WINDOWS_TASK_NAME = APP_NAME
|
|
18
19
|
|
|
19
20
|
RunCommand = Callable[[list[str]], subprocess.CompletedProcess[str]]
|
|
20
21
|
|
|
@@ -41,6 +42,83 @@ def status_text(proc: subprocess.CompletedProcess[str]) -> str:
|
|
|
41
42
|
return (proc.stdout or proc.stderr or "").strip()
|
|
42
43
|
|
|
43
44
|
|
|
45
|
+
def default_windows_startup_dir() -> Path:
|
|
46
|
+
appdata = os.environ.get("APPDATA")
|
|
47
|
+
if appdata:
|
|
48
|
+
return (
|
|
49
|
+
Path(appdata)
|
|
50
|
+
/ "Microsoft"
|
|
51
|
+
/ "Windows"
|
|
52
|
+
/ "Start Menu"
|
|
53
|
+
/ "Programs"
|
|
54
|
+
/ "Startup"
|
|
55
|
+
)
|
|
56
|
+
return (
|
|
57
|
+
Path.home()
|
|
58
|
+
/ "AppData"
|
|
59
|
+
/ "Roaming"
|
|
60
|
+
/ "Microsoft"
|
|
61
|
+
/ "Windows"
|
|
62
|
+
/ "Start Menu"
|
|
63
|
+
/ "Programs"
|
|
64
|
+
/ "Startup"
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def default_windows_startup_launcher_file(
|
|
69
|
+
startup_dir: Path | None = None,
|
|
70
|
+
*,
|
|
71
|
+
app_name: str = APP_NAME,
|
|
72
|
+
) -> Path:
|
|
73
|
+
return (startup_dir or default_windows_startup_dir()) / f"{app_name}.bat"
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def powershell_single_quote(value: str | Path) -> str:
|
|
77
|
+
return "'" + str(value).replace("'", "''") + "'"
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def windows_startup_launcher_start_command(launcher_file: Path) -> list[str]:
|
|
81
|
+
script = f"Start-Process -WindowStyle Hidden -FilePath {powershell_single_quote(launcher_file)}"
|
|
82
|
+
return [
|
|
83
|
+
"powershell.exe",
|
|
84
|
+
"-NoProfile",
|
|
85
|
+
"-ExecutionPolicy",
|
|
86
|
+
"Bypass",
|
|
87
|
+
"-Command",
|
|
88
|
+
script,
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def parse_windows_scheduled_task_status(output: str) -> str:
|
|
93
|
+
for line in output.replace("\r\n", "\n").splitlines():
|
|
94
|
+
if ":" not in line:
|
|
95
|
+
continue
|
|
96
|
+
key, value = line.split(":", 1)
|
|
97
|
+
if key.strip().lower() == "status":
|
|
98
|
+
return value.strip() or "unknown"
|
|
99
|
+
return "unknown"
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def windows_scheduled_task_status(*, task_name: str, run: RunCommand) -> str:
|
|
103
|
+
proc = run(["schtasks", "/Query", "/TN", task_name, "/FO", "LIST", "/V"])
|
|
104
|
+
if proc.returncode != 0:
|
|
105
|
+
return "not-installed"
|
|
106
|
+
return parse_windows_scheduled_task_status(proc.stdout or proc.stderr or "")
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def windows_bridge_process_running(run: RunCommand) -> bool:
|
|
110
|
+
script = (
|
|
111
|
+
"$ErrorActionPreference='SilentlyContinue'; "
|
|
112
|
+
"$p = Get-CimInstance Win32_Process | Where-Object { "
|
|
113
|
+
"$_.ProcessId -ne $PID -and $_.CommandLine -and "
|
|
114
|
+
"$_.CommandLine -match 'telegram_agent_bridge\\.py|codex_repl_bridge\\.py|telegram-agent-bridge-run' "
|
|
115
|
+
"}; "
|
|
116
|
+
"if ($p) { 'running'; exit 0 } else { 'missing'; exit 1 }"
|
|
117
|
+
)
|
|
118
|
+
proc = run(["powershell.exe", "-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", script])
|
|
119
|
+
return proc.returncode == 0
|
|
120
|
+
|
|
121
|
+
|
|
44
122
|
def launchd_state(output: str) -> str:
|
|
45
123
|
for line in output.splitlines():
|
|
46
124
|
stripped = line.strip()
|
|
@@ -130,12 +208,54 @@ def watch_macos(
|
|
|
130
208
|
return 1
|
|
131
209
|
|
|
132
210
|
|
|
211
|
+
def watch_windows(
|
|
212
|
+
*,
|
|
213
|
+
service_task_name: str,
|
|
214
|
+
startup_launcher: Path | None,
|
|
215
|
+
status_file: Path,
|
|
216
|
+
run: RunCommand,
|
|
217
|
+
settle_seconds: float,
|
|
218
|
+
) -> int:
|
|
219
|
+
if windows_bridge_process_running(run):
|
|
220
|
+
write_status(status_file, "active", "windows-process")
|
|
221
|
+
return 0
|
|
222
|
+
|
|
223
|
+
task_status = windows_scheduled_task_status(task_name=service_task_name, run=run)
|
|
224
|
+
if task_status != "not-installed":
|
|
225
|
+
start = run(["schtasks", "/Run", "/TN", service_task_name])
|
|
226
|
+
if settle_seconds > 0:
|
|
227
|
+
time.sleep(settle_seconds)
|
|
228
|
+
if windows_bridge_process_running(run):
|
|
229
|
+
write_status(status_file, "recovered", f"windows-task:{service_task_name}")
|
|
230
|
+
return 0
|
|
231
|
+
detail = status_text(start) or f"windows-task:{service_task_name}:{task_status}:start-failed"
|
|
232
|
+
write_status(status_file, "failed", detail)
|
|
233
|
+
return 1
|
|
234
|
+
|
|
235
|
+
launcher = startup_launcher or default_windows_startup_launcher_file()
|
|
236
|
+
if launcher.exists():
|
|
237
|
+
start = run(windows_startup_launcher_start_command(launcher))
|
|
238
|
+
if settle_seconds > 0:
|
|
239
|
+
time.sleep(settle_seconds)
|
|
240
|
+
if windows_bridge_process_running(run):
|
|
241
|
+
write_status(status_file, "recovered", f"windows-startup:{launcher}")
|
|
242
|
+
return 0
|
|
243
|
+
detail = status_text(start) or f"windows-startup:{launcher}:process-not-detected"
|
|
244
|
+
write_status(status_file, "failed", detail)
|
|
245
|
+
return 1
|
|
246
|
+
|
|
247
|
+
write_status(status_file, "failed", "windows:not-installed")
|
|
248
|
+
return 1
|
|
249
|
+
|
|
250
|
+
|
|
133
251
|
def watch_once(
|
|
134
252
|
*,
|
|
135
253
|
os_name: str | None = None,
|
|
136
254
|
service_name: str = SERVICE_NAME,
|
|
137
255
|
launchd_label: str = LAUNCHD_LABEL,
|
|
138
256
|
launchd_plist: Path | None = None,
|
|
257
|
+
windows_service_task_name: str = WINDOWS_TASK_NAME,
|
|
258
|
+
windows_startup_launcher: Path | None = None,
|
|
139
259
|
status_file: Path | None = None,
|
|
140
260
|
run: RunCommand = run_command,
|
|
141
261
|
settle_seconds: float = 2.0,
|
|
@@ -158,6 +278,14 @@ def watch_once(
|
|
|
158
278
|
run=run,
|
|
159
279
|
settle_seconds=settle_seconds,
|
|
160
280
|
)
|
|
281
|
+
if os_name == "Windows":
|
|
282
|
+
return watch_windows(
|
|
283
|
+
service_task_name=windows_service_task_name,
|
|
284
|
+
startup_launcher=windows_startup_launcher,
|
|
285
|
+
status_file=status_file,
|
|
286
|
+
run=run,
|
|
287
|
+
settle_seconds=settle_seconds,
|
|
288
|
+
)
|
|
161
289
|
|
|
162
290
|
write_status(status_file, "unsupported", os_name)
|
|
163
291
|
return 0
|
{codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3/codex_telegram_bridge.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codex-telegram-bridge
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.3
|
|
4
4
|
Summary: Control a live Codex CLI session from Telegram.
|
|
5
5
|
Author: Kang Daejong
|
|
6
6
|
License: MIT
|
|
@@ -132,7 +132,7 @@ Answer media attachments
|
|
|
132
132
|
-> send the actual media with sendPhoto/sendVideo/sendVoice/sendAudio
|
|
133
133
|
|
|
134
134
|
Service restart
|
|
135
|
-
-> run a local watchdog every 60 seconds
|
|
135
|
+
-> run a local watchdog every 60 seconds
|
|
136
136
|
-> restart or kickstart the bridge if the user service is inactive
|
|
137
137
|
-> load a persistent JSONL cursor and final-answer dedup ring
|
|
138
138
|
-> resume from the cursor when it still matches the current session file
|
|
@@ -219,8 +219,8 @@ The wizard will:
|
|
|
219
219
|
- install `~/.local/bin/telegram-agent-bridge-run`
|
|
220
220
|
- install and start a user service with systemd on Linux/WSL, launchd on macOS,
|
|
221
221
|
or a per-user Windows Startup launcher
|
|
222
|
-
- install a watchdog timer/LaunchAgent
|
|
223
|
-
|
|
222
|
+
- install a watchdog timer/LaunchAgent/Scheduled Task that recovers an inactive
|
|
223
|
+
bridge service
|
|
224
224
|
- send a setup-complete test message
|
|
225
225
|
|
|
226
226
|
Default setup mode is `repl`, which supports the visible Codex CLI transcript,
|
|
@@ -504,8 +504,8 @@ service was restarting.
|
|
|
504
504
|
|
|
505
505
|
## Service Watchdog
|
|
506
506
|
|
|
507
|
-
When the setup wizard installs a background service
|
|
508
|
-
|
|
507
|
+
When the setup wizard installs a background service, it also installs a small
|
|
508
|
+
watchdog.
|
|
509
509
|
|
|
510
510
|
On Windows, the wizard writes a per-user Startup launcher at
|
|
511
511
|
`%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\telegram-agent-bridge.bat`.
|
|
@@ -513,9 +513,13 @@ This does not require administrator rights. Setup also starts that launcher once
|
|
|
513
513
|
immediately so you can send `/ping` without logging out and back in. If an older
|
|
514
514
|
per-user `telegram-agent-bridge` Scheduled Task exists, `doctor` still reports
|
|
515
515
|
its `schtasks /query` status; otherwise it reports whether the Startup launcher
|
|
516
|
-
is installed.
|
|
517
|
-
|
|
518
|
-
|
|
516
|
+
is installed.
|
|
517
|
+
|
|
518
|
+
The Windows watchdog is a separate per-user Scheduled Task named
|
|
519
|
+
`telegram-agent-bridge-watchdog`. It runs `bridge_watchdog.py` every minute
|
|
520
|
+
without administrator rights. If the bridge process is missing, it first restarts
|
|
521
|
+
an older service Scheduled Task when present, otherwise it re-runs the Startup
|
|
522
|
+
launcher and writes the same status file.
|
|
519
523
|
|
|
520
524
|
On Linux and WSL, the wizard writes:
|
|
521
525
|
|
|
File without changes
|
|
File without changes
|
{codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/agent_runtime/adapters/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{codex_telegram_bridge-0.6.2 → codex_telegram_bridge-0.6.3}/agent_runtime/adapters/codex_repl.py
RENAMED
|
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
|