cluxion-agentplugin-preprocessing 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.
Files changed (48) hide show
  1. cluxion_agentplugin_adapters/claude/.claude-plugin/plugin.json +8 -0
  2. cluxion_agentplugin_adapters/claude/skills/preprocess/SKILL.md +33 -0
  3. cluxion_agentplugin_adapters/codex/config-snippet.toml +5 -0
  4. cluxion_agentplugin_docs/cluxion-Docs/README.md +22 -0
  5. cluxion_agentplugin_docs/cluxion-Docs/architecture.md +36 -0
  6. cluxion_agentplugin_docs/cluxion-Docs/harness-logic.md +51 -0
  7. cluxion_agentplugin_docs/cluxion-Docs/honesty-preprocessing.md +40 -0
  8. cluxion_agentplugin_docs/cluxion-Docs/install-and-operations.md +36 -0
  9. cluxion_agentplugin_docs/cluxion-Docs/security.md +27 -0
  10. cluxion_agentplugin_docs/github-profile/README.md +67 -0
  11. cluxion_agentplugin_preprocessing/__init__.py +7 -0
  12. cluxion_agentplugin_preprocessing/cli.py +124 -0
  13. cluxion_agentplugin_preprocessing/hermes_config.py +163 -0
  14. cluxion_agentplugin_preprocessing/plugin.py +135 -0
  15. cluxion_agentplugin_preprocessing/plugin.yaml +13 -0
  16. cluxion_agentplugin_preprocessing/runner.py +241 -0
  17. cluxion_agentplugin_preprocessing/schemas.py +148 -0
  18. cluxion_agentplugin_preprocessing-0.2.0.dist-info/METADATA +115 -0
  19. cluxion_agentplugin_preprocessing-0.2.0.dist-info/RECORD +48 -0
  20. cluxion_agentplugin_preprocessing-0.2.0.dist-info/WHEEL +4 -0
  21. cluxion_agentplugin_preprocessing-0.2.0.dist-info/entry_points.txt +8 -0
  22. cluxion_agentplugin_preprocessing-0.2.0.dist-info/licenses/LICENSE +197 -0
  23. cluxion_runtime/__init__.py +16 -0
  24. cluxion_runtime/__main__.py +5 -0
  25. cluxion_runtime/adapters/__init__.py +25 -0
  26. cluxion_runtime/adapters/contract.py +82 -0
  27. cluxion_runtime/adapters/grok_build.py +35 -0
  28. cluxion_runtime/adapters/hermes.py +161 -0
  29. cluxion_runtime/adapters/spec.py +35 -0
  30. cluxion_runtime/bootstrap.py +270 -0
  31. cluxion_runtime/cli.py +282 -0
  32. cluxion_runtime/core/__init__.py +36 -0
  33. cluxion_runtime/core/clarification.py +192 -0
  34. cluxion_runtime/core/dispatch_store.py +270 -0
  35. cluxion_runtime/core/harness.py +320 -0
  36. cluxion_runtime/core/intent.py +55 -0
  37. cluxion_runtime/core/ledger.py +189 -0
  38. cluxion_runtime/core/ledger_codec.py +38 -0
  39. cluxion_runtime/core/plan_codec.py +121 -0
  40. cluxion_runtime/core/preprocess.py +497 -0
  41. cluxion_runtime/core/types.py +220 -0
  42. cluxion_runtime/core/work_queue.py +73 -0
  43. cluxion_runtime/models/__init__.py +15 -0
  44. cluxion_runtime/models/supervisor.py +156 -0
  45. cluxion_runtime/models/vllm_mlx.py +87 -0
  46. cluxion_runtime/resources/__init__.py +7 -0
  47. cluxion_runtime/resources/queue_bridge.py +128 -0
  48. cluxion_runtime/resources/rust_bridge.py +82 -0
@@ -0,0 +1,48 @@
1
+ cluxion_agentplugin_preprocessing/__init__.py,sha256=A9ntReNZQRQa3DgiiYJ9hIRt6uExWNHp38fsKwy02Fc,137
2
+ cluxion_agentplugin_preprocessing/cli.py,sha256=RmsJCO_10ZSfVob505cy7Jn2u472Yj9v8NtEoqktWdU,4713
3
+ cluxion_agentplugin_preprocessing/hermes_config.py,sha256=phV08J4QR8_ys_0M5W_HlavtGCaoa-lRvYQvv1Mmd5Y,5582
4
+ cluxion_agentplugin_preprocessing/plugin.py,sha256=AS08ETgKmQEfCb3RHD7T8glo1VP0Ujs1jI95rTDlFWE,3837
5
+ cluxion_agentplugin_preprocessing/plugin.yaml,sha256=7HwQowiyx22q9OhRImpC2DBc7_-9qpBDbSyDI-vU10g,444
6
+ cluxion_agentplugin_preprocessing/runner.py,sha256=J-Q8vxkG00WIMansMr76DmE3FJn55uG06Mt1e1ckv1k,8787
7
+ cluxion_agentplugin_preprocessing/schemas.py,sha256=0hb5XlTBBnvdSdBA1X-yltQMwJs8L0hxXiDLUikdurQ,5192
8
+ cluxion_runtime/__init__.py,sha256=9R3bErjuyM6FEpfSfwO1lltZdQUPsA7G6BQiAt6Khvk,415
9
+ cluxion_runtime/__main__.py,sha256=VGtebB6BkEIpGdA7fgYmezhtvtdjxnns8ydEBmaVE3Y,109
10
+ cluxion_runtime/bootstrap.py,sha256=3RpdEQjQKzgkaxnyem0WudM6kEhJFkcXtcMQBypkdk0,8913
11
+ cluxion_runtime/cli.py,sha256=YKQzQaZ-ysQf0sZIdXSKNItaLWNslNxGgQERVmJ3a8c,11357
12
+ cluxion_runtime/adapters/__init__.py,sha256=NncPhKu6F63Nt0FwmouKngFm8H27tdaSG5XYMTJvwJc,804
13
+ cluxion_runtime/adapters/contract.py,sha256=YZTZW7me5EKJpPB0wfR8L32mTbct0Szh3D3vX0glwZE,3044
14
+ cluxion_runtime/adapters/grok_build.py,sha256=ypd1YmdDb37vOyV0mITKmjVCBbICF9TvCIlaKXLfH_c,896
15
+ cluxion_runtime/adapters/hermes.py,sha256=XSkSlNqSooOgHDi9z6bRGSazr3wNC-_tVVHt_at-T04,5499
16
+ cluxion_runtime/adapters/spec.py,sha256=yl_ECt6DkvSXo8eQnm2kiW1ha2IP0KaC1Z6Sb47ZzgM,1144
17
+ cluxion_runtime/core/__init__.py,sha256=UXwfInf2rE-fTsRNrFg_-mfRnOJUdyiz0KlWk-o3lXE,890
18
+ cluxion_runtime/core/clarification.py,sha256=ctp6zpBATjn_-XC0nn7e0bd6LnZ6jTQ4VWjN_T8yQj8,6867
19
+ cluxion_runtime/core/dispatch_store.py,sha256=XeNDLBx9iCI6JMcj_jkmesc-dNuiZKLiI-AtIYwp5K4,10150
20
+ cluxion_runtime/core/harness.py,sha256=iGkQzawsm_AIitlUQkTnRWYx_fhxhOYm8_5RoupaJdc,11814
21
+ cluxion_runtime/core/intent.py,sha256=0XvpWxpGqOlGl9Ij9PHCH0580T8UeHhxJgAi0zk74PQ,2411
22
+ cluxion_runtime/core/ledger.py,sha256=Okv-6384eSs61wH9JCyLga84OkPw5wRKSWnAkGUyuNU,6547
23
+ cluxion_runtime/core/ledger_codec.py,sha256=PRBVjdiJjyaH_diFFhDyH0yNPW563-umlibsfKdT8EI,1344
24
+ cluxion_runtime/core/plan_codec.py,sha256=4LXMfyWGW8pFG7vJzwFpjCTwhvdQEmxRgD_fDC06t_o,5301
25
+ cluxion_runtime/core/preprocess.py,sha256=r9Z4EB4_ujOlG0LrHqabrf5dyfyKGKDd3mqk1Gc3sQE,16040
26
+ cluxion_runtime/core/types.py,sha256=D4AVI03wJ07ArDJyXjGX1rBrVSqD56Z7fsAFExc6gk0,5691
27
+ cluxion_runtime/core/work_queue.py,sha256=Q5CpBhlHZTTyRtQNmnbPTgz4tL3OALhUwqoRakIgzQA,2320
28
+ cluxion_runtime/models/__init__.py,sha256=-hKVZkjR4DWBKDX9iKtpYvgz-2RfLff_fNRP89wCnP4,477
29
+ cluxion_runtime/models/supervisor.py,sha256=8vipSSKJL5meMQ6VBpv0V_ffCrbf9x-J7lXE89LaJ0I,5261
30
+ cluxion_runtime/models/vllm_mlx.py,sha256=wy8oviOzxMrMZ_3pgSWnOyNhFVtiOme8ceytdk4BJ74,2623
31
+ cluxion_runtime/resources/__init__.py,sha256=m0cIpFiMdwmho_kEgrFqIvWwGYdSb5VnVt0bXStMXOU,270
32
+ cluxion_runtime/resources/queue_bridge.py,sha256=ykzr_uc9448iYfU7I0qQPdOGqNyLC_7NmdmN46rvmEQ,3848
33
+ cluxion_runtime/resources/rust_bridge.py,sha256=skOQ6xNHVQjWTHonFvmciGIk9JtS8e0_MMNSWM42BZE,3401
34
+ cluxion_agentplugin_adapters/claude/.claude-plugin/plugin.json,sha256=6HBX0BEH7KTHxOh2_f0MYo0Az-BVV42fJRDFHIZ5lv0,250
35
+ cluxion_agentplugin_adapters/claude/skills/preprocess/SKILL.md,sha256=L-1gZLLcjnnLL9yksFL9-gVTo2qPjFjf6hVHuJxJ41k,1412
36
+ cluxion_agentplugin_adapters/codex/config-snippet.toml,sha256=3nAYtgEQtw-e_L0OfFQSKSNz8whz3-z7W7FVpJus5FM,223
37
+ cluxion_agentplugin_docs/cluxion-Docs/README.md,sha256=RzsFK6uf2HwMVi2_bEzjKGxw8z7NlCaqpeAIRUFMbzs,1052
38
+ cluxion_agentplugin_docs/cluxion-Docs/architecture.md,sha256=grKiSw6IYwjIXTWnllqc9e7cd4pQJ0GnasAqOu1DQKs,1085
39
+ cluxion_agentplugin_docs/cluxion-Docs/harness-logic.md,sha256=Lc77WmvDbvyLX93mxm_rribg_L6ZlIOK4yMdLdHeLV0,1470
40
+ cluxion_agentplugin_docs/cluxion-Docs/honesty-preprocessing.md,sha256=h8eqRRGALSyyTS6czSssYidKstFKHPWsqb8m5-szbXI,1355
41
+ cluxion_agentplugin_docs/cluxion-Docs/install-and-operations.md,sha256=WCGUV0dtrVJnfOl-n5GnadXjEpQZS9PmqNIv7-pudfg,940
42
+ cluxion_agentplugin_docs/cluxion-Docs/security.md,sha256=H7c70vHw7_1CgwKf5xLSoYeqxu9PkWYy6Vu0Bw0t_QE,842
43
+ cluxion_agentplugin_docs/github-profile/README.md,sha256=cbJ4M6JAAeKi8gdjclf3_S9-NY8mO_Qce45S_rb1NuY,1777
44
+ cluxion_agentplugin_preprocessing-0.2.0.dist-info/METADATA,sha256=IwJfMZqJNhLPva5-I3ZlJ6wAKihOciLx475Ug1s-Dtk,4455
45
+ cluxion_agentplugin_preprocessing-0.2.0.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
46
+ cluxion_agentplugin_preprocessing-0.2.0.dist-info/entry_points.txt,sha256=9w1Wpx4fB1hFHD_rILgC-LK5ntKBCIqpNDKn1-0o_Aw,344
47
+ cluxion_agentplugin_preprocessing-0.2.0.dist-info/licenses/LICENSE,sha256=ef8lElv6sdnw1KjbJWRRGIvUrR7XWqOUqmUDasF2gak,11132
48
+ cluxion_agentplugin_preprocessing-0.2.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.30.1
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,8 @@
1
+ [console_scripts]
2
+ cluxion-preprocess = cluxion_agentplugin_preprocessing.cli:main
3
+ cluxion-runtime = cluxion_runtime.cli:main
4
+ hermes-cluxion = cluxion_agentplugin_preprocessing.cli:main
5
+
6
+ [hermes_agent.plugins]
7
+ cluxion-agentplugin-preprocessing = cluxion_agentplugin_preprocessing.plugin
8
+ hermes-cluxion = cluxion_agentplugin_preprocessing.plugin
@@ -0,0 +1,197 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ https://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ patent license to make, have made, use, offer to sell, sell, import,
77
+ and otherwise transfer the Work, where such license applies only to
78
+ those patent claims licensable by such Contributor that are necessarily
79
+ infringed by their Contribution(s) alone or by combination of their
80
+ Contribution(s) with the Work to which such Contribution(s) was
81
+ submitted. If You institute patent litigation against any entity
82
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
83
+ the Work or a Contribution incorporated within the Work constitutes
84
+ direct or contributory patent infringement, then any patent licenses
85
+ granted to You under this License for that Work shall terminate as
86
+ of the date such litigation is filed.
87
+
88
+ 4. Redistribution. You may reproduce and distribute copies of the
89
+ Work or Derivative Works thereof in any medium, with or without
90
+ modifications, and in Source or Object form, provided that You
91
+ meet the following conditions:
92
+
93
+ (a) You must give any other recipients of the Work or
94
+ Derivative Works a copy of this License; and
95
+
96
+ (b) You must cause any modified files to carry prominent notices
97
+ stating that You changed the files; and
98
+
99
+ (c) You must retain, in the Source form of any Derivative Works
100
+ that You distribute, all copyright, patent, trademark, and
101
+ attribution notices from the Source form of the Work,
102
+ excluding those notices that do not pertain to any part of
103
+ the Derivative Works; and
104
+
105
+ (d) If the Work includes a "NOTICE" text file as part of its
106
+ distribution, then any Derivative Works that You distribute must
107
+ include a readable copy of the attribution notices contained
108
+ within such NOTICE file, excluding those notices that do not
109
+ pertain to any part of the Derivative Works, in at least one
110
+ of the following places: within a NOTICE text file distributed
111
+ as part of the Derivative Works; within the Source form or
112
+ documentation, if provided along with the Derivative Works; or,
113
+ within a display generated by the Derivative Works, if and
114
+ wherever such third-party notices normally appear. The contents
115
+ of the NOTICE file are for informational purposes only and
116
+ do not modify the License. You may add Your own attribution
117
+ notices within Derivative Works that You distribute, alongside
118
+ or as an addendum to the NOTICE text from the Work, provided
119
+ that such additional attribution notices cannot be construed
120
+ as modifying the License.
121
+
122
+ You may add Your own copyright statement to Your modifications and
123
+ may provide additional or different license terms and conditions
124
+ for use, reproduction, or distribution of Your modifications, or
125
+ for any such Derivative Works as a whole, provided Your use,
126
+ reproduction, and distribution of the Work otherwise complies with
127
+ the conditions stated in this License.
128
+
129
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
130
+ any Contribution intentionally submitted for inclusion in the Work
131
+ by You to the Licensor shall be under the terms and conditions of
132
+ this License, without any additional terms or conditions.
133
+
134
+ 6. Trademarks. This License does not grant permission to use the trade
135
+ names, trademarks, service marks, or product names of the Licensor,
136
+ except as required for reasonable and customary use in describing the
137
+ origin of the Work and reproducing the content of the NOTICE file.
138
+
139
+ 7. Disclaimer of Warranty. Unless required by applicable law or
140
+ agreed to in writing, Licensor provides the Work (and each
141
+ Contributor provides its Contributions) on an "AS IS" BASIS,
142
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
143
+ implied, including, without limitation, any warranties or conditions
144
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
145
+ PARTICULAR PURPOSE. You are solely responsible for determining the
146
+ appropriateness of using or redistributing the Work and assume any
147
+ risks associated with Your exercise of permissions under this License.
148
+
149
+ 8. Limitation of Liability. In no event and under no legal theory,
150
+ whether in tort (including negligence), contract, or otherwise,
151
+ unless required by applicable law (such as deliberate and grossly
152
+ negligent acts) or agreed to in writing, shall any Contributor be
153
+ liable to You for damages, including any direct, indirect, special,
154
+ incidental, or consequential damages of any character arising as a
155
+ result of this License or out of the use or inability to use the
156
+ Work (including but not limited to damages for loss of goodwill,
157
+ work stoppage, computer failure or malfunction, or any and all
158
+ other commercial damages or losses), even if such Contributor
159
+ has been advised of the possibility of such damages.
160
+
161
+ 9. Accepting Warranty or Additional Liability. While redistributing
162
+ the Work or Derivative Works thereof, You may choose to offer,
163
+ and charge a fee for, acceptance of support, warranty, indemnity,
164
+ or other liability obligations and/or rights consistent with this
165
+ License. However, in accepting such obligations, You may act only
166
+ on Your own behalf and on Your sole responsibility, not on behalf
167
+ of any other Contributor, and only if You agree to indemnify,
168
+ defend, and hold each Contributor harmless for any liability
169
+ incurred by, or claims asserted against, such Contributor by reason
170
+ of your accepting any such warranty or additional liability.
171
+
172
+ END OF TERMS AND CONDITIONS
173
+
174
+ APPENDIX: How to apply the Apache License to your work.
175
+
176
+ To apply the Apache License to your work, attach the following
177
+ boilerplate notice, with the fields enclosed by brackets "[]"
178
+ replaced with your own identifying information. (Don't include
179
+ the brackets!) The text should be enclosed in the appropriate
180
+ comment syntax for the file format. We also recommend that a
181
+ file or class name and description of purpose be included on the
182
+ same "printed page" as the copyright notice for easier
183
+ identification within third-party archives.
184
+
185
+ Copyright 2026 Cluxion
186
+
187
+ Licensed under the Apache License, Version 2.0 (the "License");
188
+ you may not use this file except in compliance with the License.
189
+ You may obtain a copy of the License at
190
+
191
+ https://www.apache.org/licenses/LICENSE-2.0
192
+
193
+ Unless required by applicable law or agreed to in writing, software
194
+ distributed under the License is distributed on an "AS IS" BASIS,
195
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
196
+ See the License for the specific language governing permissions and
197
+ limitations under the License.
@@ -0,0 +1,16 @@
1
+ from __future__ import annotations
2
+
3
+ """가벼운 Cluxion Agent Harness Runtime."""
4
+
5
+ from cluxion_runtime.core.harness import build_harness_plan
6
+ from cluxion_runtime.core.types import AgentSurface, AnswerPolicy, HarnessPlan, RuntimeKind, WorkItem, WorkPriority
7
+
8
+ __all__ = [
9
+ "AgentSurface",
10
+ "AnswerPolicy",
11
+ "HarnessPlan",
12
+ "RuntimeKind",
13
+ "WorkItem",
14
+ "WorkPriority",
15
+ "build_harness_plan",
16
+ ]
@@ -0,0 +1,5 @@
1
+ """`python -m cluxion_runtime` 진입점."""
2
+
3
+ from cluxion_runtime.cli import main
4
+
5
+ raise SystemExit(main())
@@ -0,0 +1,25 @@
1
+ from __future__ import annotations
2
+
3
+ """Hermes, Codex, Claude용 얇은 adapter 계약."""
4
+
5
+ from cluxion_runtime.adapters.contract import render_adapter_manifest, work_item_from_adapter_payload
6
+ from cluxion_runtime.adapters.hermes import (
7
+ HermesLocalEndpointPatch,
8
+ build_hermes_local_endpoint_patch,
9
+ hermes_config_patch_to_dict,
10
+ hermes_config_set_commands,
11
+ render_hermes_yaml_fragment,
12
+ )
13
+ from cluxion_runtime.adapters.spec import AgentAdapterSpec, default_adapter_specs
14
+
15
+ __all__ = [
16
+ "AgentAdapterSpec",
17
+ "HermesLocalEndpointPatch",
18
+ "build_hermes_local_endpoint_patch",
19
+ "default_adapter_specs",
20
+ "hermes_config_patch_to_dict",
21
+ "hermes_config_set_commands",
22
+ "render_adapter_manifest",
23
+ "render_hermes_yaml_fragment",
24
+ "work_item_from_adapter_payload",
25
+ ]
@@ -0,0 +1,82 @@
1
+ from __future__ import annotations
2
+
3
+ """Hermes/Codex/Claude/Grok wrapper가 공유하는 입력 계약."""
4
+
5
+ import hashlib
6
+ from typing import TYPE_CHECKING
7
+
8
+ from cluxion_runtime.core.types import AgentSurface, WorkItem, WorkPriority
9
+
10
+ if TYPE_CHECKING:
11
+ from collections.abc import Mapping
12
+
13
+
14
+ def work_item_from_adapter_payload(payload: Mapping[str, object], *, default_surface: AgentSurface) -> WorkItem:
15
+ """외부 wrapper JSON payload를 WorkItem으로 변환한다."""
16
+ prompt = str(payload.get("prompt", "")).strip()
17
+ if not prompt:
18
+ raise ValueError("prompt는 비어 있을 수 없다.")
19
+ work_id = str(payload.get("work_id", "")) or _stable_work_id(prompt)
20
+ return WorkItem(
21
+ work_id=work_id,
22
+ prompt=prompt,
23
+ surface=_surface(payload.get("surface"), default_surface),
24
+ priority=_priority(payload.get("priority")),
25
+ model_route=str(payload.get("model_route", "host/default")),
26
+ expected_ram_mb=max(0, int(payload.get("expected_ram_mb", 0))),
27
+ context_tokens=max(0, int(payload.get("context_tokens", 0))),
28
+ metadata=_metadata(payload.get("metadata"), payload.get("cwd")),
29
+ )
30
+
31
+
32
+ def render_adapter_manifest(surface: AgentSurface) -> dict[str, object]:
33
+ """각 agent 제품에 넣을 수 있는 공통 tool manifest를 만든다."""
34
+ return {
35
+ "name": "cluxion_harness",
36
+ "surface": surface.value,
37
+ "command": ["cluxion-runtime", "plan", "--json-stdin", "--surface", surface.value],
38
+ "description": "Cluxion 전처리, 작업큐, Rust resource admission, 로컬 모델 route를 실행 전 계획합니다.",
39
+ "input_schema": {
40
+ "type": "object",
41
+ "required": ["prompt"],
42
+ "properties": {
43
+ "prompt": {"type": "string"},
44
+ "work_id": {"type": "string"},
45
+ "priority": {"type": "string", "enum": ["critical", "high", "normal", "low"]},
46
+ "model_route": {"type": "string"},
47
+ "expected_ram_mb": {"type": "integer", "minimum": 0},
48
+ "metadata": {"type": "object"},
49
+ },
50
+ },
51
+ }
52
+
53
+
54
+ def _stable_work_id(prompt: str) -> str:
55
+ digest = hashlib.sha256(prompt.encode("utf-8")).hexdigest()[:16]
56
+ return f"work-{digest}"
57
+
58
+
59
+ def _surface(value: object, default: AgentSurface) -> AgentSurface:
60
+ if value is None or value == "":
61
+ return default
62
+ return AgentSurface(str(value))
63
+
64
+
65
+ def _priority(value: object) -> WorkPriority:
66
+ if value is None or value == "":
67
+ return WorkPriority.NORMAL
68
+ if isinstance(value, int):
69
+ return WorkPriority(value)
70
+ return WorkPriority[str(value).upper()]
71
+
72
+
73
+ def _metadata(value: object, cwd: object) -> dict[str, str]:
74
+ metadata: dict[str, str] = {}
75
+ if isinstance(value, dict):
76
+ metadata.update({str(key): str(val) for key, val in value.items()})
77
+ if cwd is not None and cwd != "":
78
+ metadata["cwd"] = str(cwd)
79
+ return metadata
80
+
81
+
82
+ __all__ = ["render_adapter_manifest", "work_item_from_adapter_payload"]
@@ -0,0 +1,35 @@
1
+ from __future__ import annotations
2
+
3
+ """재구현 개발 보조용 Grok Build CLI helper.
4
+
5
+ Cluxion runtime plan은 이 모듈을 호출하지 않는다.
6
+ """
7
+
8
+ from typing import TYPE_CHECKING
9
+
10
+ if TYPE_CHECKING:
11
+ from pathlib import Path
12
+
13
+ GROK_COMPOSER_25_FAST = "grok-composer-2.5-fast"
14
+ GROK_BUILD_MODEL = "grok-build"
15
+
16
+
17
+ def build_grok_composer_command(
18
+ prompt: str,
19
+ *,
20
+ cwd: Path,
21
+ model: str = GROK_COMPOSER_25_FAST,
22
+ json_output: bool = True,
23
+ check: bool = True,
24
+ ) -> tuple[str, ...]:
25
+ """개발자가 직접 실행할 Grok Build headless 명령을 만든다."""
26
+ cmd = ["grok", "-m", model, "--cwd", str(cwd)]
27
+ if json_output:
28
+ cmd.extend(["--output-format", "json"])
29
+ if check:
30
+ cmd.append("--check")
31
+ cmd.extend(["-p", prompt])
32
+ return tuple(cmd)
33
+
34
+
35
+ __all__ = ["GROK_BUILD_MODEL", "GROK_COMPOSER_25_FAST", "build_grok_composer_command"]
@@ -0,0 +1,161 @@
1
+ from __future__ import annotations
2
+
3
+ """Hermes Agent 로컬 endpoint 설정 패치 생성기."""
4
+
5
+ from dataclasses import dataclass
6
+ from urllib.parse import urlparse
7
+
8
+
9
+ @dataclass(frozen=True)
10
+ class HermesLocalEndpointPatch:
11
+ """Hermes가 Cluxion 로컬 서버를 공식 custom provider로 보게 하는 패치."""
12
+
13
+ provider_key: str
14
+ display_name: str
15
+ model: str
16
+ base_url: str
17
+ context_length: int = 128_000
18
+ transport: str = "openai_chat"
19
+
20
+ @property
21
+ def provider_id(self) -> str:
22
+ """Hermes model.provider에 들어갈 provider ID."""
23
+ return f"custom:{self.provider_key}"
24
+
25
+ @property
26
+ def slash_model(self) -> str:
27
+ """Hermes 세션 안에서 바로 전환할 때 쓰는 /model 값."""
28
+ return f"{self.provider_id}:{self.model}"
29
+
30
+
31
+ def build_hermes_local_endpoint_patch(
32
+ model: str,
33
+ base_url: str,
34
+ *,
35
+ provider_key: str = "cluxion-local",
36
+ display_name: str = "Cluxion Local",
37
+ context_length: int = 128_000,
38
+ ) -> HermesLocalEndpointPatch:
39
+ """입력값을 검증한 뒤 Hermes 설정 패치 객체를 만든다."""
40
+ clean_model = model.strip()
41
+ clean_url = base_url.strip().rstrip("/")
42
+ clean_key = _provider_key(provider_key)
43
+ if not clean_model:
44
+ raise ValueError("Hermes local endpoint model은 비어 있을 수 없다.")
45
+ if not _valid_http_url(clean_url):
46
+ raise ValueError("Hermes local endpoint base_url은 http(s) URL이어야 한다.")
47
+ if context_length <= 0:
48
+ raise ValueError("Hermes context_length는 양수여야 한다.")
49
+ return HermesLocalEndpointPatch(
50
+ provider_key=clean_key,
51
+ display_name=display_name.strip() or "Cluxion Local",
52
+ model=clean_model,
53
+ base_url=clean_url,
54
+ context_length=context_length,
55
+ )
56
+
57
+
58
+ def hermes_config_patch_to_dict(patch: HermesLocalEndpointPatch) -> dict[str, object]:
59
+ """Hermes config.yaml에 병합할 수 있는 dict 패치를 만든다."""
60
+ provider_entry = {
61
+ "name": patch.display_name,
62
+ "base_url": patch.base_url,
63
+ "default_model": patch.model,
64
+ "transport": patch.transport,
65
+ "discover_models": True,
66
+ "models": {
67
+ patch.model: {
68
+ "context_length": patch.context_length,
69
+ }
70
+ },
71
+ }
72
+ return {
73
+ "providers": {
74
+ patch.provider_key: provider_entry,
75
+ },
76
+ "model": {
77
+ "provider": patch.provider_id,
78
+ "default": patch.model,
79
+ "base_url": patch.base_url,
80
+ "context_length": patch.context_length,
81
+ "api_mode": "chat_completions",
82
+ },
83
+ }
84
+
85
+
86
+ def render_hermes_yaml_fragment(patch: HermesLocalEndpointPatch) -> str:
87
+ """사용자가 config.yaml에 붙여 넣을 수 있는 YAML fragment를 만든다."""
88
+ model = _yaml_str(patch.model)
89
+ base_url = _yaml_str(patch.base_url)
90
+ name = _yaml_str(patch.display_name)
91
+ provider_id = _yaml_str(patch.provider_id)
92
+ return "\n".join(
93
+ [
94
+ "providers:",
95
+ f" {patch.provider_key}:",
96
+ f" name: {name}",
97
+ f" base_url: {base_url}",
98
+ f" default_model: {model}",
99
+ f" transport: {patch.transport}",
100
+ " discover_models: true",
101
+ " models:",
102
+ f" {model}:",
103
+ f" context_length: {patch.context_length}",
104
+ "model:",
105
+ f" provider: {provider_id}",
106
+ f" default: {model}",
107
+ f" base_url: {base_url}",
108
+ f" context_length: {patch.context_length}",
109
+ " api_mode: chat_completions",
110
+ ]
111
+ )
112
+
113
+
114
+ def hermes_config_set_commands(patch: HermesLocalEndpointPatch) -> tuple[str, ...]:
115
+ """Hermes config set으로 필수 provider 전환 상태를 만드는 명령 목록."""
116
+ root = f"providers.{patch.provider_key}"
117
+ return (
118
+ f"hermes config set {root}.name {_shell_quote(patch.display_name)}",
119
+ f"hermes config set {root}.base_url {_shell_quote(patch.base_url)}",
120
+ f"hermes config set {root}.default_model {_shell_quote(patch.model)}",
121
+ f"hermes config set {root}.transport {patch.transport}",
122
+ f"hermes config set {root}.discover_models true",
123
+ f"hermes config set model.provider {_shell_quote(patch.provider_id)}",
124
+ f"hermes config set model.default {_shell_quote(patch.model)}",
125
+ f"hermes config set model.base_url {_shell_quote(patch.base_url)}",
126
+ f"hermes config set model.context_length {patch.context_length}",
127
+ "hermes config set model.api_mode chat_completions",
128
+ )
129
+
130
+
131
+ def _provider_key(value: str) -> str:
132
+ clean = value.strip().lower().replace("_", "-").replace(" ", "-")
133
+ allowed = [ch for ch in clean if ch.isalnum() or ch == "-"]
134
+ compact = "".join(allowed).strip("-")
135
+ if not compact:
136
+ raise ValueError("Hermes provider key는 비어 있을 수 없다.")
137
+ return compact
138
+
139
+
140
+ def _valid_http_url(value: str) -> bool:
141
+ parsed = urlparse(value)
142
+ return parsed.scheme in {"http", "https"} and bool(parsed.netloc)
143
+
144
+
145
+ def _yaml_str(value: str) -> str:
146
+ escaped = value.replace("'", "''")
147
+ return f"'{escaped}'"
148
+
149
+
150
+ def _shell_quote(value: str) -> str:
151
+ escaped = value.replace("'", "'\"'\"'")
152
+ return f"'{escaped}'"
153
+
154
+
155
+ __all__ = [
156
+ "HermesLocalEndpointPatch",
157
+ "build_hermes_local_endpoint_patch",
158
+ "hermes_config_patch_to_dict",
159
+ "hermes_config_set_commands",
160
+ "render_hermes_yaml_fragment",
161
+ ]
@@ -0,0 +1,35 @@
1
+ from __future__ import annotations
2
+
3
+ """외부 에이전트별 얇은 설치 계약."""
4
+
5
+ from dataclasses import dataclass
6
+
7
+ from cluxion_runtime.core.types import AgentSurface
8
+
9
+
10
+ @dataclass(frozen=True)
11
+ class AgentAdapterSpec:
12
+ """플랫폼별 wrapper가 알아야 하는 최소 정보."""
13
+
14
+ surface: AgentSurface
15
+ config_target: str
16
+ transport: str
17
+ install_hint: str
18
+
19
+
20
+ def default_adapter_specs() -> tuple[AgentAdapterSpec, ...]:
21
+ """공통 런타임에 붙는 공식 adapter 목록."""
22
+ return (
23
+ AgentAdapterSpec(AgentSurface.HERMES, "~/.hermes/plugins/cluxion", "local_override", "Hermes local model helper"),
24
+ AgentAdapterSpec(AgentSurface.CODEX, "~/.codex/config.toml", "local_override", "Codex local endpoint helper"),
25
+ AgentAdapterSpec(AgentSurface.CLAUDE, ".claude-plugin/plugin.json", "local_override", "Claude Code local endpoint helper"),
26
+ AgentAdapterSpec(
27
+ AgentSurface.GROK_BUILD,
28
+ "project agent config",
29
+ "local_override",
30
+ "Grok Build local endpoint helper",
31
+ ),
32
+ )
33
+
34
+
35
+ __all__ = ["AgentAdapterSpec", "default_adapter_specs"]