mico-agent 0.1.0__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.
- mico_agent-0.1.0/LICENSE +202 -0
- mico_agent-0.1.0/NOTICE +18 -0
- mico_agent-0.1.0/PKG-INFO +147 -0
- mico_agent-0.1.0/README.md +109 -0
- mico_agent-0.1.0/mico/__init__.py +42 -0
- mico_agent-0.1.0/mico/action_parse.py +71 -0
- mico_agent-0.1.0/mico/action_validation.py +44 -0
- mico_agent-0.1.0/mico/audit.py +262 -0
- mico_agent-0.1.0/mico/auto_fix.py +91 -0
- mico_agent-0.1.0/mico/budget.py +51 -0
- mico_agent-0.1.0/mico/cli.py +6151 -0
- mico_agent-0.1.0/mico/command_policy.py +299 -0
- mico_agent-0.1.0/mico/compact.py +110 -0
- mico_agent-0.1.0/mico/compact_meter.py +25 -0
- mico_agent-0.1.0/mico/context.py +138 -0
- mico_agent-0.1.0/mico/dependency_consent.py +334 -0
- mico_agent-0.1.0/mico/diff_render.py +37 -0
- mico_agent-0.1.0/mico/draft_mode.py +14 -0
- mico_agent-0.1.0/mico/entry.py +310 -0
- mico_agent-0.1.0/mico/eval_case_handlers.py +213 -0
- mico_agent-0.1.0/mico/eval_dispatch.py +14 -0
- mico_agent-0.1.0/mico/eval_suite.py +70 -0
- mico_agent-0.1.0/mico/files_complete.py +128 -0
- mico_agent-0.1.0/mico/git_checkpoint.py +198 -0
- mico_agent-0.1.0/mico/git_repo.py +15 -0
- mico_agent-0.1.0/mico/hardware.py +207 -0
- mico_agent-0.1.0/mico/history_utils.py +31 -0
- mico_agent-0.1.0/mico/limits.py +134 -0
- mico_agent-0.1.0/mico/longrun.py +432 -0
- mico_agent-0.1.0/mico/metrics.py +46 -0
- mico_agent-0.1.0/mico/model_client.py +938 -0
- mico_agent-0.1.0/mico/model_discovery.py +34 -0
- mico_agent-0.1.0/mico/model_ops.py +559 -0
- mico_agent-0.1.0/mico/model_recommender.py +449 -0
- mico_agent-0.1.0/mico/model_text.py +77 -0
- mico_agent-0.1.0/mico/orchestra.py +105 -0
- mico_agent-0.1.0/mico/output.py +128 -0
- mico_agent-0.1.0/mico/patch.py +469 -0
- mico_agent-0.1.0/mico/paths.py +12 -0
- mico_agent-0.1.0/mico/phase_transitions.py +111 -0
- mico_agent-0.1.0/mico/picker.py +99 -0
- mico_agent-0.1.0/mico/preflight.py +442 -0
- mico_agent-0.1.0/mico/profiles_runtime.py +334 -0
- mico_agent-0.1.0/mico/prompt_builder.py +420 -0
- mico_agent-0.1.0/mico/recovery.py +80 -0
- mico_agent-0.1.0/mico/redact.py +115 -0
- mico_agent-0.1.0/mico/repair.py +57 -0
- mico_agent-0.1.0/mico/repl.py +311 -0
- mico_agent-0.1.0/mico/retrieval.py +72 -0
- mico_agent-0.1.0/mico/router_hooks.py +44 -0
- mico_agent-0.1.0/mico/server.py +897 -0
- mico_agent-0.1.0/mico/server_watcher.py +66 -0
- mico_agent-0.1.0/mico/session_ops.py +228 -0
- mico_agent-0.1.0/mico/session_store.py +53 -0
- mico_agent-0.1.0/mico/setup_wizard.py +218 -0
- mico_agent-0.1.0/mico/shell_utils.py +19 -0
- mico_agent-0.1.0/mico/skill_io.py +51 -0
- mico_agent-0.1.0/mico/skill_loader.py +373 -0
- mico_agent-0.1.0/mico/slash.py +1273 -0
- mico_agent-0.1.0/mico/spinner.py +164 -0
- mico_agent-0.1.0/mico/state_mutations.py +39 -0
- mico_agent-0.1.0/mico/state_reports.py +62 -0
- mico_agent-0.1.0/mico/task_classify.py +439 -0
- mico_agent-0.1.0/mico/task_envelope.py +112 -0
- mico_agent-0.1.0/mico/task_state.py +669 -0
- mico_agent-0.1.0/mico/testloop.py +308 -0
- mico_agent-0.1.0/mico/text_utils.py +26 -0
- mico_agent-0.1.0/mico/tool_narration.py +112 -0
- mico_agent-0.1.0/mico/tool_runner.py +780 -0
- mico_agent-0.1.0/mico/triage.py +144 -0
- mico_agent-0.1.0/mico/ui.py +760 -0
- mico_agent-0.1.0/mico/ui_status.py +168 -0
- mico_agent-0.1.0/mico/verifier.py +71 -0
- mico_agent-0.1.0/mico_agent.egg-info/PKG-INFO +147 -0
- mico_agent-0.1.0/mico_agent.egg-info/SOURCES.txt +94 -0
- mico_agent-0.1.0/mico_agent.egg-info/dependency_links.txt +1 -0
- mico_agent-0.1.0/mico_agent.egg-info/entry_points.txt +2 -0
- mico_agent-0.1.0/mico_agent.egg-info/requires.txt +15 -0
- mico_agent-0.1.0/mico_agent.egg-info/top_level.txt +1 -0
- mico_agent-0.1.0/pyproject.toml +63 -0
- mico_agent-0.1.0/setup.cfg +4 -0
- mico_agent-0.1.0/tests/test_audit.py +159 -0
- mico_agent-0.1.0/tests/test_command_tiers.py +113 -0
- mico_agent-0.1.0/tests/test_final_format.py +119 -0
- mico_agent-0.1.0/tests/test_git_checkpoint.py +98 -0
- mico_agent-0.1.0/tests/test_limits.py +100 -0
- mico_agent-0.1.0/tests/test_longrun.py +307 -0
- mico_agent-0.1.0/tests/test_mico_orchestra.py +668 -0
- mico_agent-0.1.0/tests/test_model_profile.py +175 -0
- mico_agent-0.1.0/tests/test_new_tools.py +201 -0
- mico_agent-0.1.0/tests/test_patch_pipeline.py +218 -0
- mico_agent-0.1.0/tests/test_path_guard.py +75 -0
- mico_agent-0.1.0/tests/test_preflight.py +218 -0
- mico_agent-0.1.0/tests/test_redact.py +115 -0
- mico_agent-0.1.0/tests/test_test_loop.py +172 -0
- mico_agent-0.1.0/tests/test_triage.py +191 -0
mico_agent-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
mico_agent-0.1.0/NOTICE
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
mico — local coding agent
|
|
2
|
+
Copyright 2026 mico contributors
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
|
|
16
|
+
This product is derived from internal work originally developed under the
|
|
17
|
+
project name "qcodex". Significant portions have been rewritten and
|
|
18
|
+
sanitized for public release.
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mico-agent
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: mico — local coding agent for Apple Silicon (MLX) and Linux
|
|
5
|
+
Author: mico contributors
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/captainonedin/mico
|
|
8
|
+
Project-URL: Repository, https://github.com/captainonedin/mico
|
|
9
|
+
Project-URL: Issues, https://github.com/captainonedin/mico/issues
|
|
10
|
+
Keywords: llm,agent,cli,mlx,coding-assistant,local-ai
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
|
16
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Software Development
|
|
22
|
+
Requires-Python: >=3.11
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
License-File: NOTICE
|
|
26
|
+
Requires-Dist: requests>=2.31
|
|
27
|
+
Requires-Dist: prompt_toolkit>=3.0.43
|
|
28
|
+
Requires-Dist: rich>=13.7
|
|
29
|
+
Requires-Dist: tomli>=2.0; python_version < "3.11"
|
|
30
|
+
Provides-Extra: mlx
|
|
31
|
+
Requires-Dist: mlx>=0.20; extra == "mlx"
|
|
32
|
+
Requires-Dist: mlx-lm>=0.21; extra == "mlx"
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
35
|
+
Requires-Dist: pytest-cov>=4.1; extra == "dev"
|
|
36
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
37
|
+
Dynamic: license-file
|
|
38
|
+
|
|
39
|
+
# mico ⚓
|
|
40
|
+
|
|
41
|
+
> Local coding agent for Apple Silicon and Linux. Runs your model. On your machine. End-to-end.
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
⚓
|
|
45
|
+
┌──────┐
|
|
46
|
+
│ mico │
|
|
47
|
+
└──────┘
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Status:** alpha (0.1.0). API ve CLI değişebilir.
|
|
51
|
+
|
|
52
|
+
## Ne işe yarar?
|
|
53
|
+
|
|
54
|
+
mico, terminalinden çalışan, **yerel LLM**'lerle (MLX / Ollama / OpenAI uyumlu sunucular) konuşan bir coding agent'tır:
|
|
55
|
+
|
|
56
|
+
- Yapısal araç çağrıları (`read_file`, `replace_in_file`, `bash`, `run_tests`, `grep_code`, ...)
|
|
57
|
+
- Otomatik patch + test loop
|
|
58
|
+
- Oturum kalıcılığı, kompakt geçmiş özetleme
|
|
59
|
+
- Donanıma göre profil önerisi
|
|
60
|
+
- Bedava, açık kaynak, telemetry yok
|
|
61
|
+
|
|
62
|
+
## Gereksinimler
|
|
63
|
+
|
|
64
|
+
- macOS (Apple Silicon önerilir) veya Linux
|
|
65
|
+
- Python 3.11+
|
|
66
|
+
- 16 GB+ unified memory (8B model için 8 GB yeter, 14B+ için 24 GB+)
|
|
67
|
+
|
|
68
|
+
## Hızlı kurulum
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pip install mico-agent # core
|
|
72
|
+
pip install 'mico-agent[mlx]' # Apple Silicon MLX backend ile
|
|
73
|
+
mico # ilk çalıştırma → wizard
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
İlk açılışta mico:
|
|
77
|
+
|
|
78
|
+
1. Donanımı tespit eder (CPU, RAM, GPU/Neural Engine)
|
|
79
|
+
2. `~/Desktop/models/`, HF cache, LM Studio'yu tarayıp yerel modelleri listeler
|
|
80
|
+
3. Donanım × model eşleşmesinden bir profil önerir, onaylatır
|
|
81
|
+
4. Tüm tercihleri `~/.mico/` altına kaydeder, bir daha sormaz
|
|
82
|
+
|
|
83
|
+
## Komutlar
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
mico Interaktif chat
|
|
87
|
+
mico ask "prompt" Tek seferlik
|
|
88
|
+
mico setup Wizard'ı tekrar çalıştır (--force ile zorla)
|
|
89
|
+
mico models Algılanan modelleri listele
|
|
90
|
+
mico --doctor Tanı çıktısı (donanım + profil)
|
|
91
|
+
mico server-stop Çalışan model sunucusunu durdur
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## TUI özellikleri
|
|
95
|
+
|
|
96
|
+
- **Slash komut paleti**: `/` yazınca komutlar dropdown ile gelir
|
|
97
|
+
- `/help` `/mode` `/network` `/thinking` `/cd` `/compact` `/clear`
|
|
98
|
+
- `/history` `/save` `/model` `/exit`
|
|
99
|
+
- **Dosya tamamlama**: `@` yazınca cwd'deki dosyalar autocomplete
|
|
100
|
+
- **Alt çubuk**: Aktif model · mode · ctx · network · thinking durumu canlı
|
|
101
|
+
- **JSON-aware streaming**: Model'in `{"type":"final","message":"..."}` ham
|
|
102
|
+
JSON'u kullanıcıya gizlenir; sadece temiz mesaj görünür
|
|
103
|
+
- **Tool çağrı render'ı**: `▸ tool_name(args)` + foldlanmış sonuç
|
|
104
|
+
- **Spinner**: Braille animasyonu (TTY) — `düşünüyor → yazıyor` geçişi
|
|
105
|
+
- **Sıkı kapatma**: Ctrl+D'de model server'a SIGTERM → 3sn → SIGKILL
|
|
106
|
+
- **Oturum sürdürme**: Aynı session'a kaldığı yerden devam veya yeniden başla
|
|
107
|
+
- **Trivial chat fast path**: `selam` gibi sohbetler tool loop'u atlar
|
|
108
|
+
|
|
109
|
+
## İlk kurulum
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
git clone https://github.com/captainonedin/mico ~/mico
|
|
113
|
+
~/mico/bin/mico # ilk açılış → wizard
|
|
114
|
+
# veya PATH'e ekle:
|
|
115
|
+
ln -s ~/mico/bin/mico /opt/homebrew/bin/mico # macOS
|
|
116
|
+
ln -s ~/mico/bin/mico ~/.local/bin/mico # Linux
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
İlk açılışta:
|
|
120
|
+
1. Sistem Python 3.11+ tespit edilir
|
|
121
|
+
2. Bağımlılıklar listelenir + onay alınır
|
|
122
|
+
3. Mevcut bir venv'de gerekli paketler varsa yeniden indirilmez
|
|
123
|
+
4. Yoksa `~/.mico/.venv` oluşturulup oraya kurulur (PEP 668 uyumlu)
|
|
124
|
+
5. mico kendini venv'den yeniden başlatır
|
|
125
|
+
|
|
126
|
+
## Mimari
|
|
127
|
+
|
|
128
|
+
Detay: `docs/architecture.md`.
|
|
129
|
+
|
|
130
|
+
## Güvenlik araçları
|
|
131
|
+
|
|
132
|
+
mico **çekirdek olarak** sadece coding/dev iş akışına odaklı. Pentest/security tooling
|
|
133
|
+
ayrı bir paket olarak yayınlanır:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
pip install mico-security # nmap, ffuf, openssl wrappers; auditing skills
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
mico-security ayrı repodadır, ayrı izinlerle yönetilir, default'ta yüklü değildir.
|
|
140
|
+
|
|
141
|
+
## Lisans
|
|
142
|
+
|
|
143
|
+
Apache-2.0 — bkz. [LICENSE](LICENSE) ve [NOTICE](NOTICE).
|
|
144
|
+
|
|
145
|
+
## Katkı
|
|
146
|
+
|
|
147
|
+
[CONTRIBUTING.md](CONTRIBUTING.md) — issue açmadan önce oku.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# mico ⚓
|
|
2
|
+
|
|
3
|
+
> Local coding agent for Apple Silicon and Linux. Runs your model. On your machine. End-to-end.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
⚓
|
|
7
|
+
┌──────┐
|
|
8
|
+
│ mico │
|
|
9
|
+
└──────┘
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
**Status:** alpha (0.1.0). API ve CLI değişebilir.
|
|
13
|
+
|
|
14
|
+
## Ne işe yarar?
|
|
15
|
+
|
|
16
|
+
mico, terminalinden çalışan, **yerel LLM**'lerle (MLX / Ollama / OpenAI uyumlu sunucular) konuşan bir coding agent'tır:
|
|
17
|
+
|
|
18
|
+
- Yapısal araç çağrıları (`read_file`, `replace_in_file`, `bash`, `run_tests`, `grep_code`, ...)
|
|
19
|
+
- Otomatik patch + test loop
|
|
20
|
+
- Oturum kalıcılığı, kompakt geçmiş özetleme
|
|
21
|
+
- Donanıma göre profil önerisi
|
|
22
|
+
- Bedava, açık kaynak, telemetry yok
|
|
23
|
+
|
|
24
|
+
## Gereksinimler
|
|
25
|
+
|
|
26
|
+
- macOS (Apple Silicon önerilir) veya Linux
|
|
27
|
+
- Python 3.11+
|
|
28
|
+
- 16 GB+ unified memory (8B model için 8 GB yeter, 14B+ için 24 GB+)
|
|
29
|
+
|
|
30
|
+
## Hızlı kurulum
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pip install mico-agent # core
|
|
34
|
+
pip install 'mico-agent[mlx]' # Apple Silicon MLX backend ile
|
|
35
|
+
mico # ilk çalıştırma → wizard
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
İlk açılışta mico:
|
|
39
|
+
|
|
40
|
+
1. Donanımı tespit eder (CPU, RAM, GPU/Neural Engine)
|
|
41
|
+
2. `~/Desktop/models/`, HF cache, LM Studio'yu tarayıp yerel modelleri listeler
|
|
42
|
+
3. Donanım × model eşleşmesinden bir profil önerir, onaylatır
|
|
43
|
+
4. Tüm tercihleri `~/.mico/` altına kaydeder, bir daha sormaz
|
|
44
|
+
|
|
45
|
+
## Komutlar
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
mico Interaktif chat
|
|
49
|
+
mico ask "prompt" Tek seferlik
|
|
50
|
+
mico setup Wizard'ı tekrar çalıştır (--force ile zorla)
|
|
51
|
+
mico models Algılanan modelleri listele
|
|
52
|
+
mico --doctor Tanı çıktısı (donanım + profil)
|
|
53
|
+
mico server-stop Çalışan model sunucusunu durdur
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## TUI özellikleri
|
|
57
|
+
|
|
58
|
+
- **Slash komut paleti**: `/` yazınca komutlar dropdown ile gelir
|
|
59
|
+
- `/help` `/mode` `/network` `/thinking` `/cd` `/compact` `/clear`
|
|
60
|
+
- `/history` `/save` `/model` `/exit`
|
|
61
|
+
- **Dosya tamamlama**: `@` yazınca cwd'deki dosyalar autocomplete
|
|
62
|
+
- **Alt çubuk**: Aktif model · mode · ctx · network · thinking durumu canlı
|
|
63
|
+
- **JSON-aware streaming**: Model'in `{"type":"final","message":"..."}` ham
|
|
64
|
+
JSON'u kullanıcıya gizlenir; sadece temiz mesaj görünür
|
|
65
|
+
- **Tool çağrı render'ı**: `▸ tool_name(args)` + foldlanmış sonuç
|
|
66
|
+
- **Spinner**: Braille animasyonu (TTY) — `düşünüyor → yazıyor` geçişi
|
|
67
|
+
- **Sıkı kapatma**: Ctrl+D'de model server'a SIGTERM → 3sn → SIGKILL
|
|
68
|
+
- **Oturum sürdürme**: Aynı session'a kaldığı yerden devam veya yeniden başla
|
|
69
|
+
- **Trivial chat fast path**: `selam` gibi sohbetler tool loop'u atlar
|
|
70
|
+
|
|
71
|
+
## İlk kurulum
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
git clone https://github.com/captainonedin/mico ~/mico
|
|
75
|
+
~/mico/bin/mico # ilk açılış → wizard
|
|
76
|
+
# veya PATH'e ekle:
|
|
77
|
+
ln -s ~/mico/bin/mico /opt/homebrew/bin/mico # macOS
|
|
78
|
+
ln -s ~/mico/bin/mico ~/.local/bin/mico # Linux
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
İlk açılışta:
|
|
82
|
+
1. Sistem Python 3.11+ tespit edilir
|
|
83
|
+
2. Bağımlılıklar listelenir + onay alınır
|
|
84
|
+
3. Mevcut bir venv'de gerekli paketler varsa yeniden indirilmez
|
|
85
|
+
4. Yoksa `~/.mico/.venv` oluşturulup oraya kurulur (PEP 668 uyumlu)
|
|
86
|
+
5. mico kendini venv'den yeniden başlatır
|
|
87
|
+
|
|
88
|
+
## Mimari
|
|
89
|
+
|
|
90
|
+
Detay: `docs/architecture.md`.
|
|
91
|
+
|
|
92
|
+
## Güvenlik araçları
|
|
93
|
+
|
|
94
|
+
mico **çekirdek olarak** sadece coding/dev iş akışına odaklı. Pentest/security tooling
|
|
95
|
+
ayrı bir paket olarak yayınlanır:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
pip install mico-security # nmap, ffuf, openssl wrappers; auditing skills
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
mico-security ayrı repodadır, ayrı izinlerle yönetilir, default'ta yüklü değildir.
|
|
102
|
+
|
|
103
|
+
## Lisans
|
|
104
|
+
|
|
105
|
+
Apache-2.0 — bkz. [LICENSE](LICENSE) ve [NOTICE](NOTICE).
|
|
106
|
+
|
|
107
|
+
## Katkı
|
|
108
|
+
|
|
109
|
+
[CONTRIBUTING.md](CONTRIBUTING.md) — issue açmadan önce oku.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"""mico — local coding agent."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
__version__ = "0.1.0"
|
|
5
|
+
|
|
6
|
+
# Re-export commonly used stdlib symbols for test patching compatibility.
|
|
7
|
+
import subprocess # noqa: F401 — tests do patch.object(mico.subprocess, ...)
|
|
8
|
+
from pathlib import Path # noqa: F401 — tests do mico.Path(...)
|
|
9
|
+
|
|
10
|
+
# Lazy proxy: any attribute not found here is looked up in mico.cli.
|
|
11
|
+
# This keeps `import mico` fast (no heavy CLI import at package load time)
|
|
12
|
+
# while letting tests access internal symbols via `mico.foo`.
|
|
13
|
+
|
|
14
|
+
_cli_mod = None
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _get_cli():
|
|
18
|
+
global _cli_mod
|
|
19
|
+
if _cli_mod is None:
|
|
20
|
+
import importlib
|
|
21
|
+
_cli_mod = importlib.import_module("mico.cli")
|
|
22
|
+
return _cli_mod
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
_OUTPUT_ALIASES = {
|
|
26
|
+
"_parse_git_status_paths": ("mico.output", "parse_git_status_paths"),
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def __getattr__(name: str):
|
|
31
|
+
if name in _OUTPUT_ALIASES:
|
|
32
|
+
import importlib
|
|
33
|
+
mod_name, attr = _OUTPUT_ALIASES[name]
|
|
34
|
+
return getattr(importlib.import_module(mod_name), attr)
|
|
35
|
+
# Fall through to cli for everything else
|
|
36
|
+
try:
|
|
37
|
+
return getattr(_get_cli(), name)
|
|
38
|
+
except AttributeError:
|
|
39
|
+
raise AttributeError(f"module 'mico' has no attribute {name!r}") from None
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
__all__ = ["__version__", "subprocess", "Path"]
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
import re
|
|
5
|
+
from json import JSONDecoder
|
|
6
|
+
from typing import Any, Callable
|
|
7
|
+
|
|
8
|
+
_MD_JSON_RE = re.compile(r"```(?:json)?\s*(\{.*?\})\s*```", re.DOTALL)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def normalize_action_schema(action: dict[str, Any]) -> dict[str, Any]:
|
|
12
|
+
kind = str(action.get("type", "")).strip()
|
|
13
|
+
if kind in {"final", "patch", "tool"}:
|
|
14
|
+
return action
|
|
15
|
+
if kind in {"bash", "list_files", "read_file", "write_file", "replace_in_file", "finish", "macos_admin_task"}:
|
|
16
|
+
normalized = dict(action)
|
|
17
|
+
normalized["type"] = "tool"
|
|
18
|
+
normalized["tool"] = kind
|
|
19
|
+
if kind == "finish" and "message" not in normalized:
|
|
20
|
+
normalized["message"] = str(normalized.get("content", "")).strip()
|
|
21
|
+
return normalized
|
|
22
|
+
return action
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def is_plain_text_response(text: str) -> bool:
|
|
26
|
+
cleaned = text.strip()
|
|
27
|
+
if not cleaned or len(cleaned) < 10:
|
|
28
|
+
return False
|
|
29
|
+
for idx, ch in enumerate(cleaned):
|
|
30
|
+
if ch == "{":
|
|
31
|
+
try:
|
|
32
|
+
decoder = JSONDecoder()
|
|
33
|
+
decoder.raw_decode(cleaned[idx:])
|
|
34
|
+
return False
|
|
35
|
+
except json.JSONDecodeError:
|
|
36
|
+
continue
|
|
37
|
+
return True
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def extract_json(text: str, *, strip_thinking: Callable[[str], str]) -> dict[str, Any]:
|
|
41
|
+
cleaned = strip_thinking(text).strip()
|
|
42
|
+
|
|
43
|
+
# Try markdown block first
|
|
44
|
+
md_match = _MD_JSON_RE.search(cleaned)
|
|
45
|
+
if md_match:
|
|
46
|
+
try:
|
|
47
|
+
obj = json.loads(md_match.group(1))
|
|
48
|
+
if isinstance(obj, dict):
|
|
49
|
+
return normalize_action_schema(obj)
|
|
50
|
+
except json.JSONDecodeError:
|
|
51
|
+
pass
|
|
52
|
+
|
|
53
|
+
# Try to find the outermost JSON object
|
|
54
|
+
start_idx = cleaned.find("{")
|
|
55
|
+
end_idx = cleaned.rfind("}")
|
|
56
|
+
|
|
57
|
+
if start_idx != -1 and end_idx != -1 and end_idx > start_idx:
|
|
58
|
+
json_str = cleaned[start_idx : end_idx + 1]
|
|
59
|
+
try:
|
|
60
|
+
decoder = JSONDecoder()
|
|
61
|
+
obj, _ = decoder.raw_decode(json_str)
|
|
62
|
+
if isinstance(obj, dict):
|
|
63
|
+
return normalize_action_schema(obj)
|
|
64
|
+
except json.JSONDecodeError:
|
|
65
|
+
pass
|
|
66
|
+
|
|
67
|
+
# Fallback: If no valid JSON found but there's substantial text, treat as final message
|
|
68
|
+
if len(cleaned) >= 5:
|
|
69
|
+
return {"type": "final", "message": cleaned}
|
|
70
|
+
|
|
71
|
+
raise ValueError(f"Model did not return valid JSON or actionable text:\n{cleaned}")
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def validate_action(action: dict[str, Any]) -> tuple[bool, str]:
|
|
7
|
+
kind = str(action.get("type", "")).strip()
|
|
8
|
+
if kind == "final":
|
|
9
|
+
if not str(action.get("message", "")).strip() and not str(action.get("summary", "")).strip():
|
|
10
|
+
return (False, "final.message or final.summary is required")
|
|
11
|
+
return (True, "")
|
|
12
|
+
if kind == "patch":
|
|
13
|
+
if not str(action.get("diff", "")).strip():
|
|
14
|
+
return (False, "patch.diff is required")
|
|
15
|
+
return (True, "")
|
|
16
|
+
if kind != "tool":
|
|
17
|
+
return (False, "type must be tool, final, or patch")
|
|
18
|
+
tool = str(action.get("tool", "")).strip()
|
|
19
|
+
if not tool:
|
|
20
|
+
return (False, "tool name is required")
|
|
21
|
+
KNOWN_TOOLS = {
|
|
22
|
+
"list_files", "read_file", "write_file", "replace_in_file",
|
|
23
|
+
"bash", "grep_code", "parse_json_file", "http_request",
|
|
24
|
+
"coding_tool", "skill_tool", "macos_admin_task",
|
|
25
|
+
}
|
|
26
|
+
if tool not in KNOWN_TOOLS:
|
|
27
|
+
return (False, f"unknown tool '{tool}' — must be one of: {', '.join(sorted(KNOWN_TOOLS))}")
|
|
28
|
+
required_fields = {
|
|
29
|
+
"list_files": ["path"],
|
|
30
|
+
"read_file": ["path"],
|
|
31
|
+
"write_file": ["path", "content"],
|
|
32
|
+
"replace_in_file": ["path", "old", "new"],
|
|
33
|
+
"bash": ["command"],
|
|
34
|
+
"grep_code": ["pattern", "path"],
|
|
35
|
+
"parse_json_file": ["path"],
|
|
36
|
+
"http_request": ["url"],
|
|
37
|
+
"coding_tool": ["action"],
|
|
38
|
+
"skill_tool": ["skill", "action"],
|
|
39
|
+
"macos_admin_task": ["name"],
|
|
40
|
+
}
|
|
41
|
+
for field in required_fields.get(tool, []):
|
|
42
|
+
if not str(action.get(field, "")).strip():
|
|
43
|
+
return (False, f"{tool}.{field} is required")
|
|
44
|
+
return (True, "")
|