Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
278 lines (267 loc) · 14.1 KB
/
Copy pathpyproject.toml
File metadata and controls
278 lines (267 loc) · 14.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
[project]
name = "cowork-server"
dynamic = ["version"]
description = "FastAPI backend for the MindsHub Cowork desktop app"
readme = "README.md"
license = "AGPL-3.0-only"
requires-python = ">=3.12,<3.14"
authors = [
{ name = "MindsDB Inc", email = "admin@mindsdb.com" },
]
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Framework :: FastAPI",
"Operating System :: OS Independent",
]
dependencies = [
# Discord Gateway and Slack Socket Mode ingress import it at runtime, and
# the server image installs no extras, so it cannot live only in `channels`.
"aiohttp>=3.14",
"alembic>=1.17.0",
# First release that re-sends the previous password hash
# (`previous_access`) and raises `ArtifactOwnedByOtherUserError`.
# PyPI-channel desktop installs resolve anton from this floor, not from the
# lockfile. Releases before 2.26.10.4.1 also write DS_* scrub state into
# this process's environment, shared by every org on the server.
# 2.26.10.14.1 is the first with `StreamTurnEnded`, which the formatter and
# producer import unguarded.
# 2.26.10.19.1 is the first stable release with the agent-code sandbox, the
# deployment identity and the managed memory layer, which create_app
# requires on a self-hosted stack, and with the write-approval gate, which
# it requires when ANTON_WRITE_APPROVAL is on. It is also the first that
# registers `read_text_file` (mindsdb/anton#545), which the agent prompt in
# `harnesses/anton_harness/harness.py` names, and the first with the file
# tools' read boundary (mindsdb/anton#598). No anton the server can start
# with reaches the version-skew fallbacks in `services/providers.py` (the
# `api_key_provider` capability gate) or `handlers/turn_errors.py`
# (`is_auth_error`'s untyped 401): what they stand in for predates the
# `anton.core.artifacts.internal_files` constants it imports at startup.
# 2.26.10.21.1 is the first that exports `scratchpad_action`, which the
# connector probe imports, and the first that runs a scratchpad call left
# without `action` and names `exec` on its streamed result, which the cell
# replay reads.
# 2.26.10.22.1rc2 is the first with `anton.core.artifacts.live_app_slots`
# (mindsdb/anton#620), which live apps hand their launches to and the
# live-app tests import.
# 2.26.10.25.1rc1 is the first with `skills_artifact_roots`
# (mindsdb/anton#630), which every in-process turn sets.
# 2.26.10.26.1 is the first that keeps a compacted cell's error flag
# (mindsdb/anton#613), which the replayed write check reads.
# 2.26.10.29.1rc4 is the first whose `LiveAppHost` has `launch_lock`,
# `slots_full` and `slots_available` (mindsdb/anton#646), which shared
# live-app slots admit each person's launch through.
# 2.26.11.9.1 is the first final release that carries all of the above.
# 2.26.11.15.1 is the first final release with the asynchronous publish
# job (`PUBLISH_JOB_BUDGET_S`, `PublishJobFailed`, `PublishJobTimeout`,
# mindsdb/anton#481), which publishing imports unguarded. It also carries
# Notion's MCP server URL and `McpTokenRejected` (mindsdb/anton#549, first
# in 2.26.11.12.1rc4), which the Notion connector reads.
# 2.26.11.18.1rc1 is the first with custom MCP servers' URL check, guarded
# sessions and `list_custom_server_tools` (mindsdb/anton#814), which the
# custom MCP routes import.
# 2.26.11.19.1rc3 is the first with Slack's MCP server and tool access
# tiers (mindsdb/anton#820), which Slack's In-Browser Connect needs.
# 2.26.11.20.1rc3 tags the budget-refusal link with from=budget_denial
# (mindsdb/anton#819), so the console counts those visits.
# 2.26.11.22.1rc1 asks Jev on the MindsHub the person is signed in to, not
# only api.mindshub.ai (mindsdb/anton#837), so the artifact bar edits
# directly on staging too (quickEditDirect).
# Desktop installs the anton this lock names, so a production release
# names a final anton, never a release candidate.
"anton-agent>=2.26.11.29.1,<3",
# Floor for GHSA-8bx3-mgpq-m8m9 (IDNA 2003 vs IDNA 2009 host-name encoding
# mismatch in TLSStream/connect_tcp() lets a hijacked connection to an
# internationalized domain present a certificate that validates against
# the IDNA-2003 encoding while the client meant the IDNA-2009 one).
# Transitive via fastapi/anton-agent/httpx, none of which pin it
# themselves, so it floats to whatever the resolver picks without this.
"anyio>=4.14.2",
# Intel macOS is capped <49 and nothing else is. cryptography 48.0.1 ships
# `macosx_10_9_universal2`; from 49.0.0 the only macOS wheel is
# `macosx_11_0_arm64`, so on x86_64 Macs an unbounded floor resolves to an
# sdist and uv tries to COMPILE it (Rust + OpenSSL). The PyPI install
# channel deliberately ships no Xcode Command Line Tools step, so that
# build fails and the desktop app dead-ends at "Install cowork-server".
#
# READ THIS BEFORE BUMPING IT. The cap has a real security cost and is a
# deliberate trade, not an oversight. 48.x is a FINISHED line: 48.0.1
# shipped 2026-06-09 and 49.0.0 three days later, so nothing further will
# be backported to it.
#
# THREE open advisories apply to 48.0.1, all fixed only in 49.0.0 or later:
# - GHSA-g6cj-pr64-35w5 (HIGH) PKCS#7 EnvelopedData decryption
# Bleichenbacher oracle. Fixed 50.0.0.
# - GHSA-jwv3-5hgf-82ww (HIGH) X.509 path building, exponential blowup
# on duplicate self-signed intermediates.
# - GHSA-m2h6-j472-rp4c (MODERATE) X.509 verifier accepts wildcard DNS
# names, escaping permittedSubtrees.
#
# Do not be misled by GitHub's advisory API on the latter two: their
# `vulnerable_version_range` ends at `<= 48.0.0`, which reads as though
# 48.0.1 were clear, while `first_patched_version` says 49.0.0. The range
# is stale, and two independent checks settle it. The 48.0.1 changelog has
# exactly ONE entry — "Updated Windows, macOS, and Linux wheels to be
# compiled with OpenSSL 4.0.1" — which is GHSA-537c-gmf6-5ccf and nothing
# else, and a wheel rebuild cannot carry code fixes for cryptography's own
# Rust X.509 verifier. That same 537c advisory is the control showing the
# database does record genuine 48.0.1 backports when they exist
# (`< 48.0.1`, `first_patched_version: 48.0.1`). OSV agrees: it matches all
# three against 48.0.1 and correctly drops 537c.
#
# Reachability from THIS package is low for all three. Our own use of
# cryptography is Fernet (common/encryption.py, services/settings.py) and
# Ed25519 signature verification (channels/plugins/discord.py); we never
# decrypt PKCS#7 EnvelopedData and never drive the X.509 path builder.
# Not audited: transitive use. pyhanko is the notable cryptography consumer
# here and the X.509 pair is the half with any bearing on it, so that is
# where to look first if this is ever revisited.
#
# Weighed against an install that cannot complete at all on the affected
# hardware, the cap wins — but it is three open advisories, not a free
# trade. Re-check that reachability before assuming
# it still holds, and do not simply raise the ceiling because a scanner
# flagged it. Upstream is not restoring the wheel, so the only real exits
# are dropping Intel macOS support or `--no-build` at the install site
# (ENG-1629 item 1).
#
# Scoped by marker rather than capped globally so the cost lands only on
# the platform that forces it: a blanket <49 would freeze Apple Silicon,
# Windows and Linux on 48.0.1 too and carry all three advisories
# fleet-wide, for nothing.
#
# Enforced by the `wheels-available` CI gate — a bump that deletes the
# marker turns that job red. ENG-2864 (regression of #320), ENG-1629.
"cryptography>=48.0.0,<51",
"cryptography<49; sys_platform == 'darwin' and platform_machine == 'x86_64'",
"fastapi>=0.136.1",
# The http2 extra (h2) is for APNs, which only speaks HTTP/2
# (cowork/services/push/apns.py).
"httpx[http2]>=0.27",
# Structured app-server integration with a pinned, bundled Codex runtime;
# users do not need to install a separate CLI.
"openai-codex==0.147.0",
"pydantic>=2.12.5",
# Floor for GHSA-c8vh-cgw2-cfmc (NestedSecretsSettingsSource followed
# symlinked directories inside secrets_dir out to their target and
# skipped them in the secrets_dir_max_size accounting, an out-of-tree
# read + size-cap bypass on secrets_nested_subdir=True). We don't use
# that source (no secrets_dir/secrets_nested_subdir anywhere in this
# repo), but the fix costs nothing.
"pydantic-settings>=2.14.2",
"python-dotenv>=1.2.2",
# Used to terminate the complete coding-agent subprocess tree on both
# macOS and Windows; killing only the app-server can orphan commands.
"psutil>=7.0",
"psycopg[binary]>=3.2",
# psycopg 3 is what the code targets, but the hosted DB URIs come from the
# shared mindsdb DB stack, which mints every service's URI as bare
# `postgresql://`. SQLAlchemy maps that scheme to the psycopg2 dialect, so
# the driver has to be present or `db-migrate` dies on import.
"psycopg2-binary>=2.9",
"redis>=5.3.1,<6",
# Org-controlled channel-binding trigger patterns (channel_bindings.py)
# are matched against every inbound message at runtime (channels/runtime.py).
# stdlib `re` has no backtracking bound, so a syntactically-valid but
# pathological pattern (e.g. "(a+)+$") plus an adversarial message is a
# ReDoS. re2 uses a linear-time automaton instead of backtracking, so no
# pattern can hang a match — no timeout needed, unlike `re`/`regex`. Not
# syntax-compatible with `re`: no backreferences, no lookahead/lookbehind.
"google-re2>=1.1",
"python-multipart>=0.0.28",
"sqlmodel>=0.0.38",
"tzlocal>=5.0",
"uvicorn>=0.47.0",
# Document libraries, for export and for agent code cells. Pins are exact
# so that a new upstream release can't change what export or an agent
# cell does without review. They match the reviewed runtime export,
# cowork/release-requirements.txt; to move one, change it here, relock and
# regenerate that file with scripts/release_contract.py.
#
# Export: Markdown rendering, the fetch-free HTML inliner (lxml parses,
# tinycss2 rewrites CSS) and the Word writer.
"markdown==3.11.2",
# A doc's page and PDF highlight code blocks (cowork/docs/highlight.py).
"pygments==2.20.0",
"python-docx==1.2.0",
"lxml==6.1.3",
"tinycss2==1.5.1",
# A release with the Pillow security fixes. reportlab, xhtml2pdf and
# svglib pull it in with floors that still allow older releases.
"pillow==13.0.0",
# Agent code cells use these: the built-in pdf skill
# (cowork/skills_builtin/pdf/SKILL.md) imports pypdf and reportlab, and
# anton's prompt names BeautifulSoup. The PDF export client also counts a
# render service's pages with pypdf. Declared directly so they stay
# installed whatever another package's dependencies become.
"pypdf==6.21.4",
"reportlab==5.0.1",
"beautifulsoup4==4.15.0",
# Kept for agent code cells that render PDFs with it. cowork/ never
# imports it, because it fetches what the HTML names, and
# tests/test_no_subprocess_static.py bans it there.
"xhtml2pdf==0.2.26",
# Floor for the PyJWT security fixes; redis and mcp (via anton-agent) pull
# it in transitively with lower bounds that still allow 2.13.
"pyjwt>=2.15.0",
"structlog==26.1.0",
# Teams channel (cowork/channels/teams_client.py). Linux only: Teams runs
# only on a server Cowork, so desktop installs don't need them. A main
# dependency rather than an extra because the server image installs none.
"microsoft-teams-api>=2.1.1; sys_platform == 'linux'",
"msal>=1.37.0; sys_platform == 'linux'",
]
[project.urls]
Homepage = "https://github.com/mindsdb/cowork-server"
Repository = "https://github.com/mindsdb/cowork-server"
Issues = "https://github.com/mindsdb/cowork-server/issues"
[project.scripts]
cowork-server = "cowork.cli:main"
cowork-dev-setup = "cowork.cli:dev_setup_main"
cowork-code-runtime = "cowork.coding.runtime_worker:main"
[project.optional-dependencies]
channels = [
"slack-sdk>=3.27.0",
"aiohttp>=3.9.0",
"discord.py>=2.3.0",
]
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "vcs"
fallback-version = "0.0.0-dev"
[tool.hatch.build.targets.wheel]
packages = ["cowork"]
# pdf.js, put there by hatch_build.py and ignored by git.
artifacts = ["cowork/services/pdf_viewer/pdfjs/"]
[tool.hatch.build.targets.wheel.hooks.custom]
[tool.uv]
# uv reinstalls the editable project, and so reruns hatch_build.py, only when
# a cache key changes; the pdf.js pin lives in fetch_pdfjs.py.
cache-keys = [{ file = "pyproject.toml" }, { file = "cowork/services/pdf_viewer/fetch_pdfjs.py" }]
[tool.cowork.release.allow-prerelease]
# The exact pre-releases a production release may still name, in the lock and
# in the bounds above. `scripts/release_contract.py --require-final` refuses
# every other one, a newer candidate of the same project included. The anton
# relock (`scripts/anton_final_lock_pr.py`) removes anton-agent's entry when it
# locks anton's final.
[dependency-groups]
dev = [
"alembic>=1.18.4",
"fakeredis>=2.37.0",
"pytest>=9.0.3",
"pytest-asyncio>=0.25.0",
"pytest-cov>=7.1.0",
"pytest-xdist>=3.8.0",
]
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
markers = [
"integration: needs a real Redis; skips itself when none is reachable",
"postdeploy: runs against a deployed cowork-server; skips unless COWORK_BASE_URL is set",
"production_read_only: GET-only smoke selected by the production nightly",
"redis_service: needs a Redis at COWORK_TEST_REDIS_URL; runs in make test/services",
"postgres_service: needs a disposable PostgreSQL at COWORK_TEST_POSTGRES_URI; runs in make test/services",
]