akgentic-team 1.5.0__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.
- akgentic_team-1.5.0/.env.example +21 -0
- akgentic_team-1.5.0/.github/workflows/ci.yml +106 -0
- akgentic_team-1.5.0/.github/workflows/release.yml +69 -0
- akgentic_team-1.5.0/.gitignore +27 -0
- akgentic_team-1.5.0/LICENSE +661 -0
- akgentic_team-1.5.0/PKG-INFO +538 -0
- akgentic_team-1.5.0/README.md +497 -0
- akgentic_team-1.5.0/examples/01-team-definition.md +48 -0
- akgentic_team-1.5.0/examples/01_team_definition.py +154 -0
- akgentic_team-1.5.0/examples/02-team-factory.md +58 -0
- akgentic_team-1.5.0/examples/02_team_factory.py +142 -0
- akgentic_team-1.5.0/examples/03-team-manager-lifecycle.md +87 -0
- akgentic_team-1.5.0/examples/03_team_manager_lifecycle.py +314 -0
- akgentic_team-1.5.0/examples/04-event-sourcing.md +109 -0
- akgentic_team-1.5.0/examples/04_event_sourcing.py +382 -0
- akgentic_team-1.5.0/examples/05-crash-recovery.md +116 -0
- akgentic_team-1.5.0/examples/05_crash_recovery.py +468 -0
- akgentic_team-1.5.0/examples/06-mongo-backend.md +113 -0
- akgentic_team-1.5.0/examples/06_mongo_backend.py +331 -0
- akgentic_team-1.5.0/examples/README.md +134 -0
- akgentic_team-1.5.0/pyproject.toml +102 -0
- akgentic_team-1.5.0/src/akgentic/__init__.py +1 -0
- akgentic_team-1.5.0/src/akgentic/team/__init__.py +61 -0
- akgentic_team-1.5.0/src/akgentic/team/cli/README.md +206 -0
- akgentic_team-1.5.0/src/akgentic/team/cli/__init__.py +20 -0
- akgentic_team-1.5.0/src/akgentic/team/cli/_output.py +210 -0
- akgentic_team-1.5.0/src/akgentic/team/cli/main.py +422 -0
- akgentic_team-1.5.0/src/akgentic/team/factory.py +282 -0
- akgentic_team-1.5.0/src/akgentic/team/manager.py +369 -0
- akgentic_team-1.5.0/src/akgentic/team/messages.py +30 -0
- akgentic_team-1.5.0/src/akgentic/team/models.py +483 -0
- akgentic_team-1.5.0/src/akgentic/team/ports.py +197 -0
- akgentic_team-1.5.0/src/akgentic/team/py.typed +0 -0
- akgentic_team-1.5.0/src/akgentic/team/repositories/__init__.py +16 -0
- akgentic_team-1.5.0/src/akgentic/team/repositories/mongo.py +309 -0
- akgentic_team-1.5.0/src/akgentic/team/repositories/postgres/__init__.py +90 -0
- akgentic_team-1.5.0/src/akgentic/team/repositories/postgres/_queries.py +42 -0
- akgentic_team-1.5.0/src/akgentic/team/repositories/postgres/event_store.py +202 -0
- akgentic_team-1.5.0/src/akgentic/team/repositories/postgres/schema.toml +19 -0
- akgentic_team-1.5.0/src/akgentic/team/repositories/yaml.py +311 -0
- akgentic_team-1.5.0/src/akgentic/team/restorer.py +669 -0
- akgentic_team-1.5.0/src/akgentic/team/scripts/__init__.py +1 -0
- akgentic_team-1.5.0/src/akgentic/team/scripts/init_db.py +67 -0
- akgentic_team-1.5.0/src/akgentic/team/subscriber.py +219 -0
- akgentic_team-1.5.0/tests/__init__.py +3 -0
- akgentic_team-1.5.0/tests/cli/__init__.py +3 -0
- akgentic_team-1.5.0/tests/cli/conftest.py +55 -0
- akgentic_team-1.5.0/tests/cli/test_main.py +483 -0
- akgentic_team-1.5.0/tests/conftest.py +3 -0
- akgentic_team-1.5.0/tests/integration/__init__.py +8 -0
- akgentic_team-1.5.0/tests/integration/conftest.py +259 -0
- akgentic_team-1.5.0/tests/integration/test_factory.py +138 -0
- akgentic_team-1.5.0/tests/integration/test_lifecycle.py +405 -0
- akgentic_team-1.5.0/tests/integration/test_llm_lifecycle.py +287 -0
- akgentic_team-1.5.0/tests/integration/test_persistence.py +130 -0
- akgentic_team-1.5.0/tests/integration/test_process_human_input.py +208 -0
- akgentic_team-1.5.0/tests/integration/test_welcome_announcement.py +276 -0
- akgentic_team-1.5.0/tests/models/__init__.py +3 -0
- akgentic_team-1.5.0/tests/models/conftest.py +257 -0
- akgentic_team-1.5.0/tests/models/test_ports.py +93 -0
- akgentic_team-1.5.0/tests/models/test_process.py +193 -0
- akgentic_team-1.5.0/tests/models/test_team_card.py +360 -0
- akgentic_team-1.5.0/tests/models/test_team_runtime.py +735 -0
- akgentic_team-1.5.0/tests/models/test_welcome_message.py +64 -0
- akgentic_team-1.5.0/tests/repositories/__init__.py +3 -0
- akgentic_team-1.5.0/tests/repositories/conftest.py +149 -0
- akgentic_team-1.5.0/tests/repositories/mongo/__init__.py +3 -0
- akgentic_team-1.5.0/tests/repositories/mongo/conftest.py +16 -0
- akgentic_team-1.5.0/tests/repositories/mongo/test_mongo.py +263 -0
- akgentic_team-1.5.0/tests/repositories/postgres/__init__.py +0 -0
- akgentic_team-1.5.0/tests/repositories/postgres/conftest.py +17 -0
- akgentic_team-1.5.0/tests/repositories/postgres/test_ci_env_wiring.py +86 -0
- akgentic_team-1.5.0/tests/repositories/postgres/test_event_store.py +95 -0
- akgentic_team-1.5.0/tests/repositories/postgres/test_import_gate.py +83 -0
- akgentic_team-1.5.0/tests/repositories/postgres/test_init_db.py +163 -0
- akgentic_team-1.5.0/tests/repositories/postgres/test_init_db_script_smoke.py +32 -0
- akgentic_team-1.5.0/tests/repositories/postgres/test_schema_file.py +66 -0
- akgentic_team-1.5.0/tests/repositories/postgres/test_wheel_packaging.py +56 -0
- akgentic_team-1.5.0/tests/repositories/test_event_store_contract.py +449 -0
- akgentic_team-1.5.0/tests/repositories/test_yaml.py +109 -0
- akgentic_team-1.5.0/tests/scripts/__init__.py +0 -0
- akgentic_team-1.5.0/tests/scripts/test_init_db_script.py +54 -0
- akgentic_team-1.5.0/tests/services/__init__.py +3 -0
- akgentic_team-1.5.0/tests/services/conftest.py +106 -0
- akgentic_team-1.5.0/tests/services/test_factory.py +532 -0
- akgentic_team-1.5.0/tests/services/test_manager.py +1372 -0
- akgentic_team-1.5.0/tests/services/test_restorer.py +2162 -0
- akgentic_team-1.5.0/tests/services/test_subscriber.py +224 -0
- akgentic_team-1.5.0/tests/services/test_timer_stop_subscriber.py +203 -0
- akgentic_team-1.5.0/tests/test_public_api.py +36 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Example environment variables for akgentic-team storage backends.
|
|
2
|
+
# Copy to .env and fill in values for your deployment. The team library
|
|
3
|
+
# itself does NOT read these — env-var resolution happens at the wiring
|
|
4
|
+
# layer (application startup / infra code). NagraEventStore takes a
|
|
5
|
+
# plain connection string directly.
|
|
6
|
+
|
|
7
|
+
# Nagra / PostgreSQL backend — used by the `[postgres]` extra.
|
|
8
|
+
# Shared verbatim with akgentic-catalog (same DB, disjoint tables:
|
|
9
|
+
# catalog owns template_entries / tool_entries / agent_entries / team_entries
|
|
10
|
+
# team owns team_process_entries / event_entries / agent_state_entries
|
|
11
|
+
# ).
|
|
12
|
+
POSTGRES_SERVER=
|
|
13
|
+
POSTGRES_PORT=5432
|
|
14
|
+
POSTGRES_USER=
|
|
15
|
+
POSTGRES_PASSWORD=
|
|
16
|
+
POSTGRES_DB=
|
|
17
|
+
# Full libpq URL; what NagraEventStore receives as `conn_string`.
|
|
18
|
+
DB_CONN_STRING_PERSISTENCE=
|
|
19
|
+
|
|
20
|
+
# MongoDB backend — used by the `[mongo]` extra.
|
|
21
|
+
MONGO_URI=
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
branches: [master]
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
NO_COLOR: "1"
|
|
11
|
+
# Release channel for akgentic-* dependencies. On a release branch set this
|
|
12
|
+
# to that branch (e.g. version-1.x); sibling akgentic-* packages are built
|
|
13
|
+
# from this branch into the local wheelhouse.
|
|
14
|
+
RELEASE_BRANCH: master
|
|
15
|
+
# Transitive closure of akgentic-* dependencies, space-separated. uv resolves
|
|
16
|
+
# the graph from the wheelhouse, so order does not matter.
|
|
17
|
+
AKGENTIC_DEPS: "akgentic-core"
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
quality:
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
services:
|
|
23
|
+
postgres:
|
|
24
|
+
image: postgres:16-alpine
|
|
25
|
+
env:
|
|
26
|
+
POSTGRES_USER: akgentic
|
|
27
|
+
POSTGRES_PASSWORD: akgentic
|
|
28
|
+
POSTGRES_DB: akgentic_test
|
|
29
|
+
ports:
|
|
30
|
+
- 5432:5432
|
|
31
|
+
options: >-
|
|
32
|
+
--health-cmd="pg_isready -U akgentic"
|
|
33
|
+
--health-interval=10s
|
|
34
|
+
--health-timeout=5s
|
|
35
|
+
--health-retries=5
|
|
36
|
+
env:
|
|
37
|
+
POSTGRES_SERVER: localhost
|
|
38
|
+
POSTGRES_PORT: "5432"
|
|
39
|
+
POSTGRES_USER: akgentic
|
|
40
|
+
POSTGRES_PASSWORD: akgentic
|
|
41
|
+
POSTGRES_DB: akgentic_test
|
|
42
|
+
DB_CONN_STRING_PERSISTENCE: postgresql://akgentic:akgentic@localhost:5432/akgentic_test
|
|
43
|
+
steps:
|
|
44
|
+
- name: Checkout akgentic-team
|
|
45
|
+
uses: actions/checkout@v6
|
|
46
|
+
|
|
47
|
+
- name: Install uv
|
|
48
|
+
uses: astral-sh/setup-uv@v8.1.0
|
|
49
|
+
with:
|
|
50
|
+
version: "latest"
|
|
51
|
+
|
|
52
|
+
- name: Set up Python 3.12
|
|
53
|
+
run: uv python install 3.12
|
|
54
|
+
|
|
55
|
+
# Build every akgentic-* dependency from RELEASE_BRANCH into a local
|
|
56
|
+
# wheelhouse. uv pip install --find-links then resolves them from there;
|
|
57
|
+
# all other (PyPI) deps still come from the default index.
|
|
58
|
+
- name: Build akgentic-* dependency wheelhouse
|
|
59
|
+
run: |
|
|
60
|
+
mkdir -p wheelhouse
|
|
61
|
+
for dep in ${AKGENTIC_DEPS}; do
|
|
62
|
+
echo "::group::build ${dep} @ ${RELEASE_BRANCH}"
|
|
63
|
+
git clone --depth 1 --branch "${RELEASE_BRANCH}" \
|
|
64
|
+
"https://github.com/b12consulting/${dep}.git" "/tmp/${dep}"
|
|
65
|
+
uv build --wheel --out-dir wheelhouse "/tmp/${dep}"
|
|
66
|
+
echo "::endgroup::"
|
|
67
|
+
done
|
|
68
|
+
ls -1 wheelhouse
|
|
69
|
+
|
|
70
|
+
- name: Create virtual environment
|
|
71
|
+
run: uv venv
|
|
72
|
+
|
|
73
|
+
# Install the package editable, resolving akgentic-* deps from the
|
|
74
|
+
# wheelhouse and everything else from PyPI. All optional extras are
|
|
75
|
+
# listed so mypy can analyze their imports (postgres, mongo, cli).
|
|
76
|
+
- name: Install dependencies
|
|
77
|
+
run: uv pip install --find-links wheelhouse -e ".[dev,mongo,postgres,cli]"
|
|
78
|
+
|
|
79
|
+
# --no-sync: run in the wheelhouse-built venv without re-resolving from a
|
|
80
|
+
# lockfile (there is no project lockfile in this install model).
|
|
81
|
+
- name: Type checking
|
|
82
|
+
run: uv run --no-sync mypy src/
|
|
83
|
+
|
|
84
|
+
- name: Linting
|
|
85
|
+
run: uv run --no-sync ruff check src/
|
|
86
|
+
|
|
87
|
+
- name: Run tests with coverage
|
|
88
|
+
run: >
|
|
89
|
+
uv run --no-sync pytest tests/
|
|
90
|
+
--cov=akgentic.team
|
|
91
|
+
--cov-report=term-missing
|
|
92
|
+
--cov-report=json:coverage.json
|
|
93
|
+
--cov-fail-under=80
|
|
94
|
+
|
|
95
|
+
- name: Update coverage badge
|
|
96
|
+
if: github.ref_name == 'master' && github.event_name == 'push'
|
|
97
|
+
run: |
|
|
98
|
+
COVERAGE=$(python -c "import json; print(round(float(json.load(open('coverage.json'))['totals']['percent_covered_display'])))")
|
|
99
|
+
if [ "$COVERAGE" -ge 90 ]; then COLOR="brightgreen"
|
|
100
|
+
elif [ "$COVERAGE" -ge 80 ]; then COLOR="green"
|
|
101
|
+
elif [ "$COVERAGE" -ge 70 ]; then COLOR="yellow"
|
|
102
|
+
else COLOR="red"; fi
|
|
103
|
+
echo "{\"schemaVersion\":1,\"label\":\"coverage\",\"message\":\"${COVERAGE}%\",\"color\":\"${COLOR}\"}" > badge.json
|
|
104
|
+
gh gist edit 708bb547b8679308d083be7beaf4448a -f coverage.json badge.json
|
|
105
|
+
env:
|
|
106
|
+
GH_TOKEN: ${{ secrets.GH_PAT }}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
# Manual release: reads version from pyproject.toml on master, tags master HEAD,
|
|
4
|
+
# builds the wheel, and creates a GitHub Release with the wheel attached.
|
|
5
|
+
#
|
|
6
|
+
# Bumping the version is a separate maintainer action via a normal PR. This
|
|
7
|
+
# workflow does NOT push commits to master — branch protection blocks that.
|
|
8
|
+
# The release flow is therefore two-step:
|
|
9
|
+
# 1. Open a "chore: bump version to X.Y.Z" PR; merge it.
|
|
10
|
+
# 2. Trigger this workflow from the Actions tab.
|
|
11
|
+
|
|
12
|
+
on:
|
|
13
|
+
workflow_dispatch:
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
release:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
permissions:
|
|
19
|
+
contents: write
|
|
20
|
+
steps:
|
|
21
|
+
- name: Checkout master
|
|
22
|
+
uses: actions/checkout@v6
|
|
23
|
+
with:
|
|
24
|
+
ref: master
|
|
25
|
+
fetch-depth: 0
|
|
26
|
+
|
|
27
|
+
- name: Install uv
|
|
28
|
+
uses: astral-sh/setup-uv@v8.1.0
|
|
29
|
+
with:
|
|
30
|
+
version: "latest"
|
|
31
|
+
|
|
32
|
+
- name: Set up Python 3.12
|
|
33
|
+
run: uv python install 3.12
|
|
34
|
+
|
|
35
|
+
- name: Read version from pyproject.toml
|
|
36
|
+
id: version
|
|
37
|
+
run: |
|
|
38
|
+
VERSION=$(grep -E '^version = ' pyproject.toml | sed -E 's/version = "(.*)"/\1/')
|
|
39
|
+
echo "Releasing version: $VERSION"
|
|
40
|
+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
|
41
|
+
|
|
42
|
+
- name: Verify tag does not already exist
|
|
43
|
+
env:
|
|
44
|
+
VERSION: ${{ steps.version.outputs.version }}
|
|
45
|
+
run: |
|
|
46
|
+
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
|
|
47
|
+
echo "::error::Tag v$VERSION already exists. Bump the version in pyproject.toml first."
|
|
48
|
+
exit 1
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
- name: Tag master HEAD
|
|
52
|
+
env:
|
|
53
|
+
VERSION: ${{ steps.version.outputs.version }}
|
|
54
|
+
run: |
|
|
55
|
+
git config user.name "github-actions[bot]"
|
|
56
|
+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
57
|
+
git tag "v$VERSION"
|
|
58
|
+
git push origin "v$VERSION"
|
|
59
|
+
|
|
60
|
+
- name: Build wheel
|
|
61
|
+
run: uv build --wheel --out-dir dist/
|
|
62
|
+
|
|
63
|
+
- name: Create GitHub Release
|
|
64
|
+
uses: softprops/action-gh-release@v2
|
|
65
|
+
with:
|
|
66
|
+
tag_name: "v${{ steps.version.outputs.version }}"
|
|
67
|
+
name: "v${{ steps.version.outputs.version }}"
|
|
68
|
+
files: dist/*.whl
|
|
69
|
+
generate_release_notes: true
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# Distribution / packaging
|
|
7
|
+
dist/
|
|
8
|
+
build/
|
|
9
|
+
*.egg-info/
|
|
10
|
+
**/settings.local.json
|
|
11
|
+
|
|
12
|
+
# Testing
|
|
13
|
+
.pytest_cache/
|
|
14
|
+
.coverage
|
|
15
|
+
htmlcov/
|
|
16
|
+
|
|
17
|
+
# Type checking
|
|
18
|
+
.mypy_cache/
|
|
19
|
+
.dmypy.json
|
|
20
|
+
|
|
21
|
+
# Virtual environments
|
|
22
|
+
.venv/
|
|
23
|
+
venv/
|
|
24
|
+
|
|
25
|
+
# IDE
|
|
26
|
+
.vscode/
|
|
27
|
+
.idea/
|