agent-plugins 0.0.1__tar.gz → 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agent_plugins-0.1.1/.agent-plugin/plugin.json +12 -0
- agent_plugins-0.1.1/.agent-plugin/skills/agent-plugins/SKILL.md +195 -0
- agent_plugins-0.1.1/.agent-plugin/skills/agent-plugins/agents/openai.yaml +4 -0
- agent_plugins-0.1.1/LICENSE +203 -0
- agent_plugins-0.1.1/PKG-INFO +224 -0
- agent_plugins-0.1.1/README.md +205 -0
- agent_plugins-0.1.1/pyproject.toml +98 -0
- agent_plugins-0.1.1/pyproject.toml.orig +78 -0
- agent_plugins-0.1.1/src/agent_plugins/__init__.py +38 -0
- agent_plugins-0.1.1/src/agent_plugins/__main__.py +5 -0
- agent_plugins-0.1.1/src/agent_plugins/_build/__init__.py +1 -0
- agent_plugins-0.1.1/src/agent_plugins/_build/backend.py +117 -0
- agent_plugins-0.1.1/src/agent_plugins/_build/plan.py +157 -0
- agent_plugins-0.1.1/src/agent_plugins/_build/sdist.py +98 -0
- agent_plugins-0.1.1/src/agent_plugins/_build/wheel.py +187 -0
- agent_plugins-0.1.1/src/agent_plugins/_cli.py +107 -0
- agent_plugins-0.1.1/src/agent_plugins/_discovery.py +84 -0
- agent_plugins-0.1.1/src/agent_plugins/_errors.py +5 -0
- agent_plugins-0.1.1/src/agent_plugins/_files.py +135 -0
- agent_plugins-0.1.1/src/agent_plugins/_marker.py +63 -0
- agent_plugins-0.1.1/src/agent_plugins/_plugin.py +143 -0
- agent_plugins-0.1.1/src/agent_plugins/_schema/__init__.py +24 -0
- agent_plugins-0.1.1/src/agent_plugins/_schema/errors.py +37 -0
- agent_plugins-0.1.1/src/agent_plugins/_schema/json.py +47 -0
- agent_plugins-0.1.1/src/agent_plugins/_schema/lazy.py +47 -0
- agent_plugins-0.1.1/src/agent_plugins/_schema/manifest.py +124 -0
- agent_plugins-0.1.1/src/agent_plugins/_schema/mcp.py +101 -0
- agent_plugins-0.1.1/src/agent_plugins/_schema/models.py +87 -0
- agent_plugins-0.1.1/src/agent_plugins/_schema/skill.py +68 -0
- agent_plugins-0.1.1/src/agent_plugins/_schema/v1/__init__.py +4 -0
- agent_plugins-0.1.1/src/agent_plugins/_schema/v1/manifest.py +143 -0
- agent_plugins-0.1.1/src/agent_plugins/_schema/v1/mcp.py +242 -0
- agent_plugins-0.1.1/src/agent_plugins/_skill.py +117 -0
- agent_plugins-0.1.1/src/agent_plugins/_tree.py +95 -0
- agent_plugins-0.1.1/src/agent_plugins/build/__init__.py +5 -0
- agent_plugins-0.1.1/src/agent_plugins/build/hatchling.py +21 -0
- agent_plugins-0.1.1/src/agent_plugins/build/uv_build.py +21 -0
- agent_plugins-0.1.1/src/agent_plugins/py.typed +0 -0
- agent_plugins-0.0.1/LICENSE +0 -21
- agent_plugins-0.0.1/PKG-INFO +0 -14
- agent_plugins-0.0.1/README.md +0 -3
- agent_plugins-0.0.1/agent_plugins/__init__.py +0 -3
- agent_plugins-0.0.1/agent_plugins.egg-info/PKG-INFO +0 -14
- agent_plugins-0.0.1/agent_plugins.egg-info/SOURCES.txt +0 -8
- agent_plugins-0.0.1/agent_plugins.egg-info/dependency_links.txt +0 -1
- agent_plugins-0.0.1/agent_plugins.egg-info/top_level.txt +0 -1
- agent_plugins-0.0.1/pyproject.toml +0 -17
- agent_plugins-0.0.1/setup.cfg +0 -4
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
"license": "Apache-2.0",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Péter Ferenc Gyarmati",
|
|
8
|
+
"email": "dev.petergy@gmail.com"
|
|
9
|
+
},
|
|
10
|
+
"repository": "https://github.com/peter-gy/agent-plugins",
|
|
11
|
+
"keywords": ["python", "agent-plugins", "agent-skills"]
|
|
12
|
+
}
|
|
@@ -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.1", "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.1", "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.1"]
|
|
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,203 @@
|
|
|
1
|
+
Copyright 2026 Péter Ferenc Gyarmati
|
|
2
|
+
|
|
3
|
+
Apache License
|
|
4
|
+
Version 2.0, January 2004
|
|
5
|
+
http://www.apache.org/licenses/
|
|
6
|
+
|
|
7
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
8
|
+
|
|
9
|
+
1. Definitions.
|
|
10
|
+
|
|
11
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
12
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
13
|
+
|
|
14
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
15
|
+
the copyright owner that is granting the License.
|
|
16
|
+
|
|
17
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
18
|
+
other entities that control, are controlled by, or are under common
|
|
19
|
+
control with that entity. For the purposes of this definition,
|
|
20
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
21
|
+
direction or management of such entity, whether by contract or
|
|
22
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
23
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
24
|
+
|
|
25
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
26
|
+
exercising permissions granted by this License.
|
|
27
|
+
|
|
28
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
29
|
+
including but not limited to software source code, documentation
|
|
30
|
+
source, and configuration files.
|
|
31
|
+
|
|
32
|
+
"Object" form shall mean any form resulting from mechanical
|
|
33
|
+
transformation or translation of a Source form, including but
|
|
34
|
+
not limited to compiled object code, generated documentation,
|
|
35
|
+
and conversions to other media types.
|
|
36
|
+
|
|
37
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
38
|
+
Object form, made available under the License, as indicated by a
|
|
39
|
+
copyright notice that is included in or attached to the work
|
|
40
|
+
(an example is provided in the Appendix below).
|
|
41
|
+
|
|
42
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
43
|
+
form, that is based on (or derived from) the Work and for which the
|
|
44
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
45
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
46
|
+
of this License, Derivative Works shall not include works that remain
|
|
47
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
48
|
+
the Work and Derivative Works thereof.
|
|
49
|
+
|
|
50
|
+
"Contribution" shall mean any work of authorship, including
|
|
51
|
+
the original version of the Work and any modifications or additions
|
|
52
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
53
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
54
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
55
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
56
|
+
means any form of electronic, verbal, or written communication sent
|
|
57
|
+
to the Licensor or its representatives, including but not limited to
|
|
58
|
+
communication on electronic mailing lists, source code control systems,
|
|
59
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
60
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
61
|
+
excluding communication that is conspicuously marked or otherwise
|
|
62
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
63
|
+
|
|
64
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
65
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
66
|
+
subsequently incorporated within the Work.
|
|
67
|
+
|
|
68
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
69
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
70
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
71
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
72
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
73
|
+
Work and such Derivative Works in Source or Object form.
|
|
74
|
+
|
|
75
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
76
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
77
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
78
|
+
(except as stated in this section) patent license to make, have made,
|
|
79
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
80
|
+
where such license applies only to those patent claims licensable
|
|
81
|
+
by such Contributor that are necessarily infringed by their
|
|
82
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
83
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
84
|
+
institute patent litigation against any entity (including a
|
|
85
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
86
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
87
|
+
or contributory patent infringement, then any patent licenses
|
|
88
|
+
granted to You under this License for that Work shall terminate
|
|
89
|
+
as of the date such litigation is filed.
|
|
90
|
+
|
|
91
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
92
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
93
|
+
modifications, and in Source or Object form, provided that You
|
|
94
|
+
meet the following conditions:
|
|
95
|
+
|
|
96
|
+
(a) You must give any other recipients of the Work or
|
|
97
|
+
Derivative Works a copy of this License; and
|
|
98
|
+
|
|
99
|
+
(b) You must cause any modified files to carry prominent notices
|
|
100
|
+
stating that You changed the files; and
|
|
101
|
+
|
|
102
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
103
|
+
that You distribute, all copyright, patent, trademark, and
|
|
104
|
+
attribution notices from the Source form of the Work,
|
|
105
|
+
excluding those notices that do not pertain to any part of
|
|
106
|
+
the Derivative Works; and
|
|
107
|
+
|
|
108
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
109
|
+
distribution, then any Derivative Works that You distribute must
|
|
110
|
+
include a readable copy of the attribution notices contained
|
|
111
|
+
within such NOTICE file, excluding those notices that do not
|
|
112
|
+
pertain to any part of the Derivative Works, in at least one
|
|
113
|
+
of the following places: within a NOTICE text file distributed
|
|
114
|
+
as part of the Derivative Works; within the Source form or
|
|
115
|
+
documentation, if provided along with the Derivative Works; or,
|
|
116
|
+
within a display generated by the Derivative Works, if and
|
|
117
|
+
wherever such third-party notices normally appear. The contents
|
|
118
|
+
of the NOTICE file are for informational purposes only and
|
|
119
|
+
do not modify the License. You may add Your own attribution
|
|
120
|
+
notices within Derivative Works that You distribute, alongside
|
|
121
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
122
|
+
that such additional attribution notices cannot be construed
|
|
123
|
+
as modifying the License.
|
|
124
|
+
|
|
125
|
+
You may add Your own copyright statement to Your modifications and
|
|
126
|
+
may provide additional or different license terms and conditions
|
|
127
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
128
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
129
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
130
|
+
the conditions stated in this License.
|
|
131
|
+
|
|
132
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
133
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
134
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
135
|
+
this License, without any additional terms or conditions.
|
|
136
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
137
|
+
the terms of any separate license agreement you may have executed
|
|
138
|
+
with Licensor regarding such Contributions.
|
|
139
|
+
|
|
140
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
141
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
142
|
+
except as required for reasonable and customary use in describing the
|
|
143
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
144
|
+
|
|
145
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
146
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
147
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
148
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
149
|
+
implied, including, without limitation, any warranties or conditions
|
|
150
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
151
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
152
|
+
appropriateness of using or redistributing the Work and assume any
|
|
153
|
+
risks associated with Your exercise of permissions under this License.
|
|
154
|
+
|
|
155
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
156
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
157
|
+
unless required by applicable law (such as deliberate and grossly
|
|
158
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
159
|
+
liable to You for damages, including any direct, indirect, special,
|
|
160
|
+
incidental, or consequential damages of any character arising as a
|
|
161
|
+
result of this License or out of the use or inability to use the
|
|
162
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
163
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
164
|
+
other commercial damages or losses), even if such Contributor
|
|
165
|
+
has been advised of the possibility of such damages.
|
|
166
|
+
|
|
167
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
168
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
169
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
170
|
+
or other liability obligations and/or rights consistent with this
|
|
171
|
+
License. However, in accepting such obligations, You may act only
|
|
172
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
173
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
174
|
+
defend, and hold each Contributor harmless for any liability
|
|
175
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
176
|
+
of your accepting any such warranty or additional liability.
|
|
177
|
+
|
|
178
|
+
END OF TERMS AND CONDITIONS
|
|
179
|
+
|
|
180
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
181
|
+
|
|
182
|
+
To apply the Apache License to your work, attach the following
|
|
183
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
184
|
+
replaced with your own identifying information. (Don't include
|
|
185
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
186
|
+
comment syntax for the file format. We also recommend that a
|
|
187
|
+
file or class name and description of purpose be included on the
|
|
188
|
+
same "printed page" as the copyright notice for easier
|
|
189
|
+
identification within third-party archives.
|
|
190
|
+
|
|
191
|
+
Copyright [yyyy] [name of copyright owner]
|
|
192
|
+
|
|
193
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
194
|
+
you may not use this file except in compliance with the License.
|
|
195
|
+
You may obtain a copy of the License at
|
|
196
|
+
|
|
197
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
198
|
+
|
|
199
|
+
Unless required by applicable law or agreed to in writing, software
|
|
200
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
201
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
202
|
+
See the License for the specific language governing permissions and
|
|
203
|
+
limitations under the License.
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agent-plugins
|
|
3
|
+
Version: 0.1.1
|
|
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
|
+
License-Expression: Apache-2.0
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
14
|
+
Classifier: Typing :: Typed
|
|
15
|
+
Requires-Dist: tomli==2.3.1 ; python_full_version < '3.11'
|
|
16
|
+
Requires-Python: >=3.10, <3.15
|
|
17
|
+
Project-URL: Source, https://github.com/peter-gy/agent-plugins
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
|
|
20
|
+
# agent-plugins
|
|
21
|
+
|
|
22
|
+
`agent-plugins` packages Agent Skills, Model Context Protocol configuration, and
|
|
23
|
+
client extension files with a Python distribution. Each installed wheel carries
|
|
24
|
+
the agent files that match its code version.
|
|
25
|
+
|
|
26
|
+
The package implements the portable [Agent Plugins](https://agent-plugins.org/)
|
|
27
|
+
directory format and supports Python 3.10 through 3.14.
|
|
28
|
+
|
|
29
|
+
## Ship an Agent Plugin
|
|
30
|
+
|
|
31
|
+
Keep one Agent Plugin tree beside the code it documents:
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
my-project/
|
|
35
|
+
├── plugin.json
|
|
36
|
+
├── skills/
|
|
37
|
+
│ └── use-my-package/
|
|
38
|
+
│ ├── SKILL.md
|
|
39
|
+
│ ├── agents/
|
|
40
|
+
│ ├── references/
|
|
41
|
+
│ └── scripts/
|
|
42
|
+
├── mcp.json
|
|
43
|
+
└── packages/
|
|
44
|
+
└── python/
|
|
45
|
+
└── pyproject.toml
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`skills/` contains [Agent Skills](https://agentskills.io/specification).
|
|
49
|
+
`mcp.json` contains [Model Context Protocol](https://modelcontextprotocol.io/specification)
|
|
50
|
+
server configuration when the plugin provides MCP servers.
|
|
51
|
+
|
|
52
|
+
Create `plugin.json` at the plugin root:
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
57
|
+
"name": "my-project"
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Configure the Python package to wrap `uv_build`:
|
|
62
|
+
|
|
63
|
+
```toml
|
|
64
|
+
[build-system]
|
|
65
|
+
requires = ["agent-plugins==0.1.1", "uv_build==0.12.2"]
|
|
66
|
+
build-backend = "agent_plugins.build.uv_build"
|
|
67
|
+
|
|
68
|
+
[tool.agent-plugins]
|
|
69
|
+
root = "../.."
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
`root` is relative to `pyproject.toml`. The build selects `plugin.json`, the
|
|
73
|
+
complete `skills/` tree, and `mcp.json` when present.
|
|
74
|
+
|
|
75
|
+
Build, install, and locate the packaged plugin:
|
|
76
|
+
|
|
77
|
+
```console
|
|
78
|
+
uv build packages/python --out-dir dist
|
|
79
|
+
python -m pip install "agent-plugins==0.1.1" dist/my_package-*.whl
|
|
80
|
+
agent-plugins locate my-package
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
```text
|
|
84
|
+
/.../site-packages/my_package-1.2.3.agent-plugin
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The wheel contains the plugin directory and an `agent_plugins.json` marker in
|
|
88
|
+
the distribution metadata. A source distribution stages the same files for a
|
|
89
|
+
reproducible wheel rebuild. An editable install points the marker at the authored
|
|
90
|
+
plugin tree.
|
|
91
|
+
|
|
92
|
+
### Use Hatchling
|
|
93
|
+
|
|
94
|
+
Keep the plugin settings and select the Hatchling adapter:
|
|
95
|
+
|
|
96
|
+
```toml
|
|
97
|
+
[build-system]
|
|
98
|
+
requires = ["agent-plugins==0.1.1", "hatchling==1.31.0"]
|
|
99
|
+
build-backend = "agent_plugins.build.hatchling"
|
|
100
|
+
|
|
101
|
+
[tool.agent-plugins]
|
|
102
|
+
root = "../.."
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Include other plugin files
|
|
106
|
+
|
|
107
|
+
Add root-relative patterns for executables or client extensions:
|
|
108
|
+
|
|
109
|
+
```toml
|
|
110
|
+
[tool.agent-plugins]
|
|
111
|
+
root = "../.."
|
|
112
|
+
include = ["bin/**", "com.example.client/**"]
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Each pattern must stay within the plugin root and match at least one file.
|
|
116
|
+
|
|
117
|
+
## Inspect an installed plugin
|
|
118
|
+
|
|
119
|
+
Add `agent-plugins` to the runtime dependencies of Python code that calls the
|
|
120
|
+
inspection API:
|
|
121
|
+
|
|
122
|
+
```toml
|
|
123
|
+
[project]
|
|
124
|
+
dependencies = ["agent-plugins==0.1.1"]
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
import agent_plugins as ap
|
|
129
|
+
|
|
130
|
+
plugin = ap.locate("my-package")
|
|
131
|
+
|
|
132
|
+
print(plugin.manifest.name)
|
|
133
|
+
print(plugin.manifest.path)
|
|
134
|
+
|
|
135
|
+
for skill in plugin.skills:
|
|
136
|
+
print(skill.path)
|
|
137
|
+
print(skill / "SKILL.md")
|
|
138
|
+
|
|
139
|
+
if mcp := plugin.mcp:
|
|
140
|
+
for name, server in mcp.servers.items():
|
|
141
|
+
print(name, server)
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
`ap.locate()` accepts the distribution name used by `pip`. `ap.installed()`
|
|
145
|
+
returns every discovered Agent Plugin keyed by distribution name.
|
|
146
|
+
|
|
147
|
+
| Object | Access |
|
|
148
|
+
| --- | --- |
|
|
149
|
+
| `plugin.path` | Absolute plugin root |
|
|
150
|
+
| `plugin.manifest` | Lazy `plugin.json` document |
|
|
151
|
+
| `plugin.skills` | `ap.Skill` objects rooted under `skills/` |
|
|
152
|
+
| `plugin.mcp` | Lazy `mcp.json` document, when present |
|
|
153
|
+
| `plugin.files` | Files selected by the package build |
|
|
154
|
+
| `plugin.tree()` | Bounded ASCII tree of the installed plugin |
|
|
155
|
+
| `skill.frontmatter` | Source text between the `---` delimiters |
|
|
156
|
+
| `skill.body` | Markdown after the frontmatter |
|
|
157
|
+
| `skill.files` | Files selected below the skill root |
|
|
158
|
+
|
|
159
|
+
Manifest, MCP, and skill documents load on first parsed-field access and cache
|
|
160
|
+
their result. Call `ap.locate()` again to read a fresh snapshot. Invalid
|
|
161
|
+
documents raise `ap.ValidationError`.
|
|
162
|
+
|
|
163
|
+
MCP servers are frozen `ap.StdioServer`, `ap.StreamableHTTPServer`, or
|
|
164
|
+
`ap.SSEServer` values. Their fields preserve placeholders such as
|
|
165
|
+
`${PLUGIN_ROOT}` for the agent client to resolve.
|
|
166
|
+
|
|
167
|
+
## Inspect a build plan
|
|
168
|
+
|
|
169
|
+
Preview the files selected by `[tool.agent-plugins]` before building:
|
|
170
|
+
|
|
171
|
+
```console
|
|
172
|
+
agent-plugins plan packages/python
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Use `--json` for machine-readable output. Python build integrations can consume
|
|
176
|
+
the same plan:
|
|
177
|
+
|
|
178
|
+
```python
|
|
179
|
+
import agent_plugins as ap
|
|
180
|
+
|
|
181
|
+
plan = ap.build_plan("packages/python")
|
|
182
|
+
for file in plan.files:
|
|
183
|
+
print(file.source, "->", file.target)
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
List every plugin visible in the current environment:
|
|
187
|
+
|
|
188
|
+
```console
|
|
189
|
+
agent-plugins list --json
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Develop and release
|
|
193
|
+
|
|
194
|
+
From a repository checkout, install the locked development environment and run
|
|
195
|
+
the local checks:
|
|
196
|
+
|
|
197
|
+
```console
|
|
198
|
+
uv sync --locked
|
|
199
|
+
uv run ruff format --check src tests
|
|
200
|
+
uv run ruff check src tests
|
|
201
|
+
uv run ty check
|
|
202
|
+
uv run pyrefly check
|
|
203
|
+
uv run pytest -q
|
|
204
|
+
./scripts/build-dist.sh
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Prepare the version and lockfile in a release pull request:
|
|
208
|
+
|
|
209
|
+
```console
|
|
210
|
+
uv version --bump patch
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
After the release commit reaches `main` and its push CI passes, update the local
|
|
214
|
+
branch and start the tag-driven release:
|
|
215
|
+
|
|
216
|
+
```console
|
|
217
|
+
git pull --ff-only origin main
|
|
218
|
+
./scripts/release.sh --dry-run
|
|
219
|
+
./scripts/release.sh
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Before the first tag, configure PyPI to trust `.github/workflows/publish.yml`
|
|
223
|
+
through the repository's `pypi` environment. PyPI documents the setup in
|
|
224
|
+
[Adding a Trusted Publisher](https://docs.pypi.org/trusted-publishers/adding-a-publisher/).
|