agent-plugins 0.0.0__tar.gz → 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.
- agent_plugins-0.1.0/.agent-plugin/plugin.json +11 -0
- agent_plugins-0.1.0/.agent-plugin/skills/agent-plugins/SKILL.md +195 -0
- agent_plugins-0.1.0/.agent-plugin/skills/agent-plugins/agents/openai.yaml +4 -0
- agent_plugins-0.1.0/PKG-INFO +222 -0
- agent_plugins-0.1.0/README.md +205 -0
- agent_plugins-0.1.0/pyproject.toml +96 -0
- agent_plugins-0.1.0/pyproject.toml.orig +76 -0
- agent_plugins-0.1.0/src/agent_plugins/__init__.py +38 -0
- agent_plugins-0.1.0/src/agent_plugins/__main__.py +5 -0
- agent_plugins-0.1.0/src/agent_plugins/_build/__init__.py +1 -0
- agent_plugins-0.1.0/src/agent_plugins/_build/backend.py +117 -0
- agent_plugins-0.1.0/src/agent_plugins/_build/plan.py +157 -0
- agent_plugins-0.1.0/src/agent_plugins/_build/sdist.py +98 -0
- agent_plugins-0.1.0/src/agent_plugins/_build/wheel.py +187 -0
- agent_plugins-0.1.0/src/agent_plugins/_cli.py +107 -0
- agent_plugins-0.1.0/src/agent_plugins/_discovery.py +84 -0
- agent_plugins-0.1.0/src/agent_plugins/_errors.py +5 -0
- agent_plugins-0.1.0/src/agent_plugins/_files.py +135 -0
- agent_plugins-0.1.0/src/agent_plugins/_marker.py +63 -0
- agent_plugins-0.1.0/src/agent_plugins/_plugin.py +143 -0
- agent_plugins-0.1.0/src/agent_plugins/_schema/__init__.py +24 -0
- agent_plugins-0.1.0/src/agent_plugins/_schema/errors.py +37 -0
- agent_plugins-0.1.0/src/agent_plugins/_schema/json.py +47 -0
- agent_plugins-0.1.0/src/agent_plugins/_schema/lazy.py +47 -0
- agent_plugins-0.1.0/src/agent_plugins/_schema/manifest.py +124 -0
- agent_plugins-0.1.0/src/agent_plugins/_schema/mcp.py +101 -0
- agent_plugins-0.1.0/src/agent_plugins/_schema/models.py +87 -0
- agent_plugins-0.1.0/src/agent_plugins/_schema/skill.py +68 -0
- agent_plugins-0.1.0/src/agent_plugins/_schema/v1/__init__.py +4 -0
- agent_plugins-0.1.0/src/agent_plugins/_schema/v1/manifest.py +143 -0
- agent_plugins-0.1.0/src/agent_plugins/_schema/v1/mcp.py +242 -0
- agent_plugins-0.1.0/src/agent_plugins/_skill.py +117 -0
- agent_plugins-0.1.0/src/agent_plugins/_tree.py +95 -0
- agent_plugins-0.1.0/src/agent_plugins/build/__init__.py +5 -0
- agent_plugins-0.1.0/src/agent_plugins/build/hatchling.py +21 -0
- agent_plugins-0.1.0/src/agent_plugins/build/uv_build.py +21 -0
- agent_plugins-0.1.0/src/agent_plugins/py.typed +0 -0
- agent_plugins-0.0.0/LICENSE +0 -21
- agent_plugins-0.0.0/PKG-INFO +0 -14
- agent_plugins-0.0.0/README.md +0 -3
- agent_plugins-0.0.0/agent_plugins/__init__.py +0 -3
- agent_plugins-0.0.0/agent_plugins.egg-info/PKG-INFO +0 -14
- agent_plugins-0.0.0/agent_plugins.egg-info/SOURCES.txt +0 -8
- agent_plugins-0.0.0/agent_plugins.egg-info/dependency_links.txt +0 -1
- agent_plugins-0.0.0/agent_plugins.egg-info/top_level.txt +0 -1
- agent_plugins-0.0.0/pyproject.toml +0 -17
- agent_plugins-0.0.0/setup.cfg +0 -4
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
|
+
"name": "agent-plugins",
|
|
4
|
+
"description": "Ship Agent Plugins with Python packages and inspect their installed files.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Péter Ferenc Gyarmati",
|
|
7
|
+
"email": "dev.petergy@gmail.com"
|
|
8
|
+
},
|
|
9
|
+
"repository": "https://github.com/peter-gy/agent-plugins",
|
|
10
|
+
"keywords": ["python", "agent-plugins", "agent-skills"]
|
|
11
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-plugins
|
|
3
|
+
description: Ship Agent Skills, MCP server configuration, and extension files with a Python package, choosing build-time or runtime access as needed. Use when adding an Agent Plugin to a Python project, configuring uv_build or Hatchling, locating installed plugin and skill paths, traversing skill files, reading manifest, skill source, or MCP values, or verifying wheel, source distribution, and editable installs.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agent Plugins
|
|
7
|
+
|
|
8
|
+
Use `agent-plugins` when a Python package should carry the instructions and MCP
|
|
9
|
+
configuration that match its installed code version.
|
|
10
|
+
|
|
11
|
+
An [Agent Plugin](https://agent-plugins.org/) is an open, vendor-neutral
|
|
12
|
+
portable directory format for reusable agent components. Its fixed locations
|
|
13
|
+
let compatible clients find [Agent Skills](https://agentskills.io/specification)
|
|
14
|
+
and [Model Context Protocol (MCP)](https://modelcontextprotocol.io/specification)
|
|
15
|
+
server configuration in the same package. Distribution, permissions, and user
|
|
16
|
+
experience remain with each client.
|
|
17
|
+
|
|
18
|
+
## Build the plugin tree
|
|
19
|
+
|
|
20
|
+
Keep one Agent Plugin tree in the codebase:
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
my-plugin/
|
|
24
|
+
├── plugin.json
|
|
25
|
+
├── skills/
|
|
26
|
+
│ └── use-my-package/
|
|
27
|
+
│ ├── SKILL.md
|
|
28
|
+
│ ├── scripts/
|
|
29
|
+
│ └── references/
|
|
30
|
+
├── mcp.json
|
|
31
|
+
└── com.example.client/
|
|
32
|
+
└── hooks/
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
- `plugin.json` identifies the plugin and its Agent Plugins schema.
|
|
36
|
+
- `skills/` contains Agent Skills and their nested files.
|
|
37
|
+
- `mcp.json` describes stdio, Streamable HTTP, or legacy HTTP+SSE servers.
|
|
38
|
+
- Reverse-domain directories contain client-specific extension files.
|
|
39
|
+
|
|
40
|
+
Create a minimal `plugin.json` at the plugin root:
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
45
|
+
"name": "my-project"
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Find the Python package's `pyproject.toml` and set
|
|
50
|
+
`[tool.agent-plugins].root` relative to that file. For uv_build:
|
|
51
|
+
|
|
52
|
+
```toml
|
|
53
|
+
[build-system]
|
|
54
|
+
requires = ["agent-plugins==0.1.0", "uv_build==0.12.2"]
|
|
55
|
+
build-backend = "agent_plugins.build.uv_build"
|
|
56
|
+
|
|
57
|
+
[tool.agent-plugins]
|
|
58
|
+
root = "../.."
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
For Hatchling:
|
|
62
|
+
|
|
63
|
+
```toml
|
|
64
|
+
[build-system]
|
|
65
|
+
requires = ["agent-plugins==0.1.0", "hatchling==1.31.0"]
|
|
66
|
+
build-backend = "agent_plugins.build.hatchling"
|
|
67
|
+
|
|
68
|
+
[tool.agent-plugins]
|
|
69
|
+
root = "../.."
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The build selects `plugin.json`, the complete `skills/` tree, and `mcp.json`
|
|
73
|
+
when present. Select other root-relative files explicitly:
|
|
74
|
+
|
|
75
|
+
```toml
|
|
76
|
+
[tool.agent-plugins]
|
|
77
|
+
root = "../.."
|
|
78
|
+
include = ["bin/**", "com.example.client/**"]
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Every include pattern must stay within the plugin root and match at least one
|
|
82
|
+
file.
|
|
83
|
+
|
|
84
|
+
Use the build plan directly when another build system owns artifact writing:
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
import agent_plugins as ap
|
|
88
|
+
|
|
89
|
+
plan = ap.build_plan("packages/python")
|
|
90
|
+
for file in plan.files:
|
|
91
|
+
print(file.source, file.target)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
`agent_plugins.build.BuildBackend` provides the wheel, source distribution, and
|
|
95
|
+
editable hooks used by the bundled adapters.
|
|
96
|
+
|
|
97
|
+
## Choose build-time or runtime access
|
|
98
|
+
|
|
99
|
+
Keeping `agent-plugins` in `[build-system].requires` makes it available during
|
|
100
|
+
the build. Add the package to `[project].dependencies` when installed Python
|
|
101
|
+
code needs to locate or inspect Agent Plugins:
|
|
102
|
+
|
|
103
|
+
```toml
|
|
104
|
+
[project]
|
|
105
|
+
dependencies = ["agent-plugins==0.1.0"]
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Locate a plugin with the Python package name used by pip:
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
import agent_plugins as ap
|
|
112
|
+
|
|
113
|
+
plugin = ap.locate("my-package")
|
|
114
|
+
|
|
115
|
+
print(plugin.path)
|
|
116
|
+
print(plugin.manifest.path)
|
|
117
|
+
print(plugin.manifest.name)
|
|
118
|
+
|
|
119
|
+
for skill in plugin.skills:
|
|
120
|
+
print(skill.path)
|
|
121
|
+
print(skill / "SKILL.md")
|
|
122
|
+
|
|
123
|
+
if mcp := plugin.mcp:
|
|
124
|
+
for name, server in mcp.servers.items():
|
|
125
|
+
print(name, server)
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
`plugin.path` is the absolute installed plugin root. Each item in
|
|
129
|
+
`plugin.skills` is an `ap.Skill` rooted at one immediate directory under
|
|
130
|
+
`skills/`. Use `Path(skill)` or `skill.path` for that directory. Use `/` to
|
|
131
|
+
build native paths to its instructions, references, scripts, or assets:
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
skill = plugin.skills[0]
|
|
135
|
+
|
|
136
|
+
print(skill / "SKILL.md")
|
|
137
|
+
print(skill / "references" / "api.md")
|
|
138
|
+
print(skill.tree(max_depth=2))
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Use `skill.frontmatter` for the source text between the `---` delimiters. Use
|
|
142
|
+
`skill.body` for the Markdown source after the frontmatter. The first access to
|
|
143
|
+
either property reads and splits `SKILL.md`, then caches both strings. Path and
|
|
144
|
+
tree access leave the document unread so an agent can choose which files and
|
|
145
|
+
content to load.
|
|
146
|
+
|
|
147
|
+
`plugin.manifest` is an `ap.Manifest`. `plugin.mcp` is an `ap.MCPConfig` when
|
|
148
|
+
`mcp.json` exists. Each object exposes `.path` immediately. Accessing a parsed
|
|
149
|
+
field such as `manifest.name` or `mcp.servers` reads, validates, and caches its
|
|
150
|
+
document. MCP access validates the manifest first.
|
|
151
|
+
|
|
152
|
+
MCP servers are frozen `ap.StdioServer`, `ap.StreamableHTTPServer`, or
|
|
153
|
+
`ap.SSEServer` values in a read-only mapping. `manifest.issues` records ignored
|
|
154
|
+
manifest fields. `mcp.issues` records invalid server entries skipped during
|
|
155
|
+
loading. Document-level failures raise `ap.ValidationError` on parsed value
|
|
156
|
+
access.
|
|
157
|
+
|
|
158
|
+
Display the plugin to inspect its packaged tree:
|
|
159
|
+
|
|
160
|
+
```python
|
|
161
|
+
print(plugin)
|
|
162
|
+
print(plugin.tree(max_depth=2))
|
|
163
|
+
print(plugin.tree(max_depth=None, max_files=None))
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
`Path(plugin)`, `Path(skill)`, and `Path(plugin.manifest)` use the native path
|
|
167
|
+
protocol. When `plugin.mcp` is present, `Path(plugin.mcp)` does too.
|
|
168
|
+
`ap.installed()` returns each discovered plugin keyed by installed Python
|
|
169
|
+
package name.
|
|
170
|
+
|
|
171
|
+
## Verify the package
|
|
172
|
+
|
|
173
|
+
Inspect the selected paths before building:
|
|
174
|
+
|
|
175
|
+
```console
|
|
176
|
+
agent-plugins plan path/to/python-project
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Then verify the package through its installation boundaries:
|
|
180
|
+
|
|
181
|
+
1. Build a wheel and source distribution.
|
|
182
|
+
2. Build a wheel from the source distribution.
|
|
183
|
+
3. Install the wheel in a clean environment.
|
|
184
|
+
4. Install the Python package as editable.
|
|
185
|
+
5. Call `ap.locate()` in both environments.
|
|
186
|
+
6. Access `plugin.manifest.name` and `plugin.mcp.servers` when MCP exists to run
|
|
187
|
+
schema validation and the Agent Plugins rules.
|
|
188
|
+
7. Confirm each `skill.path`, `skill / "SKILL.md"`, and `skill.files` points to
|
|
189
|
+
the packaged skill tree.
|
|
190
|
+
8. Access `skill.frontmatter` and `skill.body` to verify the packaged
|
|
191
|
+
`SKILL.md` structure.
|
|
192
|
+
|
|
193
|
+
Handle `ap.AgentPluginError` when a requested Python package or usable plugin
|
|
194
|
+
root is absent. Handle `ap.ValidationError` when an installed plugin document
|
|
195
|
+
or `SKILL.md` structure is invalid.
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: agent-plugins
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Ship Agent Plugins with Python packages and inspect their installed files
|
|
5
|
+
Author: Péter Ferenc Gyarmati
|
|
6
|
+
Author-email: Péter Ferenc Gyarmati <dev.petergy@gmail.com>
|
|
7
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
12
|
+
Classifier: Typing :: Typed
|
|
13
|
+
Requires-Dist: tomli==2.3.1 ; python_full_version < '3.11'
|
|
14
|
+
Requires-Python: >=3.10, <3.15
|
|
15
|
+
Project-URL: Source, https://github.com/peter-gy/agent-plugins
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# agent-plugins
|
|
19
|
+
|
|
20
|
+
`agent-plugins` packages Agent Skills, Model Context Protocol configuration, and
|
|
21
|
+
client extension files with a Python distribution. Each installed wheel carries
|
|
22
|
+
the agent files that match its code version.
|
|
23
|
+
|
|
24
|
+
The package implements the portable [Agent Plugins](https://agent-plugins.org/)
|
|
25
|
+
directory format and supports Python 3.10 through 3.14.
|
|
26
|
+
|
|
27
|
+
## Ship an Agent Plugin
|
|
28
|
+
|
|
29
|
+
Keep one Agent Plugin tree beside the code it documents:
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
my-project/
|
|
33
|
+
├── plugin.json
|
|
34
|
+
├── skills/
|
|
35
|
+
│ └── use-my-package/
|
|
36
|
+
│ ├── SKILL.md
|
|
37
|
+
│ ├── agents/
|
|
38
|
+
│ ├── references/
|
|
39
|
+
│ └── scripts/
|
|
40
|
+
├── mcp.json
|
|
41
|
+
└── packages/
|
|
42
|
+
└── python/
|
|
43
|
+
└── pyproject.toml
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`skills/` contains [Agent Skills](https://agentskills.io/specification).
|
|
47
|
+
`mcp.json` contains [Model Context Protocol](https://modelcontextprotocol.io/specification)
|
|
48
|
+
server configuration when the plugin provides MCP servers.
|
|
49
|
+
|
|
50
|
+
Create `plugin.json` at the plugin root:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
55
|
+
"name": "my-project"
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Configure the Python package to wrap `uv_build`:
|
|
60
|
+
|
|
61
|
+
```toml
|
|
62
|
+
[build-system]
|
|
63
|
+
requires = ["agent-plugins==0.1.0", "uv_build==0.12.2"]
|
|
64
|
+
build-backend = "agent_plugins.build.uv_build"
|
|
65
|
+
|
|
66
|
+
[tool.agent-plugins]
|
|
67
|
+
root = "../.."
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
`root` is relative to `pyproject.toml`. The build selects `plugin.json`, the
|
|
71
|
+
complete `skills/` tree, and `mcp.json` when present.
|
|
72
|
+
|
|
73
|
+
Build, install, and locate the packaged plugin:
|
|
74
|
+
|
|
75
|
+
```console
|
|
76
|
+
uv build packages/python --out-dir dist
|
|
77
|
+
python -m pip install "agent-plugins==0.1.0" dist/my_package-*.whl
|
|
78
|
+
agent-plugins locate my-package
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
```text
|
|
82
|
+
/.../site-packages/my_package-1.2.3.agent-plugin
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The wheel contains the plugin directory and an `agent_plugins.json` marker in
|
|
86
|
+
the distribution metadata. A source distribution stages the same files for a
|
|
87
|
+
reproducible wheel rebuild. An editable install points the marker at the authored
|
|
88
|
+
plugin tree.
|
|
89
|
+
|
|
90
|
+
### Use Hatchling
|
|
91
|
+
|
|
92
|
+
Keep the plugin settings and select the Hatchling adapter:
|
|
93
|
+
|
|
94
|
+
```toml
|
|
95
|
+
[build-system]
|
|
96
|
+
requires = ["agent-plugins==0.1.0", "hatchling==1.31.0"]
|
|
97
|
+
build-backend = "agent_plugins.build.hatchling"
|
|
98
|
+
|
|
99
|
+
[tool.agent-plugins]
|
|
100
|
+
root = "../.."
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Include other plugin files
|
|
104
|
+
|
|
105
|
+
Add root-relative patterns for executables or client extensions:
|
|
106
|
+
|
|
107
|
+
```toml
|
|
108
|
+
[tool.agent-plugins]
|
|
109
|
+
root = "../.."
|
|
110
|
+
include = ["bin/**", "com.example.client/**"]
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Each pattern must stay within the plugin root and match at least one file.
|
|
114
|
+
|
|
115
|
+
## Inspect an installed plugin
|
|
116
|
+
|
|
117
|
+
Add `agent-plugins` to the runtime dependencies of Python code that calls the
|
|
118
|
+
inspection API:
|
|
119
|
+
|
|
120
|
+
```toml
|
|
121
|
+
[project]
|
|
122
|
+
dependencies = ["agent-plugins==0.1.0"]
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
```python
|
|
126
|
+
import agent_plugins as ap
|
|
127
|
+
|
|
128
|
+
plugin = ap.locate("my-package")
|
|
129
|
+
|
|
130
|
+
print(plugin.manifest.name)
|
|
131
|
+
print(plugin.manifest.path)
|
|
132
|
+
|
|
133
|
+
for skill in plugin.skills:
|
|
134
|
+
print(skill.path)
|
|
135
|
+
print(skill / "SKILL.md")
|
|
136
|
+
|
|
137
|
+
if mcp := plugin.mcp:
|
|
138
|
+
for name, server in mcp.servers.items():
|
|
139
|
+
print(name, server)
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
`ap.locate()` accepts the distribution name used by `pip`. `ap.installed()`
|
|
143
|
+
returns every discovered Agent Plugin keyed by distribution name.
|
|
144
|
+
|
|
145
|
+
| Object | Access |
|
|
146
|
+
| --- | --- |
|
|
147
|
+
| `plugin.path` | Absolute plugin root |
|
|
148
|
+
| `plugin.manifest` | Lazy `plugin.json` document |
|
|
149
|
+
| `plugin.skills` | `ap.Skill` objects rooted under `skills/` |
|
|
150
|
+
| `plugin.mcp` | Lazy `mcp.json` document, when present |
|
|
151
|
+
| `plugin.files` | Files selected by the package build |
|
|
152
|
+
| `plugin.tree()` | Bounded ASCII tree of the installed plugin |
|
|
153
|
+
| `skill.frontmatter` | Source text between the `---` delimiters |
|
|
154
|
+
| `skill.body` | Markdown after the frontmatter |
|
|
155
|
+
| `skill.files` | Files selected below the skill root |
|
|
156
|
+
|
|
157
|
+
Manifest, MCP, and skill documents load on first parsed-field access and cache
|
|
158
|
+
their result. Call `ap.locate()` again to read a fresh snapshot. Invalid
|
|
159
|
+
documents raise `ap.ValidationError`.
|
|
160
|
+
|
|
161
|
+
MCP servers are frozen `ap.StdioServer`, `ap.StreamableHTTPServer`, or
|
|
162
|
+
`ap.SSEServer` values. Their fields preserve placeholders such as
|
|
163
|
+
`${PLUGIN_ROOT}` for the agent client to resolve.
|
|
164
|
+
|
|
165
|
+
## Inspect a build plan
|
|
166
|
+
|
|
167
|
+
Preview the files selected by `[tool.agent-plugins]` before building:
|
|
168
|
+
|
|
169
|
+
```console
|
|
170
|
+
agent-plugins plan packages/python
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Use `--json` for machine-readable output. Python build integrations can consume
|
|
174
|
+
the same plan:
|
|
175
|
+
|
|
176
|
+
```python
|
|
177
|
+
import agent_plugins as ap
|
|
178
|
+
|
|
179
|
+
plan = ap.build_plan("packages/python")
|
|
180
|
+
for file in plan.files:
|
|
181
|
+
print(file.source, "->", file.target)
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
List every plugin visible in the current environment:
|
|
185
|
+
|
|
186
|
+
```console
|
|
187
|
+
agent-plugins list --json
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Develop and release
|
|
191
|
+
|
|
192
|
+
From a repository checkout, install the locked development environment and run
|
|
193
|
+
the local checks:
|
|
194
|
+
|
|
195
|
+
```console
|
|
196
|
+
uv sync --locked
|
|
197
|
+
uv run ruff format --check src tests
|
|
198
|
+
uv run ruff check src tests
|
|
199
|
+
uv run ty check
|
|
200
|
+
uv run pyrefly check
|
|
201
|
+
uv run pytest -q
|
|
202
|
+
./scripts/build-dist.sh
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Prepare the version and lockfile in a release pull request:
|
|
206
|
+
|
|
207
|
+
```console
|
|
208
|
+
uv version --bump patch
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
After the release commit reaches `main` and its push CI passes, update the local
|
|
212
|
+
branch and start the tag-driven release:
|
|
213
|
+
|
|
214
|
+
```console
|
|
215
|
+
git pull --ff-only origin main
|
|
216
|
+
./scripts/release.sh --dry-run
|
|
217
|
+
./scripts/release.sh
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Before the first tag, configure PyPI to trust `.github/workflows/publish.yml`
|
|
221
|
+
through the repository's `pypi` environment. PyPI documents the setup in
|
|
222
|
+
[Adding a Trusted Publisher](https://docs.pypi.org/trusted-publishers/adding-a-publisher/).
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# agent-plugins
|
|
2
|
+
|
|
3
|
+
`agent-plugins` packages Agent Skills, Model Context Protocol configuration, and
|
|
4
|
+
client extension files with a Python distribution. Each installed wheel carries
|
|
5
|
+
the agent files that match its code version.
|
|
6
|
+
|
|
7
|
+
The package implements the portable [Agent Plugins](https://agent-plugins.org/)
|
|
8
|
+
directory format and supports Python 3.10 through 3.14.
|
|
9
|
+
|
|
10
|
+
## Ship an Agent Plugin
|
|
11
|
+
|
|
12
|
+
Keep one Agent Plugin tree beside the code it documents:
|
|
13
|
+
|
|
14
|
+
```text
|
|
15
|
+
my-project/
|
|
16
|
+
├── plugin.json
|
|
17
|
+
├── skills/
|
|
18
|
+
│ └── use-my-package/
|
|
19
|
+
│ ├── SKILL.md
|
|
20
|
+
│ ├── agents/
|
|
21
|
+
│ ├── references/
|
|
22
|
+
│ └── scripts/
|
|
23
|
+
├── mcp.json
|
|
24
|
+
└── packages/
|
|
25
|
+
└── python/
|
|
26
|
+
└── pyproject.toml
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`skills/` contains [Agent Skills](https://agentskills.io/specification).
|
|
30
|
+
`mcp.json` contains [Model Context Protocol](https://modelcontextprotocol.io/specification)
|
|
31
|
+
server configuration when the plugin provides MCP servers.
|
|
32
|
+
|
|
33
|
+
Create `plugin.json` at the plugin root:
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
38
|
+
"name": "my-project"
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Configure the Python package to wrap `uv_build`:
|
|
43
|
+
|
|
44
|
+
```toml
|
|
45
|
+
[build-system]
|
|
46
|
+
requires = ["agent-plugins==0.1.0", "uv_build==0.12.2"]
|
|
47
|
+
build-backend = "agent_plugins.build.uv_build"
|
|
48
|
+
|
|
49
|
+
[tool.agent-plugins]
|
|
50
|
+
root = "../.."
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`root` is relative to `pyproject.toml`. The build selects `plugin.json`, the
|
|
54
|
+
complete `skills/` tree, and `mcp.json` when present.
|
|
55
|
+
|
|
56
|
+
Build, install, and locate the packaged plugin:
|
|
57
|
+
|
|
58
|
+
```console
|
|
59
|
+
uv build packages/python --out-dir dist
|
|
60
|
+
python -m pip install "agent-plugins==0.1.0" dist/my_package-*.whl
|
|
61
|
+
agent-plugins locate my-package
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
/.../site-packages/my_package-1.2.3.agent-plugin
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The wheel contains the plugin directory and an `agent_plugins.json` marker in
|
|
69
|
+
the distribution metadata. A source distribution stages the same files for a
|
|
70
|
+
reproducible wheel rebuild. An editable install points the marker at the authored
|
|
71
|
+
plugin tree.
|
|
72
|
+
|
|
73
|
+
### Use Hatchling
|
|
74
|
+
|
|
75
|
+
Keep the plugin settings and select the Hatchling adapter:
|
|
76
|
+
|
|
77
|
+
```toml
|
|
78
|
+
[build-system]
|
|
79
|
+
requires = ["agent-plugins==0.1.0", "hatchling==1.31.0"]
|
|
80
|
+
build-backend = "agent_plugins.build.hatchling"
|
|
81
|
+
|
|
82
|
+
[tool.agent-plugins]
|
|
83
|
+
root = "../.."
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Include other plugin files
|
|
87
|
+
|
|
88
|
+
Add root-relative patterns for executables or client extensions:
|
|
89
|
+
|
|
90
|
+
```toml
|
|
91
|
+
[tool.agent-plugins]
|
|
92
|
+
root = "../.."
|
|
93
|
+
include = ["bin/**", "com.example.client/**"]
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Each pattern must stay within the plugin root and match at least one file.
|
|
97
|
+
|
|
98
|
+
## Inspect an installed plugin
|
|
99
|
+
|
|
100
|
+
Add `agent-plugins` to the runtime dependencies of Python code that calls the
|
|
101
|
+
inspection API:
|
|
102
|
+
|
|
103
|
+
```toml
|
|
104
|
+
[project]
|
|
105
|
+
dependencies = ["agent-plugins==0.1.0"]
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
import agent_plugins as ap
|
|
110
|
+
|
|
111
|
+
plugin = ap.locate("my-package")
|
|
112
|
+
|
|
113
|
+
print(plugin.manifest.name)
|
|
114
|
+
print(plugin.manifest.path)
|
|
115
|
+
|
|
116
|
+
for skill in plugin.skills:
|
|
117
|
+
print(skill.path)
|
|
118
|
+
print(skill / "SKILL.md")
|
|
119
|
+
|
|
120
|
+
if mcp := plugin.mcp:
|
|
121
|
+
for name, server in mcp.servers.items():
|
|
122
|
+
print(name, server)
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
`ap.locate()` accepts the distribution name used by `pip`. `ap.installed()`
|
|
126
|
+
returns every discovered Agent Plugin keyed by distribution name.
|
|
127
|
+
|
|
128
|
+
| Object | Access |
|
|
129
|
+
| --- | --- |
|
|
130
|
+
| `plugin.path` | Absolute plugin root |
|
|
131
|
+
| `plugin.manifest` | Lazy `plugin.json` document |
|
|
132
|
+
| `plugin.skills` | `ap.Skill` objects rooted under `skills/` |
|
|
133
|
+
| `plugin.mcp` | Lazy `mcp.json` document, when present |
|
|
134
|
+
| `plugin.files` | Files selected by the package build |
|
|
135
|
+
| `plugin.tree()` | Bounded ASCII tree of the installed plugin |
|
|
136
|
+
| `skill.frontmatter` | Source text between the `---` delimiters |
|
|
137
|
+
| `skill.body` | Markdown after the frontmatter |
|
|
138
|
+
| `skill.files` | Files selected below the skill root |
|
|
139
|
+
|
|
140
|
+
Manifest, MCP, and skill documents load on first parsed-field access and cache
|
|
141
|
+
their result. Call `ap.locate()` again to read a fresh snapshot. Invalid
|
|
142
|
+
documents raise `ap.ValidationError`.
|
|
143
|
+
|
|
144
|
+
MCP servers are frozen `ap.StdioServer`, `ap.StreamableHTTPServer`, or
|
|
145
|
+
`ap.SSEServer` values. Their fields preserve placeholders such as
|
|
146
|
+
`${PLUGIN_ROOT}` for the agent client to resolve.
|
|
147
|
+
|
|
148
|
+
## Inspect a build plan
|
|
149
|
+
|
|
150
|
+
Preview the files selected by `[tool.agent-plugins]` before building:
|
|
151
|
+
|
|
152
|
+
```console
|
|
153
|
+
agent-plugins plan packages/python
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Use `--json` for machine-readable output. Python build integrations can consume
|
|
157
|
+
the same plan:
|
|
158
|
+
|
|
159
|
+
```python
|
|
160
|
+
import agent_plugins as ap
|
|
161
|
+
|
|
162
|
+
plan = ap.build_plan("packages/python")
|
|
163
|
+
for file in plan.files:
|
|
164
|
+
print(file.source, "->", file.target)
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
List every plugin visible in the current environment:
|
|
168
|
+
|
|
169
|
+
```console
|
|
170
|
+
agent-plugins list --json
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Develop and release
|
|
174
|
+
|
|
175
|
+
From a repository checkout, install the locked development environment and run
|
|
176
|
+
the local checks:
|
|
177
|
+
|
|
178
|
+
```console
|
|
179
|
+
uv sync --locked
|
|
180
|
+
uv run ruff format --check src tests
|
|
181
|
+
uv run ruff check src tests
|
|
182
|
+
uv run ty check
|
|
183
|
+
uv run pyrefly check
|
|
184
|
+
uv run pytest -q
|
|
185
|
+
./scripts/build-dist.sh
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Prepare the version and lockfile in a release pull request:
|
|
189
|
+
|
|
190
|
+
```console
|
|
191
|
+
uv version --bump patch
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
After the release commit reaches `main` and its push CI passes, update the local
|
|
195
|
+
branch and start the tag-driven release:
|
|
196
|
+
|
|
197
|
+
```console
|
|
198
|
+
git pull --ff-only origin main
|
|
199
|
+
./scripts/release.sh --dry-run
|
|
200
|
+
./scripts/release.sh
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Before the first tag, configure PyPI to trust `.github/workflows/publish.yml`
|
|
204
|
+
through the repository's `pypi` environment. PyPI documents the setup in
|
|
205
|
+
[Adding a Trusted Publisher](https://docs.pypi.org/trusted-publishers/adding-a-publisher/).
|