omni-coder 0.5.9__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Hanlin Chen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,175 @@
1
+ Metadata-Version: 2.4
2
+ Name: omni-coder
3
+ Version: 0.5.9
4
+ Summary: AI coding agent driving Qwen Coder (or any Ollama-compatible model) through a scoped toolset via MCP
5
+ License-Expression: MIT
6
+ Project-URL: Homepage, https://github.com/HarryChen1995/omni-coder
7
+ Project-URL: Repository, https://github.com/HarryChen1995/omni-coder
8
+ Project-URL: Issues, https://github.com/HarryChen1995/omni-coder/issues
9
+ Classifier: Environment :: Console
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Topic :: Software Development :: Build Tools
13
+ Requires-Python: >=3.10
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: httpx>=0.28
17
+ Requires-Dist: rich>=15.0
18
+ Requires-Dist: typer>=0.27
19
+ Requires-Dist: mcp>=1.27
20
+ Requires-Dist: prompt_toolkit>=3.0
21
+ Provides-Extra: local-embeddings
22
+ Requires-Dist: nomic[local]; extra == "local-embeddings"
23
+ Dynamic: license-file
24
+
25
+ # Omni Coder
26
+
27
+ An AI coding agent that plans, edits, and tests code by driving Qwen Coder
28
+ (or any Ollama-compatible model) through a scoped set of file and shell
29
+ tools, with human approval on every write, edit, or shell command.
30
+
31
+ ## Install
32
+
33
+ ```bash
34
+ pip install omni-coder
35
+ ollama pull qwen3-coder:30b
36
+ ```
37
+
38
+ ## Usage
39
+
40
+ ```bash
41
+ omni "Add type hints to utils.py, then run the test suite" \
42
+ --project-root ./myrepo
43
+ ```
44
+
45
+ Equivalent: `python -m omni "..." --project-root ./myrepo`.
46
+
47
+ Omit the task string to enter an interactive session instead:
48
+
49
+ ```bash
50
+ omni --project-root ./myrepo
51
+ ```
52
+
53
+ Run `omni --help` for the full option list.
54
+
55
+ ## Features
56
+
57
+ - **Structured intent parsing** — the raw task is classified (bug fix,
58
+ feature, refactor, risk level, target files) before any action is taken,
59
+ and high-risk tasks force human approval even under `--auto-approve`.
60
+ - **Session persistence** — every message is saved to SQLite as the run
61
+ happens. Resume a previous run by id or a name you gave it
62
+ (`--resume`), browse saved sessions (`--list-sessions`), or delete one
63
+ (`--delete-session`).
64
+ - **Interactive mode** — drop into a REPL that keeps the model connection
65
+ and tool session alive across turns. Ctrl-C during a running turn cancels
66
+ just that turn instead of killing the session — you land back at the
67
+ prompt and can keep going.
68
+ - **Human-in-the-loop approval** — every write, edit, or shell command
69
+ shows a diff or command preview before you confirm (diffs render with
70
+ line numbers and red/green highlighting), unless explicitly marked safe
71
+ or run with `--auto-approve`.
72
+ - **Retry and recovery** — transient model failures retry with backoff;
73
+ malformed tool-call output is caught and reported back to the model
74
+ instead of crashing the run.
75
+ - **Codebase exploration tools** — regex content search with glob
76
+ filtering, pattern-based file discovery, directory listing, and a full
77
+ git toolset (status/log/diff/show/branch/fetch read-only; add/commit/
78
+ pull/push approval-gated), all skipping noise directories (`.git`,
79
+ `node_modules`, build output).
80
+ - **Persistent project memory** — the agent can save durable notes (a
81
+ `save_memory` tool call) to a per-project `agent_memory.md`, auto-loaded
82
+ into the system prompt at the start of every new session.
83
+ - **Extensible via custom MCP servers** — point at any MCP server, local
84
+ (stdio) or remote (SSE / Streamable HTTP), and its tools merge into the
85
+ model's toolset automatically, no code changes required. Register one
86
+ permanently (`--add-mcp-server`, available on every future run) or add
87
+ one per run (`--mcp-server`/`--mcp-config`).
88
+ - **Deferred tool loading + semantic search_tools** — register a custom MCP
89
+ server with `--defer` and its tools stay out of the model's context until
90
+ a synthesized `search_tools` tool loads matching ones on demand, ranked by
91
+ on-device embeddings (`nomic-local`, default) or an Ollama-hosted
92
+ embedding model, with automatic keyword-match fallback.
93
+
94
+ ## Architecture
95
+
96
+ Tools are served over the Model Context Protocol (MCP), not called
97
+ in-process — the agent is an MCP *client* that talks to a tool server over
98
+ stdio:
99
+
100
+ ```
101
+ +-----------------------------+
102
+ | CLI / REPL |
103
+ +-----------------------------+
104
+ |
105
+ v
106
+ +-----------------------------+
107
+ | Agent loop |
108
+ | parse intent, call model, |
109
+ | approve, execute, persist |
110
+ +-----------------------------+
111
+ |
112
+ v
113
+ +-----------------------------+
114
+ | MCP client |
115
+ | built-in + custom servers |
116
+ | merged into one tool list. |
117
+ | "defer"-registered servers |
118
+ | hold tools back for on- |
119
+ | demand search_tools lookup |
120
+ +-----------------------------+
121
+ |
122
+ stdio / SSE / streamable-http
123
+ v
124
+ +-----------------------------+
125
+ | MCP server(s) |
126
+ +-----------------------------+
127
+ |
128
+ v
129
+ +-----------------------------+
130
+ | Tools |
131
+ | read / write / edit / |
132
+ | search / shell |
133
+ +-----------------------------+
134
+ ```
135
+
136
+ Because tools are exposed over MCP, any MCP-compatible client — Claude
137
+ Desktop, another agent framework, a different model entirely — can reach
138
+ the exact same toolset, approval-preview logic, and path scoping. The
139
+ reverse also holds: any additional MCP server — local (stdio) or remote
140
+ (SSE / Streamable HTTP) — can be plugged into this agent, and its tools
141
+ merge into the same list the model already sees —
142
+ ```bash
143
+ omni --add-mcp-server "weather=python -m weather_mcp_server" # local, stdio
144
+ omni --add-mcp-server "weather=https://example.com/mcp/sse" # remote, SSE
145
+ omni "what's the forecast?" # picked up automatically, every run from here on
146
+ ```
147
+ A value after `name=` starting with `http://`/`https://` is treated as a
148
+ remote server (SSE by default, append `,streamable_http` for that transport
149
+ instead); anything else is a local command spawned over stdio — it doesn't
150
+ need to be `-m`-invokable, a standalone script's absolute path works too
151
+ (e.g. `"myserver=python C:/absolute/path/to/mcp_server.py"`).
152
+
153
+ Append `,defer` (or pass `--defer` with `--add-mcp-server`) to keep a
154
+ server's tools out of the model's default tool list — it discovers them on
155
+ demand via `search_tools`, ranked semantically by default
156
+ (`pip install "omni-coder[local-embeddings]"` for on-device
157
+ embeddings, or point `--embedding-model` at an Ollama-hosted one instead;
158
+ `--embedding-model ""` falls back to plain keyword matching). See the full
159
+ README for details.
160
+
161
+ ## Configuration
162
+
163
+ Point at any Ollama-compatible host with `--ollama-host` or the
164
+ `OLLAMA_HOST` env var. If it sits behind an authenticated proxy, set
165
+ `OLLAMA_API_KEY` as an environment variable rather than a CLI flag so the
166
+ key doesn't end up in shell history.
167
+
168
+ ## Links
169
+
170
+ Source, full documentation, and issue tracker:
171
+ https://github.com/HarryChen1995/omni-coder
172
+
173
+ ## License
174
+
175
+ MIT
@@ -0,0 +1,151 @@
1
+ # Omni Coder
2
+
3
+ An AI coding agent that plans, edits, and tests code by driving Qwen Coder
4
+ (or any Ollama-compatible model) through a scoped set of file and shell
5
+ tools, with human approval on every write, edit, or shell command.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pip install omni-coder
11
+ ollama pull qwen3-coder:30b
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ ```bash
17
+ omni "Add type hints to utils.py, then run the test suite" \
18
+ --project-root ./myrepo
19
+ ```
20
+
21
+ Equivalent: `python -m omni "..." --project-root ./myrepo`.
22
+
23
+ Omit the task string to enter an interactive session instead:
24
+
25
+ ```bash
26
+ omni --project-root ./myrepo
27
+ ```
28
+
29
+ Run `omni --help` for the full option list.
30
+
31
+ ## Features
32
+
33
+ - **Structured intent parsing** — the raw task is classified (bug fix,
34
+ feature, refactor, risk level, target files) before any action is taken,
35
+ and high-risk tasks force human approval even under `--auto-approve`.
36
+ - **Session persistence** — every message is saved to SQLite as the run
37
+ happens. Resume a previous run by id or a name you gave it
38
+ (`--resume`), browse saved sessions (`--list-sessions`), or delete one
39
+ (`--delete-session`).
40
+ - **Interactive mode** — drop into a REPL that keeps the model connection
41
+ and tool session alive across turns. Ctrl-C during a running turn cancels
42
+ just that turn instead of killing the session — you land back at the
43
+ prompt and can keep going.
44
+ - **Human-in-the-loop approval** — every write, edit, or shell command
45
+ shows a diff or command preview before you confirm (diffs render with
46
+ line numbers and red/green highlighting), unless explicitly marked safe
47
+ or run with `--auto-approve`.
48
+ - **Retry and recovery** — transient model failures retry with backoff;
49
+ malformed tool-call output is caught and reported back to the model
50
+ instead of crashing the run.
51
+ - **Codebase exploration tools** — regex content search with glob
52
+ filtering, pattern-based file discovery, directory listing, and a full
53
+ git toolset (status/log/diff/show/branch/fetch read-only; add/commit/
54
+ pull/push approval-gated), all skipping noise directories (`.git`,
55
+ `node_modules`, build output).
56
+ - **Persistent project memory** — the agent can save durable notes (a
57
+ `save_memory` tool call) to a per-project `agent_memory.md`, auto-loaded
58
+ into the system prompt at the start of every new session.
59
+ - **Extensible via custom MCP servers** — point at any MCP server, local
60
+ (stdio) or remote (SSE / Streamable HTTP), and its tools merge into the
61
+ model's toolset automatically, no code changes required. Register one
62
+ permanently (`--add-mcp-server`, available on every future run) or add
63
+ one per run (`--mcp-server`/`--mcp-config`).
64
+ - **Deferred tool loading + semantic search_tools** — register a custom MCP
65
+ server with `--defer` and its tools stay out of the model's context until
66
+ a synthesized `search_tools` tool loads matching ones on demand, ranked by
67
+ on-device embeddings (`nomic-local`, default) or an Ollama-hosted
68
+ embedding model, with automatic keyword-match fallback.
69
+
70
+ ## Architecture
71
+
72
+ Tools are served over the Model Context Protocol (MCP), not called
73
+ in-process — the agent is an MCP *client* that talks to a tool server over
74
+ stdio:
75
+
76
+ ```
77
+ +-----------------------------+
78
+ | CLI / REPL |
79
+ +-----------------------------+
80
+ |
81
+ v
82
+ +-----------------------------+
83
+ | Agent loop |
84
+ | parse intent, call model, |
85
+ | approve, execute, persist |
86
+ +-----------------------------+
87
+ |
88
+ v
89
+ +-----------------------------+
90
+ | MCP client |
91
+ | built-in + custom servers |
92
+ | merged into one tool list. |
93
+ | "defer"-registered servers |
94
+ | hold tools back for on- |
95
+ | demand search_tools lookup |
96
+ +-----------------------------+
97
+ |
98
+ stdio / SSE / streamable-http
99
+ v
100
+ +-----------------------------+
101
+ | MCP server(s) |
102
+ +-----------------------------+
103
+ |
104
+ v
105
+ +-----------------------------+
106
+ | Tools |
107
+ | read / write / edit / |
108
+ | search / shell |
109
+ +-----------------------------+
110
+ ```
111
+
112
+ Because tools are exposed over MCP, any MCP-compatible client — Claude
113
+ Desktop, another agent framework, a different model entirely — can reach
114
+ the exact same toolset, approval-preview logic, and path scoping. The
115
+ reverse also holds: any additional MCP server — local (stdio) or remote
116
+ (SSE / Streamable HTTP) — can be plugged into this agent, and its tools
117
+ merge into the same list the model already sees —
118
+ ```bash
119
+ omni --add-mcp-server "weather=python -m weather_mcp_server" # local, stdio
120
+ omni --add-mcp-server "weather=https://example.com/mcp/sse" # remote, SSE
121
+ omni "what's the forecast?" # picked up automatically, every run from here on
122
+ ```
123
+ A value after `name=` starting with `http://`/`https://` is treated as a
124
+ remote server (SSE by default, append `,streamable_http` for that transport
125
+ instead); anything else is a local command spawned over stdio — it doesn't
126
+ need to be `-m`-invokable, a standalone script's absolute path works too
127
+ (e.g. `"myserver=python C:/absolute/path/to/mcp_server.py"`).
128
+
129
+ Append `,defer` (or pass `--defer` with `--add-mcp-server`) to keep a
130
+ server's tools out of the model's default tool list — it discovers them on
131
+ demand via `search_tools`, ranked semantically by default
132
+ (`pip install "omni-coder[local-embeddings]"` for on-device
133
+ embeddings, or point `--embedding-model` at an Ollama-hosted one instead;
134
+ `--embedding-model ""` falls back to plain keyword matching). See the full
135
+ README for details.
136
+
137
+ ## Configuration
138
+
139
+ Point at any Ollama-compatible host with `--ollama-host` or the
140
+ `OLLAMA_HOST` env var. If it sits behind an authenticated proxy, set
141
+ `OLLAMA_API_KEY` as an environment variable rather than a CLI flag so the
142
+ key doesn't end up in shell history.
143
+
144
+ ## Links
145
+
146
+ Source, full documentation, and issue tracker:
147
+ https://github.com/HarryChen1995/omni-coder
148
+
149
+ ## License
150
+
151
+ MIT