This repository has no description
4.4 kB
171 lines
1{
2 lib,
3 fetchPypi,
4 python313Packages,
5}:
6let
7 py = python313Packages;
8
9 # omnigent-client declares `omnigent` as a dependency, and omnigent declares
10 # omnigent-client: the two are released in lockstep from the same repo. Break
11 # the cycle by dropping the back-reference here; the final application below
12 # provides `omnigent` itself.
13 omnigent-client = py.buildPythonPackage rec {
14 pname = "omnigent_client";
15 version = "0.9.0";
16 format = "wheel";
17
18 src = fetchPypi {
19 inherit pname version format;
20 dist = "py3";
21 python = "py3";
22 hash = "sha256-NUF16ZzZkVzohOKznfAPVTT1LI09dXP6gZxlWZzmyrM=";
23 };
24
25 pythonRemoveDeps = [ "omnigent" ];
26
27 dependencies = [
28 py.httpx
29 py.pydantic
30 ];
31
32 # No pythonImportsCheck: every module imports `omnigent`, which only exists
33 # in the application closure below.
34 doCheck = false;
35
36 meta = {
37 description = "Python client library for the Omnigent server API";
38 homepage = "https://omnigent.ai";
39 license = lib.licenses.asl20;
40 };
41 };
42
43 omnigent-ui-sdk = py.buildPythonPackage rec {
44 pname = "omnigent_ui_sdk";
45 version = "0.9.0";
46 format = "wheel";
47
48 src = fetchPypi {
49 inherit pname version format;
50 dist = "py3";
51 python = "py3";
52 hash = "sha256-xr5rtx2Ac/q8GShkeQudzbKDoLGe5d+Jp7XCiXzU7lQ=";
53 };
54
55 dependencies = [
56 omnigent-client
57 py.prompt-toolkit
58 py.pyyaml
59 py.rich
60 ];
61
62 doCheck = false;
63
64 meta = {
65 description = "Terminal UI SDK for Omnigent";
66 homepage = "https://omnigent.ai";
67 license = lib.licenses.asl20;
68 };
69 };
70in
71py.buildPythonApplication rec {
72 pname = "omnigent";
73 version = "0.9.0";
74 format = "wheel";
75
76 # The published wheel ships the prebuilt web SPA under
77 # omnigent/server/static/web-ui; the sdist does not.
78 src = fetchPypi {
79 inherit pname version format;
80 dist = "py3";
81 python = "py3";
82 hash = "sha256-deNx9SHyaf1ZNkq5+88c1fUieFZastIo8N27Ixy0F1Q=";
83 };
84
85 # Upper bounds that nixpkgs has already moved past. All of these are
86 # conservative caps in omnigent's pyproject, not known incompatibilities.
87 pythonRelaxDeps = [
88 "argon2-cffi" # nixpkgs 25.1.0 vs <24
89 "cachetools" # nixpkgs 7.1.4 vs <7
90 "packaging" # nixpkgs 26.2 vs <26
91 "protobuf" # nixpkgs 7.35.1 vs <7
92 "rich" # nixpkgs 15.0.0 vs <15
93 "websockets" # nixpkgs 16.1 vs <15
94 ];
95
96 dependencies = [
97 omnigent-client
98 omnigent-ui-sdk
99 ]
100 ++ (with py; [
101 alembic
102 anyio
103 argon2-cffi
104 cachetools
105 cel-python
106 certifi
107 claude-agent-sdk
108 click
109 fastapi
110 ftfy
111 httpx
112 json5
113 keyring
114 mcp
115 openai
116 openai-agents
117 opentelemetry-exporter-otlp-proto-grpc
118 opentelemetry-exporter-otlp-proto-http
119 opentelemetry-instrumentation-fastapi
120 opentelemetry-instrumentation-httpx
121 opentelemetry-instrumentation-sqlalchemy
122 packaging
123 pexpect
124 prompt-toolkit
125 protobuf
126 psutil
127 pydantic
128 pyjwt
129 pyte
130 python-dateutil
131 pyyaml
132 rich
133 sqlalchemy
134 starlette
135 tiktoken
136 tomlkit
137 uvicorn
138 websockets
139 zstandard
140 ])
141 ++ py.pyjwt.optional-dependencies.crypto
142 ++ py.uvicorn.optional-dependencies.standard;
143
144 # The CLI respawns itself as `sys.executable -m omnigent.host._daemon_entry`
145 # (cli.py:2945) for the host daemon, and the daemon spawns runners the same
146 # way. That is the *bare* interpreter, without the site-dirs that
147 # wrapPythonPrograms bakes into the console script, so those children die
148 # with ModuleNotFoundError: No module named 'omnigent' and every session hangs
149 # on "the connect daemon did not come online within 30s". Hand them the
150 # transitive dependency closure through PYTHONPATH, which omnigent's own
151 # daemon/runner env allowlist preserves (host/connect.py) while the agent
152 # spawn allowlist drops it (inner/agent_env.py), so it never reaches omp.
153 postFixup = ''
154 buildPythonPath "$out $pythonPath"
155 wrapProgram $out/bin/omnigent --prefix PYTHONPATH : "$program_PYTHONPATH"
156 '';
157
158 pythonImportsCheck = [
159 "omnigent"
160 "omnigent_client"
161 "omnigent_ui_sdk"
162 ];
163
164 meta = {
165 description = "Open-source meta-harness giving a common orchestration layer over AI coding agents";
166 homepage = "https://omnigent.ai";
167 license = lib.licenses.asl20;
168 mainProgram = "omnigent";
169 platforms = lib.platforms.unix;
170 };
171}