clink-cli 0.2.1__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.
- clink_cli-0.2.1/LICENSE +197 -0
- clink_cli-0.2.1/MANIFEST.in +27 -0
- clink_cli-0.2.1/PKG-INFO +225 -0
- clink_cli-0.2.1/README.md +207 -0
- clink_cli-0.2.1/clink/__init__.py +19 -0
- clink_cli-0.2.1/clink/agents/__init__.py +30 -0
- clink_cli-0.2.1/clink/agents/base.py +70 -0
- clink_cli-0.2.1/clink/agents/claude.py +7 -0
- clink_cli-0.2.1/clink/agents/codex.py +7 -0
- clink_cli-0.2.1/clink/agents/gemini.py +7 -0
- clink_cli-0.2.1/clink/allowed_roots.py +356 -0
- clink_cli-0.2.1/clink/backend.py +765 -0
- clink_cli-0.2.1/clink/cli.py +594 -0
- clink_cli-0.2.1/clink/constants.py +78 -0
- clink_cli-0.2.1/clink/contracts.py +167 -0
- clink_cli-0.2.1/clink/files.py +70 -0
- clink_cli-0.2.1/clink/generation.py +274 -0
- clink_cli-0.2.1/clink/generation_capabilities.py +207 -0
- clink_cli-0.2.1/clink/generation_contracts.py +214 -0
- clink_cli-0.2.1/clink/generation_policy.py +174 -0
- clink_cli-0.2.1/clink/models.py +243 -0
- clink_cli-0.2.1/clink/native.py +409 -0
- clink_cli-0.2.1/clink/native_adapters.py +244 -0
- clink_cli-0.2.1/clink/native_contracts.py +68 -0
- clink_cli-0.2.1/clink/native_generation.py +421 -0
- clink_cli-0.2.1/clink/native_generation_claude_policy.py +59 -0
- clink_cli-0.2.1/clink/native_generation_contracts.py +264 -0
- clink_cli-0.2.1/clink/native_generation_families.py +218 -0
- clink_cli-0.2.1/clink/native_generation_family_policy.py +14 -0
- clink_cli-0.2.1/clink/native_generation_files.py +153 -0
- clink_cli-0.2.1/clink/native_generation_policy.py +82 -0
- clink_cli-0.2.1/clink/native_policy.py +86 -0
- clink_cli-0.2.1/clink/parsers/__init__.py +34 -0
- clink_cli-0.2.1/clink/parsers/agy.py +53 -0
- clink_cli-0.2.1/clink/parsers/agy_native.py +161 -0
- clink_cli-0.2.1/clink/parsers/agy_native_generation.py +189 -0
- clink_cli-0.2.1/clink/parsers/base.py +209 -0
- clink_cli-0.2.1/clink/parsers/claude.py +104 -0
- clink_cli-0.2.1/clink/parsers/claude_native.py +113 -0
- clink_cli-0.2.1/clink/parsers/claude_native_generation.py +346 -0
- clink_cli-0.2.1/clink/parsers/codex.py +172 -0
- clink_cli-0.2.1/clink/parsers/codex_generation.py +212 -0
- clink_cli-0.2.1/clink/parsers/codex_native.py +236 -0
- clink_cli-0.2.1/clink/parsers/codex_native_generation.py +367 -0
- clink_cli-0.2.1/clink/parsers/gemini.py +110 -0
- clink_cli-0.2.1/clink/parsers/grok.py +63 -0
- clink_cli-0.2.1/clink/parsers/grok_native.py +91 -0
- clink_cli-0.2.1/clink/parsers/grok_native_generation.py +157 -0
- clink_cli-0.2.1/clink/policy.py +180 -0
- clink_cli-0.2.1/clink/registry.py +544 -0
- clink_cli-0.2.1/clink/resources/CODEX-LICENSE +201 -0
- clink_cli-0.2.1/clink/resources/CODEX-NOTICE +6 -0
- clink_cli-0.2.1/clink/resources/PROVENANCE.md +16 -0
- clink_cli-0.2.1/clink/resources/codex-0.166.0-models-direct.json +1284 -0
- clink_cli-0.2.1/clink/resources/codex-0.166.0-models-generation.json +1269 -0
- clink_cli-0.2.1/clink/resources/native-agy-1.4.12-admission.json +746 -0
- clink_cli-0.2.1/clink/resources/native-claude-2.1.304-admission.json +99 -0
- clink_cli-0.2.1/clink/resources/native-generation-claude-2.1.304-admission.json +277 -0
- clink_cli-0.2.1/clink/resources/native-generation-codex-0.166.0-admission.json +309 -0
- clink_cli-0.2.1/clink/resources/native-generation-grok-1.0.70-admission.json +329 -0
- clink_cli-0.2.1/clink/resources/native-grok-1.0.70-admission.json +644 -0
- clink_cli-0.2.1/clink/runner.py +303 -0
- clink_cli-0.2.1/clink/setup.py +399 -0
- clink_cli-0.2.1/clink/tasks.py +695 -0
- clink_cli-0.2.1/clink_cli.egg-info/PKG-INFO +225 -0
- clink_cli-0.2.1/clink_cli.egg-info/SOURCES.txt +146 -0
- clink_cli-0.2.1/clink_cli.egg-info/dependency_links.txt +1 -0
- clink_cli-0.2.1/clink_cli.egg-info/entry_points.txt +3 -0
- clink_cli-0.2.1/clink_cli.egg-info/requires.txt +3 -0
- clink_cli-0.2.1/clink_cli.egg-info/top_level.txt +7 -0
- clink_cli-0.2.1/conf/__init__.py +1 -0
- clink_cli-0.2.1/conf/cli_clients/agy.json +40 -0
- clink_cli-0.2.1/conf/cli_clients/claude.json +39 -0
- clink_cli-0.2.1/conf/cli_clients/codex.json +40 -0
- clink_cli-0.2.1/conf/cli_clients/gemini.json +23 -0
- clink_cli-0.2.1/conf/cli_clients/grok.json +40 -0
- clink_cli-0.2.1/config.py +40 -0
- clink_cli-0.2.1/integrations/claude/.claude-plugin/plugin.json +8 -0
- clink_cli-0.2.1/integrations/claude/skills/setup/SKILL.md +26 -0
- clink_cli-0.2.1/pyproject.toml +112 -0
- clink_cli-0.2.1/requirements.txt +3 -0
- clink_cli-0.2.1/server.py +896 -0
- clink_cli-0.2.1/setup.cfg +4 -0
- clink_cli-0.2.1/systemprompts/__init__.py +35 -0
- clink_cli-0.2.1/systemprompts/analyze_prompt.py +87 -0
- clink_cli-0.2.1/systemprompts/chat_prompt.py +57 -0
- clink_cli-0.2.1/systemprompts/clink/codex_codereviewer.txt +8 -0
- clink_cli-0.2.1/systemprompts/clink/default.txt +8 -0
- clink_cli-0.2.1/systemprompts/clink/default_codereviewer.txt +8 -0
- clink_cli-0.2.1/systemprompts/clink/default_planner.txt +7 -0
- clink_cli-0.2.1/systemprompts/clink/native_codereviewer.txt +1 -0
- clink_cli-0.2.1/systemprompts/clink/native_default.txt +1 -0
- clink_cli-0.2.1/systemprompts/clink/native_planner.txt +1 -0
- clink_cli-0.2.1/systemprompts/codereview_prompt.py +91 -0
- clink_cli-0.2.1/systemprompts/consensus_prompt.py +120 -0
- clink_cli-0.2.1/systemprompts/debug_prompt.py +150 -0
- clink_cli-0.2.1/systemprompts/docgen_prompt.py +252 -0
- clink_cli-0.2.1/systemprompts/generate_code_prompt.py +181 -0
- clink_cli-0.2.1/systemprompts/planner_prompt.py +127 -0
- clink_cli-0.2.1/systemprompts/precommit_prompt.py +179 -0
- clink_cli-0.2.1/systemprompts/refactor_prompt.py +323 -0
- clink_cli-0.2.1/systemprompts/secaudit_prompt.py +420 -0
- clink_cli-0.2.1/systemprompts/testgen_prompt.py +133 -0
- clink_cli-0.2.1/systemprompts/thinkdeep_prompt.py +55 -0
- clink_cli-0.2.1/systemprompts/tracer_prompt.py +145 -0
- clink_cli-0.2.1/tools/__init__.py +43 -0
- clink_cli-0.2.1/tools/analyze.py +583 -0
- clink_cli-0.2.1/tools/apilookup.py +97 -0
- clink_cli-0.2.1/tools/challenge.py +198 -0
- clink_cli-0.2.1/tools/chat.py +187 -0
- clink_cli-0.2.1/tools/clink.py +130 -0
- clink_cli-0.2.1/tools/codereview.py +724 -0
- clink_cli-0.2.1/tools/consensus.py +790 -0
- clink_cli-0.2.1/tools/debug.py +573 -0
- clink_cli-0.2.1/tools/docgen.py +577 -0
- clink_cli-0.2.1/tools/listmodels.py +48 -0
- clink_cli-0.2.1/tools/models.py +373 -0
- clink_cli-0.2.1/tools/planner.py +533 -0
- clink_cli-0.2.1/tools/precommit.py +776 -0
- clink_cli-0.2.1/tools/refactor.py +645 -0
- clink_cli-0.2.1/tools/secaudit.py +685 -0
- clink_cli-0.2.1/tools/shared/__init__.py +19 -0
- clink_cli-0.2.1/tools/shared/base_models.py +167 -0
- clink_cli-0.2.1/tools/shared/base_tool.py +659 -0
- clink_cli-0.2.1/tools/shared/exceptions.py +20 -0
- clink_cli-0.2.1/tools/shared/schema_builders.py +159 -0
- clink_cli-0.2.1/tools/simple/__init__.py +18 -0
- clink_cli-0.2.1/tools/simple/base.py +539 -0
- clink_cli-0.2.1/tools/testgen.py +513 -0
- clink_cli-0.2.1/tools/thinkdeep.py +586 -0
- clink_cli-0.2.1/tools/tracer.py +763 -0
- clink_cli-0.2.1/tools/version.py +53 -0
- clink_cli-0.2.1/tools/workflow/__init__.py +22 -0
- clink_cli-0.2.1/tools/workflow/base.py +448 -0
- clink_cli-0.2.1/tools/workflow/schema_builders.py +166 -0
- clink_cli-0.2.1/tools/workflow/workflow_mixin.py +1195 -0
- clink_cli-0.2.1/utils/__init__.py +21 -0
- clink_cli-0.2.1/utils/call_state.py +349 -0
- clink_cli-0.2.1/utils/client_info.py +293 -0
- clink_cli-0.2.1/utils/consensus_manifest.py +131 -0
- clink_cli-0.2.1/utils/conversation_memory.py +582 -0
- clink_cli-0.2.1/utils/env.py +111 -0
- clink_cli-0.2.1/utils/file_types.py +271 -0
- clink_cli-0.2.1/utils/file_utils.py +803 -0
- clink_cli-0.2.1/utils/image_utils.py +94 -0
- clink_cli-0.2.1/utils/security_config.py +163 -0
- clink_cli-0.2.1/utils/storage_backend.py +177 -0
- clink_cli-0.2.1/utils/token_utils.py +54 -0
clink_cli-0.2.1/LICENSE
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://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 granting the License.
|
|
13
|
+
|
|
14
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
15
|
+
other entities that control, are controlled by, or are under common
|
|
16
|
+
control with that entity. For the purposes of this definition,
|
|
17
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
18
|
+
direction or management of such entity, whether by contract or
|
|
19
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
20
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
21
|
+
|
|
22
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
23
|
+
exercising permissions granted by this License.
|
|
24
|
+
|
|
25
|
+
"Source" shall mean the preferred form for making modifications,
|
|
26
|
+
including but not limited to software source code, documentation
|
|
27
|
+
source, and configuration files.
|
|
28
|
+
|
|
29
|
+
"Object" shall mean any form resulting from mechanical
|
|
30
|
+
transformation or translation of a Source form, including but
|
|
31
|
+
not limited to compiled object code, generated documentation,
|
|
32
|
+
and conversions to other media types.
|
|
33
|
+
|
|
34
|
+
"Work" shall mean the work of authorship covered by this License,
|
|
35
|
+
whether in source or binary form, which is made available under the
|
|
36
|
+
License, as indicated by a copyright notice that is included in or
|
|
37
|
+
attached to the work. (The copyright notice requirement does not
|
|
38
|
+
apply to derivative works of the License holder.)
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based upon (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
|
|
57
|
+
systems, and issue tracking systems that are managed by, or on behalf
|
|
58
|
+
of, the Licensor for the purpose of discussing and improving the Work,
|
|
59
|
+
but 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 use, reproduce, modify, distribute, and otherwise
|
|
70
|
+
transfer the Work as part of a Derivative Work.
|
|
71
|
+
|
|
72
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
73
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
74
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
75
|
+
(except as stated in this section) patent license to make, have made,
|
|
76
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
77
|
+
where such license applies only to those patent claims licensable
|
|
78
|
+
by such Contributor that are necessarily infringed by their
|
|
79
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
80
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
81
|
+
institute patent litigation against any entity (including a
|
|
82
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
83
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
84
|
+
or contributory patent infringement, then any patent licenses
|
|
85
|
+
granted to You under this License for that Work shall terminate
|
|
86
|
+
as 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" 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 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 notice 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
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
134
|
+
the terms of any separate license agreement you may have executed
|
|
135
|
+
with Licensor regarding such Contributions.
|
|
136
|
+
|
|
137
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
138
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
139
|
+
except as required for reasonable and customary use in describing the
|
|
140
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
141
|
+
|
|
142
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
143
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
144
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
145
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
146
|
+
implied, including, without limitation, any warranties or conditions
|
|
147
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
148
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
149
|
+
appropriateness of using or redistributing the Work and assume any
|
|
150
|
+
risks associated with Your exercise of permissions under this License.
|
|
151
|
+
|
|
152
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
153
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
154
|
+
unless required by applicable law (such as deliberate and grossly
|
|
155
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
156
|
+
liable to You for damages, including any direct, indirect, special,
|
|
157
|
+
incidental, or consequential damages of any character arising as a
|
|
158
|
+
result of this License or out of the use or inability to use the
|
|
159
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
160
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
161
|
+
other commercial damages or losses), even if such Contributor
|
|
162
|
+
has been advised of the possibility of such damages.
|
|
163
|
+
|
|
164
|
+
9. Accepting Warranty or Support. You may choose to offer, and to
|
|
165
|
+
charge a fee for, warranty, support, indemnity or other liability
|
|
166
|
+
obligations and/or rights consistent with this License. However,
|
|
167
|
+
in accepting such obligations, You may act only on Your own behalf
|
|
168
|
+
and on Your sole responsibility, not on behalf of any other
|
|
169
|
+
Contributor, and only if You agree to indemnify, defend, and hold
|
|
170
|
+
each Contributor harmless for any liability incurred by, or claims
|
|
171
|
+
asserted against, such Contributor by reason of your accepting any
|
|
172
|
+
such warranty or support.
|
|
173
|
+
|
|
174
|
+
END OF TERMS AND CONDITIONS
|
|
175
|
+
|
|
176
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
177
|
+
|
|
178
|
+
To apply the Apache License to your work, attach the following
|
|
179
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
180
|
+
replaced with your own identifying information. (Don't include
|
|
181
|
+
the brackets!) The text should be enclosed in comments for the
|
|
182
|
+
particular file format. An identification line is also useful.
|
|
183
|
+
|
|
184
|
+
Copyright 2025 Beehive Innovations
|
|
185
|
+
https://github.com/BeehiveInnovations
|
|
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
|
+
http://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,27 @@
|
|
|
1
|
+
include LICENSE README.md requirements.txt
|
|
2
|
+
include clink/resources/codex-0.166.0-models-direct.json
|
|
3
|
+
include clink/resources/codex-0.166.0-models-generation.json
|
|
4
|
+
include clink/resources/native-claude-2.1.304-admission.json
|
|
5
|
+
include clink/resources/native-grok-1.0.70-admission.json
|
|
6
|
+
include clink/resources/native-agy-1.4.12-admission.json
|
|
7
|
+
include clink/resources/native-generation-codex-0.166.0-admission.json
|
|
8
|
+
include clink/resources/native-generation-claude-2.1.304-admission.json
|
|
9
|
+
include clink/resources/native-generation-grok-1.0.70-admission.json
|
|
10
|
+
include clink/resources/PROVENANCE.md
|
|
11
|
+
include clink/resources/CODEX-LICENSE
|
|
12
|
+
include clink/resources/CODEX-NOTICE
|
|
13
|
+
recursive-include conf/cli_clients *.json
|
|
14
|
+
recursive-include systemprompts/clink *.txt
|
|
15
|
+
recursive-include integrations/claude *.json *.md
|
|
16
|
+
prune providers
|
|
17
|
+
prune tests
|
|
18
|
+
prune simulator_tests
|
|
19
|
+
prune test_simulation_files
|
|
20
|
+
prune docs
|
|
21
|
+
prune logs
|
|
22
|
+
prune .github
|
|
23
|
+
prune .agents
|
|
24
|
+
prune .codex
|
|
25
|
+
recursive-exclude conf *_models.json
|
|
26
|
+
exclude CLAUDE.local.md
|
|
27
|
+
global-exclude .env* *.py[cod] .DS_Store
|
clink_cli-0.2.1/PKG-INFO
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: clink-cli
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: CLI consultation and native agent task delegation over the Model Context Protocol
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Project-URL: Homepage, https://github.com/acebytes/clink-mcp-server
|
|
7
|
+
Project-URL: Repository, https://github.com/acebytes/clink-mcp-server
|
|
8
|
+
Project-URL: Issues, https://github.com/acebytes/clink-mcp-server/issues
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
License-File: clink/resources/CODEX-LICENSE
|
|
13
|
+
License-File: clink/resources/CODEX-NOTICE
|
|
14
|
+
Requires-Dist: mcp<2,>=1.0.0
|
|
15
|
+
Requires-Dist: pydantic>=2.0.0
|
|
16
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
# clink-mcp-server
|
|
20
|
+
|
|
21
|
+
Delegate work to installed CLI agents through MCP. Consultations return advice and proposed code. Explicit native tasks can edit files, run tests, and use the selected CLI's configured tools, hooks, skills, plugins, MCP integrations, and subagents under its native permissions.
|
|
22
|
+
|
|
23
|
+
Version **0.2.1** preserves PAL's **18 MCP tools** and adds a separate `clink generate` command for bounded programmatic text generation. The Python distribution is named `clink-cli` and installs both `clink` and `clink-mcp-server`.
|
|
24
|
+
|
|
25
|
+
Derived from [PAL MCP Server](https://github.com/BeehiveInnovations/pal-mcp-server), formerly Zen MCP. **Copyright 2025 Beehive Innovations.** Retains upstream attribution and the [Apache 2.0 license](LICENSE).
|
|
26
|
+
|
|
27
|
+
## Supported operations
|
|
28
|
+
|
|
29
|
+
Admission is specific to an operation, executable, launch recipe, and parser. Support in one column does not enable another.
|
|
30
|
+
|
|
31
|
+
| CLI | Consultation | Native MCP tasks | Programmatic generation |
|
|
32
|
+
| --- | --- | --- | --- |
|
|
33
|
+
| Codex 0.166.0 | Admitted for text, explicit local images, and structured search. | Disabled: supported output omits a genuine prelaunch permission refusal. | Admitted; schema 2 or 3 with an explicit model. |
|
|
34
|
+
| Claude Code 2.1.304 | Unavailable under the advisory policy. | Admitted. | Admitted; schema 2 or 3 with an explicit full model ID. |
|
|
35
|
+
| xAI Grok Build 1.0.70 (`grok`) | Unverified. | Admitted. | Admitted; schema 3 with `native_default` selection. |
|
|
36
|
+
| Antigravity 1.4.12 (`agy`) | Unverified. | Admitted. | Implemented but unverified; execution is refused. |
|
|
37
|
+
| Gemini | Unverified. | Not implemented. | Not implemented. |
|
|
38
|
+
|
|
39
|
+
The recorded admissions cover exact macOS arm64 binaries. Other builds, operating systems, versions, or changed recipes require verification and fail closed. An installed executable or successful login alone is insufficient. Grok reported `grok-4.7-build` in the recorded successful generation text/action checks. Antigravity's native-task actual model remains unknown; its native-task admission does not admit generation. See [release evidence and limits](docs/release-evidence.md).
|
|
40
|
+
|
|
41
|
+
Python 3.10+ is required; Python 3.12 is the tested runtime. Process supervision targets POSIX systems. Local discovery and offline tests can run without CLI credentials. Native Windows delegation is unavailable; the [container](docker/README.md) supports local tools without installing CLI agents.
|
|
42
|
+
|
|
43
|
+
## Install and connect
|
|
44
|
+
|
|
45
|
+
To install the PyPI release into an isolated tool environment, use:
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
uv tool install clink-cli
|
|
49
|
+
clink generation-capabilities --json
|
|
50
|
+
clink-mcp-server --help
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
If you installed the v0.2.0 GitHub wheel with uv, run `uv tool uninstall clink-mcp-server` first so both executable names are available to the new distribution.
|
|
54
|
+
|
|
55
|
+
For a standalone wheel installation, replace the wheel path and choose a persistent environment outside the source tree:
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
python3 -m venv /absolute/path/to/clink-runtime
|
|
59
|
+
/absolute/path/to/clink-runtime/bin/python -m pip install /absolute/path/to/clink_cli-0.2.1-py3-none-any.whl
|
|
60
|
+
/absolute/path/to/clink-runtime/bin/python -m clink.setup --project /absolute/path/to/your-project
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The installed package contains its manifests, prompts, and admission resources. It does not need the original checkout at runtime. To register its console entrypoint directly in an MCP client, use:
|
|
64
|
+
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"mcpServers": {
|
|
68
|
+
"clink": {
|
|
69
|
+
"command": "/absolute/path/to/clink-runtime/bin/clink-mcp-server",
|
|
70
|
+
"args": ["--project", "/absolute/path/to/your-project"]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Alternatively, from the reviewed 0.2.1 source tree:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
cd /absolute/path/to/clink-mcp-server
|
|
80
|
+
./run-server.sh --setup
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
This explicitly creates `.venv`, installs runtime requirements, and exits. Ordinary startup installs nothing. The launcher does not create `.env`, copy credentials, change native CLI configuration, or register MCP clients. Optional server settings are documented in [.env.example](.env.example). To build a wheel from this tree, install the development requirements and run `.venv/bin/python -m build`; the wheel is written under `dist/`.
|
|
84
|
+
|
|
85
|
+
Configure an existing project from that source installation:
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
.venv/bin/python -m clink.setup --project /absolute/path/to/your-project
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Setup creates project-local `.clink/cli_clients/` manifests, `.clink/prompts/`, and `.mcp.json`. It makes no model calls and preserves custom files by reporting conflicts. The generated MCP registration binds a server explicitly to that project. Reconnect your MCP client, then call `version` and `listmodels` with empty arguments. These calls need no native CLI login.
|
|
92
|
+
|
|
93
|
+
Claude Code users can load the checkout-local setup plugin:
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
cd /absolute/path/to/your-project
|
|
97
|
+
claude --plugin-dir /absolute/path/to/clink-mcp-server/integrations/claude
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Then run `/clink:setup`. This command is available only when that local plugin is loaded; MCP registration alone does not install it. See the [project setup guide](docs/project-setup.md) for selected clients, configuration precedence, conflicts, and recovery.
|
|
101
|
+
|
|
102
|
+
For another MCP client, adapt this stdio registration to its configuration format:
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"mcpServers": {
|
|
107
|
+
"clink": {
|
|
108
|
+
"command": "/absolute/path/to/clink-mcp-server/run-server.sh",
|
|
109
|
+
"args": ["--project", "/absolute/path/to/your-project"]
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Authenticate the chosen CLI through its own login mechanism before an admitted model call. Ensure the MCP client's `PATH` can find it, or configure its executable path in a manifest. The server does not require hosted-provider API keys. See [getting started](docs/getting-started.md), [CLI configuration](docs/cli-configuration.md), and [migration from PAL](docs/migration.md).
|
|
116
|
+
|
|
117
|
+
## Consult or delegate
|
|
118
|
+
|
|
119
|
+
Omitting `action` selects consultation with `codex` and the `default` role. The following is a `clink` MCP tool argument, not a shell command:
|
|
120
|
+
|
|
121
|
+
```json
|
|
122
|
+
{"prompt":"Review this proposed change and return suggested improvements.","cli_name":"codex"}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
For native work, select an admitted CLI and a project inside its configured roots:
|
|
126
|
+
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"action": "start",
|
|
130
|
+
"cli_name": "claude",
|
|
131
|
+
"project_dir": "/absolute/path/to/your-project",
|
|
132
|
+
"prompt": "Fix the failing test, run the relevant checks, and report changed files and unfinished work.",
|
|
133
|
+
"request_key": "fix-test-1",
|
|
134
|
+
"timeout_seconds": 180
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Save the returned `task_handle`. Poll, follow up when `followup_available` is true, or cancel:
|
|
139
|
+
|
|
140
|
+
```json
|
|
141
|
+
{"action":"status","task_handle":"<returned task_handle>"}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{"action":"followup","task_handle":"<returned task_handle>","prompt":"Check one edge case and report the result.","request_key":"fix-test-followup-1"}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
```json
|
|
149
|
+
{"action":"cancel","task_handle":"<returned task_handle>"}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
A follow-up resumes the private native session with a new attempt; native handles are separate from consultation `continuation_id` values. Identical submissions with the same request key are deduplicated while retained. Changed input with that key returns `request_key_conflict`. Handles, session mapping, and deduplication are volatile and are lost on restart. See [native task usage](docs/native-cli-tasks.md) for states, bounds, and ownership rules.
|
|
153
|
+
|
|
154
|
+
## Programmatic generation
|
|
155
|
+
|
|
156
|
+
The examples below use the source installation's `.venv/bin`. For a standalone wheel, use `/absolute/path/to/clink-runtime/bin` instead. Install the checkout's console commands locally if needed:
|
|
157
|
+
|
|
158
|
+
```sh
|
|
159
|
+
.venv/bin/python -m pip install -e .
|
|
160
|
+
.venv/bin/clink generation-capabilities --json
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Capabilities discovery is read-only: it does not launch a CLI, authenticate, or grant execution authority. It reports schemas 2 and 3 with operation-specific admission. Optional `--cli NAME --executable /absolute/path/to/executable` checks one local executable's identity without running it. Launch admission is checked again before execution.
|
|
164
|
+
|
|
165
|
+
Approve an existing project folder independently of MCP project setup:
|
|
166
|
+
|
|
167
|
+
```sh
|
|
168
|
+
.venv/bin/clink allow /absolute/path/to/your-project --cli grok
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
The command shows the resolved path and asks a default-No question; `--yes` explicitly preapproves it for scripts. It saves an `allowed_roots` entry in operator configuration and preserves existing settings. This does not grant native CLI trust or permissions. Generation does not discover project manifests from request paths.
|
|
172
|
+
|
|
173
|
+
Schema 3 example `request.json`, using an existing canonical project path:
|
|
174
|
+
|
|
175
|
+
```json
|
|
176
|
+
{
|
|
177
|
+
"schema_version": 3,
|
|
178
|
+
"request_id": "66f96fc9-969d-4c0e-ab92-e355fa0e7588",
|
|
179
|
+
"execution_mode": "native",
|
|
180
|
+
"project_dir": "/absolute/path/to/your-project",
|
|
181
|
+
"cli": "grok",
|
|
182
|
+
"model_selection": {"kind": "native_default"},
|
|
183
|
+
"instructions": "Rewrite the supplied text for clarity. Return only the revision.",
|
|
184
|
+
"input": "Explain the tradeoffs of a cache for this application.",
|
|
185
|
+
"timeout_seconds": 120
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
```sh
|
|
190
|
+
.venv/bin/clink generate --request-json - < request.json
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Generation reads one JSON request followed by EOF and writes one terminal JSON result. Schema 3 uses `model_selection`: Codex and Claude require `{"kind":"explicit","id":"<native model ID>"}`; Grok and Antigravity accept only `{"kind":"native_default"}`. Antigravity still refuses execution because its generation admission is unverified. Schema 2 preserves Codex/Claude's explicit `model` field. The older no-tools schema 1 profile remains refused.
|
|
194
|
+
|
|
195
|
+
Each accepted request makes at most one top-level CLI invocation, with no wrapper retry, resume, or fallback. Only `status: "completed"` with exit `0` is ordinary success; validate the result's request identity and hashes before using its text. Completion validates final-response transport, not fulfillment. Requested/effective model selection is distinct from CLI-reported actual identity, which remains `null` when unreported. See [generation setup](docs/generation-native-setup.md), [schema 2 protocol](docs/generation-native-protocol.md), and [schema 3 and family discovery](docs/generation-native-families.md).
|
|
196
|
+
|
|
197
|
+
## Tools and configuration
|
|
198
|
+
|
|
199
|
+
All 18 tools are enabled unless listed in `DISABLED_TOOLS`; `version` and `listmodels` remain available.
|
|
200
|
+
|
|
201
|
+
| Tools | Purpose |
|
|
202
|
+
| --- | --- |
|
|
203
|
+
| `chat`, `clink` | Advisory consultations; `clink` also provides explicit native tasks. |
|
|
204
|
+
| `thinkdeep`, `codereview`, `precommit`, `debug`, `secaudit`, `analyze`, `refactor`, `testgen` | Caller-driven investigation with final expert-call conditions. |
|
|
205
|
+
| `consensus` | Independent consultations for caller synthesis, sequential by default with explicit parallel mode. |
|
|
206
|
+
| `apilookup` | Verified native search with structured sources. |
|
|
207
|
+
| `planner`, `docgen`, `tracer`, `challenge` | Local workflow guidance. |
|
|
208
|
+
| `listmodels`, `version` | Local configuration discovery and provenance. |
|
|
209
|
+
|
|
210
|
+
Manifest precedence is bundled defaults → legacy `~/.pal/cli_clients/` → user `~/.clink/cli_clients/` → explicitly bound project `.clink/cli_clients/` → `CLI_CLIENTS_CONFIG_PATH`. Each later manifest replaces the entire named client. Consultation and native task model defaults are separate; generation has its own request and admission contracts. See [CLI configuration](docs/cli-configuration.md).
|
|
211
|
+
|
|
212
|
+
**Risk & Mitigation:** Native execution can change files or external systems before failure or cancellation. Approved roots constrain project selection and supplied context, not all native authority. Cancellation does not roll back effects or guarantee detached/remote work stopped. Inspect actual changes and independently run checks before accepting work. Clink preserves native permission controls and provides no approval bypass or relay. See [security policy](SECURITY.md).
|
|
213
|
+
|
|
214
|
+
## Development
|
|
215
|
+
|
|
216
|
+
```sh
|
|
217
|
+
.venv/bin/python -m pip install -r requirements-dev.txt
|
|
218
|
+
.venv/bin/python -m pytest tests/ -v -m "not integration and not real_cli and not private_evidence"
|
|
219
|
+
.venv/bin/python -m ruff check .
|
|
220
|
+
.venv/bin/python -m black --check .
|
|
221
|
+
.venv/bin/python -m isort --check-only .
|
|
222
|
+
.venv/bin/python -m build
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Ordinary verification uses synthetic executables and makes no live model calls. Historical live verification requires the private evidence and approval process; the public verification scripts do not submit model requests. See [release evidence](docs/release-evidence.md) and [changelog](CHANGELOG.md). Report bugs in this fork's [issue tracker](https://github.com/acebytes/clink-mcp-server/issues), excluding secrets and private transcripts.
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# clink-mcp-server
|
|
2
|
+
|
|
3
|
+
Delegate work to installed CLI agents through MCP. Consultations return advice and proposed code. Explicit native tasks can edit files, run tests, and use the selected CLI's configured tools, hooks, skills, plugins, MCP integrations, and subagents under its native permissions.
|
|
4
|
+
|
|
5
|
+
Version **0.2.1** preserves PAL's **18 MCP tools** and adds a separate `clink generate` command for bounded programmatic text generation. The Python distribution is named `clink-cli` and installs both `clink` and `clink-mcp-server`.
|
|
6
|
+
|
|
7
|
+
Derived from [PAL MCP Server](https://github.com/BeehiveInnovations/pal-mcp-server), formerly Zen MCP. **Copyright 2025 Beehive Innovations.** Retains upstream attribution and the [Apache 2.0 license](LICENSE).
|
|
8
|
+
|
|
9
|
+
## Supported operations
|
|
10
|
+
|
|
11
|
+
Admission is specific to an operation, executable, launch recipe, and parser. Support in one column does not enable another.
|
|
12
|
+
|
|
13
|
+
| CLI | Consultation | Native MCP tasks | Programmatic generation |
|
|
14
|
+
| --- | --- | --- | --- |
|
|
15
|
+
| Codex 0.166.0 | Admitted for text, explicit local images, and structured search. | Disabled: supported output omits a genuine prelaunch permission refusal. | Admitted; schema 2 or 3 with an explicit model. |
|
|
16
|
+
| Claude Code 2.1.304 | Unavailable under the advisory policy. | Admitted. | Admitted; schema 2 or 3 with an explicit full model ID. |
|
|
17
|
+
| xAI Grok Build 1.0.70 (`grok`) | Unverified. | Admitted. | Admitted; schema 3 with `native_default` selection. |
|
|
18
|
+
| Antigravity 1.4.12 (`agy`) | Unverified. | Admitted. | Implemented but unverified; execution is refused. |
|
|
19
|
+
| Gemini | Unverified. | Not implemented. | Not implemented. |
|
|
20
|
+
|
|
21
|
+
The recorded admissions cover exact macOS arm64 binaries. Other builds, operating systems, versions, or changed recipes require verification and fail closed. An installed executable or successful login alone is insufficient. Grok reported `grok-4.7-build` in the recorded successful generation text/action checks. Antigravity's native-task actual model remains unknown; its native-task admission does not admit generation. See [release evidence and limits](docs/release-evidence.md).
|
|
22
|
+
|
|
23
|
+
Python 3.10+ is required; Python 3.12 is the tested runtime. Process supervision targets POSIX systems. Local discovery and offline tests can run without CLI credentials. Native Windows delegation is unavailable; the [container](docker/README.md) supports local tools without installing CLI agents.
|
|
24
|
+
|
|
25
|
+
## Install and connect
|
|
26
|
+
|
|
27
|
+
To install the PyPI release into an isolated tool environment, use:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
uv tool install clink-cli
|
|
31
|
+
clink generation-capabilities --json
|
|
32
|
+
clink-mcp-server --help
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
If you installed the v0.2.0 GitHub wheel with uv, run `uv tool uninstall clink-mcp-server` first so both executable names are available to the new distribution.
|
|
36
|
+
|
|
37
|
+
For a standalone wheel installation, replace the wheel path and choose a persistent environment outside the source tree:
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
python3 -m venv /absolute/path/to/clink-runtime
|
|
41
|
+
/absolute/path/to/clink-runtime/bin/python -m pip install /absolute/path/to/clink_cli-0.2.1-py3-none-any.whl
|
|
42
|
+
/absolute/path/to/clink-runtime/bin/python -m clink.setup --project /absolute/path/to/your-project
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The installed package contains its manifests, prompts, and admission resources. It does not need the original checkout at runtime. To register its console entrypoint directly in an MCP client, use:
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"mcpServers": {
|
|
50
|
+
"clink": {
|
|
51
|
+
"command": "/absolute/path/to/clink-runtime/bin/clink-mcp-server",
|
|
52
|
+
"args": ["--project", "/absolute/path/to/your-project"]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Alternatively, from the reviewed 0.2.1 source tree:
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
cd /absolute/path/to/clink-mcp-server
|
|
62
|
+
./run-server.sh --setup
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
This explicitly creates `.venv`, installs runtime requirements, and exits. Ordinary startup installs nothing. The launcher does not create `.env`, copy credentials, change native CLI configuration, or register MCP clients. Optional server settings are documented in [.env.example](.env.example). To build a wheel from this tree, install the development requirements and run `.venv/bin/python -m build`; the wheel is written under `dist/`.
|
|
66
|
+
|
|
67
|
+
Configure an existing project from that source installation:
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
.venv/bin/python -m clink.setup --project /absolute/path/to/your-project
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Setup creates project-local `.clink/cli_clients/` manifests, `.clink/prompts/`, and `.mcp.json`. It makes no model calls and preserves custom files by reporting conflicts. The generated MCP registration binds a server explicitly to that project. Reconnect your MCP client, then call `version` and `listmodels` with empty arguments. These calls need no native CLI login.
|
|
74
|
+
|
|
75
|
+
Claude Code users can load the checkout-local setup plugin:
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
cd /absolute/path/to/your-project
|
|
79
|
+
claude --plugin-dir /absolute/path/to/clink-mcp-server/integrations/claude
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Then run `/clink:setup`. This command is available only when that local plugin is loaded; MCP registration alone does not install it. See the [project setup guide](docs/project-setup.md) for selected clients, configuration precedence, conflicts, and recovery.
|
|
83
|
+
|
|
84
|
+
For another MCP client, adapt this stdio registration to its configuration format:
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"mcpServers": {
|
|
89
|
+
"clink": {
|
|
90
|
+
"command": "/absolute/path/to/clink-mcp-server/run-server.sh",
|
|
91
|
+
"args": ["--project", "/absolute/path/to/your-project"]
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Authenticate the chosen CLI through its own login mechanism before an admitted model call. Ensure the MCP client's `PATH` can find it, or configure its executable path in a manifest. The server does not require hosted-provider API keys. See [getting started](docs/getting-started.md), [CLI configuration](docs/cli-configuration.md), and [migration from PAL](docs/migration.md).
|
|
98
|
+
|
|
99
|
+
## Consult or delegate
|
|
100
|
+
|
|
101
|
+
Omitting `action` selects consultation with `codex` and the `default` role. The following is a `clink` MCP tool argument, not a shell command:
|
|
102
|
+
|
|
103
|
+
```json
|
|
104
|
+
{"prompt":"Review this proposed change and return suggested improvements.","cli_name":"codex"}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
For native work, select an admitted CLI and a project inside its configured roots:
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"action": "start",
|
|
112
|
+
"cli_name": "claude",
|
|
113
|
+
"project_dir": "/absolute/path/to/your-project",
|
|
114
|
+
"prompt": "Fix the failing test, run the relevant checks, and report changed files and unfinished work.",
|
|
115
|
+
"request_key": "fix-test-1",
|
|
116
|
+
"timeout_seconds": 180
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Save the returned `task_handle`. Poll, follow up when `followup_available` is true, or cancel:
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
{"action":"status","task_handle":"<returned task_handle>"}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
{"action":"followup","task_handle":"<returned task_handle>","prompt":"Check one edge case and report the result.","request_key":"fix-test-followup-1"}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{"action":"cancel","task_handle":"<returned task_handle>"}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
A follow-up resumes the private native session with a new attempt; native handles are separate from consultation `continuation_id` values. Identical submissions with the same request key are deduplicated while retained. Changed input with that key returns `request_key_conflict`. Handles, session mapping, and deduplication are volatile and are lost on restart. See [native task usage](docs/native-cli-tasks.md) for states, bounds, and ownership rules.
|
|
135
|
+
|
|
136
|
+
## Programmatic generation
|
|
137
|
+
|
|
138
|
+
The examples below use the source installation's `.venv/bin`. For a standalone wheel, use `/absolute/path/to/clink-runtime/bin` instead. Install the checkout's console commands locally if needed:
|
|
139
|
+
|
|
140
|
+
```sh
|
|
141
|
+
.venv/bin/python -m pip install -e .
|
|
142
|
+
.venv/bin/clink generation-capabilities --json
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Capabilities discovery is read-only: it does not launch a CLI, authenticate, or grant execution authority. It reports schemas 2 and 3 with operation-specific admission. Optional `--cli NAME --executable /absolute/path/to/executable` checks one local executable's identity without running it. Launch admission is checked again before execution.
|
|
146
|
+
|
|
147
|
+
Approve an existing project folder independently of MCP project setup:
|
|
148
|
+
|
|
149
|
+
```sh
|
|
150
|
+
.venv/bin/clink allow /absolute/path/to/your-project --cli grok
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
The command shows the resolved path and asks a default-No question; `--yes` explicitly preapproves it for scripts. It saves an `allowed_roots` entry in operator configuration and preserves existing settings. This does not grant native CLI trust or permissions. Generation does not discover project manifests from request paths.
|
|
154
|
+
|
|
155
|
+
Schema 3 example `request.json`, using an existing canonical project path:
|
|
156
|
+
|
|
157
|
+
```json
|
|
158
|
+
{
|
|
159
|
+
"schema_version": 3,
|
|
160
|
+
"request_id": "66f96fc9-969d-4c0e-ab92-e355fa0e7588",
|
|
161
|
+
"execution_mode": "native",
|
|
162
|
+
"project_dir": "/absolute/path/to/your-project",
|
|
163
|
+
"cli": "grok",
|
|
164
|
+
"model_selection": {"kind": "native_default"},
|
|
165
|
+
"instructions": "Rewrite the supplied text for clarity. Return only the revision.",
|
|
166
|
+
"input": "Explain the tradeoffs of a cache for this application.",
|
|
167
|
+
"timeout_seconds": 120
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
```sh
|
|
172
|
+
.venv/bin/clink generate --request-json - < request.json
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Generation reads one JSON request followed by EOF and writes one terminal JSON result. Schema 3 uses `model_selection`: Codex and Claude require `{"kind":"explicit","id":"<native model ID>"}`; Grok and Antigravity accept only `{"kind":"native_default"}`. Antigravity still refuses execution because its generation admission is unverified. Schema 2 preserves Codex/Claude's explicit `model` field. The older no-tools schema 1 profile remains refused.
|
|
176
|
+
|
|
177
|
+
Each accepted request makes at most one top-level CLI invocation, with no wrapper retry, resume, or fallback. Only `status: "completed"` with exit `0` is ordinary success; validate the result's request identity and hashes before using its text. Completion validates final-response transport, not fulfillment. Requested/effective model selection is distinct from CLI-reported actual identity, which remains `null` when unreported. See [generation setup](docs/generation-native-setup.md), [schema 2 protocol](docs/generation-native-protocol.md), and [schema 3 and family discovery](docs/generation-native-families.md).
|
|
178
|
+
|
|
179
|
+
## Tools and configuration
|
|
180
|
+
|
|
181
|
+
All 18 tools are enabled unless listed in `DISABLED_TOOLS`; `version` and `listmodels` remain available.
|
|
182
|
+
|
|
183
|
+
| Tools | Purpose |
|
|
184
|
+
| --- | --- |
|
|
185
|
+
| `chat`, `clink` | Advisory consultations; `clink` also provides explicit native tasks. |
|
|
186
|
+
| `thinkdeep`, `codereview`, `precommit`, `debug`, `secaudit`, `analyze`, `refactor`, `testgen` | Caller-driven investigation with final expert-call conditions. |
|
|
187
|
+
| `consensus` | Independent consultations for caller synthesis, sequential by default with explicit parallel mode. |
|
|
188
|
+
| `apilookup` | Verified native search with structured sources. |
|
|
189
|
+
| `planner`, `docgen`, `tracer`, `challenge` | Local workflow guidance. |
|
|
190
|
+
| `listmodels`, `version` | Local configuration discovery and provenance. |
|
|
191
|
+
|
|
192
|
+
Manifest precedence is bundled defaults → legacy `~/.pal/cli_clients/` → user `~/.clink/cli_clients/` → explicitly bound project `.clink/cli_clients/` → `CLI_CLIENTS_CONFIG_PATH`. Each later manifest replaces the entire named client. Consultation and native task model defaults are separate; generation has its own request and admission contracts. See [CLI configuration](docs/cli-configuration.md).
|
|
193
|
+
|
|
194
|
+
**Risk & Mitigation:** Native execution can change files or external systems before failure or cancellation. Approved roots constrain project selection and supplied context, not all native authority. Cancellation does not roll back effects or guarantee detached/remote work stopped. Inspect actual changes and independently run checks before accepting work. Clink preserves native permission controls and provides no approval bypass or relay. See [security policy](SECURITY.md).
|
|
195
|
+
|
|
196
|
+
## Development
|
|
197
|
+
|
|
198
|
+
```sh
|
|
199
|
+
.venv/bin/python -m pip install -r requirements-dev.txt
|
|
200
|
+
.venv/bin/python -m pytest tests/ -v -m "not integration and not real_cli and not private_evidence"
|
|
201
|
+
.venv/bin/python -m ruff check .
|
|
202
|
+
.venv/bin/python -m black --check .
|
|
203
|
+
.venv/bin/python -m isort --check-only .
|
|
204
|
+
.venv/bin/python -m build
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Ordinary verification uses synthetic executables and makes no live model calls. Historical live verification requires the private evidence and approval process; the public verification scripts do not submit model requests. See [release evidence](docs/release-evidence.md) and [changelog](CHANGELOG.md). Report bugs in this fork's [issue tracker](https://github.com/acebytes/clink-mcp-server/issues), excluding secrets and private transcripts.
|