agentforge-core 0.2.1__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 (105) hide show
  1. agentforge_core-0.2.1/.gitignore +49 -0
  2. agentforge_core-0.2.1/LICENSE +202 -0
  3. agentforge_core-0.2.1/PKG-INFO +66 -0
  4. agentforge_core-0.2.1/README.md +40 -0
  5. agentforge_core-0.2.1/pyproject.toml +63 -0
  6. agentforge_core-0.2.1/src/agentforge_core/__init__.py +228 -0
  7. agentforge_core-0.2.1/src/agentforge_core/_bm25.py +132 -0
  8. agentforge_core-0.2.1/src/agentforge_core/config/__init__.py +62 -0
  9. agentforge_core-0.2.1/src/agentforge_core/config/loader.py +239 -0
  10. agentforge_core-0.2.1/src/agentforge_core/config/module_schemas.py +208 -0
  11. agentforge_core-0.2.1/src/agentforge_core/config/schema.py +424 -0
  12. agentforge_core-0.2.1/src/agentforge_core/contracts/__init__.py +52 -0
  13. agentforge_core-0.2.1/src/agentforge_core/contracts/auth.py +33 -0
  14. agentforge_core-0.2.1/src/agentforge_core/contracts/chat.py +118 -0
  15. agentforge_core-0.2.1/src/agentforge_core/contracts/embedding.py +71 -0
  16. agentforge_core-0.2.1/src/agentforge_core/contracts/evaluator.py +56 -0
  17. agentforge_core-0.2.1/src/agentforge_core/contracts/finding.py +39 -0
  18. agentforge_core-0.2.1/src/agentforge_core/contracts/graph_store.py +180 -0
  19. agentforge_core-0.2.1/src/agentforge_core/contracts/guardrails.py +129 -0
  20. agentforge_core-0.2.1/src/agentforge_core/contracts/llm.py +152 -0
  21. agentforge_core-0.2.1/src/agentforge_core/contracts/memory.py +113 -0
  22. agentforge_core-0.2.1/src/agentforge_core/contracts/migrator.py +120 -0
  23. agentforge_core-0.2.1/src/agentforge_core/contracts/renderer.py +57 -0
  24. agentforge_core-0.2.1/src/agentforge_core/contracts/reranker.py +91 -0
  25. agentforge_core-0.2.1/src/agentforge_core/contracts/strategy.py +70 -0
  26. agentforge_core-0.2.1/src/agentforge_core/contracts/task.py +73 -0
  27. agentforge_core-0.2.1/src/agentforge_core/contracts/tool.py +71 -0
  28. agentforge_core-0.2.1/src/agentforge_core/contracts/vector_store.py +151 -0
  29. agentforge_core-0.2.1/src/agentforge_core/migrations/__init__.py +14 -0
  30. agentforge_core-0.2.1/src/agentforge_core/migrations/discover.py +77 -0
  31. agentforge_core-0.2.1/src/agentforge_core/migrations/template.py +34 -0
  32. agentforge_core-0.2.1/src/agentforge_core/observability/__init__.py +18 -0
  33. agentforge_core-0.2.1/src/agentforge_core/observability/tracing.py +37 -0
  34. agentforge_core-0.2.1/src/agentforge_core/production/__init__.py +77 -0
  35. agentforge_core-0.2.1/src/agentforge_core/production/budget.py +134 -0
  36. agentforge_core-0.2.1/src/agentforge_core/production/exceptions.py +136 -0
  37. agentforge_core-0.2.1/src/agentforge_core/production/fallback.py +321 -0
  38. agentforge_core-0.2.1/src/agentforge_core/production/log_filter.py +49 -0
  39. agentforge_core-0.2.1/src/agentforge_core/production/log_format.py +117 -0
  40. agentforge_core-0.2.1/src/agentforge_core/production/run_context.py +108 -0
  41. agentforge_core-0.2.1/src/agentforge_core/py.typed +0 -0
  42. agentforge_core-0.2.1/src/agentforge_core/resolver/__init__.py +38 -0
  43. agentforge_core-0.2.1/src/agentforge_core/resolver/discover.py +145 -0
  44. agentforge_core-0.2.1/src/agentforge_core/resolver/resolve.py +168 -0
  45. agentforge_core-0.2.1/src/agentforge_core/testing/__init__.py +45 -0
  46. agentforge_core-0.2.1/src/agentforge_core/testing/conformance.py +1138 -0
  47. agentforge_core-0.2.1/src/agentforge_core/values/__init__.py +103 -0
  48. agentforge_core-0.2.1/src/agentforge_core/values/auth.py +20 -0
  49. agentforge_core-0.2.1/src/agentforge_core/values/chat.py +131 -0
  50. agentforge_core-0.2.1/src/agentforge_core/values/claim.py +30 -0
  51. agentforge_core-0.2.1/src/agentforge_core/values/graph.py +136 -0
  52. agentforge_core-0.2.1/src/agentforge_core/values/guardrails.py +49 -0
  53. agentforge_core-0.2.1/src/agentforge_core/values/manifest.py +129 -0
  54. agentforge_core-0.2.1/src/agentforge_core/values/messages.py +153 -0
  55. agentforge_core-0.2.1/src/agentforge_core/values/module.py +40 -0
  56. agentforge_core-0.2.1/src/agentforge_core/values/pipeline.py +43 -0
  57. agentforge_core-0.2.1/src/agentforge_core/values/retrieval.py +53 -0
  58. agentforge_core-0.2.1/src/agentforge_core/values/state.py +118 -0
  59. agentforge_core-0.2.1/src/agentforge_core/values/vector.py +59 -0
  60. agentforge_core-0.2.1/tests/conftest.py +3 -0
  61. agentforge_core-0.2.1/tests/unit/.gitkeep +0 -0
  62. agentforge_core-0.2.1/tests/unit/test_auth_values.py +26 -0
  63. agentforge_core-0.2.1/tests/unit/test_bm25.py +155 -0
  64. agentforge_core-0.2.1/tests/unit/test_budget.py +193 -0
  65. agentforge_core-0.2.1/tests/unit/test_capability_extensions.py +231 -0
  66. agentforge_core-0.2.1/tests/unit/test_chat_conformance.py +124 -0
  67. agentforge_core-0.2.1/tests/unit/test_chat_values.py +63 -0
  68. agentforge_core-0.2.1/tests/unit/test_claim.py +66 -0
  69. agentforge_core-0.2.1/tests/unit/test_config_chat.py +73 -0
  70. agentforge_core-0.2.1/tests/unit/test_config_feat012.py +284 -0
  71. agentforge_core-0.2.1/tests/unit/test_config_module_schemas.py +192 -0
  72. agentforge_core-0.2.1/tests/unit/test_config_pipeline.py +63 -0
  73. agentforge_core-0.2.1/tests/unit/test_config_retrieval.py +91 -0
  74. agentforge_core-0.2.1/tests/unit/test_contracts_auth.py +27 -0
  75. agentforge_core-0.2.1/tests/unit/test_contracts_chat.py +97 -0
  76. agentforge_core-0.2.1/tests/unit/test_contracts_evaluator.py +78 -0
  77. agentforge_core-0.2.1/tests/unit/test_contracts_finding.py +63 -0
  78. agentforge_core-0.2.1/tests/unit/test_contracts_llm.py +62 -0
  79. agentforge_core-0.2.1/tests/unit/test_contracts_memory.py +140 -0
  80. agentforge_core-0.2.1/tests/unit/test_contracts_strategy.py +28 -0
  81. agentforge_core-0.2.1/tests/unit/test_contracts_task.py +71 -0
  82. agentforge_core-0.2.1/tests/unit/test_contracts_tool.py +94 -0
  83. agentforge_core-0.2.1/tests/unit/test_embedding_client.py +134 -0
  84. agentforge_core-0.2.1/tests/unit/test_exceptions.py +56 -0
  85. agentforge_core-0.2.1/tests/unit/test_fallback_chain.py +343 -0
  86. agentforge_core-0.2.1/tests/unit/test_graph_store_contract.py +107 -0
  87. agentforge_core-0.2.1/tests/unit/test_guardrails_config.py +55 -0
  88. agentforge_core-0.2.1/tests/unit/test_guardrails_contracts.py +129 -0
  89. agentforge_core-0.2.1/tests/unit/test_log_filter.py +101 -0
  90. agentforge_core-0.2.1/tests/unit/test_log_format.py +173 -0
  91. agentforge_core-0.2.1/tests/unit/test_messages.py +164 -0
  92. agentforge_core-0.2.1/tests/unit/test_migrations.py +194 -0
  93. agentforge_core-0.2.1/tests/unit/test_pipeline_values.py +38 -0
  94. agentforge_core-0.2.1/tests/unit/test_provider_errors.py +78 -0
  95. agentforge_core-0.2.1/tests/unit/test_reranker_contract.py +97 -0
  96. agentforge_core-0.2.1/tests/unit/test_resolver.py +211 -0
  97. agentforge_core-0.2.1/tests/unit/test_resolver_discovery.py +243 -0
  98. agentforge_core-0.2.1/tests/unit/test_run_context.py +133 -0
  99. agentforge_core-0.2.1/tests/unit/test_state.py +123 -0
  100. agentforge_core-0.2.1/tests/unit/test_strategy_conformance.py +92 -0
  101. agentforge_core-0.2.1/tests/unit/test_strategy_stream_default.py +74 -0
  102. agentforge_core-0.2.1/tests/unit/test_task_conformance.py +74 -0
  103. agentforge_core-0.2.1/tests/unit/test_values_graph.py +176 -0
  104. agentforge_core-0.2.1/tests/unit/test_values_vector.py +85 -0
  105. agentforge_core-0.2.1/tests/unit/test_vector_store_contract.py +96 -0
@@ -0,0 +1,49 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+
7
+ # Distribution / packaging
8
+ .Python
9
+ build/
10
+ dist/
11
+ *.egg-info/
12
+ *.egg
13
+ wheels/
14
+ sdist/
15
+ share/python-wheels/
16
+
17
+ # uv
18
+ .venv/
19
+ uv-cache/
20
+
21
+ # Testing
22
+ .pytest_cache/
23
+ .coverage
24
+ .coverage.*
25
+ htmlcov/
26
+ coverage.xml
27
+ .tox/
28
+ .mypy_cache/
29
+ .ruff_cache/
30
+ .hypothesis/
31
+
32
+ # Environment
33
+ .env
34
+ .envrc
35
+
36
+ # Editors
37
+ .vscode/
38
+ .idea/
39
+ *.swp
40
+ *.swo
41
+ *~
42
+
43
+ # OS
44
+ .DS_Store
45
+ Thumbs.db
46
+
47
+ # Project-local
48
+ *.local
49
+ .agentforge-state/.session-cache
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,66 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentforge-core
3
+ Version: 0.2.1
4
+ Summary: AgentForge core — stable contracts (ABCs, value types) for the agentic framework
5
+ Project-URL: Homepage, https://github.com/Scaffoldic/agentforge-py
6
+ Project-URL: Repository, https://github.com/Scaffoldic/agentforge-py
7
+ Project-URL: Documentation, https://github.com/Scaffoldic/agentforge-py
8
+ Project-URL: Changelog, https://github.com/Scaffoldic/agentforge-py/blob/main/CHANGELOG.md
9
+ Project-URL: Issues, https://github.com/Scaffoldic/agentforge-py/issues
10
+ Author: The AgentForge Authors
11
+ License-Expression: Apache-2.0
12
+ License-File: LICENSE
13
+ Keywords: agent,ai,contracts,framework,llm
14
+ Classifier: Development Status :: 2 - Pre-Alpha
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: Apache Software License
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Classifier: Typing :: Typed
21
+ Requires-Python: >=3.13
22
+ Requires-Dist: opentelemetry-api>=1.27
23
+ Requires-Dist: pydantic>=2.10
24
+ Requires-Dist: python-ulid>=3.0
25
+ Description-Content-Type: text/markdown
26
+
27
+ # agentforge-core
28
+
29
+ The stable contract layer for AgentForge. ABCs, Protocols, and value
30
+ types that every module implements.
31
+
32
+ ## What's in here
33
+
34
+ (Once feat-001 lands.)
35
+
36
+ - `LLMClient`, `EmbeddingClient` — provider abstractions
37
+ - `ReasoningStrategy` — agent loop shape
38
+ - `Tool` — pluggable capabilities
39
+ - `MemoryStore`, `GraphStore` — persistence
40
+ - `Evaluator` — post-run scoring
41
+ - `InputValidator`, `OutputValidator`, `ToolCallGate` — real-time safety
42
+ - `Finding` — output Protocol with shipped variants
43
+ - `BudgetPolicy`, `RunContext`, `RunIdFilter` — production rails
44
+ - Value types: `Claim`, `Step`, `RunResult`, etc.
45
+
46
+ This package is a **locked contract** — adding a method to an ABC is a
47
+ major version bump. See ADR-0007.
48
+
49
+ ## What's NOT in here
50
+
51
+ - Reference implementations (`ReActLoop`, `InMemoryStore`, etc.) — those
52
+ live in `agentforge`
53
+ - Provider clients — those live in `agentforge-anthropic`, etc.
54
+ - Anything that does I/O
55
+
56
+ ## Install
57
+
58
+ ```bash
59
+ pip install agentforge-core
60
+ ```
61
+
62
+ Most users install `agentforge` directly, which depends on this package.
63
+
64
+ ## License
65
+
66
+ Apache 2.0.
@@ -0,0 +1,40 @@
1
+ # agentforge-core
2
+
3
+ The stable contract layer for AgentForge. ABCs, Protocols, and value
4
+ types that every module implements.
5
+
6
+ ## What's in here
7
+
8
+ (Once feat-001 lands.)
9
+
10
+ - `LLMClient`, `EmbeddingClient` — provider abstractions
11
+ - `ReasoningStrategy` — agent loop shape
12
+ - `Tool` — pluggable capabilities
13
+ - `MemoryStore`, `GraphStore` — persistence
14
+ - `Evaluator` — post-run scoring
15
+ - `InputValidator`, `OutputValidator`, `ToolCallGate` — real-time safety
16
+ - `Finding` — output Protocol with shipped variants
17
+ - `BudgetPolicy`, `RunContext`, `RunIdFilter` — production rails
18
+ - Value types: `Claim`, `Step`, `RunResult`, etc.
19
+
20
+ This package is a **locked contract** — adding a method to an ABC is a
21
+ major version bump. See ADR-0007.
22
+
23
+ ## What's NOT in here
24
+
25
+ - Reference implementations (`ReActLoop`, `InMemoryStore`, etc.) — those
26
+ live in `agentforge`
27
+ - Provider clients — those live in `agentforge-anthropic`, etc.
28
+ - Anything that does I/O
29
+
30
+ ## Install
31
+
32
+ ```bash
33
+ pip install agentforge-core
34
+ ```
35
+
36
+ Most users install `agentforge` directly, which depends on this package.
37
+
38
+ ## License
39
+
40
+ Apache 2.0.
@@ -0,0 +1,63 @@
1
+ # agentforge-core — locked contracts (ABCs, value types) for AgentForge.
2
+ #
3
+ # This package ships only the stable contract layer. No I/O. No
4
+ # third-party SDKs except Pydantic. Every other module pins against
5
+ # this package's major version and implements its ABCs.
6
+ #
7
+ # Per ADR-0007 (ABC + Protocol as the framework's stable surface) and
8
+ # ADR-0003 (three-tier package model — this is Tier 1).
9
+
10
+ [project]
11
+ name = "agentforge-core"
12
+ version = "0.2.1"
13
+ description = "AgentForge core — stable contracts (ABCs, value types) for the agentic framework"
14
+ readme = "README.md"
15
+ requires-python = ">=3.13"
16
+ license = "Apache-2.0"
17
+ license-files = ["LICENSE"]
18
+ authors = [
19
+ {name = "The AgentForge Authors"},
20
+ ]
21
+ keywords = ["ai", "agent", "llm", "framework", "contracts"]
22
+ classifiers = [
23
+ "Development Status :: 2 - Pre-Alpha",
24
+ "Intended Audience :: Developers",
25
+ "License :: OSI Approved :: Apache Software License",
26
+ "Programming Language :: Python :: 3",
27
+ "Programming Language :: Python :: 3.13",
28
+ "Topic :: Software Development :: Libraries :: Python Modules",
29
+ "Typing :: Typed",
30
+ ]
31
+
32
+ dependencies = [
33
+ "pydantic>=2.10",
34
+ "python-ulid>=3.0",
35
+ # OpenTelemetry API only (no SDK / exporter) — small, stable,
36
+ # pure-Python. When no provider is configured, `tracer.start_*`
37
+ # calls degrade to the NonRecordingTracer (zero-cost no-ops).
38
+ # The SDK + OTLP exporter ship in `agentforge-otel`; consumers
39
+ # opt in by installing that package.
40
+ "opentelemetry-api>=1.27",
41
+ ]
42
+
43
+ [project.urls]
44
+ Homepage = "https://github.com/Scaffoldic/agentforge-py"
45
+ Repository = "https://github.com/Scaffoldic/agentforge-py"
46
+ Documentation = "https://github.com/Scaffoldic/agentforge-py"
47
+ Changelog = "https://github.com/Scaffoldic/agentforge-py/blob/main/CHANGELOG.md"
48
+ Issues = "https://github.com/Scaffoldic/agentforge-py/issues"
49
+
50
+ [build-system]
51
+ requires = ["hatchling>=1.27"]
52
+ build-backend = "hatchling.build"
53
+
54
+ [tool.hatch.build.targets.wheel]
55
+ packages = ["src/agentforge_core"]
56
+
57
+ [tool.hatch.build.targets.sdist]
58
+ include = [
59
+ "src/agentforge_core",
60
+ "tests",
61
+ "README.md",
62
+ "LICENSE",
63
+ ]
@@ -0,0 +1,228 @@
1
+ """AgentForge core — stable contracts (ABCs, value types).
2
+
3
+ Per ADR-0007, this package's public surface is the framework's locked
4
+ contract layer. Adding a method to an ABC is a major version bump.
5
+
6
+ This module re-exports every public symbol so consumers can import
7
+ from `agentforge_core` directly. Submodules (`agentforge_core.contracts`,
8
+ `agentforge_core.values`, `agentforge_core.production`) remain part of
9
+ the public surface for granular imports.
10
+ """
11
+
12
+ from __future__ import annotations
13
+
14
+ from agentforge_core.config import (
15
+ AgentConfig,
16
+ AgentForgeConfig,
17
+ BudgetConfig,
18
+ EvaluatorEntry,
19
+ GraphModuleConfig,
20
+ LoggingConfig,
21
+ MemoryModuleConfig,
22
+ ModuleEntry,
23
+ ModulesConfig,
24
+ ObservabilityEntry,
25
+ OutputConfig,
26
+ ProviderConfig,
27
+ RerankerEntry,
28
+ RetrievalConfig,
29
+ RetrieverModuleConfig,
30
+ load_config,
31
+ parse_overrides,
32
+ )
33
+ from agentforge_core.contracts import (
34
+ EmbeddingClient,
35
+ EvalResult,
36
+ Evaluator,
37
+ Finding,
38
+ FindingRenderer,
39
+ GraphStore,
40
+ LLMClient,
41
+ MemoryStore,
42
+ Migration,
43
+ MigrationChecksumError,
44
+ MigrationStatus,
45
+ Migrator,
46
+ ReasoningStrategy,
47
+ Reranker,
48
+ Tool,
49
+ VectorStore,
50
+ )
51
+ from agentforge_core.migrations import discover_migrations
52
+ from agentforge_core.observability import SCOPE_NAME as OBSERVABILITY_SCOPE_NAME
53
+ from agentforge_core.observability import get_tracer
54
+ from agentforge_core.production import (
55
+ AgentForgeError,
56
+ AuthenticationError,
57
+ BudgetExceeded,
58
+ BudgetPolicy,
59
+ CapabilityNotSupported,
60
+ GuardrailViolation,
61
+ JsonFormatter,
62
+ ModelNotFoundError,
63
+ ModuleError,
64
+ ProviderError,
65
+ RateLimitError,
66
+ RunContext,
67
+ RunIdFilter,
68
+ ServiceError,
69
+ TimeoutError,
70
+ bind_run,
71
+ current_run,
72
+ install_json_formatter,
73
+ install_run_id_filter,
74
+ new_run,
75
+ reset_run,
76
+ uninstall_json_formatter,
77
+ uninstall_run_id_filter,
78
+ )
79
+
80
+ # Imported from the submodule directly (not via production/__init__)
81
+ # to avoid a circular import — see the comment in production/__init__.py
82
+ # for the chain. This import runs *after* production finishes, so
83
+ # LLMClient is already available.
84
+ from agentforge_core.production.fallback import FallbackChain
85
+ from agentforge_core.resolver import (
86
+ Resolver,
87
+ discover_entry_points,
88
+ parse_model_string,
89
+ register,
90
+ register_embedding_provider,
91
+ register_provider,
92
+ reset_discovery,
93
+ )
94
+ from agentforge_core.values import (
95
+ AgentState,
96
+ AppliedEnvVar,
97
+ AppliedManifest,
98
+ AppliedTemplate,
99
+ Claim,
100
+ EmbeddingResponse,
101
+ EnvVarEntry,
102
+ FinishReason,
103
+ GraphEdge,
104
+ GraphNode,
105
+ GraphPattern,
106
+ GraphSegment,
107
+ LLMResponse,
108
+ Manifest,
109
+ Message,
110
+ MessageRole,
111
+ ModuleInfo,
112
+ Path,
113
+ RunResult,
114
+ Step,
115
+ StepKind,
116
+ StopReason,
117
+ StreamChunk,
118
+ StreamChunkKind,
119
+ TemplateFile,
120
+ TokenUsage,
121
+ ToolCall,
122
+ ToolSpec,
123
+ VectorItem,
124
+ VectorMatch,
125
+ )
126
+
127
+ __version__ = "0.2.1"
128
+
129
+ __all__ = [
130
+ "OBSERVABILITY_SCOPE_NAME",
131
+ "AgentConfig",
132
+ "AgentForgeConfig",
133
+ "AgentForgeError",
134
+ "AgentState",
135
+ "AppliedEnvVar",
136
+ "AppliedManifest",
137
+ "AppliedTemplate",
138
+ "AuthenticationError",
139
+ "BudgetConfig",
140
+ "BudgetExceeded",
141
+ "BudgetPolicy",
142
+ "CapabilityNotSupported",
143
+ "Claim",
144
+ "EmbeddingClient",
145
+ "EmbeddingResponse",
146
+ "EnvVarEntry",
147
+ "EvalResult",
148
+ "Evaluator",
149
+ "EvaluatorEntry",
150
+ "FallbackChain",
151
+ "Finding",
152
+ "FindingRenderer",
153
+ "FinishReason",
154
+ "GraphEdge",
155
+ "GraphModuleConfig",
156
+ "GraphNode",
157
+ "GraphPattern",
158
+ "GraphSegment",
159
+ "GraphStore",
160
+ "GuardrailViolation",
161
+ "JsonFormatter",
162
+ "LLMClient",
163
+ "LLMResponse",
164
+ "LoggingConfig",
165
+ "Manifest",
166
+ "MemoryModuleConfig",
167
+ "MemoryStore",
168
+ "Message",
169
+ "MessageRole",
170
+ "Migration",
171
+ "MigrationChecksumError",
172
+ "MigrationStatus",
173
+ "Migrator",
174
+ "ModelNotFoundError",
175
+ "ModuleEntry",
176
+ "ModuleError",
177
+ "ModuleInfo",
178
+ "ModulesConfig",
179
+ "ObservabilityEntry",
180
+ "OutputConfig",
181
+ "Path",
182
+ "ProviderConfig",
183
+ "ProviderError",
184
+ "RateLimitError",
185
+ "ReasoningStrategy",
186
+ "Reranker",
187
+ "RerankerEntry",
188
+ "Resolver",
189
+ "RetrievalConfig",
190
+ "RetrieverModuleConfig",
191
+ "RunContext",
192
+ "RunIdFilter",
193
+ "RunResult",
194
+ "ServiceError",
195
+ "Step",
196
+ "StepKind",
197
+ "StopReason",
198
+ "StreamChunk",
199
+ "StreamChunkKind",
200
+ "TemplateFile",
201
+ "TimeoutError",
202
+ "TokenUsage",
203
+ "Tool",
204
+ "ToolCall",
205
+ "ToolSpec",
206
+ "VectorItem",
207
+ "VectorMatch",
208
+ "VectorStore",
209
+ "__version__",
210
+ "bind_run",
211
+ "current_run",
212
+ "discover_entry_points",
213
+ "discover_migrations",
214
+ "get_tracer",
215
+ "install_json_formatter",
216
+ "install_run_id_filter",
217
+ "load_config",
218
+ "new_run",
219
+ "parse_model_string",
220
+ "parse_overrides",
221
+ "register",
222
+ "register_embedding_provider",
223
+ "register_provider",
224
+ "reset_discovery",
225
+ "reset_run",
226
+ "uninstall_json_formatter",
227
+ "uninstall_run_id_filter",
228
+ ]