claude-smart 0.2.28 → 0.2.30
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 +23 -16
- package/bin/claude-smart.js +333 -73
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/README.md +4 -0
- package/plugin/hooks/codex-hooks.json +8 -3
- package/plugin/hooks/hooks.json +13 -3
- package/plugin/pyproject.toml +1 -1
- package/plugin/scripts/_lib.sh +38 -0
- package/plugin/scripts/backend-log-runner.sh +33 -0
- package/plugin/scripts/backend-service.sh +24 -12
- package/plugin/scripts/cli.sh +27 -3
- package/plugin/scripts/codex-claude-compat +9 -0
- package/plugin/scripts/codex-claude-compat.cmd +4 -0
- package/plugin/scripts/codex-claude-compat.js +162 -0
- package/plugin/scripts/codex-hook.js +102 -11
- package/plugin/scripts/dashboard-service.sh +13 -4
- package/plugin/scripts/hook_entry.sh +29 -3
- package/plugin/scripts/smart-install.sh +176 -50
- package/plugin/src/claude_smart/cli.py +101 -2
- package/plugin/src/claude_smart/context_inject.py +2 -4
- package/plugin/src/claude_smart/cs_cite.py +2 -90
- package/plugin/src/claude_smart/events/stop.py +16 -42
- package/plugin/src/claude_smart/internal_call.py +23 -0
- package/plugin/src/claude_smart/state.py +3 -3
- package/plugin/uv.lock +73 -76
- package/plugin/bin/cs-cite +0 -77
- package/plugin/scripts/codex-claude-compat.py +0 -144
|
@@ -77,7 +77,7 @@ def session_path(session_id: str) -> Path:
|
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
def injected_path(session_id: str) -> Path:
|
|
80
|
-
"""Return the JSONL path for the per-session
|
|
80
|
+
"""Return the JSONL path for the per-session citation registry."""
|
|
81
81
|
return state_dir() / f"{session_id}.injected.jsonl"
|
|
82
82
|
|
|
83
83
|
|
|
@@ -85,8 +85,8 @@ def append_injected(session_id: str, entries: Iterable[dict[str, Any]]) -> None:
|
|
|
85
85
|
"""Append citation-registry entries to the per-session injected-items file.
|
|
86
86
|
|
|
87
87
|
Each entry maps a short ``id`` (4-hex-char) back to the skill or
|
|
88
|
-
preference it came from so the Stop hook can resolve ids
|
|
89
|
-
|
|
88
|
+
preference it came from so the Stop hook can resolve citation ids into
|
|
89
|
+
human-readable titles for the dashboard.
|
|
90
90
|
Silently no-ops when ``entries`` is empty.
|
|
91
91
|
"""
|
|
92
92
|
records = list(entries)
|
package/plugin/uv.lock
CHANGED
|
@@ -377,7 +377,7 @@ wheels = [
|
|
|
377
377
|
|
|
378
378
|
[[package]]
|
|
379
379
|
name = "chromadb"
|
|
380
|
-
version = "1.5.
|
|
380
|
+
version = "1.5.9"
|
|
381
381
|
source = { registry = "https://pypi.org/simple" }
|
|
382
382
|
dependencies = [
|
|
383
383
|
{ name = "bcrypt" },
|
|
@@ -408,18 +408,18 @@ dependencies = [
|
|
|
408
408
|
{ name = "typing-extensions" },
|
|
409
409
|
{ name = "uvicorn", extra = ["standard"] },
|
|
410
410
|
]
|
|
411
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
411
|
+
sdist = { url = "https://files.pythonhosted.org/packages/92/d1/5e33b26985f0c7046a0be1cee2158ada1748ee700d2545057fde1468d74d/chromadb-1.5.9.tar.gz", hash = "sha256:5c20e62a455c28bacac927f26116a73fd8e1799e0d908be8e8a4f02197a54731", size = 2595635, upload-time = "2026-05-05T05:54:51.713Z" }
|
|
412
412
|
wheels = [
|
|
413
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
414
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
415
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
416
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
417
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
413
|
+
{ url = "https://files.pythonhosted.org/packages/dd/5b/3cced915244f43ed14b53fe9f63a37f05f865064f4e4fe7d9448d3f2a352/chromadb-1.5.9-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:60701011b5e6409647fa40d12c7c5a66b2b0bfcf33a52db2ad53a30a2abc4957", size = 22564540, upload-time = "2026-05-05T05:54:48.906Z" },
|
|
414
|
+
{ url = "https://files.pythonhosted.org/packages/34/4c/adcef1f4e82a2ef69ccd3711d55fc289193d54c4c0ff7a0292a3631db46f/chromadb-1.5.9-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:814b9c95617377f6501e5757d63dfddb554a283a7739c87b9fa573850174e6f3", size = 21699698, upload-time = "2026-05-05T05:54:45.078Z" },
|
|
415
|
+
{ url = "https://files.pythonhosted.org/packages/38/4e/937bc4d2e6f8ab9664ec79931fbbd69efff47e513ec2924b071e4b0ff774/chromadb-1.5.9-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9192d111bd662241625867962333d99369a00769a50f8b2f58cb388731274d7e", size = 22680924, upload-time = "2026-05-05T05:54:36.25Z" },
|
|
416
|
+
{ url = "https://files.pythonhosted.org/packages/e6/ec/0c42039e80b9acc534f67b73b7a42471948042859b3a64867b50a4a77fa3/chromadb-1.5.9-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cc09b3df76e5a5cb386aed2715a2eea152e3949f9e1ba93c7119505377749929", size = 23316203, upload-time = "2026-05-05T05:54:41.157Z" },
|
|
417
|
+
{ url = "https://files.pythonhosted.org/packages/eb/ce/0f7be6e5d0feafa2cda54b12e6542afeea7dea89d2d411e14da90f8abb96/chromadb-1.5.9-cp39-abi3-win_amd64.whl", hash = "sha256:4fd0b560e56761b7f3cb4d5c6205fd5f20814484b4a3e4e9af9038c2b428fc6c", size = 23542454, upload-time = "2026-05-05T05:54:54.942Z" },
|
|
418
418
|
]
|
|
419
419
|
|
|
420
420
|
[[package]]
|
|
421
421
|
name = "claude-smart"
|
|
422
|
-
version = "0.2.
|
|
422
|
+
version = "0.2.30"
|
|
423
423
|
source = { editable = "." }
|
|
424
424
|
dependencies = [
|
|
425
425
|
{ name = "chromadb" },
|
|
@@ -510,9 +510,6 @@ wheels = [
|
|
|
510
510
|
]
|
|
511
511
|
|
|
512
512
|
[package.optional-dependencies]
|
|
513
|
-
cublas = [
|
|
514
|
-
{ name = "nvidia-cublas", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
|
|
515
|
-
]
|
|
516
513
|
cudart = [
|
|
517
514
|
{ name = "nvidia-cuda-runtime", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
|
|
518
515
|
]
|
|
@@ -1750,14 +1747,14 @@ wheels = [
|
|
|
1750
1747
|
|
|
1751
1748
|
[[package]]
|
|
1752
1749
|
name = "nvidia-cudnn-cu13"
|
|
1753
|
-
version = "9.
|
|
1750
|
+
version = "9.20.0.48"
|
|
1754
1751
|
source = { registry = "https://pypi.org/simple" }
|
|
1755
1752
|
dependencies = [
|
|
1756
1753
|
{ name = "nvidia-cublas" },
|
|
1757
1754
|
]
|
|
1758
1755
|
wheels = [
|
|
1759
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1760
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1756
|
+
{ url = "https://files.pythonhosted.org/packages/56/c5/83384d846b2fd17c44bd499b36c75a45ed4f095fbbb2252294e89cea5c5c/nvidia_cudnn_cu13-9.20.0.48-py3-none-manylinux_2_27_aarch64.whl", hash = "sha256:e31454ae00094b0c55319d9d15b6fa2fc50a9e1c0f5c8c80fb75258234e731e1", size = 444574296, upload-time = "2026-03-09T19:28:27.751Z" },
|
|
1757
|
+
{ url = "https://files.pythonhosted.org/packages/6e/5e/edb9c0ae051602c3ccaffe424256463636d639e27d7f302dde9975ef9e7a/nvidia_cudnn_cu13-9.20.0.48-py3-none-manylinux_2_27_x86_64.whl", hash = "sha256:0c45dd8eeb50b603f07995b1b300c62ffe6a1980482b82b3bcf94a4ca9d49304", size = 366173588, upload-time = "2026-03-09T19:29:34.474Z" },
|
|
1761
1758
|
]
|
|
1762
1759
|
|
|
1763
1760
|
[[package]]
|
|
@@ -1818,20 +1815,20 @@ wheels = [
|
|
|
1818
1815
|
|
|
1819
1816
|
[[package]]
|
|
1820
1817
|
name = "nvidia-cusparselt-cu13"
|
|
1821
|
-
version = "0.8.
|
|
1818
|
+
version = "0.8.1"
|
|
1822
1819
|
source = { registry = "https://pypi.org/simple" }
|
|
1823
1820
|
wheels = [
|
|
1824
|
-
{ url = "https://files.pythonhosted.org/packages/46/
|
|
1825
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1821
|
+
{ url = "https://files.pythonhosted.org/packages/46/e1/cdc1797eadf82d3a9a575a19b33fdc871a97edbec42c00b5b5e914f4aff4/nvidia_cusparselt_cu13-0.8.1-py3-none-manylinux2014_aarch64.whl", hash = "sha256:4dca476c50bf4780d46cd0bfbd82e2bc10a08e4fef7950917ce8d7578d22a23f", size = 221051344, upload-time = "2025-09-05T18:49:51.289Z" },
|
|
1822
|
+
{ url = "https://files.pythonhosted.org/packages/34/7d/2661f2fb3ac4302f3a246f5fc030213ac60c1fe0bce84f9783dbd831dbb7/nvidia_cusparselt_cu13-0.8.1-py3-none-manylinux2014_x86_64.whl", hash = "sha256:786ce87568c303fadb5afcc7102d454cd3040d75f6f8626f5db460d1871f4dd0", size = 170148586, upload-time = "2025-09-05T18:50:50.248Z" },
|
|
1826
1823
|
]
|
|
1827
1824
|
|
|
1828
1825
|
[[package]]
|
|
1829
1826
|
name = "nvidia-nccl-cu13"
|
|
1830
|
-
version = "2.
|
|
1827
|
+
version = "2.29.7"
|
|
1831
1828
|
source = { registry = "https://pypi.org/simple" }
|
|
1832
1829
|
wheels = [
|
|
1833
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1834
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1830
|
+
{ url = "https://files.pythonhosted.org/packages/72/0d/daf50d44177ee0cbc7ff0a0c91eb5ff676c82be42f9a970bc7597f440c3a/nvidia_nccl_cu13-2.29.7-py3-none-manylinux_2_18_aarch64.whl", hash = "sha256:674a12383e3c38a1bcccae7d4f3633b37852230b6047883cb2f4c2d1b36d9bf5", size = 206014712, upload-time = "2026-03-03T05:34:20.843Z" },
|
|
1831
|
+
{ url = "https://files.pythonhosted.org/packages/67/f4/58e4e91b6919367c7aafb8e36fce9aad1a3047e536bf7e2fd560927d3a4c/nvidia_nccl_cu13-2.29.7-py3-none-manylinux_2_18_x86_64.whl", hash = "sha256:edd81538446786ec3b73972543e53bb43bcaf0bfc8ef76cb679fcc390ffe136d", size = 205976000, upload-time = "2026-03-03T05:36:24.472Z" },
|
|
1835
1832
|
]
|
|
1836
1833
|
|
|
1837
1834
|
[[package]]
|
|
@@ -1872,35 +1869,34 @@ wheels = [
|
|
|
1872
1869
|
|
|
1873
1870
|
[[package]]
|
|
1874
1871
|
name = "onnxruntime"
|
|
1875
|
-
version = "1.
|
|
1872
|
+
version = "1.26.0"
|
|
1876
1873
|
source = { registry = "https://pypi.org/simple" }
|
|
1877
1874
|
dependencies = [
|
|
1878
1875
|
{ name = "flatbuffers" },
|
|
1879
1876
|
{ name = "numpy" },
|
|
1880
1877
|
{ name = "packaging" },
|
|
1881
1878
|
{ name = "protobuf" },
|
|
1882
|
-
{ name = "sympy" },
|
|
1883
1879
|
]
|
|
1884
1880
|
wheels = [
|
|
1885
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1886
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1887
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1888
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1889
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1890
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1891
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1892
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1893
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1894
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1895
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1896
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1897
|
-
{ url = "https://files.pythonhosted.org/packages/89/
|
|
1898
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1899
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1900
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1901
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1902
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1903
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1881
|
+
{ url = "https://files.pythonhosted.org/packages/81/b1/d111b1df656761f980d9e298a60039a9cb66036b1d039e777537743d0ac3/onnxruntime-1.26.0-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:05b028781b322ad74b57ce5b50aa5280bb1fe96ceec334628ade681e0b24c1ac", size = 18016624, upload-time = "2026-05-12T00:41:01.735Z" },
|
|
1882
|
+
{ url = "https://files.pythonhosted.org/packages/f6/a0/3f9d896a0385a36bd04345d6d0b802821a5782adde562e7e135f6bb71c73/onnxruntime-1.26.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:91f2bb870a4b9224eba0a6728c1fa7a9e552b8e59e1083c51fbbc3d013f2b5c0", size = 16052692, upload-time = "2026-05-08T19:07:13.829Z" },
|
|
1883
|
+
{ url = "https://files.pythonhosted.org/packages/7c/43/2a4e04f8dbeffad19bbcced4bcd4289bf478921518437404d6b92bdf213b/onnxruntime-1.26.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9b6dd70599005bd1bf29779f04a91978b92b5e719c11a20068a8f8e535f725b6", size = 18185439, upload-time = "2026-05-08T19:07:36.299Z" },
|
|
1884
|
+
{ url = "https://files.pythonhosted.org/packages/44/fc/026d0a7162b9c2153dac292baea9e027c42304dc1d9dc6f8ff5b4cfbaedd/onnxruntime-1.26.0-cp312-cp312-win_amd64.whl", hash = "sha256:a26374dc7fbcaae593601086b242120e13f2310558df0991da6dd8b8fac00414", size = 13026427, upload-time = "2026-05-08T19:08:03.503Z" },
|
|
1885
|
+
{ url = "https://files.pythonhosted.org/packages/3e/27/1dcf88e45e4c69db5f7b106f2dacc3801ba98994e082ca03e1dfdf7bfe57/onnxruntime-1.26.0-cp312-cp312-win_arm64.whl", hash = "sha256:54a8053410fd31fd66469bd754fcfe8a4df9f7eb44756b4b5479bf50c842d948", size = 12796647, upload-time = "2026-05-08T19:07:52.108Z" },
|
|
1886
|
+
{ url = "https://files.pythonhosted.org/packages/cf/a2/c801242685e0ce48a4ca51dfafbb588765e0446397e123be53ba5598f3f5/onnxruntime-1.26.0-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:ccce19c5f771b8268902f77d9fed9e88f9499465d6780808faa6611a789d33f0", size = 18016563, upload-time = "2026-05-08T19:07:28.081Z" },
|
|
1887
|
+
{ url = "https://files.pythonhosted.org/packages/e2/64/0492c0b1db04e29b2630c87cfa36f9d6872b1ca8614b90c5cad58fac7d76/onnxruntime-1.26.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bdbed8cf3b672b66acb032f33a253bc27f42bce6ece48ae3fab4fa483a5e96e0", size = 16052634, upload-time = "2026-05-08T19:07:16.885Z" },
|
|
1888
|
+
{ url = "https://files.pythonhosted.org/packages/3d/26/4d09ddc755a84fc8d5e192991626b0e0680e8f6c5d58f4f1d05c42bc48cf/onnxruntime-1.26.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c07af6fc6d5557835f2b6ee7a96d8b3235d0c57a8e230efdedaee106a8a3cbc6", size = 18185632, upload-time = "2026-05-08T19:07:38.756Z" },
|
|
1889
|
+
{ url = "https://files.pythonhosted.org/packages/77/89/3e52249aa08fa301e217ecba07b5246a8338fa2b401e109326e3fc5be0f9/onnxruntime-1.26.0-cp313-cp313-win_amd64.whl", hash = "sha256:61bec80655efa460591c2bc655392d57d2650ce85533a6b9b3b7a790d7ea7916", size = 13026751, upload-time = "2026-05-08T19:08:06.2Z" },
|
|
1890
|
+
{ url = "https://files.pythonhosted.org/packages/06/b3/c1c8782b14af6797c303de132d6eef26a9fb80dfacd3750ce57911d11c6b/onnxruntime-1.26.0-cp313-cp313-win_arm64.whl", hash = "sha256:a6677545ff451e3539a02746d2f207d8c5baa4a0a818886bb9d6a6eb9511ee89", size = 12796807, upload-time = "2026-05-08T19:07:54.879Z" },
|
|
1891
|
+
{ url = "https://files.pythonhosted.org/packages/c3/f5/47b0676408abec652c14b84d7173e389837832d850c24f87184277313e8d/onnxruntime-1.26.0-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5e016edc15d3c19f36807e1c6b10be5b27807688c32720f91b5ae480a95215d0", size = 16057265, upload-time = "2026-05-08T19:07:19.603Z" },
|
|
1892
|
+
{ url = "https://files.pythonhosted.org/packages/3b/45/33ab6deeef010ca844c877dd618cebc079590bbe52d2a3678e7223b1b908/onnxruntime-1.26.0-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f5fc48a91a046a6a5c9b147f83fb41d65d24d24923373b222cdd248f0f4f4aac", size = 18197590, upload-time = "2026-05-08T19:07:41.422Z" },
|
|
1893
|
+
{ url = "https://files.pythonhosted.org/packages/40/89/17546c1c20f6bfc3ae41c22152378a26edfea918af3129e2139dcd7c99f3/onnxruntime-1.26.0-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:33a791f31432a3af1a96db5e54818b37aba5e5eefc2e6af5794c10a9118a9993", size = 18019724, upload-time = "2026-05-08T19:07:30.723Z" },
|
|
1894
|
+
{ url = "https://files.pythonhosted.org/packages/bb/24/89457a35f6af29538a76647f2c18c3a28277e6c19234c847e7b4b7c19860/onnxruntime-1.26.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e90c00732c4553618103149d93f688e8c3063017938f8983e21a71d9f3b6d22e", size = 16054821, upload-time = "2026-05-08T19:07:22.348Z" },
|
|
1895
|
+
{ url = "https://files.pythonhosted.org/packages/12/f9/15b2e1815cf570d238e0135529f80d2dce64e8e8818a1489cae83823c5c6/onnxruntime-1.26.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:01498e80ba8988428d08c2d51b1338f89e3de2a93e6ffe555f79c68f26a5c06b", size = 18185815, upload-time = "2026-05-08T19:07:44.179Z" },
|
|
1896
|
+
{ url = "https://files.pythonhosted.org/packages/d7/65/2e11055faf015e4b07f45b513fa49b391baf2e19d92d77d73ebee13c1004/onnxruntime-1.26.0-cp314-cp314-win_amd64.whl", hash = "sha256:7ead61450d8405167c87dd3a31d8da1d576b490a57dab1aa8b82a7da6825f5aa", size = 13349887, upload-time = "2026-05-08T19:08:08.671Z" },
|
|
1897
|
+
{ url = "https://files.pythonhosted.org/packages/19/e4/0f9d1a5718b1781c610c1e354765a3820597081754277a6a9a2b50705702/onnxruntime-1.26.0-cp314-cp314-win_arm64.whl", hash = "sha256:31d71a53490e46910877d0902b5ad99c69a5955e5c7ea6c82863519410e1ba7c", size = 13140121, upload-time = "2026-05-08T19:07:57.804Z" },
|
|
1898
|
+
{ url = "https://files.pythonhosted.org/packages/1c/42/3b8e635f067d06d9f45bede470b8d539d101a4166c272213158dfd08b6ce/onnxruntime-1.26.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d7b6d258fb78fdfcf049795bcfaa74dcb90ae7baa277afd21e6fd28b83f2c496", size = 16057240, upload-time = "2026-05-08T19:07:25.163Z" },
|
|
1899
|
+
{ url = "https://files.pythonhosted.org/packages/93/99/f2be40a31b908d96b861ae0ce98582fa376c18a7f816b9d5eb4cd6aa0a4c/onnxruntime-1.26.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4eefd386a45202aefb7a5132b94f32df9d506c9edcc7faf2fc60d65183f4b183", size = 18197382, upload-time = "2026-05-08T19:07:46.965Z" },
|
|
1904
1900
|
]
|
|
1905
1901
|
|
|
1906
1902
|
[[package]]
|
|
@@ -3229,15 +3225,16 @@ wheels = [
|
|
|
3229
3225
|
|
|
3230
3226
|
[[package]]
|
|
3231
3227
|
name = "torch"
|
|
3232
|
-
version = "2.
|
|
3228
|
+
version = "2.12.0"
|
|
3233
3229
|
source = { registry = "https://pypi.org/simple" }
|
|
3234
3230
|
dependencies = [
|
|
3235
3231
|
{ name = "cuda-bindings", marker = "sys_platform == 'linux'" },
|
|
3236
|
-
{ name = "cuda-toolkit", extra = ["
|
|
3232
|
+
{ name = "cuda-toolkit", extra = ["cudart", "cufft", "cufile", "cupti", "curand", "cusolver", "cusparse", "nvjitlink", "nvrtc", "nvtx"], marker = "sys_platform == 'linux'" },
|
|
3237
3233
|
{ name = "filelock" },
|
|
3238
3234
|
{ name = "fsspec" },
|
|
3239
3235
|
{ name = "jinja2" },
|
|
3240
3236
|
{ name = "networkx" },
|
|
3237
|
+
{ name = "nvidia-cublas", marker = "sys_platform == 'linux'" },
|
|
3241
3238
|
{ name = "nvidia-cudnn-cu13", marker = "sys_platform == 'linux'" },
|
|
3242
3239
|
{ name = "nvidia-cusparselt-cu13", marker = "sys_platform == 'linux'" },
|
|
3243
3240
|
{ name = "nvidia-nccl-cu13", marker = "sys_platform == 'linux'" },
|
|
@@ -3248,26 +3245,26 @@ dependencies = [
|
|
|
3248
3245
|
{ name = "typing-extensions" },
|
|
3249
3246
|
]
|
|
3250
3247
|
wheels = [
|
|
3251
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3252
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3253
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3254
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3255
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3256
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3257
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3258
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3259
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3260
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3261
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3262
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3263
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3264
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3265
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3266
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3267
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3268
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3269
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3270
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3248
|
+
{ url = "https://files.pythonhosted.org/packages/ef/bb/285d643f254731294c9b595a007eac39db4600a98682d7bca688f42ca164/torch-2.12.0-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:b41339df93d491435e790ff8bcbae1c0ce777175889bfd1281d119862793e6a2", size = 88010197, upload-time = "2026-05-13T14:55:35.414Z" },
|
|
3249
|
+
{ url = "https://files.pythonhosted.org/packages/79/81/76debf1db1343bd929bbb5d74c89fb437c2ed88eb144712557e7bd3eea45/torch-2.12.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:8fbef9f108a863e7722a73740998967e3b074742a834fc5be3a535a2befa7057", size = 426376751, upload-time = "2026-05-13T14:55:03.353Z" },
|
|
3250
|
+
{ url = "https://files.pythonhosted.org/packages/de/f0/80026028b603c4650ff270fc3785bdef4bd6738765a9cc5a0f5a637d65a2/torch-2.12.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:4b4f64c2c2b11f7510d93dd6412b87025ff6eddd6bb61c3b5a3d892ea20c4756", size = 532261691, upload-time = "2026-05-13T14:52:54.453Z" },
|
|
3251
|
+
{ url = "https://files.pythonhosted.org/packages/b9/c2/64b06cbb7830fb3cd9be13e1158b31a3f36b68e6a209105ee3c9d9480be0/torch-2.12.0-cp312-cp312-win_amd64.whl", hash = "sha256:8b958caff4a14d3a3b0b2dfc6a378f64dda9728a9dad28c08a0db9ce4dafb549", size = 122988114, upload-time = "2026-05-13T14:54:42.153Z" },
|
|
3252
|
+
{ url = "https://files.pythonhosted.org/packages/86/ca/01896c80ba921676aa45886b2c5b8d774912de2a1f719de48169c6f755cd/torch-2.12.0-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:90dd587a5f61bfe1307148b581e2084fc5bc4a06e2b90a20e9a36b81087ff16b", size = 88009511, upload-time = "2026-05-13T14:54:47.411Z" },
|
|
3253
|
+
{ url = "https://files.pythonhosted.org/packages/a5/04/52bdaf4787eab6ac7d7f5851dff934e4def0bc8ead9c8fd2b69b3e529699/torch-2.12.0-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:864392c73b7654f4d2b3ae712f607937d0dbb1101c4555fbb41848106b297f39", size = 426383231, upload-time = "2026-05-13T14:53:32.129Z" },
|
|
3254
|
+
{ url = "https://files.pythonhosted.org/packages/49/8a/94bdecd13f5aaa90d45920b89789d9fe7c6f4af8c3cdd7ce01fcb59908fc/torch-2.12.0-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:5d6b560dfa7d56291c07d615c3bb73e8d9943d9b6d87f76cd0d9d570c4797fa6", size = 532269288, upload-time = "2026-05-13T14:53:49.423Z" },
|
|
3255
|
+
{ url = "https://files.pythonhosted.org/packages/3e/2f/bdbaaa267de519ef1b73054bf590d8c93c37a266c9a4e24a01bd38b6918f/torch-2.12.0-cp313-cp313-win_amd64.whl", hash = "sha256:3fee918902090ade827643e758e98363278815de583c75d111fdd665ebffde9f", size = 122987706, upload-time = "2026-05-13T14:54:00.335Z" },
|
|
3256
|
+
{ url = "https://files.pythonhosted.org/packages/9b/ad/e95e822f3538171e22640a7fbe839a1fdb666600bf6487025de2ff03b11a/torch-2.12.0-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:10ee1448a9f304d3b987eb4656f664ba6e4d7b410ca7a5a7c642199777a2cf88", size = 88319556, upload-time = "2026-05-13T14:54:05.574Z" },
|
|
3257
|
+
{ url = "https://files.pythonhosted.org/packages/b7/07/055d06d985b445d67422d25b033c11cf55bbb81785d4c4e68e28bca5820e/torch-2.12.0-cp313-cp313t-manylinux_2_28_aarch64.whl", hash = "sha256:af68dbf403439cae9ceaeaaf92f8352b460787dcd27b92aa05c40dd4a19c0f1e", size = 426397656, upload-time = "2026-05-13T14:52:38.84Z" },
|
|
3258
|
+
{ url = "https://files.pythonhosted.org/packages/43/94/b0b4fdc3014122e0a7302fb90086d352aa48f2576f0b252561ebb38c01a8/torch-2.12.0-cp313-cp313t-manylinux_2_28_x86_64.whl", hash = "sha256:a6a2eebb237d3b1d9ad3b378e86d9b9e0782afdea8b1e0eba6a13646b9b49c07", size = 532183124, upload-time = "2026-05-13T14:53:16.178Z" },
|
|
3259
|
+
{ url = "https://files.pythonhosted.org/packages/d8/c8/052405e6ad05d3237bfe5a4df78f917773956f8e17813a2d44c059068b74/torch-2.12.0-cp313-cp313t-win_amd64.whl", hash = "sha256:2140e373e9a51a3e22ef62e8d14366d0b470d18f0adf19fdc757368077133a34", size = 123232462, upload-time = "2026-05-13T14:52:27.26Z" },
|
|
3260
|
+
{ url = "https://files.pythonhosted.org/packages/67/dc/ac069f8d6e8be701535921141055293b0d4819d3d7f224a4612cf157c7f9/torch-2.12.0-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:f7dfae4a519197dfa050e98d8e36378a0fb5899625a875c2b54445005a2e404e", size = 88027282, upload-time = "2026-05-13T14:53:05.258Z" },
|
|
3261
|
+
{ url = "https://files.pythonhosted.org/packages/33/c3/1c1eb00e34555b536dddf792676026a988d710ed36981aa00499b36b0620/torch-2.12.0-cp314-cp314-manylinux_2_28_aarch64.whl", hash = "sha256:891c769072637c74e9a5a77a3bc782894696d8ffec83b938df8536dee7f0ba78", size = 426386961, upload-time = "2026-05-13T14:51:28.406Z" },
|
|
3262
|
+
{ url = "https://files.pythonhosted.org/packages/cd/d4/7e730dba0c7032a4154dc9056b76cf9625515e030e269cfbf8098fcfee7d/torch-2.12.0-cp314-cp314-manylinux_2_28_x86_64.whl", hash = "sha256:e2ad3eb85d39c3cab62dfa93ed5a73516e6a53c6713cb97d004004fe089f0f1f", size = 532272265, upload-time = "2026-05-13T14:51:59.308Z" },
|
|
3263
|
+
{ url = "https://files.pythonhosted.org/packages/f1/b4/92c80d1bbfee1c0036c06d1d2155a3065bd2423134c83bf8a47e65cd6b9b/torch-2.12.0-cp314-cp314-win_amd64.whl", hash = "sha256:c66696857e987efb8bc1777a37357ec4f60ab5e8af6250b83d6034437fa2d8f3", size = 122987138, upload-time = "2026-05-13T14:51:45.942Z" },
|
|
3264
|
+
{ url = "https://files.pythonhosted.org/packages/7b/78/2e12b37ce50a19a037d7bc62d652a5a8f27385a7b05859d6bc9204f20cfe/torch-2.12.0-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:b4556715c8572758625d62b6e0ae3b1f76c440221913a6fb5e100f321fb4fb02", size = 88320100, upload-time = "2026-05-13T14:51:39.955Z" },
|
|
3265
|
+
{ url = "https://files.pythonhosted.org/packages/56/5e/83c450ec7b0bb40a7b74611c1b5440f9260e33c54c90d556fd4a1f0fd955/torch-2.12.0-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:a43ac605a5e13116c72b64c359644cce0229f213dde48d2ae0ae5eb5becf7feb", size = 426391871, upload-time = "2026-05-13T14:52:14.989Z" },
|
|
3266
|
+
{ url = "https://files.pythonhosted.org/packages/c9/e9/1a0b575d98d0afedd8f157d23fa3d2759421483660448e60d0a4b10b6daa/torch-2.12.0-cp314-cp314t-manylinux_2_28_x86_64.whl", hash = "sha256:6a7512adfdd7f6732e40de1c620831e3c75b39b98cef60b11d0c5f0a76473ec5", size = 532192241, upload-time = "2026-05-13T14:51:07.795Z" },
|
|
3267
|
+
{ url = "https://files.pythonhosted.org/packages/88/21/afadd25ecd81b3cea1e11c73cf1ab41a983a50271548c3ec7ec3b9efc3e9/torch-2.12.0-cp314-cp314t-win_amd64.whl", hash = "sha256:5f96b63f8287f66a005dd1b5a6abba2920f11156c5e5c4d815f3e2050fd1aa16", size = 123231092, upload-time = "2026-05-13T14:51:18.854Z" },
|
|
3271
3268
|
]
|
|
3272
3269
|
|
|
3273
3270
|
[[package]]
|
|
@@ -3304,19 +3301,19 @@ wheels = [
|
|
|
3304
3301
|
|
|
3305
3302
|
[[package]]
|
|
3306
3303
|
name = "triton"
|
|
3307
|
-
version = "3.
|
|
3308
|
-
source = { registry = "https://pypi.org/simple" }
|
|
3309
|
-
wheels = [
|
|
3310
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3311
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3312
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3313
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3314
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3315
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3316
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3317
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3318
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3319
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
3304
|
+
version = "3.7.0"
|
|
3305
|
+
source = { registry = "https://pypi.org/simple" }
|
|
3306
|
+
wheels = [
|
|
3307
|
+
{ url = "https://files.pythonhosted.org/packages/f7/13/ec05adfcd87311d532ba61e3af143e8be59fcd26675884c4682841406a20/triton-3.7.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a4bf49b00a7a377a68a6da603a876e797614e6455a80e9021669c476a953ad9a", size = 188505104, upload-time = "2026-05-07T19:05:09.843Z" },
|
|
3308
|
+
{ url = "https://files.pythonhosted.org/packages/62/7b/468a576e35beef1426e0828e28e9ba9e65f5474d496f16ee126c15646324/triton-3.7.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8f111161d49bf903c0eaedde3962353a3d841c08a836839b7cc1025b8426efcf", size = 201457567, upload-time = "2026-05-07T18:46:13.505Z" },
|
|
3309
|
+
{ url = "https://files.pythonhosted.org/packages/01/e1/a59a583de59b8f62c495d67c80ee3ea97d09e91ac80c4c6e76456ed8d8ac/triton-3.7.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:abdf6beaa89b1bcfb9a43cd990536ce66091a997841a4814b260b7bee4c88c3c", size = 188503209, upload-time = "2026-05-07T19:05:17.935Z" },
|
|
3310
|
+
{ url = "https://files.pythonhosted.org/packages/30/b1/b7507bb9815d403927c8dd51d4158ed2e11751a92dbc118a044f247b6848/triton-3.7.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a35d7afe3f3f058e7ec49fcce09794049e0ffc5c59019ac25ec3413741b8c4e7", size = 201453566, upload-time = "2026-05-07T18:46:20.427Z" },
|
|
3311
|
+
{ url = "https://files.pythonhosted.org/packages/a6/8f/0bea7a6a0c989315c9135a1d7fb37e41905cfb3a17cbc1f10044ebd4cc3a/triton-3.7.0-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:cc1d61c172d257db80ddf42595131fb196ad2e9bdd751e90fe2ef13531734e8b", size = 188612899, upload-time = "2026-05-07T19:05:24.955Z" },
|
|
3312
|
+
{ url = "https://files.pythonhosted.org/packages/e1/02/d96f57828d0912aec733b9bc7e0e7dbfd2c6f079a8fa433ac25cb93d1a30/triton-3.7.0-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:70fb9bbdc9f400afc54bbf6eb2670af28829a6ae3996863317964783141daf56", size = 201553816, upload-time = "2026-05-07T18:46:27.49Z" },
|
|
3313
|
+
{ url = "https://files.pythonhosted.org/packages/40/fb/82a802dac4689f2a2fb2e69302e6a138eecc3e175bbe976ba3cfc717683a/triton-3.7.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c4a44a8476d0d3571eac4e4d1048e1ff75aad81a09ff4602ccfc56c6dea1672e", size = 188507879, upload-time = "2026-05-07T19:05:32.209Z" },
|
|
3314
|
+
{ url = "https://files.pythonhosted.org/packages/8f/af/9904ec6d3c93d9b24e5ec360445bbdf758b7f00bfbeedb89cb0eb64eb8bb/triton-3.7.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b9b85e72968a9d8bba5ddb24e9b64aaabaf48affb042f2755cb7cfa92b7531ce", size = 201460637, upload-time = "2026-05-07T18:46:34.749Z" },
|
|
3315
|
+
{ url = "https://files.pythonhosted.org/packages/a1/f9/4835a8ea746b88727d8899f4e3ccce4f9cacb38abfc3bb0a638266c53111/triton-3.7.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:18a160de426fd99f92b0baf509045360afbd3bfaa0b4a5171dde800ec9f09684", size = 188608706, upload-time = "2026-05-07T19:05:39.218Z" },
|
|
3316
|
+
{ url = "https://files.pythonhosted.org/packages/c1/68/fa86e5a39608000f645535b2c124920126327ab731f8c4fafd5b07ff8d4b/triton-3.7.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ce061073102714b725f3660ec6939d94a1da7984b3aa99c921417cae273672f5", size = 201546766, upload-time = "2026-05-07T18:46:42.088Z" },
|
|
3320
3317
|
]
|
|
3321
3318
|
|
|
3322
3319
|
[[package]]
|
package/plugin/bin/cs-cite
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""cs-cite — claude-smart citation tool.
|
|
3
|
-
|
|
4
|
-
Claude invokes this via Bash at the end of a reply when an injected
|
|
5
|
-
skill or preference materially shaped the response. The script silently
|
|
6
|
-
validates the id tokens and exits; the Stop hook reads the citation IDs
|
|
7
|
-
off the Bash ``tool_use`` block when it scans the session transcript —
|
|
8
|
-
no session_id, no sidecar file, no state. The confirmation line
|
|
9
|
-
("✨ N claude-smart learnings applied") is emitted by Claude itself as
|
|
10
|
-
the trailing content of the same assistant message, not by this script,
|
|
11
|
-
so the model has a natural, bounded turn-closer after the tool returns.
|
|
12
|
-
|
|
13
|
-
Usage:
|
|
14
|
-
cs-cite <id> [<id>...] # space- or comma-separated
|
|
15
|
-
|
|
16
|
-
Accepts one or more rank ids: ``p<N>[-<fp>]`` for preferences
|
|
17
|
-
and ``s<N>[-<fp>]`` for skills, as emitted in ``[cs:p1-ab12]``
|
|
18
|
-
/ ``[cs:s2-cd34]`` tags. The optional ``-<fp>`` suffix is a 1–4 char
|
|
19
|
-
alphanumeric fingerprint of the underlying real id. Tokens may be
|
|
20
|
-
separated by commas and/or whitespace. An optional ``cs:`` prefix is
|
|
21
|
-
stripped for convenience since the model often copies the tag
|
|
22
|
-
verbatim. Case is normalized to lowercase.
|
|
23
|
-
"""
|
|
24
|
-
|
|
25
|
-
from __future__ import annotations
|
|
26
|
-
|
|
27
|
-
import re
|
|
28
|
-
import sys
|
|
29
|
-
|
|
30
|
-
_TOKEN_RE = re.compile(r"^(?:cs:)?([ps]\d+(?:-[a-z0-9]{1,4})?)$", re.IGNORECASE)
|
|
31
|
-
_SPLIT_RE = re.compile(r"[,\s]+")
|
|
32
|
-
_USAGE = (
|
|
33
|
-
"cs-cite: expected one or more rank ids "
|
|
34
|
-
"(e.g. `cs-cite p1-ab12,s2-cd34` or `cs-cite cs:p1-ab12`)\n"
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def main() -> int:
|
|
39
|
-
"""Parse ids from argv and exit silently on success.
|
|
40
|
-
|
|
41
|
-
The confirmation line is emitted by Claude as the trailing content of
|
|
42
|
-
the same assistant message (see ``CITATION_INSTRUCTION``), not here —
|
|
43
|
-
keeping this script silent gives the model a natural, bounded thing
|
|
44
|
-
to say after the tool returns instead of leaving a "must emit
|
|
45
|
-
something" gap that tends to hallucinate role markers.
|
|
46
|
-
|
|
47
|
-
Returns:
|
|
48
|
-
int: ``0`` on success, ``1`` when no valid ids were found.
|
|
49
|
-
"""
|
|
50
|
-
argv = sys.argv[1:]
|
|
51
|
-
if not argv:
|
|
52
|
-
sys.stderr.write(_USAGE)
|
|
53
|
-
return 1
|
|
54
|
-
tokens = [t for t in _SPLIT_RE.split(" ".join(argv).strip()) if t]
|
|
55
|
-
if not tokens:
|
|
56
|
-
sys.stderr.write(_USAGE)
|
|
57
|
-
return 1
|
|
58
|
-
ids: list[str] = []
|
|
59
|
-
bad: list[str] = []
|
|
60
|
-
for tok in tokens:
|
|
61
|
-
if match := _TOKEN_RE.match(tok):
|
|
62
|
-
ids.append(match.group(1).lower())
|
|
63
|
-
else:
|
|
64
|
-
bad.append(tok)
|
|
65
|
-
if bad:
|
|
66
|
-
sys.stderr.write(
|
|
67
|
-
"cs-cite: ignoring invalid tokens (expected rank ids like "
|
|
68
|
-
f"`p1` or `s2`, optionally 'cs:'-prefixed): {', '.join(bad)}\n"
|
|
69
|
-
)
|
|
70
|
-
if not ids:
|
|
71
|
-
sys.stderr.write(_USAGE)
|
|
72
|
-
return 1
|
|
73
|
-
return 0
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if __name__ == "__main__":
|
|
77
|
-
raise SystemExit(main())
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Translate Reflexio's Claude CLI provider contract to ``codex exec``.
|
|
3
|
-
|
|
4
|
-
Reflexio's local provider currently shells out to ``CLAUDE_SMART_CLI_PATH`` as
|
|
5
|
-
if it were the Claude Code CLI:
|
|
6
|
-
|
|
7
|
-
<path> -p --output-format json --model <model> [--append-system-prompt ...]
|
|
8
|
-
|
|
9
|
-
When claude-smart runs under Codex, this executable preserves that narrow
|
|
10
|
-
contract while routing the actual model call through ``codex exec``. The
|
|
11
|
-
stdout shape intentionally matches Claude Code's JSON output enough for
|
|
12
|
-
Reflexio's provider to read ``result``.
|
|
13
|
-
"""
|
|
14
|
-
|
|
15
|
-
from __future__ import annotations
|
|
16
|
-
|
|
17
|
-
import json
|
|
18
|
-
import os
|
|
19
|
-
import shutil
|
|
20
|
-
import subprocess
|
|
21
|
-
import sys
|
|
22
|
-
import tempfile
|
|
23
|
-
from pathlib import Path
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
_TIMEOUT_SECONDS = 120
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def main(argv: list[str] | None = None) -> int:
|
|
30
|
-
argv = list(sys.argv[1:] if argv is None else argv)
|
|
31
|
-
try:
|
|
32
|
-
output_format, system_prompt = _parse_supported_args(argv)
|
|
33
|
-
content = _run_codex(
|
|
34
|
-
prompt=sys.stdin.read(),
|
|
35
|
-
system_prompt=system_prompt,
|
|
36
|
-
)
|
|
37
|
-
except Exception as exc: # noqa: BLE001 - CLI bridge errors go to stderr.
|
|
38
|
-
print(f"codex-claude-compat: {exc}", file=sys.stderr)
|
|
39
|
-
return 1
|
|
40
|
-
|
|
41
|
-
payload = {"result": content}
|
|
42
|
-
if output_format == "stream-json":
|
|
43
|
-
payload = {"type": "result", "subtype": "success", "result": content}
|
|
44
|
-
json.dump(payload, sys.stdout, ensure_ascii=False)
|
|
45
|
-
sys.stdout.write("\n")
|
|
46
|
-
return 0
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
def _parse_supported_args(argv: list[str]) -> tuple[str, str]:
|
|
50
|
-
output_format = "json"
|
|
51
|
-
system_prompt = ""
|
|
52
|
-
idx = 0
|
|
53
|
-
while idx < len(argv):
|
|
54
|
-
arg = argv[idx]
|
|
55
|
-
if arg == "-p":
|
|
56
|
-
idx += 1
|
|
57
|
-
elif arg == "--output-format":
|
|
58
|
-
if idx + 1 >= len(argv):
|
|
59
|
-
raise ValueError("--output-format requires a value")
|
|
60
|
-
output_format = argv[idx + 1]
|
|
61
|
-
idx += 2
|
|
62
|
-
elif arg == "--model":
|
|
63
|
-
idx += 2
|
|
64
|
-
elif arg in {"--verbose", "--include-partial-messages"}:
|
|
65
|
-
idx += 1
|
|
66
|
-
elif arg == "--append-system-prompt":
|
|
67
|
-
if idx + 1 >= len(argv):
|
|
68
|
-
raise ValueError("--append-system-prompt requires a value")
|
|
69
|
-
system_prompt = argv[idx + 1]
|
|
70
|
-
idx += 2
|
|
71
|
-
else:
|
|
72
|
-
raise ValueError(f"unsupported Claude CLI argument: {arg}")
|
|
73
|
-
if output_format not in {"json", "stream-json"}:
|
|
74
|
-
raise ValueError(f"unsupported --output-format: {output_format}")
|
|
75
|
-
return output_format, system_prompt
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
def _run_codex(*, prompt: str, system_prompt: str) -> str:
|
|
79
|
-
codex_path = os.environ.get("CLAUDE_SMART_CODEX_PATH") or shutil.which("codex")
|
|
80
|
-
if not codex_path:
|
|
81
|
-
raise FileNotFoundError("codex CLI not found on PATH")
|
|
82
|
-
|
|
83
|
-
output_path = _temporary_output_path()
|
|
84
|
-
cmd = [
|
|
85
|
-
codex_path,
|
|
86
|
-
"exec",
|
|
87
|
-
"--sandbox",
|
|
88
|
-
"read-only",
|
|
89
|
-
"--skip-git-repo-check",
|
|
90
|
-
"--ephemeral",
|
|
91
|
-
"--ignore-rules",
|
|
92
|
-
"--output-last-message",
|
|
93
|
-
str(output_path),
|
|
94
|
-
"-",
|
|
95
|
-
]
|
|
96
|
-
|
|
97
|
-
env = os.environ.copy()
|
|
98
|
-
env["CLAUDE_SMART_HOST"] = "codex"
|
|
99
|
-
env["CLAUDE_SMART_INTERNAL"] = "1"
|
|
100
|
-
env["CLAUDE_CODE_ENTRYPOINT"] = "optimizer"
|
|
101
|
-
|
|
102
|
-
try:
|
|
103
|
-
proc = subprocess.run( # noqa: S603 - fixed command plus resolved executable.
|
|
104
|
-
cmd,
|
|
105
|
-
input=_codex_prompt(prompt=prompt, system_prompt=system_prompt),
|
|
106
|
-
capture_output=True,
|
|
107
|
-
text=True,
|
|
108
|
-
timeout=_TIMEOUT_SECONDS,
|
|
109
|
-
check=False,
|
|
110
|
-
env=env,
|
|
111
|
-
)
|
|
112
|
-
if proc.returncode != 0:
|
|
113
|
-
stderr = proc.stderr.strip()
|
|
114
|
-
raise RuntimeError(f"codex CLI exited {proc.returncode}: {stderr[:500]}")
|
|
115
|
-
content = output_path.read_text(encoding="utf-8").strip()
|
|
116
|
-
except subprocess.TimeoutExpired as exc:
|
|
117
|
-
raise TimeoutError(f"codex CLI timed out after {_TIMEOUT_SECONDS}s") from exc
|
|
118
|
-
finally:
|
|
119
|
-
try:
|
|
120
|
-
output_path.unlink()
|
|
121
|
-
except OSError:
|
|
122
|
-
pass
|
|
123
|
-
|
|
124
|
-
if not content:
|
|
125
|
-
raise RuntimeError("codex CLI returned empty output")
|
|
126
|
-
return content
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
def _temporary_output_path() -> Path:
|
|
130
|
-
handle = tempfile.NamedTemporaryFile(prefix="claude-smart-codex-", delete=False)
|
|
131
|
-
try:
|
|
132
|
-
return Path(handle.name)
|
|
133
|
-
finally:
|
|
134
|
-
handle.close()
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
def _codex_prompt(*, prompt: str, system_prompt: str) -> str:
|
|
138
|
-
if not system_prompt:
|
|
139
|
-
return prompt
|
|
140
|
-
return f"{system_prompt}\n\n## Task\n{prompt}"
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
if __name__ == "__main__":
|
|
144
|
-
raise SystemExit(main())
|