modulex-integrations 0.0.1a0__py3-none-any.whl

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.
@@ -0,0 +1,55 @@
1
+ """modulex-integrations — community-contributable integrations for ModuleX.
2
+
3
+ Every integration lives at ``modulex_integrations.tools.<name>`` and is
4
+ discovered by the modulex runtime via the ``modulex.tools`` entry-point
5
+ group declared in ``pyproject.toml``.
6
+
7
+ This top-level module re-exports the schema types so contributors can
8
+ write a manifest with::
9
+
10
+ from modulex_integrations import (
11
+ IntegrationManifest, ActionDefinition, OAuth2AuthSchema, ...
12
+ )
13
+ """
14
+ from importlib.metadata import PackageNotFoundError
15
+ from importlib.metadata import version as _pkg_version
16
+
17
+ from modulex_integrations.schema import (
18
+ ActionDefinition,
19
+ ApiKeyAuthSchema,
20
+ AuthSchema,
21
+ BearerTokenAuthSchema,
22
+ CustomAuthSchema,
23
+ EnvVar,
24
+ IntegrationManifest,
25
+ InternalAuthSchema,
26
+ ModulexKeyAuthSchema,
27
+ OAuth2AuthSchema,
28
+ OAuthConfig,
29
+ ParameterDef,
30
+ SuccessIndicators,
31
+ TestEndpoint,
32
+ )
33
+
34
+ try:
35
+ __version__ = _pkg_version("modulex-integrations")
36
+ except PackageNotFoundError: # source checkout without `pip install -e .`
37
+ __version__ = "0.0.0+unknown"
38
+
39
+ __all__ = [
40
+ "ActionDefinition",
41
+ "ApiKeyAuthSchema",
42
+ "AuthSchema",
43
+ "BearerTokenAuthSchema",
44
+ "CustomAuthSchema",
45
+ "EnvVar",
46
+ "IntegrationManifest",
47
+ "InternalAuthSchema",
48
+ "ModulexKeyAuthSchema",
49
+ "OAuth2AuthSchema",
50
+ "OAuthConfig",
51
+ "ParameterDef",
52
+ "SuccessIndicators",
53
+ "TestEndpoint",
54
+ "__version__",
55
+ ]
@@ -0,0 +1,24 @@
1
+ # file generated by vcs-versioning
2
+ # don't change, don't track in version control
3
+ from __future__ import annotations
4
+
5
+ __all__ = [
6
+ "__version__",
7
+ "__version_tuple__",
8
+ "version",
9
+ "version_tuple",
10
+ "__commit_id__",
11
+ "commit_id",
12
+ ]
13
+
14
+ version: str
15
+ __version__: str
16
+ __version_tuple__: tuple[int | str, ...]
17
+ version_tuple: tuple[int | str, ...]
18
+ commit_id: str | None
19
+ __commit_id__: str | None
20
+
21
+ __version__ = version = '0.0.1a0'
22
+ __version_tuple__ = version_tuple = (0, 0, 1, 'a0')
23
+
24
+ __commit_id__ = commit_id = None
File without changes
@@ -0,0 +1,212 @@
1
+ """Schema definitions for the modulex-integrations package.
2
+
3
+ Every integration declares its metadata by constructing an
4
+ ``IntegrationManifest`` instance in its own ``manifest.py``. The modulex
5
+ runtime imports these manifests via the ``modulex.tools`` entry-point
6
+ group and uses them to drive credential UI, validation, and tool
7
+ discovery.
8
+
9
+ Design choices worth knowing:
10
+
11
+ - All models use ``extra="forbid"`` so a typo in a contributor's
12
+ manifest fails at import time, not at runtime.
13
+ - ``auth_schemas`` is a discriminated union keyed on ``auth_type``;
14
+ the same integration can expose multiple credential methods (GitHub
15
+ supports both OAuth2 and a personal access token).
16
+ - Action ``output_schema`` is intentionally absent. The shape of every
17
+ action's return value is derived from the LangChain ``@tool``
18
+ function's return-type annotation (defined in each integration's
19
+ ``outputs.py``); the runtime obtains it via
20
+ ``Model.model_json_schema()`` at startup.
21
+ """
22
+ from __future__ import annotations
23
+
24
+ from typing import Annotated, Any, Literal
25
+
26
+ from pydantic import BaseModel, ConfigDict, Field
27
+
28
+ __all__ = [
29
+ "ActionDefinition",
30
+ "ApiKeyAuthSchema",
31
+ "AuthSchema",
32
+ "BearerTokenAuthSchema",
33
+ "CustomAuthSchema",
34
+ "EnvVar",
35
+ "IntegrationManifest",
36
+ "InternalAuthSchema",
37
+ "ModulexKeyAuthSchema",
38
+ "OAuth2AuthSchema",
39
+ "OAuthConfig",
40
+ "ParameterDef",
41
+ "SuccessIndicators",
42
+ "TestEndpoint",
43
+ ]
44
+
45
+
46
+ # --- Parameters --------------------------------------------------------
47
+
48
+ ParameterType = Literal[
49
+ "string",
50
+ "integer",
51
+ "number",
52
+ "boolean",
53
+ "array",
54
+ "object",
55
+ ]
56
+
57
+
58
+ class ParameterDef(BaseModel):
59
+ """Definition of a single action parameter."""
60
+
61
+ model_config = ConfigDict(extra="forbid")
62
+
63
+ type: ParameterType
64
+ description: str
65
+ default: Any = None
66
+ required: bool = False
67
+
68
+
69
+ # --- Actions -----------------------------------------------------------
70
+
71
+
72
+ class ActionDefinition(BaseModel):
73
+ """One callable action exposed by the integration.
74
+
75
+ The return shape is derived from the matching ``@tool`` function's
76
+ return-type annotation in ``tools.py`` — do not duplicate it here.
77
+ """
78
+
79
+ model_config = ConfigDict(extra="forbid")
80
+
81
+ name: str = Field(pattern=r"^[a-z][a-z0-9_]*$")
82
+ description: str
83
+ parameters: dict[str, ParameterDef] = Field(default_factory=dict)
84
+
85
+
86
+ # --- Credentials -------------------------------------------------------
87
+
88
+
89
+ class EnvVar(BaseModel):
90
+ """A configurable secret/setting the operator must provide."""
91
+
92
+ model_config = ConfigDict(extra="forbid")
93
+
94
+ name: str
95
+ display_name: str
96
+ description: str
97
+ required: bool = True
98
+ sensitive: bool = False
99
+ only_for_custom: bool = False
100
+ sample_format: str | None = None
101
+ about_url: str | None = None
102
+
103
+
104
+ class SuccessIndicators(BaseModel):
105
+ """How to tell a credential test endpoint succeeded."""
106
+
107
+ model_config = ConfigDict(extra="forbid")
108
+
109
+ status_codes: list[int]
110
+ response_fields: list[str] | None = None
111
+
112
+
113
+ class TestEndpoint(BaseModel):
114
+ """Endpoint hit to validate a configured credential.
115
+
116
+ Header values may contain placeholders such as ``{access_token}`` or
117
+ ``{token}`` which the runtime substitutes with the resolved
118
+ credential value.
119
+ """
120
+
121
+ __test__ = False # pydantic model, not a pytest test class
122
+ model_config = ConfigDict(extra="forbid")
123
+
124
+ url: str
125
+ method: Literal["GET", "POST", "PUT", "DELETE", "PATCH"] = "GET"
126
+ headers: dict[str, str] = Field(default_factory=dict)
127
+ success_indicators: SuccessIndicators
128
+ cost_level: str = "free"
129
+ description: str | None = None
130
+
131
+
132
+ # --- Auth schemas (discriminated union) --------------------------------
133
+
134
+
135
+ class _AuthSchemaBase(BaseModel):
136
+ """Fields shared by every auth_schema variant."""
137
+
138
+ model_config = ConfigDict(extra="forbid")
139
+
140
+ display_name: str
141
+ description: str
142
+ setup_instructions: list[str] | None = None
143
+ setup_environment_variables: list[EnvVar] = Field(default_factory=list)
144
+ test_endpoint: TestEndpoint
145
+
146
+
147
+ class OAuthConfig(BaseModel):
148
+ """OAuth 2.0 authorize/token URL bundle."""
149
+
150
+ model_config = ConfigDict(extra="forbid")
151
+
152
+ auth_url: str
153
+ token_url: str
154
+ scopes: list[str] = Field(default_factory=list)
155
+ token_auth_method: Literal["body", "basic"] = "body"
156
+
157
+
158
+ class OAuth2AuthSchema(_AuthSchemaBase):
159
+ auth_type: Literal["oauth2"] = "oauth2"
160
+ oauth_config: OAuthConfig
161
+
162
+
163
+ class BearerTokenAuthSchema(_AuthSchemaBase):
164
+ auth_type: Literal["bearer_token"] = "bearer_token"
165
+
166
+
167
+ class ApiKeyAuthSchema(_AuthSchemaBase):
168
+ auth_type: Literal["api_key"] = "api_key"
169
+
170
+
171
+ class ModulexKeyAuthSchema(_AuthSchemaBase):
172
+ auth_type: Literal["modulex_key"] = "modulex_key"
173
+
174
+
175
+ class CustomAuthSchema(_AuthSchemaBase):
176
+ auth_type: Literal["custom"] = "custom"
177
+
178
+
179
+ class InternalAuthSchema(_AuthSchemaBase):
180
+ auth_type: Literal["internal"] = "internal"
181
+
182
+
183
+ AuthSchema = Annotated[
184
+ OAuth2AuthSchema
185
+ | BearerTokenAuthSchema
186
+ | ApiKeyAuthSchema
187
+ | ModulexKeyAuthSchema
188
+ | CustomAuthSchema
189
+ | InternalAuthSchema,
190
+ Field(discriminator="auth_type"),
191
+ ]
192
+
193
+
194
+ # --- Top-level manifest ------------------------------------------------
195
+
196
+
197
+ class IntegrationManifest(BaseModel):
198
+ """The contract every integration's ``manifest.py`` produces."""
199
+
200
+ model_config = ConfigDict(extra="forbid")
201
+
202
+ integration_type: Literal["tool"] = "tool"
203
+ name: str = Field(pattern=r"^[a-z][a-z0-9_]*$")
204
+ display_name: str
205
+ description: str
206
+ version: str = "1.0.0"
207
+ author: str = "ModuleX"
208
+ logo: str | None = None
209
+ app_url: str | None = None
210
+ categories: list[str] = Field(default_factory=list)
211
+ actions: list[ActionDefinition] = Field(default_factory=list)
212
+ auth_schemas: list[AuthSchema] = Field(default_factory=list)
@@ -0,0 +1,7 @@
1
+ """Namespace for individual integration packages.
2
+
3
+ Each integration lives in its own directory under this module:
4
+ ``modulex_integrations.tools.<name>``. The modulex runtime discovers
5
+ them via the ``modulex.tools`` entry-point group; do not import from
6
+ here directly.
7
+ """
@@ -0,0 +1,134 @@
1
+ Metadata-Version: 2.4
2
+ Name: modulex-integrations
3
+ Version: 0.0.1a0
4
+ Summary: Community-contributable integrations (tools) for ModuleX
5
+ Project-URL: Homepage, https://github.com/ModuleXAI/modulex-integrations
6
+ Project-URL: Repository, https://github.com/ModuleXAI/modulex-integrations
7
+ Project-URL: Issues, https://github.com/ModuleXAI/modulex-integrations/issues
8
+ Author-email: ModuleX <team@modulex.dev>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: ai,integrations,langchain,modulex,tools
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Typing :: Typed
19
+ Requires-Python: >=3.12
20
+ Requires-Dist: httpx>=0.25.0
21
+ Requires-Dist: langchain-core>=0.3.0
22
+ Requires-Dist: pydantic>=2.5.0
23
+ Provides-Extra: all
24
+ Provides-Extra: dev
25
+ Requires-Dist: mypy>=1.10.0; extra == 'dev'
26
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
27
+ Requires-Dist: pytest-httpx>=0.30.0; extra == 'dev'
28
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
29
+ Requires-Dist: ruff>=0.6.0; extra == 'dev'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # modulex-integrations
33
+
34
+ [![CI](https://github.com/ModuleXAI/modulex-integrations/actions/workflows/validate.yml/badge.svg)](https://github.com/ModuleXAI/modulex-integrations/actions/workflows/validate.yml)
35
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
36
+ [![PyPI](https://img.shields.io/pypi/v/modulex-integrations.svg)](https://pypi.org/project/modulex-integrations/)
37
+
38
+ Community-contributable integrations (tools) for the [ModuleX](https://github.com/ModuleXAI/modulex) runtime.
39
+
40
+ ## Why this repo exists
41
+
42
+ `modulex` is a FastAPI/Python backend that, until now, bundled 45
43
+ LangChain tool integrations inline. We are extracting those 45 tools
44
+ into this standalone, publicly pip-installable package so that:
45
+
46
+ - adding a new tool is a single-repo PR, not a multi-file edit
47
+ across the modulex monorepo,
48
+ - integration code is publicly inspectable,
49
+ - community contributions flow through the standard GitHub PR model.
50
+
51
+ LLM providers and knowledge providers stay in modulex. Only the
52
+ `tool` integrations migrate here.
53
+
54
+ ## Status
55
+
56
+ **Phase 1 — early development.** The schema contract and packaging
57
+ are in place; integrations themselves will be migrated from the
58
+ modulex monorepo one at a time, starting with a `github` POC and
59
+ continuing via a scripted bulk migration. See [CHANGELOG.md](CHANGELOG.md)
60
+ for progress and [CONTRIBUTING.md](CONTRIBUTING.md) for layout rules.
61
+
62
+ ## What is this?
63
+
64
+ Each integration in this package exposes one or more LangChain
65
+ `@tool` functions to the ModuleX runtime, together with credential
66
+ metadata (auth schemas, env vars, test endpoints). The runtime
67
+ discovers integrations via the Python `modulex.tools` entry-point
68
+ group and loads them at startup.
69
+
70
+ ## Installation
71
+
72
+ ```bash
73
+ pip install modulex-integrations
74
+ ```
75
+
76
+ With every integration's optional dependencies:
77
+
78
+ ```bash
79
+ pip install "modulex-integrations[all]"
80
+ ```
81
+
82
+ Or only the integrations you need (extras are populated as
83
+ integrations are migrated):
84
+
85
+ ```bash
86
+ pip install "modulex-integrations[github,slack]"
87
+ ```
88
+
89
+ ## Per-integration layout
90
+
91
+ Every integration ships in the same shape:
92
+
93
+ ```
94
+ src/modulex_integrations/tools/<name>/
95
+ ├── __init__.py # re-exports manifest + TOOLS
96
+ ├── manifest.py # IntegrationManifest instance
97
+ ├── tools.py # LangChain @tool functions
98
+ ├── outputs.py # pydantic response models (UI/docs derive JSONSchema)
99
+ ├── dependencies.toml # per-integration runtime deps
100
+ ├── README.md # 5-section strict template (see CONTRIBUTING.md)
101
+ └── tests/
102
+ └── test_<name>.py
103
+ ```
104
+
105
+ The contract is enforced by pydantic types in
106
+ [`src/modulex_integrations/schema.py`](src/modulex_integrations/schema.py)
107
+ with `extra="forbid"` everywhere — a typo in a manifest fails at
108
+ import time, not at runtime.
109
+
110
+ ## Development
111
+
112
+ ```bash
113
+ git clone https://github.com/ModuleXAI/modulex-integrations.git
114
+ cd modulex-integrations
115
+ pip install -e ".[dev]"
116
+ pytest
117
+ ruff check src tests
118
+ mypy src/modulex_integrations
119
+ ```
120
+
121
+ ## Roadmap
122
+
123
+ - **Phase 1 — bootstrap (this commit).** Schema, packaging, CI,
124
+ community meta files, cross-repo brief workflow.
125
+ - **Phase 2 — github POC migration.** One integration end-to-end:
126
+ manifest, tools, outputs, tests, entry point, real
127
+ `httpx.MockTransport` coverage of at least one action.
128
+ - **Phase 3 — scripted bulk migration.** The remaining 44
129
+ integrations migrated by a one-shot script, then reviewed
130
+ individually.
131
+
132
+ ## License
133
+
134
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,9 @@
1
+ modulex_integrations/__init__.py,sha256=y03jgEhl4SeWPR89ZqXdlfweSkFJ4rpUfKWHXSLaSrk,1447
2
+ modulex_integrations/_version.py,sha256=FsByamrmbXweQe1NVtH7k9LbbU4TLa-ybqnCcTiv85U,528
3
+ modulex_integrations/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ modulex_integrations/schema.py,sha256=SaXqBfZtSftfuw1gC6SNGC4zgKZ2tlSILBRXGMF0R6A,5804
5
+ modulex_integrations/tools/__init__.py,sha256=MkxH_u0Nx2VysZVVRX5Fz5swCb38CUPBenWFJT4uN2M,271
6
+ modulex_integrations-0.0.1a0.dist-info/METADATA,sha256=tby9Ka9PQ_2RoNe937jU3lmhzE4G-4Yuhs7o188kmOY,4742
7
+ modulex_integrations-0.0.1a0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
8
+ modulex_integrations-0.0.1a0.dist-info/licenses/LICENSE,sha256=bfr2xGJEVUFiqqrNKUl973a_UchvRWcJ9jZX8x4SAOA,1064
9
+ modulex_integrations-0.0.1a0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.29.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ModuleX
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.