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
|
# Maintainer: enihcam <enihcam@noreply.gitcode.com>
pkgname=python-jiuwenswarm
pkgver=0.2.3
pkgrel=1
pkgdesc="Open-source multi-agent orchestration framework (Python backend + bundled React frontend + native TUI built from source)"
arch=('x86_64')
url="https://pypi.org/project/jiuwenswarm/"
license=('Apache-2.0')
# Requires Python 3.11–3.13 (per upstream Requires-Python: >=3.11,<3.14).
# Arch `python` is currently on 3.13 at time of writing — safe.
depends=(
'python>=3.11'
'python-aiosqlite'
'python-charset-normalizer'
'python-chromadb'
'python-croniter'
'python-discord'
'python-dingtalk-stream'
'python-dotenv'
'faiss-cpu' # provides faiss lib (no python- prefix in Arch)
'python-fastapi'
'python-google-genai'
'python-greenlet'
'python-httpx'
'python-json-repair'
'python-lark-oapi'
'python-loguru'
'python-multipart'
'python-mutagen'
'python-numpy'
'python-opentelemetry-api'
'python-opentelemetry-exporter-otlp-proto-grpc'
'python-opentelemetry-exporter-otlp-proto-http'
'python-opentelemetry-sdk'
'python-pgvector'
'python-psutil'
'python-pydantic'
'python-requests'
'python-ruamel-yaml'
'python-sqlite-vec'
'python-telegram-bot'
'python-tree-sitter'
'python-tree-sitter-bash'
'python-urllib3'
'uvicorn' # extra/uvicorn (no python- prefix in Arch)
'python-websockets'
'python-yaml'
'icu' # libicui18n/libicuuc/libicudata needed by TUI native binary
)
makedepends=(
'bun' # compiles TUI TypeScript into a self-contained native binary
'nodejs' # npm ci for TUI JS runtime deps
'python-build' # python -m build --wheel for the TUI Python wheel
'python-installer' # python -m installer to copy wheels into $pkgdir
'python-wheel' # required by python -m build
'git' # base-devel; needed for git+https:// source
)
optdepends=(
'python-a2a-sdk-fastapi: highly recommended - A2A HTTP server transport, required by jiuwenswarm-acp (the a2a-sdk[http-server] extra)'
'python-a2a-sdk: A2A protocol SDK runtime (needed alongside python-a2a-sdk-fastapi for jiuwenswarm-acp)'
'python-pywebview: desktop application GUI (jiuwenswarm-desktop)'
'openjiuwen: distributed deployment extras (postgres, zmq backends)'
)
# The real jiuwenswarm-tui (TypeScript-based interactive terminal client built with Bun)
# is no longer an optdepend — it is built from source and bundled in this package.
#
# Source 1: PyPI wheel. Pure-Python (`py3-none-any`), bundles the built React frontend
# `dist/`, so no Node.js build step is required for the main package at install time.
# Local filename must match the wheel's internal .dist-info directory name
# (jiuwenswarm-${pkgver}.dist-info). Using ${pkgname}- prefix breaks
# python -m installer's filename-to-dist-info check.
#
# Source 2: Upstream git tag. The tag for v0.2.2 on gitcode is named "JiuwenSwarm0.2.2"
# (no `v` prefix, capital `J`). Provides:
# - jiuwenswarm/channels/tui/frontend/ (TypeScript source + package.json + package-lock.json)
# - packages/jiuwenswarm-tui/ (Python wrapper package + setup.py + pyproject.toml)
# - scripts/build_tui.py (Bun --compile script)
# Git sources are inherently unstable so checksum is SKIP; pin by commit in a follow-up.
_tag="JiuwenSwarm${pkgver}"
source=(
"jiuwenswarm-${pkgver}-py3-none-any.whl::https://files.pythonhosted.org/packages/28/eb/024b218d2761ae2db59362ed62ad05ab0dc3200e51cc2026dbbdaae8aafe/jiuwenswarm-${pkgver}-py3-none-any.whl"
"${_tag}.tar.gz::git+https://gitcode.com/openJiuwen/jiuwenswarm.git#tag=${_tag}"
)
sha256sums=(
'b0bb02b030e66a5a12c492ff5a06e91c0f9e207d49dce93bcc174a76916c3430' # main PyPI wheel
'SKIP' # git tag, verified via git fetch + checkout
)
prepare() {
cd "$srcdir/${_tag}.tar.gz"
# Extract main wheel metadata so we can install LICENSE to the canonical path
# without polluting $pkgdir with a second copy of the dist-info tree.
python -m zipfile -e \
"$srcdir/jiuwenswarm-${pkgver}-py3-none-any.whl" \
"$srcdir/wheel-extract"
# Install TUI JS runtime dependencies (chalk, ws, @mariozechner/pi-tui).
# Skip devDependencies (typescript, oxlint, oxfmt) — not needed for the build.
# The upstream package-lock.json pins to registry.npmmirror.com — force the
# official npmjs.org registry so AUR users worldwide can build without
# depending on a third-party mirror.
# `--allow-remote=all` is required by npm >=11 which defaults to allow-remote=none
# to block remote package fetches.
pushd "jiuwenswarm/channels/tui/frontend" >/dev/null
npm ci --omit=dev \
--allow-remote=all \
--registry=https://registry.npmjs.org/
popd >/dev/null
# Compile TUI TypeScript into a self-contained native binary via Bun.
# scripts/build_tui.py writes the binary to
# packages/jiuwenswarm-tui/jiuwenswarm_tui/resources/tui-bin/<platform>/jiuwenswarm-tui
# so the TUI Python wrapper package picks it up at install time.
python scripts/build_tui.py --target current
# Build the TUI Python wheel (which now bundles the native binary inside).
# --no-isolation reuses the system Python's build/wheel/setuptools (faster, no venv).
pushd "packages/jiuwenswarm-tui" >/dev/null
python -m build --wheel --no-isolation
popd >/dev/null
}
package() {
cd "$srcdir"
# Install main wheel first (contains the `jiuwenswarm-tui` CLI subcommand dispatcher).
python -m installer --destdir="$pkgdir" \
"jiuwenswarm-${pkgver}-py3-none-any.whl"
# Install TUI wheel LAST with --overwrite-existing so the real launcher
# (jiuwenswarm_tui.app:main) replaces the bundled CLI dispatcher under
# the same /usr/bin/jiuwenswarm-tui path.
python -m installer --destdir="$pkgdir" --overwrite-existing \
"${_tag}.tar.gz/packages/jiuwenswarm-tui/dist/"*.whl
# Install upstream LICENSE into the canonical Arch location.
install -Dm644 \
"$srcdir/wheel-extract/jiuwenswarm-${pkgver}.dist-info/licenses/LICENSE" \
"$pkgdir/usr/share/licenses/${pkgname}/LICENSE"
}
|