codent 0.3.4__tar.gz → 0.3.5__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.
Files changed (133) hide show
  1. {codent-0.3.4 → codent-0.3.5}/PKG-INFO +1 -1
  2. {codent-0.3.4 → codent-0.3.5}/codent.egg-info/PKG-INFO +1 -1
  3. {codent-0.3.4 → codent-0.3.5}/core/context_utils.py +3 -0
  4. {codent-0.3.4 → codent-0.3.5}/core/init_cmd.py +67 -1
  5. {codent-0.3.4 → codent-0.3.5}/pyproject.toml +1 -1
  6. {codent-0.3.4 → codent-0.3.5}/codent.egg-info/SOURCES.txt +0 -0
  7. {codent-0.3.4 → codent-0.3.5}/codent.egg-info/dependency_links.txt +0 -0
  8. {codent-0.3.4 → codent-0.3.5}/codent.egg-info/entry_points.txt +0 -0
  9. {codent-0.3.4 → codent-0.3.5}/codent.egg-info/requires.txt +0 -0
  10. {codent-0.3.4 → codent-0.3.5}/codent.egg-info/top_level.txt +0 -0
  11. {codent-0.3.4 → codent-0.3.5}/cont.py +0 -0
  12. {codent-0.3.4 → codent-0.3.5}/cont_ui/__init__.py +0 -0
  13. {codent-0.3.4 → codent-0.3.5}/cont_ui/frontend.html +0 -0
  14. {codent-0.3.4 → codent-0.3.5}/cont_ui/server.py +0 -0
  15. {codent-0.3.4 → codent-0.3.5}/cont_watcher.py +0 -0
  16. {codent-0.3.4 → codent-0.3.5}/core/__init__.py +0 -0
  17. {codent-0.3.4 → codent-0.3.5}/core/adaptive_prompt.py +0 -0
  18. {codent-0.3.4 → codent-0.3.5}/core/advanced_overnight.py +0 -0
  19. {codent-0.3.4 → codent-0.3.5}/core/anomaly_tools.py +0 -0
  20. {codent-0.3.4 → codent-0.3.5}/core/app.py +0 -0
  21. {codent-0.3.4 → codent-0.3.5}/core/auto_eval.py +0 -0
  22. {codent-0.3.4 → codent-0.3.5}/core/automations.py +0 -0
  23. {codent-0.3.4 → codent-0.3.5}/core/benchmark.py +0 -0
  24. {codent-0.3.4 → codent-0.3.5}/core/bridge_server.py +0 -0
  25. {codent-0.3.4 → codent-0.3.5}/core/browser.py +0 -0
  26. {codent-0.3.4 → codent-0.3.5}/core/browser_agent.py +0 -0
  27. {codent-0.3.4 → codent-0.3.5}/core/budget_committee.py +0 -0
  28. {codent-0.3.4 → codent-0.3.5}/core/cc_auditor.py +0 -0
  29. {codent-0.3.4 → codent-0.3.5}/core/cleaning_tools.py +0 -0
  30. {codent-0.3.4 → codent-0.3.5}/core/cli.py +0 -0
  31. {codent-0.3.4 → codent-0.3.5}/core/curriculum_runner.py +0 -0
  32. {codent-0.3.4 → codent-0.3.5}/core/daemon.py +0 -0
  33. {codent-0.3.4 → codent-0.3.5}/core/data_tools.py +0 -0
  34. {codent-0.3.4 → codent-0.3.5}/core/decomposer.py +0 -0
  35. {codent-0.3.4 → codent-0.3.5}/core/domain_tools.py +0 -0
  36. {codent-0.3.4 → codent-0.3.5}/core/endpoint_discovery.py +0 -0
  37. {codent-0.3.4 → codent-0.3.5}/core/env_snapshot.py +0 -0
  38. {codent-0.3.4 → codent-0.3.5}/core/episodic.py +0 -0
  39. {codent-0.3.4 → codent-0.3.5}/core/escalation.py +0 -0
  40. {codent-0.3.4 → codent-0.3.5}/core/events.py +0 -0
  41. {codent-0.3.4 → codent-0.3.5}/core/feedback_training.py +0 -0
  42. {codent-0.3.4 → codent-0.3.5}/core/file_context.py +0 -0
  43. {codent-0.3.4 → codent-0.3.5}/core/fitness.py +0 -0
  44. {codent-0.3.4 → codent-0.3.5}/core/formatters.py +0 -0
  45. {codent-0.3.4 → codent-0.3.5}/core/genesis.py +0 -0
  46. {codent-0.3.4 → codent-0.3.5}/core/golden_test_runner.py +0 -0
  47. {codent-0.3.4 → codent-0.3.5}/core/guardian.py +0 -0
  48. {codent-0.3.4 → codent-0.3.5}/core/hive_recall.py +0 -0
  49. {codent-0.3.4 → codent-0.3.5}/core/identity.py +0 -0
  50. {codent-0.3.4 → codent-0.3.5}/core/intent_detection.py +0 -0
  51. {codent-0.3.4 → codent-0.3.5}/core/intent_gate.py +0 -0
  52. {codent-0.3.4 → codent-0.3.5}/core/learning_loop.py +0 -0
  53. {codent-0.3.4 → codent-0.3.5}/core/lmstudio.py +0 -0
  54. {codent-0.3.4 → codent-0.3.5}/core/local_llm.py +0 -0
  55. {codent-0.3.4 → codent-0.3.5}/core/memory_eviction.py +0 -0
  56. {codent-0.3.4 → codent-0.3.5}/core/memory_gate.py +0 -0
  57. {codent-0.3.4 → codent-0.3.5}/core/memory_store.py +0 -0
  58. {codent-0.3.4 → codent-0.3.5}/core/ml_tools.py +0 -0
  59. {codent-0.3.4 → codent-0.3.5}/core/model.py +0 -0
  60. {codent-0.3.4 → codent-0.3.5}/core/model_routing.py +0 -0
  61. {codent-0.3.4 → codent-0.3.5}/core/network_audit.py +0 -0
  62. {codent-0.3.4 → codent-0.3.5}/core/ocr.py +0 -0
  63. {codent-0.3.4 → codent-0.3.5}/core/overfit_test.py +0 -0
  64. {codent-0.3.4 → codent-0.3.5}/core/overnight_training.py +0 -0
  65. {codent-0.3.4 → codent-0.3.5}/core/path_resolution.py +0 -0
  66. {codent-0.3.4 → codent-0.3.5}/core/postprocess.py +0 -0
  67. {codent-0.3.4 → codent-0.3.5}/core/prefetch.py +0 -0
  68. {codent-0.3.4 → codent-0.3.5}/core/prompt_patches.py +0 -0
  69. {codent-0.3.4 → codent-0.3.5}/core/prompts.py +0 -0
  70. {codent-0.3.4 → codent-0.3.5}/core/provider_router.py +0 -0
  71. {codent-0.3.4 → codent-0.3.5}/core/quick_overfit_test.py +0 -0
  72. {codent-0.3.4 → codent-0.3.5}/core/recipe_factory.py +0 -0
  73. {codent-0.3.4 → codent-0.3.5}/core/recipe_feedback.py +0 -0
  74. {codent-0.3.4 → codent-0.3.5}/core/recipe_learner.py +0 -0
  75. {codent-0.3.4 → codent-0.3.5}/core/recipes.py +0 -0
  76. {codent-0.3.4 → codent-0.3.5}/core/relation_discovery.py +0 -0
  77. {codent-0.3.4 → codent-0.3.5}/core/relay.py +0 -0
  78. {codent-0.3.4 → codent-0.3.5}/core/repl.py +0 -0
  79. {codent-0.3.4 → codent-0.3.5}/core/router.py +0 -0
  80. {codent-0.3.4 → codent-0.3.5}/core/rpc.py +0 -0
  81. {codent-0.3.4 → codent-0.3.5}/core/run_logger.py +0 -0
  82. {codent-0.3.4 → codent-0.3.5}/core/runtime.py +0 -0
  83. {codent-0.3.4 → codent-0.3.5}/core/safety.py +0 -0
  84. {codent-0.3.4 → codent-0.3.5}/core/scheduler.py +0 -0
  85. {codent-0.3.4 → codent-0.3.5}/core/scratchpad.py +0 -0
  86. {codent-0.3.4 → codent-0.3.5}/core/self_improve.py +0 -0
  87. {codent-0.3.4 → codent-0.3.5}/core/spreading_activation.py +0 -0
  88. {codent-0.3.4 → codent-0.3.5}/core/sql_guard.py +0 -0
  89. {codent-0.3.4 → codent-0.3.5}/core/sticky_config.py +0 -0
  90. {codent-0.3.4 → codent-0.3.5}/core/structured_output.py +0 -0
  91. {codent-0.3.4 → codent-0.3.5}/core/system_executor.py +0 -0
  92. {codent-0.3.4 → codent-0.3.5}/core/system_map.py +0 -0
  93. {codent-0.3.4 → codent-0.3.5}/core/task_classifier.py +0 -0
  94. {codent-0.3.4 → codent-0.3.5}/core/task_utils.py +0 -0
  95. {codent-0.3.4 → codent-0.3.5}/core/teacher.py +0 -0
  96. {codent-0.3.4 → codent-0.3.5}/core/tool_budget.py +0 -0
  97. {codent-0.3.4 → codent-0.3.5}/core/tool_helpers.py +0 -0
  98. {codent-0.3.4 → codent-0.3.5}/core/tool_schemas.py +0 -0
  99. {codent-0.3.4 → codent-0.3.5}/core/tools.py +0 -0
  100. {codent-0.3.4 → codent-0.3.5}/core/trace.py +0 -0
  101. {codent-0.3.4 → codent-0.3.5}/core/types.py +0 -0
  102. {codent-0.3.4 → codent-0.3.5}/core/utils.py +0 -0
  103. {codent-0.3.4 → codent-0.3.5}/core/verification.py +0 -0
  104. {codent-0.3.4 → codent-0.3.5}/core/verify_minions.py +0 -0
  105. {codent-0.3.4 → codent-0.3.5}/core/vocabulary.py +0 -0
  106. {codent-0.3.4 → codent-0.3.5}/core/voice.py +0 -0
  107. {codent-0.3.4 → codent-0.3.5}/core/web.py +0 -0
  108. {codent-0.3.4 → codent-0.3.5}/core/yis_deep_training.py +0 -0
  109. {codent-0.3.4 → codent-0.3.5}/setup.cfg +0 -0
  110. {codent-0.3.4 → codent-0.3.5}/tests/test_auto_eval.py +0 -0
  111. {codent-0.3.4 → codent-0.3.5}/tests/test_browser.py +0 -0
  112. {codent-0.3.4 → codent-0.3.5}/tests/test_browser_agent.py +0 -0
  113. {codent-0.3.4 → codent-0.3.5}/tests/test_commands_and_teach.py +0 -0
  114. {codent-0.3.4 → codent-0.3.5}/tests/test_cont.py +0 -0
  115. {codent-0.3.4 → codent-0.3.5}/tests/test_corpus_parser.py +0 -0
  116. {codent-0.3.4 → codent-0.3.5}/tests/test_episodic.py +0 -0
  117. {codent-0.3.4 → codent-0.3.5}/tests/test_eviction.py +0 -0
  118. {codent-0.3.4 → codent-0.3.5}/tests/test_formatters.py +0 -0
  119. {codent-0.3.4 → codent-0.3.5}/tests/test_golden.py +0 -0
  120. {codent-0.3.4 → codent-0.3.5}/tests/test_health_report_valid_json.py +0 -0
  121. {codent-0.3.4 → codent-0.3.5}/tests/test_integrity_and_memory_gate.py +0 -0
  122. {codent-0.3.4 → codent-0.3.5}/tests/test_known_bugs.py +0 -0
  123. {codent-0.3.4 → codent-0.3.5}/tests/test_model_agnostic.py +0 -0
  124. {codent-0.3.4 → codent-0.3.5}/tests/test_new_tools.py +0 -0
  125. {codent-0.3.4 → codent-0.3.5}/tests/test_provider_router.py +0 -0
  126. {codent-0.3.4 → codent-0.3.5}/tests/test_recipes.py +0 -0
  127. {codent-0.3.4 → codent-0.3.5}/tests/test_teacher.py +0 -0
  128. {codent-0.3.4 → codent-0.3.5}/tests/test_verification.py +0 -0
  129. {codent-0.3.4 → codent-0.3.5}/tests/test_web_fetch.py +0 -0
  130. {codent-0.3.4 → codent-0.3.5}/vendor/__init__.py +0 -0
  131. {codent-0.3.4 → codent-0.3.5}/vendor/bin/__init__.py +0 -0
  132. {codent-0.3.4 → codent-0.3.5}/vendor/bin/ollama +0 -0
  133. {codent-0.3.4 → codent-0.3.5}/vendor/wheels/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codent
3
- Version: 0.3.4
3
+ Version: 0.3.5
4
4
  Requires-Python: >=3.10
5
5
  Requires-Dist: rich>=13.0
6
6
  Requires-Dist: openai>=1.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codent
3
- Version: 0.3.4
3
+ Version: 0.3.5
4
4
  Requires-Python: >=3.10
5
5
  Requires-Dist: rich>=13.0
6
6
  Requires-Dist: openai>=1.0
@@ -1,3 +1,6 @@
1
+ import os
2
+
3
+ from core.tool_helpers import _classify_llm_error
1
4
 
2
5
 
3
6
  # Additional extractions from runtime.py
@@ -109,13 +109,79 @@ def _model_exists(ollama_bin: str, model_name: str) -> bool:
109
109
  return False
110
110
 
111
111
 
112
+ _QWEN3_CODER_TEMPLATE = '''{{- if .Messages }}
113
+ {{- if or .System .Tools }}<|im_start|>system
114
+ {{- if .System }}
115
+ {{ .System }}
116
+ {{- end }}
117
+ {{- if .Tools }}
118
+
119
+ # Tools
120
+
121
+ You may call one or more functions to assist with the user query.
122
+
123
+ You are provided with function signatures within <tools></tools> XML tags:
124
+ <tools>
125
+ {{- range .Tools }}
126
+ {"type": "function", "function": {{ .Function }}}
127
+ {{- end }}
128
+ </tools>
129
+
130
+ For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
131
+ <tool_call>
132
+ {"name": <function-name>, "arguments": <args-json-object>}
133
+ </tool_call>
134
+ {{- end }}<|im_end|>
135
+ {{ end }}
136
+ {{- range $i, $_ := .Messages }}
137
+ {{- $last := eq (len (slice $.Messages $i)) 1 -}}
138
+ {{- if eq .Role "user" }}<|im_start|>user
139
+ {{ .Content }}<|im_end|>
140
+ {{ else if eq .Role "assistant" }}<|im_start|>assistant
141
+ {{ if .Content }}{{ .Content }}
142
+ {{- else if .ToolCalls }}<tool_call>
143
+ {{ range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
144
+ {{ end }}</tool_call>
145
+ {{- end }}{{ if not $last }}<|im_end|>
146
+ {{ end }}
147
+ {{- else if eq .Role "tool" }}<|im_start|>user
148
+ <tool_response>
149
+ {{ .Content }}
150
+ </tool_response><|im_end|>
151
+ {{ end }}
152
+ {{- if and (ne .Role "assistant") $last }}<|im_start|>assistant
153
+ {{ end }}
154
+ {{- end }}
155
+ {{- else }}
156
+ {{- if .System }}<|im_start|>system
157
+ {{ .System }}<|im_end|>
158
+ {{ end }}{{ if .Prompt }}<|im_start|>user
159
+ {{ .Prompt }}<|im_end|>
160
+ {{ end }}<|im_start|>assistant
161
+ {{ end }}{{ .Response }}{{ if .Response }}<|im_end|>{{ end }}'''
162
+
163
+
164
+ def _build_modelfile(gguf_path: Path) -> str:
165
+ """Qwen3-Coder tool-calling template + parameters."""
166
+ return (
167
+ f"FROM {gguf_path}\n\n"
168
+ f'TEMPLATE """{_QWEN3_CODER_TEMPLATE}"""\n\n'
169
+ 'PARAMETER num_ctx 10000\n'
170
+ 'PARAMETER temperature 0.1\n'
171
+ 'PARAMETER stop "<|im_start|>"\n'
172
+ 'PARAMETER stop "<|im_end|>"\n'
173
+ 'PARAMETER stop "<|endoftext|>"\n\n'
174
+ 'SYSTEM """You are a helpful coding assistant."""\n'
175
+ )
176
+
177
+
112
178
  def _create_model_from_gguf(ollama_bin: str, gguf_path: Path,
113
179
  model_name: str = "cont-local") -> bool:
114
180
  """Generate Modelfile + run `ollama create`."""
115
181
  print(f"[*] {model_name} modeli {gguf_path.name} GGUF'undan oluşturuluyor...")
116
182
  modelfile = Path.home() / ".cache" / "cont" / "Modelfile.cont"
117
183
  modelfile.parent.mkdir(parents=True, exist_ok=True)
118
- modelfile.write_text(f"FROM {gguf_path}\n", encoding="utf-8")
184
+ modelfile.write_text(_build_modelfile(gguf_path), encoding="utf-8")
119
185
 
120
186
  try:
121
187
  subprocess.run(
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "codent"
7
- version = "0.3.4"
7
+ version = "0.3.5"
8
8
  requires-python = ">=3.10"
9
9
  dependencies = [
10
10
  "rich>=13.0",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes