Skip to content

Commit b677cec

Browse files
authored
Merge pull request #10 from deeleeramone/claude/goofy-diffie
Refactor Chat to ACP-Native Subpackage with Deep Agents Provider
2 parents 5647e15 + 8739308 commit b677cec

175 files changed

Lines changed: 41435 additions & 25268 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/publish-pywry.yml

Lines changed: 110 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,19 @@ jobs:
3737
contents: read
3838
strategy:
3939
fail-fast: true
40+
# ``deepagents`` in ``.[dev]`` requires Python >=3.11 (3.10 is
41+
# blocked upstream); ``sqlcipher3`` is built from source
42+
# against the SQLCipher C library installed in the ``Build
43+
# SQLCipher`` step, so 3.14 works too.
4044
matrix:
4145
include:
4246
- os: ubuntu-24.04
43-
python-version: '3.10'
47+
python-version: '3.11'
4448
- os: ubuntu-24.04
4549
python-version: '3.14'
4650
- os: windows-2025
4751
python-version: '3.12'
48-
- os: macos-15
52+
- os: macos-15-intel
4953
python-version: '3.12'
5054

5155
steps:
@@ -67,7 +71,61 @@ jobs:
6771
if: runner.os == 'Linux'
6872
run: |
6973
for i in 1 2 3; do sudo apt-get update && break || sleep 15; done
70-
for i in 1 2 3; do sudo apt-get install -y --fix-missing xvfb dbus-x11 at-spi2-core libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 libxcb-shape0 libgl1 libegl1 libwebkit2gtk-4.1-dev libgtk-3-dev && break || { sleep 30; sudo apt-get update; }; done
74+
for i in 1 2 3; do sudo apt-get install -y --fix-missing xvfb dbus-x11 at-spi2-core libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 libxcb-shape0 libgl1 libegl1 libwebkit2gtk-4.1-dev libgtk-3-dev build-essential libssl-dev && break || { sleep 30; sudo apt-get update; }; done
75+
76+
- name: Build SQLCipher from source (Linux)
77+
if: runner.os == 'Linux'
78+
shell: bash
79+
run: |
80+
# ``--disable-tcl`` skips the Tcl extension; the Python
81+
# ``sqlcipher3`` binding doesn't need it, and modern Tcl
82+
# bottles break its compile on macOS.
83+
git clone --depth=1 --branch=v4.6.1 https://github.com/sqlcipher/sqlcipher.git /tmp/sqlcipher
84+
cd /tmp/sqlcipher
85+
./configure \
86+
--disable-tcl \
87+
--enable-tempstore=yes \
88+
CFLAGS="-DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL" \
89+
LDFLAGS="-lcrypto"
90+
make -j$(nproc) libsqlcipher.la || make -j$(nproc)
91+
sudo make install-libLTLIBRARIES install-includeHEADERS || sudo make install
92+
sudo ldconfig
93+
94+
- name: Build SQLCipher from source (macOS)
95+
if: runner.os == 'macOS'
96+
shell: bash
97+
run: |
98+
# No ``tcl-tk`` install — Homebrew ships Tcl 9.0, whose
99+
# headers break SQLCipher's Tcl-8-era ``tclsqlite.c``.
100+
# ``--disable-tcl`` is the fix.
101+
brew install openssl@3
102+
OPENSSL_PREFIX="$(brew --prefix openssl@3)"
103+
git clone --depth=1 --branch=v4.6.1 https://github.com/sqlcipher/sqlcipher.git /tmp/sqlcipher
104+
cd /tmp/sqlcipher
105+
./configure \
106+
--disable-tcl \
107+
--enable-tempstore=yes \
108+
CFLAGS="-DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -I$OPENSSL_PREFIX/include" \
109+
LDFLAGS="-L$OPENSSL_PREFIX/lib -lcrypto"
110+
make -j$(sysctl -n hw.logicalcpu) libsqlcipher.la || make -j$(sysctl -n hw.logicalcpu)
111+
sudo make install-libLTLIBRARIES install-includeHEADERS || sudo make install
112+
echo "LDFLAGS=-L/usr/local/lib -L$OPENSSL_PREFIX/lib -lsqlcipher -lcrypto" >> $GITHUB_ENV
113+
echo "CPPFLAGS=-I/usr/local/include -I/usr/local/include/sqlcipher -I$OPENSSL_PREFIX/include" >> $GITHUB_ENV
114+
115+
- name: Install SQLCipher via vcpkg (Windows x64)
116+
if: runner.os == 'Windows' && runner.arch != 'ARM64'
117+
shell: pwsh
118+
run: |
119+
# arm64-windows skipped: tcl (transitive port dep) doesn't
120+
# build there under vcpkg; ``SqliteStateBackend`` handles
121+
# missing ``sqlcipher3`` by falling back to plain SQLite.
122+
$env:VCPKG_ROOT = "$env:VCPKG_INSTALLATION_ROOT"
123+
& "$env:VCPKG_ROOT\vcpkg" install "sqlcipher:x64-windows"
124+
$sqlcipherDir = "$env:VCPKG_ROOT\installed\x64-windows"
125+
echo "SQLCIPHER_PATH=$sqlcipherDir" >> $env:GITHUB_ENV
126+
echo "INCLUDE=$sqlcipherDir\include;$sqlcipherDir\include\sqlcipher;$env:INCLUDE" >> $env:GITHUB_ENV
127+
echo "LIB=$sqlcipherDir\lib;$env:LIB" >> $env:GITHUB_ENV
128+
echo "PATH=$sqlcipherDir\bin;$env:PATH" >> $env:GITHUB_ENV
71129
72130
- name: Install dependencies
73131
run: |
@@ -548,7 +606,55 @@ jobs:
548606
if: runner.os == 'Linux'
549607
run: |
550608
for i in 1 2 3; do sudo apt-get update && break || sleep 15; done
551-
for i in 1 2 3; do sudo apt-get install -y --fix-missing xvfb dbus-x11 at-spi2-core libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 libxcb-shape0 libgl1 libegl1 libwebkit2gtk-4.1-dev libgtk-3-dev && break || { sleep 30; sudo apt-get update; }; done
609+
for i in 1 2 3; do sudo apt-get install -y --fix-missing xvfb dbus-x11 at-spi2-core libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 libxcb-shape0 libgl1 libegl1 libwebkit2gtk-4.1-dev libgtk-3-dev build-essential libssl-dev && break || { sleep 30; sudo apt-get update; }; done
610+
611+
- name: Build SQLCipher from source (Linux)
612+
if: runner.os == 'Linux'
613+
shell: bash
614+
run: |
615+
git clone --depth=1 --branch=v4.6.1 https://github.com/sqlcipher/sqlcipher.git /tmp/sqlcipher
616+
cd /tmp/sqlcipher
617+
./configure \
618+
--disable-tcl \
619+
--enable-tempstore=yes \
620+
CFLAGS="-DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL" \
621+
LDFLAGS="-lcrypto"
622+
make -j$(nproc) libsqlcipher.la || make -j$(nproc)
623+
sudo make install-libLTLIBRARIES install-includeHEADERS || sudo make install
624+
sudo ldconfig
625+
626+
- name: Build SQLCipher from source (macOS)
627+
if: runner.os == 'macOS'
628+
shell: bash
629+
run: |
630+
brew install openssl@3
631+
OPENSSL_PREFIX="$(brew --prefix openssl@3)"
632+
git clone --depth=1 --branch=v4.6.1 https://github.com/sqlcipher/sqlcipher.git /tmp/sqlcipher
633+
cd /tmp/sqlcipher
634+
./configure \
635+
--disable-tcl \
636+
--enable-tempstore=yes \
637+
CFLAGS="-DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -I$OPENSSL_PREFIX/include" \
638+
LDFLAGS="-L$OPENSSL_PREFIX/lib -lcrypto"
639+
make -j$(sysctl -n hw.logicalcpu) libsqlcipher.la || make -j$(sysctl -n hw.logicalcpu)
640+
sudo make install-libLTLIBRARIES install-includeHEADERS || sudo make install
641+
echo "LDFLAGS=-L/usr/local/lib -L$OPENSSL_PREFIX/lib -lsqlcipher -lcrypto" >> $GITHUB_ENV
642+
echo "CPPFLAGS=-I/usr/local/include -I/usr/local/include/sqlcipher -I$OPENSSL_PREFIX/include" >> $GITHUB_ENV
643+
644+
- name: Install SQLCipher via vcpkg (Windows x64)
645+
if: runner.os == 'Windows' && runner.arch != 'ARM64'
646+
shell: pwsh
647+
run: |
648+
# arm64-windows skipped: tcl (transitive port dep) doesn't
649+
# build there under vcpkg; ``SqliteStateBackend`` handles
650+
# missing ``sqlcipher3`` by falling back to plain SQLite.
651+
$env:VCPKG_ROOT = "$env:VCPKG_INSTALLATION_ROOT"
652+
& "$env:VCPKG_ROOT\vcpkg" install "sqlcipher:x64-windows"
653+
$sqlcipherDir = "$env:VCPKG_ROOT\installed\x64-windows"
654+
echo "SQLCIPHER_PATH=$sqlcipherDir" >> $env:GITHUB_ENV
655+
echo "INCLUDE=$sqlcipherDir\include;$sqlcipherDir\include\sqlcipher;$env:INCLUDE" >> $env:GITHUB_ENV
656+
echo "LIB=$sqlcipherDir\lib;$env:LIB" >> $env:GITHUB_ENV
657+
echo "PATH=$sqlcipherDir\bin;$env:PATH" >> $env:GITHUB_ENV
552658
553659
- name: Cache vcpkg packages (Windows ARM)
554660
if: runner.os == 'Windows' && runner.arch == 'ARM64'

.github/workflows/test-pywry.yml

Lines changed: 121 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ jobs:
4444
- name: Install dependencies
4545
run: |
4646
python -m pip install --upgrade pip
47-
pip install -e ".[dev]"
47+
pip install -e ".[notebook,auth,mcp,acp,deepagent,openai,anthropic,magentic]"
48+
pip install ruff mypy pylint pytauri-wheel plotly pandas cryptography
4849
4950
- name: Run Ruff linter
5051
run: ruff check pywry/ tests/
@@ -65,19 +66,24 @@ jobs:
6566
contents: read
6667
strategy:
6768
fail-fast: false
69+
# ``deepagents`` (pulled in by ``.[dev]`` → ``features``) hard-
70+
# requires Python >=3.11 — 3.10 can't resolve the dev extra.
71+
# ``sqlcipher3`` is a source build against the SQLCipher C
72+
# library installed in the ``Build SQLCipher`` step below, so
73+
# any Python ABI works (no binary-wheel coverage gaps).
6874
matrix:
6975
include:
7076
- os: ubuntu-24.04
71-
python-version: '3.10'
77+
python-version: '3.11'
7278
- os: ubuntu-24.04
7379
python-version: '3.14'
7480
- os: windows-2025
75-
python-version: '3.10'
81+
python-version: '3.11'
7682
- os: windows-2025
7783
python-version: '3.14'
78-
- os: macos-15
79-
python-version: '3.10'
80-
- os: macos-15
84+
- os: macos-15-intel
85+
python-version: '3.11'
86+
- os: macos-15-intel
8187
python-version: '3.14'
8288
- os: ubuntu-24.04-arm
8389
python-version: '3.11'
@@ -88,7 +94,7 @@ jobs:
8894
- os: windows-11-arm
8995
python-version: '3.14'
9096
- os: macos-latest
91-
python-version: '3.10'
97+
python-version: '3.11'
9298
- os: macos-latest
9399
python-version: '3.14'
94100

@@ -117,7 +123,77 @@ jobs:
117123
if: runner.os == 'Linux'
118124
run: |
119125
for i in 1 2 3; do sudo apt-get update && break || sleep 15; done
120-
for i in 1 2 3; do sudo apt-get install -y --fix-missing xvfb dbus-x11 at-spi2-core libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 libxcb-shape0 libgl1 libegl1 libwebkit2gtk-4.1-dev libgtk-3-dev && break || { sleep 30; sudo apt-get update; }; done
126+
for i in 1 2 3; do sudo apt-get install -y --fix-missing xvfb dbus-x11 at-spi2-core libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 libxcb-shape0 libgl1 libegl1 libwebkit2gtk-4.1-dev libgtk-3-dev build-essential libssl-dev && break || { sleep 30; sudo apt-get update; }; done
127+
128+
- name: Build SQLCipher from source (Linux)
129+
if: runner.os == 'Linux'
130+
shell: bash
131+
run: |
132+
# Build from the upstream source (https://github.com/sqlcipher/sqlcipher)
133+
# so the ``sqlcipher3`` Python package's setup.py links
134+
# against a known-good library on every Python ABI —
135+
# binary wheels stop at Python 3.13. ``--disable-tcl``
136+
# skips the Tcl extension (not needed by the Python
137+
# binding, and modern Tcl bottles break its compile).
138+
git clone --depth=1 --branch=v4.6.1 https://github.com/sqlcipher/sqlcipher.git /tmp/sqlcipher
139+
cd /tmp/sqlcipher
140+
./configure \
141+
--disable-tcl \
142+
--enable-tempstore=yes \
143+
CFLAGS="-DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL" \
144+
LDFLAGS="-lcrypto"
145+
make -j$(nproc) libsqlcipher.la || make -j$(nproc)
146+
sudo make install-libLTLIBRARIES install-includeHEADERS || sudo make install
147+
sudo ldconfig
148+
149+
- name: Build SQLCipher from source (macOS)
150+
if: runner.os == 'macOS'
151+
shell: bash
152+
run: |
153+
# Intentionally NOT installing ``tcl-tk`` from Homebrew:
154+
# the current bottle is Tcl 9.0, whose headers drop the
155+
# ``CONST`` macro and ``TCL_CHANNEL_VERSION_2``, so
156+
# SQLCipher's ``tclsqlite.c`` (still Tcl-8 API) fails to
157+
# compile. SQLCipher's configure auto-disables the Tcl
158+
# extension when no ``tclConfig.sh`` is on the usual
159+
# search paths — we only need the C library anyway; the
160+
# ``sqlcipher3`` Python binding doesn't touch Tcl.
161+
brew install openssl@3
162+
OPENSSL_PREFIX="$(brew --prefix openssl@3)"
163+
git clone --depth=1 --branch=v4.6.1 https://github.com/sqlcipher/sqlcipher.git /tmp/sqlcipher
164+
cd /tmp/sqlcipher
165+
./configure \
166+
--disable-tcl \
167+
--enable-tempstore=yes \
168+
CFLAGS="-DSQLITE_HAS_CODEC -DSQLCIPHER_CRYPTO_OPENSSL -I$OPENSSL_PREFIX/include" \
169+
LDFLAGS="-L$OPENSSL_PREFIX/lib -lcrypto"
170+
# Build only the library target — the default ``make`` tries
171+
# to build the ``sqlcipher`` shell which links against Tcl.
172+
make -j$(sysctl -n hw.logicalcpu) libsqlcipher.la || make -j$(sysctl -n hw.logicalcpu)
173+
sudo make install-libLTLIBRARIES install-includeHEADERS || sudo make install
174+
echo "LDFLAGS=-L/usr/local/lib -L$OPENSSL_PREFIX/lib -lsqlcipher -lcrypto" >> $GITHUB_ENV
175+
echo "CPPFLAGS=-I/usr/local/include -I/usr/local/include/sqlcipher -I$OPENSSL_PREFIX/include" >> $GITHUB_ENV
176+
177+
- name: Install SQLCipher via vcpkg (Windows x64)
178+
if: runner.os == 'Windows' && runner.arch != 'ARM64'
179+
shell: pwsh
180+
run: |
181+
# vcpkg builds SQLCipher from source using the same upstream
182+
# repo (https://github.com/sqlcipher/sqlcipher), just
183+
# packaged as an MSVC-friendly port so we don't have to wire
184+
# nmake + OpenSSL manually. ``SQLCIPHER_PATH`` points
185+
# ``sqlcipher3``'s setup.py at the install root. Skipped on
186+
# arm64-windows: the transitive ``tcl`` port doesn't build
187+
# there even with ``--allow-unsupported``, and the
188+
# ``SqliteStateBackend`` handles the missing binding by
189+
# falling back to plain SQLite.
190+
$env:VCPKG_ROOT = "$env:VCPKG_INSTALLATION_ROOT"
191+
& "$env:VCPKG_ROOT\vcpkg" install "sqlcipher:x64-windows"
192+
$sqlcipherDir = "$env:VCPKG_ROOT\installed\x64-windows"
193+
echo "SQLCIPHER_PATH=$sqlcipherDir" >> $env:GITHUB_ENV
194+
echo "INCLUDE=$sqlcipherDir\include;$sqlcipherDir\include\sqlcipher;$env:INCLUDE" >> $env:GITHUB_ENV
195+
echo "LIB=$sqlcipherDir\lib;$env:LIB" >> $env:GITHUB_ENV
196+
echo "PATH=$sqlcipherDir\bin;$env:PATH" >> $env:GITHUB_ENV
121197
122198
- name: Cache vcpkg packages (Windows ARM)
123199
if: runner.os == 'Windows' && runner.arch == 'ARM64'
@@ -170,16 +246,45 @@ jobs:
170246
if: runner.os == 'Linux'
171247
run: docker version
172248

173-
- name: Setup Docker (macOS Intel)
174-
id: docker-macos
175-
if: runner.os == 'macOS' && runner.arch == 'X64'
176-
uses: docker/setup-docker-action@v4
177-
178-
- name: Verify Docker (macOS Intel)
249+
- name: Configure Docker (macOS Intel)
179250
if: runner.os == 'macOS' && runner.arch == 'X64'
251+
shell: bash
180252
run: |
181-
echo "DOCKER_HOST=$DOCKER_HOST"
182-
docker version
253+
# ``docker/setup-docker-action@v4`` doesn't reliably bring up
254+
# a Docker daemon on ``macos-15-intel`` runners — testcontainers
255+
# then fails with ``FileNotFoundError: /var/run/docker.sock``
256+
# during the Redis fixture setup. Mirror the resilient
257+
# Docker-Desktop → Colima fallback used in publish-pywry.yml.
258+
set -euo pipefail
259+
260+
if docker info >/dev/null 2>&1; then
261+
echo "Docker daemon already available"
262+
else
263+
if [ -d "/Applications/Docker.app" ]; then
264+
echo "Starting Docker Desktop"
265+
open -a Docker
266+
for _ in {1..30}; do
267+
if docker info >/dev/null 2>&1; then
268+
break
269+
fi
270+
sleep 5
271+
done
272+
fi
273+
fi
274+
275+
if ! docker info >/dev/null 2>&1; then
276+
echo "Falling back to Colima"
277+
brew install docker colima
278+
colima start --runtime docker --arch x86_64 --cpu 2 --memory 4 --disk 20
279+
fi
280+
281+
if [ -S "$HOME/.colima/default/docker.sock" ]; then
282+
sudo mkdir -p /var/run
283+
sudo ln -sf "$HOME/.colima/default/docker.sock" /var/run/docker.sock
284+
fi
285+
286+
echo "DOCKER_HOST=unix:///var/run/docker.sock" >> "$GITHUB_ENV"
287+
docker info
183288
184289
- name: Run tests (Linux)
185290
if: runner.os == 'Linux'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,4 @@ marimo/_lsp/
208208
__marimo__/
209209

210210
docs/site/*
211+
.claude/settings.local.json

0 commit comments

Comments
 (0)