agentweld 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 (60) hide show
  1. agentweld-0.1.0/.gitignore +33 -0
  2. agentweld-0.1.0/CHANGELOG.md +54 -0
  3. agentweld-0.1.0/CONTRIBUTING.md +95 -0
  4. agentweld-0.1.0/LICENSE +21 -0
  5. agentweld-0.1.0/PKG-INFO +330 -0
  6. agentweld-0.1.0/README.md +270 -0
  7. agentweld-0.1.0/pyproject.toml +94 -0
  8. agentweld-0.1.0/src/agentweld/__init__.py +3 -0
  9. agentweld-0.1.0/src/agentweld/cli/__init__.py +0 -0
  10. agentweld-0.1.0/src/agentweld/cli/add.py +142 -0
  11. agentweld-0.1.0/src/agentweld/cli/generate.py +164 -0
  12. agentweld-0.1.0/src/agentweld/cli/init.py +197 -0
  13. agentweld-0.1.0/src/agentweld/cli/inspect.py +171 -0
  14. agentweld-0.1.0/src/agentweld/cli/main.py +22 -0
  15. agentweld-0.1.0/src/agentweld/cli/preview.py +122 -0
  16. agentweld-0.1.0/src/agentweld/composition/__init__.py +1 -0
  17. agentweld-0.1.0/src/agentweld/composition/composer.py +85 -0
  18. agentweld-0.1.0/src/agentweld/config/__init__.py +6 -0
  19. agentweld-0.1.0/src/agentweld/config/loader.py +117 -0
  20. agentweld-0.1.0/src/agentweld/config/writer.py +235 -0
  21. agentweld-0.1.0/src/agentweld/curation/__init__.py +1 -0
  22. agentweld-0.1.0/src/agentweld/curation/engine.py +28 -0
  23. agentweld-0.1.0/src/agentweld/curation/quality.py +77 -0
  24. agentweld-0.1.0/src/agentweld/curation/rules.py +67 -0
  25. agentweld-0.1.0/src/agentweld/generators/__init__.py +13 -0
  26. agentweld-0.1.0/src/agentweld/generators/agent_card.py +76 -0
  27. agentweld-0.1.0/src/agentweld/generators/base.py +27 -0
  28. agentweld-0.1.0/src/agentweld/generators/readme.py +70 -0
  29. agentweld-0.1.0/src/agentweld/generators/runner.py +87 -0
  30. agentweld-0.1.0/src/agentweld/generators/system_prompt.py +81 -0
  31. agentweld-0.1.0/src/agentweld/generators/templates/readme.md.j2 +18 -0
  32. agentweld-0.1.0/src/agentweld/generators/templates/system_prompt.md.j2 +16 -0
  33. agentweld-0.1.0/src/agentweld/generators/tool_manifest.py +63 -0
  34. agentweld-0.1.0/src/agentweld/models/__init__.py +0 -0
  35. agentweld-0.1.0/src/agentweld/models/artifacts.py +61 -0
  36. agentweld-0.1.0/src/agentweld/models/composed.py +32 -0
  37. agentweld-0.1.0/src/agentweld/models/config.py +162 -0
  38. agentweld-0.1.0/src/agentweld/models/tool.py +99 -0
  39. agentweld-0.1.0/src/agentweld/plugins/__init__.py +5 -0
  40. agentweld-0.1.0/src/agentweld/plugins/loader.py +55 -0
  41. agentweld-0.1.0/src/agentweld/sources/__init__.py +15 -0
  42. agentweld-0.1.0/src/agentweld/sources/base.py +49 -0
  43. agentweld-0.1.0/src/agentweld/sources/mcp_http.py +129 -0
  44. agentweld-0.1.0/src/agentweld/sources/mcp_stdio.py +156 -0
  45. agentweld-0.1.0/src/agentweld/sources/registry.py +120 -0
  46. agentweld-0.1.0/src/agentweld/utils/__init__.py +0 -0
  47. agentweld-0.1.0/src/agentweld/utils/console.py +105 -0
  48. agentweld-0.1.0/src/agentweld/utils/errors.py +33 -0
  49. agentweld-0.1.0/tests/__init__.py +0 -0
  50. agentweld-0.1.0/tests/conftest.py +90 -0
  51. agentweld-0.1.0/tests/integration/__init__.py +0 -0
  52. agentweld-0.1.0/tests/integration/test_cli.py +728 -0
  53. agentweld-0.1.0/tests/unit/__init__.py +0 -0
  54. agentweld-0.1.0/tests/unit/test_composer.py +286 -0
  55. agentweld-0.1.0/tests/unit/test_config_io.py +301 -0
  56. agentweld-0.1.0/tests/unit/test_generators.py +297 -0
  57. agentweld-0.1.0/tests/unit/test_quality_scanner.py +210 -0
  58. agentweld-0.1.0/tests/unit/test_rule_curator.py +207 -0
  59. agentweld-0.1.0/tests/unit/test_sources.py +317 -0
  60. agentweld-0.1.0/tests/unit/test_tool_model.py +81 -0
@@ -0,0 +1,33 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info/
8
+
9
+ # Virtual environments
10
+ .venv/
11
+ venv/
12
+ env/
13
+
14
+ # Test / coverage
15
+ .pytest_cache/
16
+ .coverage
17
+ coverage.xml
18
+ htmlcov/
19
+
20
+ # Type checking
21
+ .mypy_cache/
22
+
23
+ # Ruff
24
+ .ruff_cache/
25
+
26
+ # agentforge output (generated artifacts — not source code)
27
+ agent/
28
+
29
+ # Editor / OS
30
+ .DS_Store
31
+ .idea/
32
+ .vscode/
33
+ *.swp
@@ -0,0 +1,54 @@
1
+ # Changelog
2
+
3
+ All notable changes to agentweld are documented here.
4
+
5
+ The format follows [Keep a Changelog](https://keepachangelog.com/).
6
+ This project adheres to [Semantic Versioning](https://semver.org/).
7
+
8
+ ## [0.1.0] — 2026-03-22
9
+
10
+ Initial public release of agentweld.
11
+
12
+ ### Added
13
+
14
+ **Phase 1 — Core models and utilities**
15
+ - `ToolDefinition` Pydantic model — universal data model for all pipeline stages. `description_original` is immutable; all curation writes to `description_curated`.
16
+ - `QualityFlag` enum — 7 quality flags: `MISSING_DESCRIPTION`, `WEAK_DESCRIPTION`, `POOR_NAMING`, `UNDOCUMENTED_PARAMS`, `NO_ERROR_GUIDANCE`, `DUPLICATE_INTENT`, `OVERLOADED_TOOL`.
17
+ - `AgentForgeConfig` Pydantic model tree — full `agentweld.yaml` schema.
18
+ - `AgentForgeError` exception hierarchy — 8 typed error classes.
19
+ - Rich console singleton, table builders, and score formatting utilities.
20
+
21
+ **Phase 2 — Source adapters**
22
+ - `MCPStdioAdapter` — spawns a subprocess, calls `tools/list`, terminates. Security: `--trust` flag required for all stdio sources.
23
+ - `MCPHttpAdapter` — streamable-HTTP MCP transport.
24
+ - Adapter registry with plugin discovery via `agentweld.adapters` entry-point group.
25
+
26
+ **Phase 3 — Configuration I/O**
27
+ - `config/loader.py` — parse, env-interpolate, and validate `agentweld.yaml`.
28
+ - `config/writer.py` — `ruamel.yaml` round-trip with comment preservation.
29
+
30
+ **Phase 4 — Curation engine**
31
+ - `QualityScanner` — 7-flag rubric producing 0.0–1.0 quality scores per tool.
32
+ - `RuleBasedCurator` — filter (include/exclude lists), rename, description override.
33
+ - `CurationEngine` — orchestrates scanner → rule curator. LLM enrichment is never triggered here.
34
+
35
+ **Phase 5 — Artifact generators**
36
+ - `AgentCardGenerator` — A2A-valid `agent_card.json`.
37
+ - `ToolManifestGenerator` — `mcp.json` tool manifest.
38
+ - `SystemPromptGenerator` — `system_prompt.md` via Jinja2.
39
+ - `ReadmeGenerator` — `README.md` via Jinja2.
40
+
41
+ **Phase 6 — CLI**
42
+ - `agentweld init` — scaffold `agentweld.yaml` from an MCP source.
43
+ - `agentweld add` — append an MCP source to an existing project.
44
+ - `agentweld inspect` — view tool quality metrics (`--source`, `--final`, `--conflicts`).
45
+ - `agentweld generate` — run the full pipeline (`--force`, `--only`, `--output-dir`).
46
+ - `agentweld preview` — dry-run generation with artifact output.
47
+
48
+ **Phase 7 — Integration and polish**
49
+ - 172 tests, ~88% coverage.
50
+ - Multi-source concurrent introspection via `anyio.create_task_group()`.
51
+ - Quality gate in the `generate` pipeline (configurable `quality.block_below` threshold).
52
+ - Conflict resolution strategies: `prefix`, `explicit`, `error`.
53
+
54
+ [0.1.0]: https://github.com/sheshnath08/agentweld/releases/tag/v0.1.0
@@ -0,0 +1,95 @@
1
+ # Contributing to agentweld
2
+
3
+ Thank you for your interest in contributing!
4
+
5
+ ## Development Setup
6
+
7
+ ```bash
8
+ git clone https://github.com/sheshnath08/agentweld
9
+ cd agentweld
10
+
11
+ # Using uv (recommended)
12
+ uv venv && source .venv/bin/activate
13
+ pip install -e ".[dev]"
14
+
15
+ # Or with standard venv
16
+ python -m venv .venv && source .venv/bin/activate
17
+ pip install -e ".[dev]"
18
+ ```
19
+
20
+ See [CLAUDE.md](CLAUDE.md) for the full list of development commands (tests, lint, type checking, individual test runs).
21
+
22
+ ## Code Quality
23
+
24
+ Run all of the following before submitting a PR:
25
+
26
+ ```bash
27
+ ruff check src/ # lint
28
+ ruff format src/ # format
29
+ mypy src/agentweld # type checking
30
+ pytest tests/unit/ # unit tests (no live MCP connections required)
31
+ ```
32
+
33
+ All four must pass. CI enforces the same checks.
34
+
35
+ ## Pull Request Process
36
+
37
+ 1. Fork the repo and create a branch from `main`.
38
+ 2. Add tests for any new behaviour. Unit tests live in `tests/unit/`, integration tests in `tests/integration/`.
39
+ 3. Ensure `ruff`, `mypy`, and `pytest tests/unit/` all pass locally.
40
+ 4. Open a PR against `main`. Describe **what** changed and **why**.
41
+
42
+ ## Architecture Overview
43
+
44
+ See [CLAUDE.md](CLAUDE.md) for the full module layout and pipeline stages.
45
+
46
+ **The most important invariant:** `ToolDefinition.description_original` is set once on construction and must never be modified. All curation writes exclusively to `description_curated`. Breaking this invariant corrupts the provenance chain and will be rejected.
47
+
48
+ Other key decisions:
49
+ - `SourceAdapter` is a `typing.Protocol` — third-party adapters do not need to import agentweld internals.
50
+ - LLM enrichment is **explicit-only** — it never runs silently during `generate`. Only via an explicit `agentweld enrich` call.
51
+ - `--trust` is required for stdio sources — spawning arbitrary subprocesses is code execution; opt-in is non-negotiable.
52
+ - `ruamel.yaml` is used over PyYAML to preserve YAML comments on round-trip.
53
+
54
+ ## Writing a Source Adapter Plugin
55
+
56
+ A source adapter is any class that satisfies the `SourceAdapter` Protocol. No inheritance from agentweld is required.
57
+
58
+ **Required interface** (from `src/agentweld/sources/base.py`):
59
+
60
+ ```python
61
+ class MyAdapter:
62
+ async def introspect(self, config: SourceConfig) -> list[ToolDefinition]:
63
+ """Connect to the source and return normalized ToolDefinition objects.
64
+
65
+ Raises:
66
+ SourceConnectionError: if the source cannot be reached.
67
+ """
68
+ ...
69
+
70
+ async def health_check(self, config: SourceConfig) -> bool:
71
+ """Return True if reachable; False otherwise. Must not raise."""
72
+ ...
73
+ ```
74
+
75
+ **Register via entry point** in your package's `pyproject.toml`:
76
+
77
+ ```toml
78
+ [project.entry-points."agentweld.adapters"]
79
+ my-transport = "my_package.adapter:MyAdapter"
80
+ ```
81
+
82
+ The key (`my-transport`) becomes the `--from` value users pass to `init` and `add`.
83
+
84
+ ## Commit Messages
85
+
86
+ Use [Conventional Commits](https://www.conventionalcommits.org/):
87
+
88
+ | Prefix | When to use |
89
+ |--------|-------------|
90
+ | `feat:` | New feature |
91
+ | `fix:` | Bug fix |
92
+ | `docs:` | Documentation only |
93
+ | `test:` | Test additions or fixes |
94
+ | `refactor:` | Code change with no feature/bug impact |
95
+ | `chore:` | Tooling, CI, or dependency changes |
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026: Sheshnath Yadav
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.
@@ -0,0 +1,330 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentweld
3
+ Version: 0.1.0
4
+ Summary: Turn any MCP server into a curated, composable, A2A-ready agent.
5
+ Project-URL: Homepage, https://github.com/sheshnath08/agentweld
6
+ Project-URL: Repository, https://github.com/sheshnath08/agentweld
7
+ Project-URL: Bug Tracker, https://github.com/sheshnath08/agentweld/issues
8
+ Project-URL: Changelog, https://github.com/sheshnath08/agentweld/blob/main/CHANGELOG.md
9
+ Author-email: Sheshnath Yadav <sheshnathyadav08@gmail.com>
10
+ License: MIT License
11
+
12
+ Copyright (c) 2026: Sheshnath Yadav
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all
22
+ copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
+ SOFTWARE.
31
+ License-File: LICENSE
32
+ Keywords: a2a,agent,agentic,llm,mcp,model-context-protocol,tool-curation
33
+ Classifier: Development Status :: 4 - Beta
34
+ Classifier: Intended Audience :: Developers
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Operating System :: OS Independent
37
+ Classifier: Programming Language :: Python :: 3
38
+ Classifier: Programming Language :: Python :: 3.11
39
+ Classifier: Programming Language :: Python :: 3.12
40
+ Classifier: Topic :: Software Development :: Code Generators
41
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
42
+ Classifier: Typing :: Typed
43
+ Requires-Python: >=3.11
44
+ Requires-Dist: anyio>=4.4
45
+ Requires-Dist: httpx>=0.27
46
+ Requires-Dist: jinja2>=3.1
47
+ Requires-Dist: mcp>=1.0
48
+ Requires-Dist: pydantic-settings>=2.3
49
+ Requires-Dist: pydantic>=2.7
50
+ Requires-Dist: rich>=13.7
51
+ Requires-Dist: ruamel-yaml>=0.18
52
+ Requires-Dist: typer[all]>=0.12
53
+ Provides-Extra: dev
54
+ Requires-Dist: mypy>=1.10; extra == 'dev'
55
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
56
+ Requires-Dist: pytest-cov>=5.0; extra == 'dev'
57
+ Requires-Dist: pytest>=8.2; extra == 'dev'
58
+ Requires-Dist: ruff>=0.4; extra == 'dev'
59
+ Description-Content-Type: text/markdown
60
+
61
+ # agentweld
62
+
63
+ > Turn any MCP server into a curated, composable, A2A-ready agent.
64
+
65
+ [![PyPI version](https://img.shields.io/pypi/v/agentweld)](https://pypi.org/project/agentweld/)
66
+ [![Python 3.11+](https://img.shields.io/pypi/pyversions/agentweld)](https://pypi.org/project/agentweld/)
67
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
68
+ [![CI](https://github.com/sheshnath08/agentweld/actions/workflows/ci.yml/badge.svg)](https://github.com/sheshnath08/agentweld/actions/workflows/ci.yml)
69
+
70
+ ## What is agentweld?
71
+
72
+ The MCP ecosystem has servers — lots of them. What it's missing is a way to turn those servers into purposeful, well-described, discoverable agents. Raw MCP servers expose dozens or hundreds of tools with weak descriptions, inconsistent naming, and no quality signal. Clients have no way to know which tools are useful, what they do, or how to combine them.
73
+
74
+ **agentweld** solves both problems. It connects to one or more MCP servers, runs a quality scan across every exposed tool, lets you curate the results (filter, rename, enrich descriptions), then generates a complete set of deployment artifacts: an A2A-valid agent card, a tool manifest, a system prompt, and a README — all from a single `agentweld.yaml`.
75
+
76
+ ## The Pipeline
77
+
78
+ ```
79
+ SOURCE LAYER (MCP servers → tools/list)
80
+ ↓ ToolDefinition[]
81
+ CURATION ENGINE (quality scanner → rule-based curator → LLM enrichment)
82
+
83
+ COMPOSITION LAYER (namespace merge, conflict resolution)
84
+
85
+ GENERATORS → agent_card.json / mcp.json / system_prompt.md / README.md
86
+ ```
87
+
88
+ ## Quick Start
89
+
90
+ ### Install
91
+
92
+ ```bash
93
+ pip install agentweld
94
+ ```
95
+
96
+ ### 5-command walkthrough
97
+
98
+ ```bash
99
+ # 1. Scaffold a project from an MCP server
100
+ # --trust is required for stdio sources (spawning npx is code execution)
101
+ $ agentweld init "npx @modelcontextprotocol/server-github" --trust
102
+ WARNING: --trust flag set. Spawning subprocess: npx @modelcontextprotocol/server-github
103
+ Connecting to npx @modelcontextprotocol/server-github...
104
+ Discovered 26 tools.
105
+ Created ./agentweld.yaml
106
+
107
+ # 2. (Optional) Add a second source
108
+ $ agentweld add "npx @linear/mcp" --trust
109
+
110
+ # 3. Check tool quality before generating
111
+ $ agentweld inspect
112
+ ┌──────────┬───────┬─────────────┐
113
+ │ Source │ Tools │ Avg Quality │
114
+ ├──────────┼───────┼─────────────┤
115
+ │ github │ 26 │ 0.54 ⚠ │
116
+ │ linear │ 24 │ 0.71 │
117
+ └──────────┴───────┴─────────────┘
118
+
119
+ # 4. Edit agentweld.yaml to filter, rename, or override descriptions
120
+ # (see Configuration Reference below)
121
+
122
+ # 5. Generate artifacts
123
+ $ agentweld generate
124
+ Generated 4 artifact(s) in ./agent:
125
+ • agent_card.json
126
+ • mcp.json
127
+ • system_prompt.md
128
+ • README.md
129
+ ```
130
+
131
+ ## CLI Reference
132
+
133
+ ### `agentweld init`
134
+
135
+ Scaffold a new `agentweld.yaml` from an MCP source.
136
+
137
+ ```
138
+ agentweld init SOURCE [OPTIONS]
139
+
140
+ Arguments:
141
+ SOURCE MCP server command (stdio) or URL (http/https)
142
+
143
+ Options:
144
+ --from TEXT Source type [default: mcp]
145
+ --trust Trust and execute the stdio command (required for npx/docker)
146
+ -o, --output PATH Output directory [default: .]
147
+ -n, --name TEXT Agent name
148
+ ```
149
+
150
+ > **Security:** `--trust` is required for any stdio source because spawning `npx`, `docker`, or any arbitrary command is code execution. HTTP/HTTPS sources do not require it.
151
+
152
+ ### `agentweld add`
153
+
154
+ Add another MCP source to an existing project.
155
+
156
+ ```
157
+ agentweld add SOURCE [OPTIONS]
158
+
159
+ Arguments:
160
+ SOURCE MCP server command (stdio) or URL (http/https)
161
+
162
+ Options:
163
+ --from TEXT Source type [default: mcp]
164
+ --trust Trust and execute the stdio command
165
+ -c, --config PATH Path to agentweld.yaml [default: ./agentweld.yaml]
166
+ ```
167
+
168
+ ### `agentweld inspect`
169
+
170
+ Inspect tools and quality metrics for all configured sources.
171
+
172
+ ```
173
+ agentweld inspect [OPTIONS]
174
+
175
+ Options:
176
+ --source Show raw tools per source (pre-curation)
177
+ --final Show post-curation tools
178
+ --conflicts Show naming conflicts across sources
179
+ -c, --config PATH Path to agentweld.yaml [default: ./agentweld.yaml]
180
+ ```
181
+
182
+ ### `agentweld generate`
183
+
184
+ Run the full pipeline and write artifacts to the output directory.
185
+
186
+ ```
187
+ agentweld generate [OPTIONS]
188
+
189
+ Options:
190
+ --force Overwrite existing artifacts and bypass the quality gate
191
+ --only TEXT Only generate specific artifacts (repeatable):
192
+ agent_card | tool_manifest | system_prompt | readme
193
+ -o, --output-dir PATH Override the output directory from agentweld.yaml
194
+ -c, --config PATH Path to agentweld.yaml [default: ./agentweld.yaml]
195
+ ```
196
+
197
+ ### `agentweld preview`
198
+
199
+ Same as `generate` but writes to a temp directory and prints artifact contents. Nothing is written to your project.
200
+
201
+ ```
202
+ agentweld preview [OPTIONS]
203
+
204
+ Options:
205
+ -c, --config PATH Path to agentweld.yaml [default: ./agentweld.yaml]
206
+ ```
207
+
208
+ ## Configuration Reference
209
+
210
+ `agentweld.yaml` is the single source of truth for the entire pipeline. Here is an annotated example:
211
+
212
+ ```yaml
213
+ meta:
214
+ created_at: "2026-01-01T00:00:00+00:00"
215
+ updated_at: "2026-01-01T00:00:00+00:00"
216
+
217
+ agent:
218
+ name: "My Dev Agent"
219
+ description: "An agent for GitHub and Linear workflows."
220
+ version: "0.1.0"
221
+
222
+ sources:
223
+ - id: github
224
+ type: mcp_server
225
+ transport: stdio
226
+ command: "npx @modelcontextprotocol/server-github"
227
+ # env:
228
+ # GITHUB_PERSONAL_ACCESS_TOKEN: "${GITHUB_TOKEN}"
229
+
230
+ - id: linear
231
+ type: mcp_server
232
+ transport: streamable-http
233
+ url: "https://mcp.linear.app/sse"
234
+
235
+ tools:
236
+ filters:
237
+ github:
238
+ # include and exclude are mutually exclusive — use one or the other
239
+ include:
240
+ - search_repositories
241
+ - create_issue
242
+ - list_pull_requests
243
+ # exclude:
244
+ # - delete_repository
245
+
246
+ rename:
247
+ "github::search_repositories": search_repos
248
+ "linear::create_issue": linear_create_issue
249
+
250
+ descriptions:
251
+ # Written here by `agentweld enrich` — safe to edit manually too
252
+ search_repos: "Search GitHub repositories by keyword, language, or topic."
253
+
254
+ quality:
255
+ block_below: 0.4 # Quality gate: fail generate if avg score < this threshold
256
+ # Use --force to bypass
257
+
258
+ composition:
259
+ conflict_strategy: prefix # prefix | explicit | error
260
+ # prefix: prepend source_id:: to conflicting names
261
+ # explicit: require rename in tools.rename
262
+ # error: abort on any conflict
263
+
264
+ a2a:
265
+ skills:
266
+ - id: code-search
267
+ name: "Code Search"
268
+ description: "Search repositories and navigate codebases."
269
+ tags: [github, search]
270
+
271
+ generate:
272
+ output_dir: ./agent
273
+ emit:
274
+ agent_card: true
275
+ tool_manifest: true
276
+ system_prompt: true
277
+ readme: true
278
+ ```
279
+
280
+ ## Generated Artifacts
281
+
282
+ | Artifact | Path | Purpose |
283
+ |---|---|---|
284
+ | `agent_card.json` | `<output_dir>/agent_card.json` | A2A Agent Card, suitable for hosting at `/.well-known/agent.json` |
285
+ | `mcp.json` | `<output_dir>/mcp.json` | Tool manifest for MCP clients |
286
+ | `system_prompt.md` | `<output_dir>/system_prompt.md` | LLM system prompt describing the agent and its tools |
287
+ | `README.md` | `<output_dir>/README.md` | Quickstart for users of the generated agent |
288
+
289
+ ## Plugin System
290
+
291
+ agentweld discovers third-party source adapters via the `agentweld.adapters` entry-point group. No inheritance from agentweld internals is required — structural subtyping (Protocol) is used.
292
+
293
+ **Implement the `SourceAdapter` protocol:**
294
+
295
+ ```python
296
+ # my_package/adapter.py
297
+ from __future__ import annotations
298
+ from typing import TYPE_CHECKING
299
+
300
+ if TYPE_CHECKING:
301
+ from agentweld.models.config import SourceConfig
302
+ from agentweld.models.tool import ToolDefinition
303
+
304
+
305
+ class MyAdapter:
306
+ async def introspect(self, config: SourceConfig) -> list[ToolDefinition]:
307
+ """Connect to the source and return normalized ToolDefinition objects."""
308
+ ...
309
+
310
+ async def health_check(self, config: SourceConfig) -> bool:
311
+ """Return True if the source is reachable; False otherwise. Must not raise."""
312
+ ...
313
+ ```
314
+
315
+ **Register it in your package's `pyproject.toml`:**
316
+
317
+ ```toml
318
+ [project.entry-points."agentweld.adapters"]
319
+ my-transport = "my_package.adapter:MyAdapter"
320
+ ```
321
+
322
+ After `pip install my-package`, agentweld discovers your adapter automatically. Use the transport key (`my-transport`) as the `--from` argument when running `init` or `add`.
323
+
324
+ ## Contributing
325
+
326
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, code quality requirements, and the PR process.
327
+
328
+ ## License
329
+
330
+ MIT — see [LICENSE](LICENSE).