tai42-kit 0.1.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. tai42_kit-0.1.0/LICENSE +202 -0
  2. tai42_kit-0.1.0/MANIFEST.in +1 -0
  3. tai42_kit-0.1.0/NOTICE +5 -0
  4. tai42_kit-0.1.0/PKG-INFO +163 -0
  5. tai42_kit-0.1.0/README.md +75 -0
  6. tai42_kit-0.1.0/pyproject.toml +177 -0
  7. tai42_kit-0.1.0/setup.cfg +4 -0
  8. tai42_kit-0.1.0/src/tai42_kit/__init__.py +20 -0
  9. tai42_kit-0.1.0/src/tai42_kit/clients/__init__.py +27 -0
  10. tai42_kit-0.1.0/src/tai42_kit/clients/base.py +203 -0
  11. tai42_kit-0.1.0/src/tai42_kit/clients/facade.py +44 -0
  12. tai42_kit-0.1.0/src/tai42_kit/clients/impl/__init__.py +3 -0
  13. tai42_kit-0.1.0/src/tai42_kit/clients/impl/curl.py +41 -0
  14. tai42_kit-0.1.0/src/tai42_kit/clients/impl/http.py +26 -0
  15. tai42_kit-0.1.0/src/tai42_kit/clients/impl/mcp.py +60 -0
  16. tai42_kit-0.1.0/src/tai42_kit/clients/impl/postgres.py +58 -0
  17. tai42_kit-0.1.0/src/tai42_kit/clients/impl/redis.py +120 -0
  18. tai42_kit-0.1.0/src/tai42_kit/clients/settings.py +159 -0
  19. tai42_kit-0.1.0/src/tai42_kit/llm/__init__.py +23 -0
  20. tai42_kit-0.1.0/src/tai42_kit/llm/_resource_registry.py +150 -0
  21. tai42_kit-0.1.0/src/tai42_kit/llm/_secret_kwargs.py +84 -0
  22. tai42_kit-0.1.0/src/tai42_kit/llm/checkpoint/__init__.py +0 -0
  23. tai42_kit-0.1.0/src/tai42_kit/llm/checkpoint/checkpoint.py +147 -0
  24. tai42_kit-0.1.0/src/tai42_kit/llm/checkpoint/checkpoint_registry.py +39 -0
  25. tai42_kit-0.1.0/src/tai42_kit/llm/embedding.py +51 -0
  26. tai42_kit-0.1.0/src/tai42_kit/llm/middleware/__init__.py +0 -0
  27. tai42_kit-0.1.0/src/tai42_kit/llm/middleware/context_overflow.py +130 -0
  28. tai42_kit-0.1.0/src/tai42_kit/llm/middleware/trimming.py +64 -0
  29. tai42_kit-0.1.0/src/tai42_kit/llm/models.py +61 -0
  30. tai42_kit-0.1.0/src/tai42_kit/llm/runtime.py +123 -0
  31. tai42_kit-0.1.0/src/tai42_kit/llm/settings.py +166 -0
  32. tai42_kit-0.1.0/src/tai42_kit/llm/store/__init__.py +0 -0
  33. tai42_kit-0.1.0/src/tai42_kit/llm/store/store.py +139 -0
  34. tai42_kit-0.1.0/src/tai42_kit/llm/store/store_registry.py +59 -0
  35. tai42_kit-0.1.0/src/tai42_kit/logging/__init__.py +10 -0
  36. tai42_kit-0.1.0/src/tai42_kit/logging/logger.py +25 -0
  37. tai42_kit-0.1.0/src/tai42_kit/logging/settings.py +35 -0
  38. tai42_kit-0.1.0/src/tai42_kit/net/__init__.py +28 -0
  39. tai42_kit-0.1.0/src/tai42_kit/net/fetch_url.py +153 -0
  40. tai42_kit-0.1.0/src/tai42_kit/net/jwt.py +319 -0
  41. tai42_kit-0.1.0/src/tai42_kit/net/url_guard.py +135 -0
  42. tai42_kit-0.1.0/src/tai42_kit/plugins/__init__.py +233 -0
  43. tai42_kit-0.1.0/src/tai42_kit/py.typed +0 -0
  44. tai42_kit-0.1.0/src/tai42_kit/settings/__init__.py +25 -0
  45. tai42_kit-0.1.0/src/tai42_kit/settings/base.py +48 -0
  46. tai42_kit-0.1.0/src/tai42_kit/settings/cache_registry.py +37 -0
  47. tai42_kit-0.1.0/src/tai42_kit/settings/registry.py +279 -0
  48. tai42_kit-0.1.0/src/tai42_kit/transport/__init__.py +17 -0
  49. tai42_kit-0.1.0/src/tai42_kit/transport/base_uds_transport.py +72 -0
  50. tai42_kit-0.1.0/src/tai42_kit/transport/http_uds_transport.py +20 -0
  51. tai42_kit-0.1.0/src/tai42_kit/transport/sse_uds_transport.py +20 -0
  52. tai42_kit-0.1.0/src/tai42_kit/transport/utils.py +27 -0
  53. tai42_kit-0.1.0/src/tai42_kit/utils/__init__.py +1 -0
  54. tai42_kit-0.1.0/src/tai42_kit/utils/data/__init__.py +31 -0
  55. tai42_kit-0.1.0/src/tai42_kit/utils/data/jq_util.py +47 -0
  56. tai42_kit-0.1.0/src/tai42_kit/utils/data/json_schema_util.py +470 -0
  57. tai42_kit-0.1.0/src/tai42_kit/utils/data/mcp_output_util.py +93 -0
  58. tai42_kit-0.1.0/src/tai42_kit/utils/data/string_util.py +28 -0
  59. tai42_kit-0.1.0/src/tai42_kit/utils/data/url_util.py +9 -0
  60. tai42_kit-0.1.0/src/tai42_kit/utils/data/yaml_util.py +136 -0
  61. tai42_kit-0.1.0/src/tai42_kit/utils/lc/__init__.py +54 -0
  62. tai42_kit-0.1.0/src/tai42_kit/utils/lc/lc_util.py +57 -0
  63. tai42_kit-0.1.0/src/tai42_kit/utils/lc/signature_util.py +54 -0
  64. tai42_kit-0.1.0/src/tai42_kit/utils/runtime/__init__.py +12 -0
  65. tai42_kit-0.1.0/src/tai42_kit/utils/runtime/files_util.py +122 -0
  66. tai42_kit-0.1.0/src/tai42_kit/utils/runtime/schedule_util.py +112 -0
  67. tai42_kit-0.1.0/src/tai42_kit/utils/runtime/uvicorn_util.py +140 -0
  68. tai42_kit-0.1.0/src/tai42_kit.egg-info/PKG-INFO +163 -0
  69. tai42_kit-0.1.0/src/tai42_kit.egg-info/SOURCES.txt +70 -0
  70. tai42_kit-0.1.0/src/tai42_kit.egg-info/dependency_links.txt +1 -0
  71. tai42_kit-0.1.0/src/tai42_kit.egg-info/requires.txt +81 -0
  72. tai42_kit-0.1.0/src/tai42_kit.egg-info/top_level.txt +1 -0
@@ -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 @@
1
+ prune tests
tai42_kit-0.1.0/NOTICE ADDED
@@ -0,0 +1,5 @@
1
+ tai42-kit
2
+ Copyright 2026 tai42
3
+
4
+ This product includes software developed at tai42 (https://tai42.ai).
5
+ Licensed under the Apache License, Version 2.0.
@@ -0,0 +1,163 @@
1
+ Metadata-Version: 2.4
2
+ Name: tai42-kit
3
+ Version: 0.1.0
4
+ Summary: Generic leaf helpers, settings primitives, pooled clients, and LLM/AI factories for the TAI ecosystem.
5
+ Author-email: tai42 <oss@tai42.ai>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://tai42.ai
8
+ Project-URL: Repository, https://github.com/tai42ai/tai-kit
9
+ Project-URL: Issues, https://github.com/tai42ai/tai-kit/issues
10
+ Project-URL: Changelog, https://github.com/tai42ai/tai-kit/blob/main/CHANGELOG.md
11
+ Keywords: llm,langchain,langgraph,mcp,utilities,settings
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Typing :: Typed
18
+ Requires-Python: >=3.13
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ License-File: NOTICE
22
+ Requires-Dist: tai42-contract<0.2,>=0.1
23
+ Requires-Dist: pydantic>=2.12
24
+ Requires-Dist: pydantic-settings>=2.11
25
+ Requires-Dist: python-dotenv>=1.0
26
+ Requires-Dist: fastmcp<4,>=3.2
27
+ Requires-Dist: mcp>=1
28
+ Requires-Dist: anyio>=4
29
+ Requires-Dist: httpx>=0.28
30
+ Requires-Dist: httpcore>=1
31
+ Requires-Dist: ruamel.yaml>=0.18
32
+ Requires-Dist: PyYAML>=6
33
+ Requires-Dist: jsonschema>=4
34
+ Provides-Extra: llm
35
+ Requires-Dist: langchain<2,>=1.2; extra == "llm"
36
+ Requires-Dist: langchain-core<2,>=1.2; extra == "llm"
37
+ Requires-Dist: langchain-openai>=1.3; extra == "llm"
38
+ Requires-Dist: langgraph<2,>=1.1; extra == "llm"
39
+ Requires-Dist: langgraph-checkpoint>=4.0; extra == "llm"
40
+ Requires-Dist: langgraph-checkpoint-redis>=0.5; extra == "llm"
41
+ Provides-Extra: jq
42
+ Requires-Dist: jq>=1.10; extra == "jq"
43
+ Provides-Extra: uvicorn
44
+ Requires-Dist: uvicorn>=0.43; extra == "uvicorn"
45
+ Provides-Extra: anthropic
46
+ Requires-Dist: tai42-kit[llm]; extra == "anthropic"
47
+ Requires-Dist: langchain-anthropic>=1.4; extra == "anthropic"
48
+ Provides-Extra: mistral
49
+ Requires-Dist: tai42-kit[llm]; extra == "mistral"
50
+ Requires-Dist: langchain-mistralai>=1.1; extra == "mistral"
51
+ Provides-Extra: google
52
+ Requires-Dist: tai42-kit[llm]; extra == "google"
53
+ Requires-Dist: langchain-google-genai>=4.2; extra == "google"
54
+ Provides-Extra: xai
55
+ Requires-Dist: tai42-kit[llm]; extra == "xai"
56
+ Requires-Dist: langchain-xai>=1.2; extra == "xai"
57
+ Provides-Extra: ollama
58
+ Requires-Dist: tai42-kit[llm]; extra == "ollama"
59
+ Requires-Dist: langchain-ollama>=1.0; extra == "ollama"
60
+ Provides-Extra: huggingface
61
+ Requires-Dist: tai42-kit[llm]; extra == "huggingface"
62
+ Requires-Dist: langchain-huggingface>=1.2; extra == "huggingface"
63
+ Requires-Dist: sentence-transformers>=5.3; extra == "huggingface"
64
+ Provides-Extra: langgraph-checkpoint-postgres
65
+ Requires-Dist: tai42-kit[llm]; extra == "langgraph-checkpoint-postgres"
66
+ Requires-Dist: langgraph-checkpoint-postgres>=3.0.5; extra == "langgraph-checkpoint-postgres"
67
+ Requires-Dist: psycopg[pool]>=3.3.2; extra == "langgraph-checkpoint-postgres"
68
+ Provides-Extra: langgraph-checkpoint-sqlite
69
+ Requires-Dist: tai42-kit[llm]; extra == "langgraph-checkpoint-sqlite"
70
+ Requires-Dist: langgraph-checkpoint-sqlite>=3.0.3; extra == "langgraph-checkpoint-sqlite"
71
+ Requires-Dist: aiosqlite>=0.20; extra == "langgraph-checkpoint-sqlite"
72
+ Provides-Extra: redis
73
+ Requires-Dist: redis>=5; extra == "redis"
74
+ Provides-Extra: curl
75
+ Requires-Dist: curl-cffi>=0.7; extra == "curl"
76
+ Provides-Extra: postgres
77
+ Requires-Dist: psycopg[binary,pool]>=3.3.2; extra == "postgres"
78
+ Provides-Extra: jwt
79
+ Requires-Dist: joserfc>=1.7; extra == "jwt"
80
+ Provides-Extra: dev
81
+ Requires-Dist: pytest>=8; extra == "dev"
82
+ Requires-Dist: pytest-asyncio>=1.3; extra == "dev"
83
+ Requires-Dist: pytest-cov>=5; extra == "dev"
84
+ Requires-Dist: ruff>=0.6; extra == "dev"
85
+ Requires-Dist: pyright>=1.1.389; extra == "dev"
86
+ Requires-Dist: joserfc>=1.7; extra == "dev"
87
+ Dynamic: license-file
88
+
89
+ # tai42-kit
90
+
91
+ [![CI](https://github.com/tai42ai/tai-kit/actions/workflows/ci.yml/badge.svg)](https://github.com/tai42ai/tai-kit/actions/workflows/ci.yml)
92
+ [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
93
+
94
+ Generic leaf helpers, settings primitives, pooled clients, and LLM/AI factories
95
+ for the TAI ecosystem. It provides the reusable building blocks the server is
96
+ composed from: data and text transforms, LangChain/FastMCP/MCP tool glue, the
97
+ pooled-client facade and concrete drivers (`redis`, `curl`, `mcp`, `postgres`,
98
+ `http`), the SSRF URL guard and safe download, MCP client transports over a UDS
99
+ socket, the settings machinery, LLM/embedding factories with checkpoint/store
100
+ backends, and logging setup. Heavier backends are gated behind extras and
101
+ imported lazily. Typed package (`py.typed`).
102
+
103
+ ## Position in the ecosystem
104
+
105
+ TAI is an open-source runtime for MCP tools, agents, and workflows — the server
106
+ that hosts a capability and supplies the operational layer around it (manifest
107
+ loading, access control, OAuth connectors, background execution, monitoring,
108
+ storage, and human-in-the-loop steps).
109
+
110
+ Three packages; each depends only on the ones to its left:
111
+
112
+ ```
113
+ tai42-contract <-- tai42-kit <-- tai42-skeleton
114
+ (interfaces) (helpers) (the server)
115
+ ```
116
+
117
+ `tai42-kit` obeys the leaf rule: its only tai-* dependency is `tai42-contract`. It
118
+ implements the contract's `BaseClient` Protocol and consumes its manifest types;
119
+ among tai-* packages it depends on nothing else.
120
+
121
+ ## Install
122
+
123
+ Requires **Python 3.13+**. Nothing is on PyPI yet, so install from source. Clone
124
+ this repo alongside `tai42-contract` — this repo's `[tool.uv.sources]` points at
125
+ `../tai-contract` — then add it as an editable dependency of the environment
126
+ that runs the server:
127
+
128
+ ```bash
129
+ git clone https://github.com/tai42ai/tai-contract
130
+ git clone https://github.com/tai42ai/tai-kit
131
+ cd tai-skeleton # or your own app checkout
132
+ uv add --editable ../tai-kit # once published: uv add tai42-kit
133
+ ```
134
+
135
+ Backends are gated behind extras, so install the ones you need — e.g. the
136
+ pooled-client drivers `tai42-kit[redis]`, `tai42-kit[postgres]`, `tai42-kit[curl]`, the
137
+ checkpoint/store backends `tai42-kit[langgraph-checkpoint-postgres]`,
138
+ `tai42-kit[langgraph-checkpoint-sqlite]`, and LLM-provider backends like
139
+ `tai42-kit[anthropic]`, `tai42-kit[google]`, `tai42-kit[mistral]`, `tai42-kit[xai]`,
140
+ `tai42-kit[ollama]`, `tai42-kit[huggingface]`.
141
+
142
+ ## Development
143
+
144
+ ```bash
145
+ uv sync --extra dev --extra llm --extra jq --extra uvicorn --extra redis --extra curl --extra postgres
146
+ uv run ruff check .
147
+ uv run pyright # 0 errors; missing optional ML backends are warnings
148
+ uv run pytest # optional-extra tests skip if their extra is absent
149
+ ```
150
+
151
+ See `CONTRIBUTING.md` for the rules.
152
+
153
+ ## Documentation
154
+
155
+ The whole platform — concepts, guides, and the generated reference — lives in
156
+ the unified documentation site:
157
+
158
+ - Layering & the contract/kit/skeleton split: https://tai42.ai/concepts/layering
159
+ - Python SDK reference (this package's public API): https://tai42.ai/reference/python-sdk
160
+
161
+ ## License
162
+
163
+ Apache-2.0. See `LICENSE` and `NOTICE`.
@@ -0,0 +1,75 @@
1
+ # tai42-kit
2
+
3
+ [![CI](https://github.com/tai42ai/tai-kit/actions/workflows/ci.yml/badge.svg)](https://github.com/tai42ai/tai-kit/actions/workflows/ci.yml)
4
+ [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
5
+
6
+ Generic leaf helpers, settings primitives, pooled clients, and LLM/AI factories
7
+ for the TAI ecosystem. It provides the reusable building blocks the server is
8
+ composed from: data and text transforms, LangChain/FastMCP/MCP tool glue, the
9
+ pooled-client facade and concrete drivers (`redis`, `curl`, `mcp`, `postgres`,
10
+ `http`), the SSRF URL guard and safe download, MCP client transports over a UDS
11
+ socket, the settings machinery, LLM/embedding factories with checkpoint/store
12
+ backends, and logging setup. Heavier backends are gated behind extras and
13
+ imported lazily. Typed package (`py.typed`).
14
+
15
+ ## Position in the ecosystem
16
+
17
+ TAI is an open-source runtime for MCP tools, agents, and workflows — the server
18
+ that hosts a capability and supplies the operational layer around it (manifest
19
+ loading, access control, OAuth connectors, background execution, monitoring,
20
+ storage, and human-in-the-loop steps).
21
+
22
+ Three packages; each depends only on the ones to its left:
23
+
24
+ ```
25
+ tai42-contract <-- tai42-kit <-- tai42-skeleton
26
+ (interfaces) (helpers) (the server)
27
+ ```
28
+
29
+ `tai42-kit` obeys the leaf rule: its only tai-* dependency is `tai42-contract`. It
30
+ implements the contract's `BaseClient` Protocol and consumes its manifest types;
31
+ among tai-* packages it depends on nothing else.
32
+
33
+ ## Install
34
+
35
+ Requires **Python 3.13+**. Nothing is on PyPI yet, so install from source. Clone
36
+ this repo alongside `tai42-contract` — this repo's `[tool.uv.sources]` points at
37
+ `../tai-contract` — then add it as an editable dependency of the environment
38
+ that runs the server:
39
+
40
+ ```bash
41
+ git clone https://github.com/tai42ai/tai-contract
42
+ git clone https://github.com/tai42ai/tai-kit
43
+ cd tai-skeleton # or your own app checkout
44
+ uv add --editable ../tai-kit # once published: uv add tai42-kit
45
+ ```
46
+
47
+ Backends are gated behind extras, so install the ones you need — e.g. the
48
+ pooled-client drivers `tai42-kit[redis]`, `tai42-kit[postgres]`, `tai42-kit[curl]`, the
49
+ checkpoint/store backends `tai42-kit[langgraph-checkpoint-postgres]`,
50
+ `tai42-kit[langgraph-checkpoint-sqlite]`, and LLM-provider backends like
51
+ `tai42-kit[anthropic]`, `tai42-kit[google]`, `tai42-kit[mistral]`, `tai42-kit[xai]`,
52
+ `tai42-kit[ollama]`, `tai42-kit[huggingface]`.
53
+
54
+ ## Development
55
+
56
+ ```bash
57
+ uv sync --extra dev --extra llm --extra jq --extra uvicorn --extra redis --extra curl --extra postgres
58
+ uv run ruff check .
59
+ uv run pyright # 0 errors; missing optional ML backends are warnings
60
+ uv run pytest # optional-extra tests skip if their extra is absent
61
+ ```
62
+
63
+ See `CONTRIBUTING.md` for the rules.
64
+
65
+ ## Documentation
66
+
67
+ The whole platform — concepts, guides, and the generated reference — lives in
68
+ the unified documentation site:
69
+
70
+ - Layering & the contract/kit/skeleton split: https://tai42.ai/concepts/layering
71
+ - Python SDK reference (this package's public API): https://tai42.ai/reference/python-sdk
72
+
73
+ ## License
74
+
75
+ Apache-2.0. See `LICENSE` and `NOTICE`.
@@ -0,0 +1,177 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "tai42-kit"
7
+ version = "0.1.0"
8
+ description = "Generic leaf helpers, settings primitives, pooled clients, and LLM/AI factories for the TAI ecosystem."
9
+ readme = "README.md"
10
+ requires-python = ">=3.13"
11
+ license = "Apache-2.0"
12
+ license-files = ["LICENSE", "NOTICE"]
13
+ authors = [
14
+ { name = "tai42", email = "oss@tai42.ai" },
15
+ ]
16
+ keywords = ["llm", "langchain", "langgraph", "mcp", "utilities", "settings"]
17
+ classifiers = [
18
+ "Development Status :: 4 - Beta",
19
+ "Intended Audience :: Developers",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.13",
22
+ "Operating System :: OS Independent",
23
+ "Typing :: Typed",
24
+ ]
25
+ dependencies = [
26
+ # The pure interface contract — kit's only tai-* dependency (leaf rule).
27
+ "tai42-contract>=0.1,<0.2",
28
+ "pydantic>=2.12",
29
+ "pydantic-settings>=2.11",
30
+ "python-dotenv>=1.0",
31
+ "fastmcp>=3.2,<4",
32
+ # Imported directly by utils/lc/lc_util.py (not just transitively via fastmcp).
33
+ "mcp>=1",
34
+ # Imported directly by clients/impl/mcp.py (core FastMCP client disconnection set).
35
+ "anyio>=4",
36
+ "httpx>=0.28",
37
+ # Imported directly by net/fetch_url.py (the SSRF-pinning httpx network backend).
38
+ "httpcore>=1",
39
+ # Imported directly by utils/data/yaml_util.py (comment-preserving manifest
40
+ # round-trip: load/merge/dump keeping comments, ordering, and !ENV tags).
41
+ "ruamel.yaml>=0.18",
42
+ # Imported directly by plugins/__init__.py (the strict plugin-spec SafeLoader).
43
+ "PyYAML>=6",
44
+ # Imported directly by utils/data/json_schema_util.py (the draft-2020-12
45
+ # validate_against_json_schema path).
46
+ "jsonschema>=4",
47
+ ]
48
+
49
+ [project.urls]
50
+ Homepage = "https://tai42.ai"
51
+ Repository = "https://github.com/tai42ai/tai-kit"
52
+ Issues = "https://github.com/tai42ai/tai-kit/issues"
53
+ Changelog = "https://github.com/tai42ai/tai-kit/blob/main/CHANGELOG.md"
54
+
55
+ [project.optional-dependencies]
56
+ # The LLM stack (tai42_kit.llm + tai42_kit.utils.lc) — everything LangChain-shaped
57
+ # is opt-in so the bare install stays a light leaf kit. openai + redis ship
58
+ # inside this extra because they are the default llm/embedding and
59
+ # checkpoint/store providers (llm/settings.py). langgraph-checkpoint-redis
60
+ # floors at 0.5: 0.4.x calls a serializer method langgraph-checkpoint 4.1+
61
+ # removed. postgres/sqlite backends stay separate extras below.
62
+ llm = [
63
+ "langchain>=1.2,<2",
64
+ "langchain-core>=1.2,<2",
65
+ "langchain-openai>=1.3",
66
+ "langgraph>=1.1,<2",
67
+ "langgraph-checkpoint>=4.0",
68
+ "langgraph-checkpoint-redis>=0.5",
69
+ ]
70
+
71
+ # jq expression compilation (utils/data/jq_util.py) — a C extension, opt-in.
72
+ jq = ["jq>=1.10"]
73
+
74
+ # uvicorn CLI-arg parsing (utils/runtime/uvicorn_util.py) — opt-in for
75
+ # consumers that run their own server.
76
+ uvicorn = ["uvicorn>=0.43"]
77
+
78
+ # LLM provider backends — imported lazily by llm/models.py and llm/embedding.py
79
+ # inside the per-provider match branches. Each pulls the llm base stack.
80
+ anthropic = ["tai42-kit[llm]", "langchain-anthropic>=1.4"]
81
+ mistral = ["tai42-kit[llm]", "langchain-mistralai>=1.1"]
82
+ google = ["tai42-kit[llm]", "langchain-google-genai>=4.2"]
83
+ xai = ["tai42-kit[llm]", "langchain-xai>=1.2"]
84
+ ollama = ["tai42-kit[llm]", "langchain-ollama>=1.0"]
85
+ huggingface = [
86
+ "tai42-kit[llm]",
87
+ "langchain-huggingface>=1.2",
88
+ "sentence-transformers>=5.3",
89
+ ]
90
+
91
+ # Checkpoint/store backends — imported lazily by llm/checkpoint/checkpoint.py and
92
+ # llm/store/store.py inside the per-backend match branches.
93
+ langgraph-checkpoint-postgres = [
94
+ "tai42-kit[llm]",
95
+ "langgraph-checkpoint-postgres>=3.0.5",
96
+ "psycopg[pool]>=3.3.2",
97
+ ]
98
+ langgraph-checkpoint-sqlite = [
99
+ "tai42-kit[llm]",
100
+ "langgraph-checkpoint-sqlite>=3.0.3",
101
+ "aiosqlite>=0.20",
102
+ ]
103
+
104
+ # Pooled-client backends — each client submodule (tai42_kit.clients.*) imports its
105
+ # driver at module top, so install the matching extra to use that client.
106
+ redis = ["redis>=5"]
107
+ curl = ["curl-cffi>=0.7"]
108
+ postgres = ["psycopg[binary,pool]>=3.3.2"]
109
+
110
+ # OIDC discovery + JWKS + JWT verification (net/jwt.py imports joserfc at module top).
111
+ jwt = ["joserfc>=1.7"]
112
+
113
+ dev = [
114
+ "pytest>=8",
115
+ "pytest-asyncio>=1.3",
116
+ "pytest-cov>=5",
117
+ "ruff>=0.6",
118
+ "pyright>=1.1.389",
119
+ # net/jwt.py's joserfc driver, so the suite always exercises the [jwt] module.
120
+ "joserfc>=1.7",
121
+ ]
122
+
123
+ [tool.setuptools]
124
+ package-dir = { "" = "src" }
125
+
126
+ [tool.setuptools.packages.find]
127
+ where = ["src"]
128
+ include = ["tai42_kit*"]
129
+
130
+ [tool.setuptools.package-data]
131
+ tai42_kit = ["py.typed"]
132
+
133
+ [tool.pytest.ini_options]
134
+ asyncio_mode = "auto"
135
+ asyncio_default_fixture_loop_scope = "function"
136
+ testpaths = ["tests"]
137
+ xfail_strict = true
138
+ # Turn warnings into errors so a real defect that only surfaces as a warning
139
+ # (e.g. a missing await -> "coroutine was never awaited") fails the suite loudly
140
+ # instead of passing green.
141
+ filterwarnings = ["error"]
142
+
143
+ [tool.coverage.run]
144
+ source = ["tai42_kit"]
145
+
146
+ [tool.coverage.report]
147
+ fail_under = 97
148
+
149
+ [tool.uv]
150
+ cache-keys = [{ file = "pyproject.toml" }]
151
+
152
+
153
+ # The version floors in [project] are the compatibility contract; these path
154
+ # sources resolve the sibling checkouts while the packages are unpublished.
155
+ # They are not part of wheel metadata.
156
+ [tool.uv.sources]
157
+ tai42-contract = { path = "../tai-contract", editable = true }
158
+ [tool.ruff]
159
+ src = ["src"]
160
+ target-version = "py313"
161
+ line-length = 120
162
+
163
+ [tool.ruff.lint]
164
+ select = ["E", "W", "F", "I", "UP", "B", "C4", "SIM", "PIE", "PT", "RUF", "TID"]
165
+
166
+ [tool.ruff.lint.flake8-tidy-imports.banned-api]
167
+ "tai42_skeleton".msg = "tai42-kit sits below the skeleton: it never imports tai42-skeleton."
168
+
169
+ [tool.pyright]
170
+ include = ["src", "tests"]
171
+ pythonVersion = "3.13"
172
+ typeCheckingMode = "basic"
173
+ # The LLM provider + checkpoint/store backends are optional extras, imported
174
+ # lazily inside guarded match-branches. Type-checking them needs every optional
175
+ # (incl. heavy ML) dep installed, so a missing one is a warning here, not an
176
+ # error — guarded optional imports are by design.
177
+ reportMissingImports = "warning"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,20 @@
1
+ """tai42-kit — generic leaf helpers, LLM factories, pooled clients, and settings
2
+ for the TAI ecosystem.
3
+
4
+ Utilities (data/runtime/langchain helpers), LLM provider + checkpoint/store
5
+ factories, pooled clients + MCP transports, and co-located pydantic-settings.
6
+ The only tai-* dependency is ``tai42-contract`` (the leaf rule): kit implements its
7
+ ``BaseClient`` Protocol and consumes its manifest types; it imports no other
8
+ tai-* package.
9
+
10
+ Deliberately light: nothing is re-exported here, so ``import tai42_kit`` pulls no
11
+ vendor dependency (no langchain, no drivers). Import the subpackage you need —
12
+ each one (``tai42_kit.llm``, ``tai42_kit.clients``, ...) is the opt-in boundary for
13
+ its dependencies.
14
+ """
15
+
16
+ from importlib.metadata import version
17
+
18
+ __version__ = version("tai42-kit")
19
+
20
+ __all__ = ["__version__"]