cdx-manager 0.20.6 → 0.20.7

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 CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  <br clear="left"/>
6
6
 
7
- [![License](https://img.shields.io/badge/license-MIT-4C8BF5)](LICENSE) ![Version](https://img.shields.io/badge/version-v0.20.6-4C8BF5) ![Python](https://img.shields.io/badge/python-3.9%2B-3776AB?logo=python&logoColor=white)
7
+ [![License](https://img.shields.io/badge/license-MIT-4C8BF5)](LICENSE) ![Version](https://img.shields.io/badge/version-v0.20.7-4C8BF5) ![Python](https://img.shields.io/badge/python-3.9%2B-3776AB?logo=python&logoColor=white)
8
8
 
9
9
  **Stop guessing which AI account still has quota.** `cdx` tracks the rate-limit window of every Codex and Claude account you own, tells you which one is usable right now, and launches it with isolated auth — in one command.
10
10
 
@@ -106,7 +106,7 @@ The reason `cdx` exists: knowing, across every account you own, which one you ca
106
106
 
107
107
  ### Context handoff
108
108
 
109
- - **Shared handoff context.** Keep a per-workspace Markdown context, or build one from a source session transcript, and install it into another assistant session before switching providers or accounts.
109
+ - **Shared handoff context.** Keep a per-workspace Markdown context, or build one from a source session transcript, and install it into another assistant session before switching providers or accounts. Source transcript selection prefers the current workspace when the provider transcript records one, then falls back to the newest source-session transcript.
110
110
  - **Session transcript capture.** Every launch is recorded to a local log file via `script`, giving you a full terminal transcript for each session.
111
111
 
112
112
  ### Maintenance
package/VERSION CHANGED
@@ -1 +1 @@
1
- 0.20.6
1
+ 0.20.7
@@ -0,0 +1,12 @@
1
+ # CDX Manager 0.20.7
2
+
3
+ ## Fixes
4
+
5
+ - `cdx handoff <source> <target>` now prefers the source transcript from the
6
+ current workspace when Codex rollout metadata records one, avoiding stale or
7
+ unrelated context when the same account recently worked in another repository.
8
+
9
+ ## Notes
10
+
11
+ - If provider metadata does not identify a workspace, handoff keeps the previous
12
+ newest-transcript fallback.
@@ -375,6 +375,17 @@
375
375
  "x86_64-pc-windows-msvc": "208064f2bfee19914ca72edb527966a9966154179d6d040f0dae4a647a61f9f4",
376
376
  "x86_64-unknown-linux-musl": "9fa01d3b71daed98c9234ddb0cf7b6345b3d757edff910ece4e3bd9f5eb8eb6b"
377
377
  }
378
+ },
379
+ "v0.20.6": {
380
+ "github_tarball_sha256": "5842d4e743b15c996a21c4f0ef9e58243335f6ac9c313f02e419ef2a772e1177",
381
+ "github_zip_sha256": "9d9d65832490ce515c2c9857159196d55c5ee5b95c02b0fa981c38b919979361",
382
+ "tray_assets": {
383
+ "aarch64-apple-darwin": "6ac68d8aa45b9a7e3256eb6eb0f62f00e738bc023483987d5066d33ce2e6602f",
384
+ "aarch64-unknown-linux-musl": "b77e185c61b8d7b99bbbd24f4d9c6f0fdb6df6ed0f29eda6e7a2443bb034e6c4",
385
+ "x86_64-apple-darwin": "813be88dedc64dfeff551a36ab9971d64b9a9f768d573cd1281334bb59437ff6",
386
+ "x86_64-pc-windows-msvc": "994a6a5767df705d6c6335bc11294990b2527fa1688e372d8a42c87c79cafa8c",
387
+ "x86_64-unknown-linux-musl": "c3c9b67befccff31c0c5090a09384d0788c59cb7be3c233dd61eb0118af50988"
388
+ }
378
389
  }
379
390
  }
380
391
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cdx-manager",
3
- "version": "0.20.6",
3
+ "version": "0.20.7",
4
4
  "description": "Terminal session manager for Codex and Claude accounts.",
5
5
  "license": "MIT",
6
6
  "author": "Alexandre Agostini",
package/pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "cdx-manager"
7
- version = "0.20.6"
7
+ version = "0.20.7"
8
8
  description = "Terminal session manager for Codex and Claude accounts."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -252,8 +252,28 @@ def _collect_native_handoff_transcript_paths(session):
252
252
  return _sort_recent_paths(candidates)[:HANDOFF_NATIVE_TRANSCRIPT_CANDIDATES]
253
253
 
254
254
 
255
- def _latest_handoff_transcript_path(session):
255
+ def _handoff_transcript_workspace(path):
256
+ if not path.endswith(".jsonl"):
257
+ return None
258
+ try:
259
+ with open(path, encoding="utf-8", errors="replace") as handle:
260
+ record = json.loads(handle.readline() or "{}")
261
+ except (OSError, json.JSONDecodeError):
262
+ return None
263
+ if record.get("type") != "session_meta":
264
+ return None
265
+ payload = record.get("payload") if isinstance(record.get("payload"), dict) else {}
266
+ cwd = payload.get("cwd")
267
+ return os.path.realpath(cwd) if isinstance(cwd, str) and cwd else None
268
+
269
+
270
+ def _latest_handoff_transcript_path(session, cwd=None):
256
271
  native_paths = _collect_native_handoff_transcript_paths(session)
272
+ if cwd:
273
+ workspace = os.path.realpath(cwd)
274
+ for path in native_paths:
275
+ if _handoff_transcript_workspace(path) == workspace:
276
+ return path
257
277
  if native_paths:
258
278
  return native_paths[0]
259
279
  return _latest_launch_transcript_path(session)
@@ -430,7 +430,7 @@ def handle_handoff(rest, ctx):
430
430
  target = ctx["service"]["get_session"](target_name)
431
431
  if not target:
432
432
  raise CdxError(f"Unknown session: {target_name}")
433
- transcript_path = _latest_handoff_transcript_path(source)
433
+ transcript_path = _latest_handoff_transcript_path(source, ctx.get("cwd"))
434
434
  if not transcript_path:
435
435
  raise CdxError(f"No transcript found for session: {source_name}")
436
436
  transcript, truncated = _read_handoff_transcript(transcript_path)