ejagent-core 0.6.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 (104) hide show
  1. ejagent_core-0.6.0/.env.example +8 -0
  2. ejagent_core-0.6.0/.github/workflows/ci.yml +68 -0
  3. ejagent_core-0.6.0/.github/workflows/release.yml +150 -0
  4. ejagent_core-0.6.0/.gitignore +18 -0
  5. ejagent_core-0.6.0/.python-version +1 -0
  6. ejagent_core-0.6.0/LICENSE +21 -0
  7. ejagent_core-0.6.0/PKG-INFO +1075 -0
  8. ejagent_core-0.6.0/README.md +1036 -0
  9. ejagent_core-0.6.0/README_zh-CN.md +861 -0
  10. ejagent_core-0.6.0/benchmarks/session_journal.py +64 -0
  11. ejagent_core-0.6.0/docs/pi-harness-gap-analysis.md +617 -0
  12. ejagent_core-0.6.0/examples/01_stateful_chat.py +32 -0
  13. ejagent_core-0.6.0/examples/02_custom_tool.py +71 -0
  14. ejagent_core-0.6.0/examples/04_mcp_tools.py +37 -0
  15. ejagent_core-0.6.0/examples/06_skill.py +36 -0
  16. ejagent_core-0.6.0/examples/07_event_observers.py +54 -0
  17. ejagent_core-0.6.0/examples/08_session_resume.py +70 -0
  18. ejagent_core-0.6.0/examples/09_runtime_control.py +79 -0
  19. ejagent_core-0.6.0/examples/10_composed_harness.py +161 -0
  20. ejagent_core-0.6.0/examples/11_streaming_events.py +59 -0
  21. ejagent_core-0.6.0/examples/12_tool_progress.py +115 -0
  22. ejagent_core-0.6.0/examples/13_usage_budget.py +105 -0
  23. ejagent_core-0.6.0/examples/14_context_pressure.py +180 -0
  24. ejagent_core-0.6.0/examples/15_explicit_compaction.py +169 -0
  25. ejagent_core-0.6.0/examples/16_durable_session.py +91 -0
  26. ejagent_core-0.6.0/examples/17_session_tree.py +65 -0
  27. ejagent_core-0.6.0/examples/README.md +97 -0
  28. ejagent_core-0.6.0/examples/mcp_config.json +9 -0
  29. ejagent_core-0.6.0/examples/skills/release_notes/SKILL.md +17 -0
  30. ejagent_core-0.6.0/examples/skills/release_notes/examples/sample.md +9 -0
  31. ejagent_core-0.6.0/examples/skills/release_notes/template.md +13 -0
  32. ejagent_core-0.6.0/pyproject.toml +67 -0
  33. ejagent_core-0.6.0/src/ejagent/__init__.py +335 -0
  34. ejagent_core-0.6.0/src/ejagent/agent/__init__.py +223 -0
  35. ejagent_core-0.6.0/src/ejagent/agent/base.py +666 -0
  36. ejagent_core-0.6.0/src/ejagent/agent/behavior.py +115 -0
  37. ejagent_core-0.6.0/src/ejagent/agent/cancellation.py +98 -0
  38. ejagent_core-0.6.0/src/ejagent/agent/compaction.py +439 -0
  39. ejagent_core-0.6.0/src/ejagent/agent/context_builder.py +125 -0
  40. ejagent_core-0.6.0/src/ejagent/agent/context_management.py +409 -0
  41. ejagent_core-0.6.0/src/ejagent/agent/control.py +334 -0
  42. ejagent_core-0.6.0/src/ejagent/agent/events.py +367 -0
  43. ejagent_core-0.6.0/src/ejagent/agent/model_compactor.py +64 -0
  44. ejagent_core-0.6.0/src/ejagent/agent/orchestrator.py +866 -0
  45. ejagent_core-0.6.0/src/ejagent/agent/result.py +65 -0
  46. ejagent_core-0.6.0/src/ejagent/agent/runtime_policy.py +33 -0
  47. ejagent_core-0.6.0/src/ejagent/agent/state.py +136 -0
  48. ejagent_core-0.6.0/src/ejagent/agent/tool_runtime.py +517 -0
  49. ejagent_core-0.6.0/src/ejagent/agent/types.py +64 -0
  50. ejagent_core-0.6.0/src/ejagent/agent/usage.py +143 -0
  51. ejagent_core-0.6.0/src/ejagent/handlers/__init__.py +23 -0
  52. ejagent_core-0.6.0/src/ejagent/handlers/base.py +178 -0
  53. ejagent_core-0.6.0/src/ejagent/handlers/definition.py +149 -0
  54. ejagent_core-0.6.0/src/ejagent/handlers/mcp.py +114 -0
  55. ejagent_core-0.6.0/src/ejagent/logger.py +44 -0
  56. ejagent_core-0.6.0/src/ejagent/middleware/__init__.py +47 -0
  57. ejagent_core-0.6.0/src/ejagent/middleware/base.py +113 -0
  58. ejagent_core-0.6.0/src/ejagent/middleware/policy.py +374 -0
  59. ejagent_core-0.6.0/src/ejagent/middleware/validation.py +189 -0
  60. ejagent_core-0.6.0/src/ejagent/plugins/__init__.py +6 -0
  61. ejagent_core-0.6.0/src/ejagent/plugins/mcp/mcp_manager.py +156 -0
  62. ejagent_core-0.6.0/src/ejagent/plugins/skill/skill_manager.py +233 -0
  63. ejagent_core-0.6.0/src/ejagent/providers/__init__.py +38 -0
  64. ejagent_core-0.6.0/src/ejagent/providers/base.py +232 -0
  65. ejagent_core-0.6.0/src/ejagent/providers/openai.py +429 -0
  66. ejagent_core-0.6.0/src/ejagent/py.typed +1 -0
  67. ejagent_core-0.6.0/src/ejagent/session/__init__.py +73 -0
  68. ejagent_core-0.6.0/src/ejagent/session/_file_lock.py +168 -0
  69. ejagent_core-0.6.0/src/ejagent/session/codec.py +278 -0
  70. ejagent_core-0.6.0/src/ejagent/session/errors.py +18 -0
  71. ejagent_core-0.6.0/src/ejagent/session/journal.py +504 -0
  72. ejagent_core-0.6.0/src/ejagent/session/jsonl.py +963 -0
  73. ejagent_core-0.6.0/src/ejagent/session/memory.py +20 -0
  74. ejagent_core-0.6.0/src/ejagent/session/recorder.py +196 -0
  75. ejagent_core-0.6.0/src/ejagent/session/storage.py +91 -0
  76. ejagent_core-0.6.0/src/ejagent/session/tree.py +62 -0
  77. ejagent_core-0.6.0/src/ejagent/session/types.py +290 -0
  78. ejagent_core-0.6.0/tests/__init__.py +0 -0
  79. ejagent_core-0.6.0/tests/package_artifact_smoke.py +77 -0
  80. ejagent_core-0.6.0/tests/public_api_smoke.py +121 -0
  81. ejagent_core-0.6.0/tests/test_agent.py +1603 -0
  82. ejagent_core-0.6.0/tests/test_agent_cancellation.py +345 -0
  83. ejagent_core-0.6.0/tests/test_agent_continue.py +390 -0
  84. ejagent_core-0.6.0/tests/test_agent_events.py +378 -0
  85. ejagent_core-0.6.0/tests/test_agent_follow_up.py +278 -0
  86. ejagent_core-0.6.0/tests/test_agent_session.py +265 -0
  87. ejagent_core-0.6.0/tests/test_agent_steering.py +331 -0
  88. ejagent_core-0.6.0/tests/test_agent_streaming.py +577 -0
  89. ejagent_core-0.6.0/tests/test_auto_compaction.py +457 -0
  90. ejagent_core-0.6.0/tests/test_behavior_hooks.py +364 -0
  91. ejagent_core-0.6.0/tests/test_context_compaction.py +477 -0
  92. ejagent_core-0.6.0/tests/test_context_management.py +336 -0
  93. ejagent_core-0.6.0/tests/test_examples.py +78 -0
  94. ejagent_core-0.6.0/tests/test_mcp_manager.py +111 -0
  95. ejagent_core-0.6.0/tests/test_model_compactor.py +132 -0
  96. ejagent_core-0.6.0/tests/test_parallel_tool_calls.py +533 -0
  97. ejagent_core-0.6.0/tests/test_provider_errors.py +94 -0
  98. ejagent_core-0.6.0/tests/test_session_persistence.py +947 -0
  99. ejagent_core-0.6.0/tests/test_tool_definitions.py +347 -0
  100. ejagent_core-0.6.0/tests/test_tool_policy.py +480 -0
  101. ejagent_core-0.6.0/tests/test_tool_progress.py +326 -0
  102. ejagent_core-0.6.0/tests/test_tool_validation.py +543 -0
  103. ejagent_core-0.6.0/tests/test_usage_budget.py +487 -0
  104. ejagent_core-0.6.0/uv.lock +1662 -0
@@ -0,0 +1,8 @@
1
+ MODEL_API_KEY=sk--x
2
+ MODEL_URL=https://api.deepseek.com
3
+
4
+ CHAT_MODEL=deepseek-v4-flash
5
+
6
+ LLM_TIMEOUT=30
7
+ LLM_TEMPERATURE=0.7
8
+ LLM_INCLUDE_USAGE=true
@@ -0,0 +1,68 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, dev]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ quality:
13
+ name: Python ${{ matrix.python-version }}
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ python-version: ["3.12", "3.13"]
19
+ env:
20
+ UV_PYTHON: ${{ matrix.python-version }}
21
+ steps:
22
+ - uses: actions/checkout@v7
23
+
24
+ - name: Install uv
25
+ uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
26
+ with:
27
+ enable-cache: true
28
+
29
+ - name: Install project and development dependencies
30
+ run: uv sync --locked --all-extras --group dev
31
+
32
+ - name: Lint
33
+ run: uv run ruff check src tests examples benchmarks
34
+
35
+ - name: Check formatting
36
+ run: uv run ruff format --check src tests examples benchmarks
37
+
38
+ - name: Type check
39
+ run: uv run mypy
40
+
41
+ - name: Test
42
+ run: uv run python -m unittest discover -s tests -p 'test*.py' -q
43
+
44
+ package:
45
+ name: Build and installed-package smoke test
46
+ runs-on: ubuntu-latest
47
+ steps:
48
+ - uses: actions/checkout@v7
49
+
50
+ - name: Install uv
51
+ uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
52
+ with:
53
+ enable-cache: true
54
+
55
+ - name: Build distributions
56
+ run: uv build
57
+
58
+ - name: Create clean environment
59
+ run: uv venv --python 3.12 .smoke-venv
60
+
61
+ - name: Validate distribution contents
62
+ run: .smoke-venv/bin/python tests/package_artifact_smoke.py dist
63
+
64
+ - name: Install wheel without optional extras
65
+ run: uv pip install --python .smoke-venv/bin/python dist/*.whl
66
+
67
+ - name: Validate installed public API
68
+ run: .smoke-venv/bin/python tests/public_api_smoke.py --expect-no-mcp
@@ -0,0 +1,150 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*.*.*"
7
+
8
+ concurrency:
9
+ group: release-${{ github.ref }}
10
+ cancel-in-progress: false
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ jobs:
16
+ validate-release:
17
+ name: Validate release tag
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@v7
21
+ with:
22
+ fetch-depth: 0
23
+
24
+ - name: Require a version-matching tag on main
25
+ env:
26
+ RELEASE_TAG: ${{ github.ref_name }}
27
+ run: |
28
+ project_version="$(python3 -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')"
29
+ if [[ "$RELEASE_TAG" != "v$project_version" ]]; then
30
+ echo "Tag $RELEASE_TAG does not match project version $project_version" >&2
31
+ exit 1
32
+ fi
33
+ git merge-base --is-ancestor "$GITHUB_SHA" origin/main
34
+
35
+ quality:
36
+ name: Verify Python ${{ matrix.python-version }}
37
+ needs: validate-release
38
+ runs-on: ubuntu-latest
39
+ strategy:
40
+ fail-fast: false
41
+ matrix:
42
+ python-version: ["3.12", "3.13"]
43
+ env:
44
+ UV_PYTHON: ${{ matrix.python-version }}
45
+ steps:
46
+ - uses: actions/checkout@v7
47
+
48
+ - name: Install uv
49
+ uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
50
+ with:
51
+ enable-cache: true
52
+
53
+ - name: Install project and development dependencies
54
+ run: uv sync --locked --all-extras --group dev
55
+
56
+ - name: Lint
57
+ run: uv run ruff check src tests examples benchmarks
58
+
59
+ - name: Check formatting
60
+ run: uv run ruff format --check src tests examples benchmarks
61
+
62
+ - name: Type check
63
+ run: uv run mypy
64
+
65
+ - name: Test
66
+ run: uv run python -m unittest discover -s tests -p 'test*.py' -q
67
+
68
+ build:
69
+ name: Build distributions
70
+ needs: quality
71
+ runs-on: ubuntu-latest
72
+ env:
73
+ UV_PYTHON: "3.12"
74
+ steps:
75
+ - uses: actions/checkout@v7
76
+
77
+ - name: Install uv
78
+ uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
79
+ with:
80
+ enable-cache: true
81
+
82
+ - name: Build distributions
83
+ run: uv build
84
+
85
+ - name: Create clean environment
86
+ run: uv venv --python 3.12 .release-smoke
87
+
88
+ - name: Validate distribution contents
89
+ run: .release-smoke/bin/python tests/package_artifact_smoke.py dist
90
+
91
+ - name: Install wheel without optional extras
92
+ run: uv pip install --python .release-smoke/bin/python dist/*.whl
93
+
94
+ - name: Validate installed public API
95
+ run: .release-smoke/bin/python tests/public_api_smoke.py --expect-no-mcp
96
+
97
+ - name: Upload distributions
98
+ uses: actions/upload-artifact@v7
99
+ with:
100
+ name: python-package-distributions
101
+ path: dist/
102
+ if-no-files-found: error
103
+ retention-days: 7
104
+
105
+ publish:
106
+ name: Publish distributions to PyPI
107
+ needs: build
108
+ runs-on: ubuntu-latest
109
+ environment:
110
+ name: pypi
111
+ url: https://pypi.org/p/ejagent-core
112
+ permissions:
113
+ id-token: write
114
+ steps:
115
+ - name: Download distributions
116
+ uses: actions/download-artifact@v8
117
+ with:
118
+ name: python-package-distributions
119
+ path: dist/
120
+
121
+ - name: Publish distributions to PyPI
122
+ uses: pypa/gh-action-pypi-publish@release/v1
123
+
124
+ github-release:
125
+ name: Publish GitHub Release
126
+ needs: build
127
+ runs-on: ubuntu-latest
128
+ permissions:
129
+ contents: write
130
+ steps:
131
+ - name: Download distributions
132
+ uses: actions/download-artifact@v8
133
+ with:
134
+ name: python-package-distributions
135
+ path: dist/
136
+
137
+ - name: Create or update GitHub Release
138
+ env:
139
+ GH_TOKEN: ${{ github.token }}
140
+ GH_REPO: ${{ github.repository }}
141
+ RELEASE_TAG: ${{ github.ref_name }}
142
+ run: |
143
+ if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then
144
+ gh release upload "$RELEASE_TAG" dist/* --clobber
145
+ else
146
+ gh release create "$RELEASE_TAG" dist/* \
147
+ --verify-tag \
148
+ --generate-notes \
149
+ --title "$RELEASE_TAG"
150
+ fi
@@ -0,0 +1,18 @@
1
+ .env
2
+
3
+ __pycache__/
4
+
5
+ my_skills
6
+
7
+ .ruff_cache
8
+
9
+ .playwright-mcp
10
+
11
+ .DS_Store
12
+
13
+ .claude
14
+
15
+ .pytest_cache
16
+
17
+ .ejagent-sessions
18
+ .simagentplg-sessions
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.