akgentic-core 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.
Files changed (72) hide show
  1. akgentic_core-1.5.0/.github/workflows/ci.yml +55 -0
  2. akgentic_core-1.5.0/.github/workflows/release.yml +69 -0
  3. akgentic_core-1.5.0/.gitignore +27 -0
  4. akgentic_core-1.5.0/.python-version +1 -0
  5. akgentic_core-1.5.0/CONTRIBUTING.md +94 -0
  6. akgentic_core-1.5.0/LICENSE +661 -0
  7. akgentic_core-1.5.0/PKG-INFO +785 -0
  8. akgentic_core-1.5.0/README.md +759 -0
  9. akgentic_core-1.5.0/examples/01-hello-world.md +183 -0
  10. akgentic_core-1.5.0/examples/01_hello_world.py +158 -0
  11. akgentic_core-1.5.0/examples/02-request-response.md +166 -0
  12. akgentic_core-1.5.0/examples/02_request_response.py +262 -0
  13. akgentic_core-1.5.0/examples/03-dynamic-agents.md +152 -0
  14. akgentic_core-1.5.0/examples/03_dynamic_agents.py +241 -0
  15. akgentic_core-1.5.0/examples/04-stateful-agents.md +251 -0
  16. akgentic_core-1.5.0/examples/04_stateful_agents.py +312 -0
  17. akgentic_core-1.5.0/examples/05-multi-agent.md +294 -0
  18. akgentic_core-1.5.0/examples/05_multi_agent.py +540 -0
  19. akgentic_core-1.5.0/examples/06-agent-cards.md +159 -0
  20. akgentic_core-1.5.0/examples/06_agent_cards.py +175 -0
  21. akgentic_core-1.5.0/examples/README.md +97 -0
  22. akgentic_core-1.5.0/pyproject.toml +83 -0
  23. akgentic_core-1.5.0/quick_start.py +25 -0
  24. akgentic_core-1.5.0/src/akgentic/__init__.py +2 -0
  25. akgentic_core-1.5.0/src/akgentic/core/__init__.py +59 -0
  26. akgentic_core-1.5.0/src/akgentic/core/actor_address.py +150 -0
  27. akgentic_core-1.5.0/src/akgentic/core/actor_address_impl.py +377 -0
  28. akgentic_core-1.5.0/src/akgentic/core/actor_system_impl.py +472 -0
  29. akgentic_core-1.5.0/src/akgentic/core/agent.py +757 -0
  30. akgentic_core-1.5.0/src/akgentic/core/agent_card.py +339 -0
  31. akgentic_core-1.5.0/src/akgentic/core/agent_config.py +78 -0
  32. akgentic_core-1.5.0/src/akgentic/core/agent_state.py +113 -0
  33. akgentic_core-1.5.0/src/akgentic/core/diagnostics/__init__.py +28 -0
  34. akgentic_core-1.5.0/src/akgentic/core/diagnostics/memory.py +421 -0
  35. akgentic_core-1.5.0/src/akgentic/core/messages/__init__.py +39 -0
  36. akgentic_core-1.5.0/src/akgentic/core/messages/message.py +121 -0
  37. akgentic_core-1.5.0/src/akgentic/core/messages/orchestrator.py +125 -0
  38. akgentic_core-1.5.0/src/akgentic/core/orchestrator.py +936 -0
  39. akgentic_core-1.5.0/src/akgentic/core/py.typed +0 -0
  40. akgentic_core-1.5.0/src/akgentic/core/user_proxy.py +96 -0
  41. akgentic_core-1.5.0/src/akgentic/core/utils/__init__.py +37 -0
  42. akgentic_core-1.5.0/src/akgentic/core/utils/deserializer.py +202 -0
  43. akgentic_core-1.5.0/src/akgentic/core/utils/serializer.py +304 -0
  44. akgentic_core-1.5.0/tests/__init__.py +1 -0
  45. akgentic_core-1.5.0/tests/core/test_actor_address.py +353 -0
  46. akgentic_core-1.5.0/tests/core/test_actor_identity.py +162 -0
  47. akgentic_core-1.5.0/tests/core/test_actor_system_impl.py +421 -0
  48. akgentic_core-1.5.0/tests/core/test_agent.py +657 -0
  49. akgentic_core-1.5.0/tests/core/test_agent_card.py +604 -0
  50. akgentic_core-1.5.0/tests/core/test_agent_card_config_coercion.py +282 -0
  51. akgentic_core-1.5.0/tests/core/test_agent_card_role_property.py +146 -0
  52. akgentic_core-1.5.0/tests/core/test_agent_config.py +116 -0
  53. akgentic_core-1.5.0/tests/core/test_agent_state.py +291 -0
  54. akgentic_core-1.5.0/tests/core/test_message.py +340 -0
  55. akgentic_core-1.5.0/tests/core/test_orchestrator.py +1541 -0
  56. akgentic_core-1.5.0/tests/core/test_orchestrator_stop.py +679 -0
  57. akgentic_core-1.5.0/tests/core/test_orchestrator_timer.py +622 -0
  58. akgentic_core-1.5.0/tests/core/test_package_init.py +16 -0
  59. akgentic_core-1.5.0/tests/core/test_pykka_mailbox_drain_on_self_stop.py +167 -0
  60. akgentic_core-1.5.0/tests/core/test_serializer.py +973 -0
  61. akgentic_core-1.5.0/tests/core/test_user_proxy.py +178 -0
  62. akgentic_core-1.5.0/tests/examples/test_example_dynamic_agents.py +476 -0
  63. akgentic_core-1.5.0/tests/examples/test_example_hello_world.py +141 -0
  64. akgentic_core-1.5.0/tests/examples/test_example_multi_agent.py +676 -0
  65. akgentic_core-1.5.0/tests/examples/test_example_request_response.py +343 -0
  66. akgentic_core-1.5.0/tests/examples/test_example_stateful_agents.py +633 -0
  67. akgentic_core-1.5.0/tests/test_diagnostics_memory.py +471 -0
  68. akgentic_core-1.5.0/tests/test_epic3_integration.py +328 -0
  69. akgentic_core-1.5.0/tests/test_init_llm_context.py +70 -0
  70. akgentic_core-1.5.0/tests/test_public_api.py +202 -0
  71. akgentic_core-1.5.0/tests/test_readme_quick_start.py +60 -0
  72. akgentic_core-1.5.0/tests/test_timer_integration.py +328 -0
@@ -0,0 +1,55 @@
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
+
12
+ jobs:
13
+ quality:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - name: Checkout akgentic-core
17
+ uses: actions/checkout@v6
18
+
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v8.1.0
21
+ with:
22
+ version: "latest"
23
+
24
+ - name: Set up Python 3.12
25
+ run: uv python install 3.12
26
+
27
+ - name: Install dependencies
28
+ run: uv sync --extra dev
29
+
30
+ - name: Type checking
31
+ run: uv run mypy src/
32
+
33
+ - name: Linting
34
+ run: uv run ruff check src/
35
+
36
+ - name: Run tests with coverage
37
+ run: >
38
+ uv run pytest tests/
39
+ --cov=akgentic.core
40
+ --cov-report=term-missing
41
+ --cov-report=json:coverage.json
42
+ --cov-fail-under=80
43
+
44
+ - name: Update coverage badge
45
+ if: github.ref_name == 'master' && github.event_name == 'push'
46
+ run: |
47
+ COVERAGE=$(python -c "import json; print(int(json.load(open('coverage.json'))['totals']['percent_covered_display']))")
48
+ if [ "$COVERAGE" -ge 90 ]; then COLOR="brightgreen"
49
+ elif [ "$COVERAGE" -ge 80 ]; then COLOR="green"
50
+ elif [ "$COVERAGE" -ge 70 ]; then COLOR="yellow"
51
+ else COLOR="red"; fi
52
+ echo "{\"schemaVersion\":1,\"label\":\"coverage\",\"message\":\"${COVERAGE}%\",\"color\":\"${COLOR}\"}" > badge.json
53
+ gh gist edit 5fae2fa4f4f3cd3fc5cc08f5d2a7da44 -f coverage.json badge.json
54
+ env:
55
+ 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/
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,94 @@
1
+ # Contributing to Akgentic v2
2
+
3
+ ## Development Setup
4
+
5
+ 1. Clone the repository
6
+ 2. Install uv: https://docs.astral.sh/uv/getting-started/installation/
7
+ 3. Install dependencies:
8
+ ```bash
9
+ cd akgentic-core
10
+ uv sync --dev
11
+ ```
12
+
13
+ ## Code Quality Requirements
14
+
15
+ All contributions must pass these checks before merging:
16
+
17
+ ### Type Checking (mypy)
18
+
19
+ ```bash
20
+ uv run mypy src/
21
+ ```
22
+
23
+ - Strict mode enabled (no untyped definitions allowed)
24
+ - All public APIs must have complete type annotations
25
+ - Use Python 3.12+ type syntax (`|` for unions, not `Optional`)
26
+
27
+ ### Linting (ruff)
28
+
29
+ ```bash
30
+ # Check for issues
31
+ uv run ruff check src/
32
+
33
+ # Auto-fix issues
34
+ uv run ruff check --fix src/
35
+ ```
36
+
37
+ - Rules enforced: E, F, I, N, UP, ANN, ASYNC
38
+ - Line length: 100 characters
39
+
40
+ ### Testing (pytest)
41
+
42
+ ```bash
43
+ # Run tests
44
+ uv run pytest
45
+
46
+ # Run with coverage
47
+ uv run pytest --cov=src/akgentic --cov-report=term-missing
48
+ ```
49
+
50
+ - Minimum 80% code coverage required
51
+ - All public APIs must have unit tests
52
+
53
+ ## Type Hint Guidelines
54
+
55
+ Use modern Python 3.12+ type syntax:
56
+
57
+ ```python
58
+ # Correct
59
+ def get_agent(self, agent_id: str) -> ActorRef | None: ...
60
+ self.state_dict: dict[str, BaseState | dict] = {}
61
+
62
+ # Incorrect (old style)
63
+ from typing import Optional, Dict, Union
64
+ def get_agent(self, agent_id: str) -> Optional[ActorRef]: ...
65
+ ```
66
+
67
+ ## Docstring Style
68
+
69
+ Use Google-style docstrings for all public APIs:
70
+
71
+ ```python
72
+ def create_agent(self, config: AgentConfig) -> ActorRef:
73
+ """Create and start a new agent actor.
74
+
75
+ Args:
76
+ config: Configuration object for the agent
77
+
78
+ Returns:
79
+ Reference to the created actor
80
+
81
+ Raises:
82
+ ValueError: If config is invalid
83
+ """
84
+ ```
85
+
86
+ ## Pull Request Checklist
87
+
88
+ Before submitting a PR:
89
+
90
+ - [ ] `uv run mypy src/` passes with zero errors
91
+ - [ ] `uv run ruff check src/` passes with zero violations
92
+ - [ ] `uv run pytest` passes with 80%+ coverage
93
+ - [ ] All public APIs have type hints
94
+ - [ ] All public APIs have Google-style docstrings