cdx-manager 0.9.10 → 0.9.11
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.
- package/README.md +1 -1
- package/changelogs/CHANGELOGS_0_9_11.md +44 -0
- package/checksums/release-archives.json +4 -0
- package/package.json +1 -1
- package/pyproject.toml +5 -2
- package/src/backup_bundle.py +0 -1
- package/src/claude_usage.py +19 -3
- package/src/cli.py +27 -9
- package/src/cli_args.py +631 -0
- package/src/cli_commands.py +64 -995
- package/src/cli_helpers.py +385 -0
- package/src/cli_render.py +0 -1
- package/src/cli_view.py +1 -20
- package/src/context_store.py +1 -2
- package/src/logics_view.py +0 -1
- package/src/notify.py +0 -1
- package/src/provider_runtime.py +9 -33
- package/src/run_command.py +1 -1
- package/src/run_registry.py +2 -2
- package/src/run_usage.py +1 -2
- package/src/session_service.py +6 -20
- package/src/session_store.py +2 -2
- package/src/status_source.py +0 -19
- package/src/status_view.py +1 -1
- package/src/update_check.py +1 -2
package/src/session_store.py
CHANGED
|
@@ -24,7 +24,7 @@ def _restrict_dir_permissions(path):
|
|
|
24
24
|
|
|
25
25
|
def _read_json(file_path, fallback):
|
|
26
26
|
try:
|
|
27
|
-
with open(file_path,
|
|
27
|
+
with open(file_path, encoding="utf-8") as f:
|
|
28
28
|
return json.load(f)
|
|
29
29
|
except FileNotFoundError:
|
|
30
30
|
return fallback
|
|
@@ -273,7 +273,7 @@ def create_session_store(base_dir):
|
|
|
273
273
|
def list_launch_history(session_name=None, limit=20):
|
|
274
274
|
with _file_lock(lock_file):
|
|
275
275
|
try:
|
|
276
|
-
with open(launch_history_file,
|
|
276
|
+
with open(launch_history_file, encoding="utf-8") as handle:
|
|
277
277
|
lines = handle.readlines()
|
|
278
278
|
except FileNotFoundError:
|
|
279
279
|
return []
|
package/src/status_source.py
CHANGED
|
@@ -307,22 +307,6 @@ def _parse_month_index(name):
|
|
|
307
307
|
return -1
|
|
308
308
|
|
|
309
309
|
|
|
310
|
-
def _infer_reset_year(month, day):
|
|
311
|
-
now = datetime.now().astimezone()
|
|
312
|
-
year = now.year
|
|
313
|
-
try:
|
|
314
|
-
candidate = datetime(
|
|
315
|
-
year,
|
|
316
|
-
month + 1,
|
|
317
|
-
day,
|
|
318
|
-
tzinfo=now.tzinfo,
|
|
319
|
-
)
|
|
320
|
-
except ValueError:
|
|
321
|
-
return year
|
|
322
|
-
two_days_ago = datetime.fromtimestamp(now.timestamp() - 2 * 24 * 3600, tz=now.tzinfo)
|
|
323
|
-
return year + 1 if candidate < two_days_ago else year
|
|
324
|
-
|
|
325
|
-
|
|
326
310
|
def _normalize_reset_date(raw):
|
|
327
311
|
if not raw:
|
|
328
312
|
return None
|
|
@@ -349,7 +333,6 @@ def _normalize_reset_date(raw):
|
|
|
349
333
|
hours, minutes, day, month_str = int(m[1]), int(m[2]), int(m[3]), m[4]
|
|
350
334
|
month = _parse_month_index(month_str)
|
|
351
335
|
if month != -1:
|
|
352
|
-
year = _infer_reset_year(month, day)
|
|
353
336
|
return f"{MONTH_ABBR[month]} {day} {pad(hours)}:{pad(minutes)}"
|
|
354
337
|
|
|
355
338
|
# Claude: "Thursday, April 17 at 5:00 AM" or "April 17, 2026, 5 PM"
|
|
@@ -363,7 +346,6 @@ def _normalize_reset_date(raw):
|
|
|
363
346
|
month = _parse_month_index(m[1])
|
|
364
347
|
if month != -1:
|
|
365
348
|
day = int(m[2])
|
|
366
|
-
year = int(m[3]) if m[3] else _infer_reset_year(month, day)
|
|
367
349
|
if m[4]:
|
|
368
350
|
hours, minutes = parse_ampm(int(m[4]), int(m[5] or 0), m[6])
|
|
369
351
|
return f"{MONTH_ABBR[month]} {day} {format_time(hours, minutes)}"
|
|
@@ -397,7 +379,6 @@ def _normalize_reset_date(raw):
|
|
|
397
379
|
month = _parse_month_index(m[1])
|
|
398
380
|
if month != -1:
|
|
399
381
|
day = int(m[2])
|
|
400
|
-
year = int(m[3]) if m[3] else _infer_reset_year(month, day)
|
|
401
382
|
return f"{MONTH_ABBR[month]} {day}"
|
|
402
383
|
|
|
403
384
|
return None
|
package/src/status_view.py
CHANGED
package/src/update_check.py
CHANGED
|
@@ -6,7 +6,6 @@ import urllib.error
|
|
|
6
6
|
import urllib.request
|
|
7
7
|
from datetime import datetime, timezone
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
UPDATE_CHECK_TTL_SECONDS = 60 * 60
|
|
11
10
|
LATEST_RELEASE_URL = "https://api.github.com/repos/AlexAgo83/cdx-manager/releases/latest"
|
|
12
11
|
LOGICS_MANAGER_LATEST_URL = "https://registry.npmjs.org/@grifhinz%2Flogics-manager/latest"
|
|
@@ -49,7 +48,7 @@ def _tool_cache_path(base_dir, tool):
|
|
|
49
48
|
|
|
50
49
|
def _read_cache(path):
|
|
51
50
|
try:
|
|
52
|
-
with open(path,
|
|
51
|
+
with open(path, encoding="utf-8") as handle:
|
|
53
52
|
return json.load(handle)
|
|
54
53
|
except (FileNotFoundError, OSError, json.JSONDecodeError):
|
|
55
54
|
return None
|