agent-plugins 0.2.1__tar.gz → 0.2.3__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.2.3/.agent-plugin/skills/agent-plugins/SKILL.md +103 -0
- agent_plugins-0.2.3/.agent-plugin/skills/agent-plugins/agents/openai.yaml +4 -0
- agent_plugins-0.2.3/.agent-plugin/skills/package-agent-plugin/SKILL.md +108 -0
- agent_plugins-0.2.3/.agent-plugin/skills/package-agent-plugin/agents/openai.yaml +4 -0
- agent_plugins-0.2.3/.agent-plugin/skills/package-agent-plugin/references/build-variants.md +77 -0
- agent_plugins-0.2.3/.agent-plugin/skills/package-agent-plugin/references/verify-artifacts.md +36 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/PKG-INFO +27 -7
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/README.md +25 -5
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/pyproject.toml +3 -3
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/pyproject.toml.orig +3 -3
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_cli.py +20 -3
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_discovery.py +5 -1
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_files.py +53 -29
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_plugin.py +16 -36
- agent_plugins-0.2.3/src/agent_plugins/_read.py +156 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_schema/errors.py +3 -2
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_skill.py +24 -8
- agent_plugins-0.2.1/.agent-plugin/skills/agent-plugins/SKILL.md +0 -250
- agent_plugins-0.2.1/.agent-plugin/skills/agent-plugins/agents/openai.yaml +0 -4
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/.agent-plugin/plugin.json +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/LICENSE +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/__init__.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/__main__.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_build/__init__.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_build/backend.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_build/plan.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_build/sdist.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_build/wheel.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_build/wheel_archive.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_errors.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_marker.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_mcp.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_schema/__init__.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_schema/json.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_schema/lazy.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_schema/manifest.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_schema/mcp.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_schema/models.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_schema/skill.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_schema/v1/__init__.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_schema/v1/manifest.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_schema/v1/mcp.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/_tree.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/build/__init__.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/build/hatchling.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/build/uv_build.py +0 -0
- {agent_plugins-0.2.1 → agent_plugins-0.2.3}/src/agent_plugins/py.typed +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-plugins
|
|
3
|
+
description: Read and inspect the version-matched Agent Plugin carried by an installed Python distribution. Use when a package README points to agent-plugins, when loading packaged Agent Skills and resources, listing or locating installed plugins, inspecting manifest or MCP summaries, or troubleshooting discovery. For adding Agent Plugin packaging to a repository, use the package-agent-plugin skill.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Read installed Agent Plugins
|
|
7
|
+
|
|
8
|
+
Use `agent-plugins` to load the instructions and resources shipped with the
|
|
9
|
+
same version of a Python package that the agent will use.
|
|
10
|
+
|
|
11
|
+
## Start from a package README
|
|
12
|
+
|
|
13
|
+
Run the package and `agent-plugins` in one temporary environment:
|
|
14
|
+
|
|
15
|
+
```console
|
|
16
|
+
uvx --with my-package agent-plugins read my-package
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The requirement after `--with` tells uv what to install. The final argument is
|
|
20
|
+
the installed Python distribution to inspect. Use a version constraint when
|
|
21
|
+
the task requires an exact release:
|
|
22
|
+
|
|
23
|
+
```console
|
|
24
|
+
uvx --with 'my-package==1.2.3' agent-plugins read my-package
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Follow each applicable skill in the output. Resolve its relative links from the
|
|
28
|
+
instruction file's directory. Use `--skill NAME` when one plugin carries
|
|
29
|
+
several skills and the task needs a single workflow.
|
|
30
|
+
|
|
31
|
+
`read` reports MCP metadata for discovery. It does not start servers or print
|
|
32
|
+
configured commands, arguments, environment values, URLs, or headers. The
|
|
33
|
+
agent client owns component activation, permissions, processes, and data.
|
|
34
|
+
|
|
35
|
+
## Choose the CLI operation
|
|
36
|
+
|
|
37
|
+
| Task | Command |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| Read one installed plugin and all primary instructions | `agent-plugins read DISTRIBUTION` |
|
|
40
|
+
| Read one named skill with the plugin context | `agent-plugins read DISTRIBUTION --skill NAME` |
|
|
41
|
+
| List every discoverable plugin and skill path | `agent-plugins list` |
|
|
42
|
+
| List discoverable plugins as JSON | `agent-plugins list --json` |
|
|
43
|
+
| Print one installed plugin root | `agent-plugins locate DISTRIBUTION` |
|
|
44
|
+
| Preview files selected from a source project | `agent-plugins plan [PROJECT]` |
|
|
45
|
+
| Attach a configured plugin to a prebuilt wheel | `agent-plugins attach-wheel WHEEL` |
|
|
46
|
+
|
|
47
|
+
`plan` and `attach-wheel` are repository packaging operations. Load the
|
|
48
|
+
`package-agent-plugin` skill before changing a project or wheel.
|
|
49
|
+
|
|
50
|
+
Running `uvx agent-plugins` with no arguments reads the Agent Plugin carried by
|
|
51
|
+
`agent-plugins` itself. It is the shortcut for:
|
|
52
|
+
|
|
53
|
+
```console
|
|
54
|
+
uvx agent-plugins read agent-plugins
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Use `agent-plugins --help` or `agent-plugins COMMAND --help` for command syntax.
|
|
58
|
+
Successful commands write data to stdout. Expected discovery, validation,
|
|
59
|
+
configuration, and filesystem failures return status `1` with an
|
|
60
|
+
`agent-plugins: error:` diagnostic on stderr. Argument errors return status
|
|
61
|
+
`2`.
|
|
62
|
+
|
|
63
|
+
## Read the current Python environment
|
|
64
|
+
|
|
65
|
+
When the target package is already installed in the active environment, run:
|
|
66
|
+
|
|
67
|
+
```console
|
|
68
|
+
agent-plugins read my-package
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Use the Python API when the task needs one skill or a linked resource:
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
import agent_plugins as ap
|
|
75
|
+
|
|
76
|
+
plugin = ap.locate("my-package")
|
|
77
|
+
skill = plugin.skill("use-my-package")
|
|
78
|
+
|
|
79
|
+
print(skill.source)
|
|
80
|
+
reference = skill.file("references/api.md")
|
|
81
|
+
print(reference.read_text(encoding="utf-8"))
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
`plugin.skills` contains every immediate `skills/<name>/SKILL.md` selected by
|
|
85
|
+
the installed package. `skill.file()` accepts an exact selected path below that
|
|
86
|
+
skill and rechecks containment. `plugin.tree()` and `skill.tree()` provide a
|
|
87
|
+
bounded inventory before reading more files.
|
|
88
|
+
|
|
89
|
+
Use `plugin.manifest` for validated plugin metadata. `plugin.mcp` is an
|
|
90
|
+
`MCPConfig` when the package selected `mcp.json`. Accessing parsed manifest or
|
|
91
|
+
MCP fields validates and caches the document. Handle `AgentPluginError` for
|
|
92
|
+
missing or unusable installed plugins and `ValidationError` for invalid plugin,
|
|
93
|
+
MCP, or skill documents.
|
|
94
|
+
|
|
95
|
+
## Keep the environment explicit
|
|
96
|
+
|
|
97
|
+
`uvx` creates a temporary environment for the command. Install the package in
|
|
98
|
+
the notebook, service, or project environment where its Python API will run.
|
|
99
|
+
The instructions printed by `read` describe the exact distribution version
|
|
100
|
+
resolved for that command.
|
|
101
|
+
|
|
102
|
+
Python distribution names and manifest plugin names are independent. Pass the
|
|
103
|
+
name used by pip or uv to `read`, `locate`, and `ap.locate()`.
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: package-agent-plugin
|
|
3
|
+
description: Add Agent Plugin packaging to a Python project. Use when creating plugin.json and skills, configuring uv_build or Hatchling, attaching a plugin to a prebuilt wheel, exposing runtime plugin access, or verifying wheel, source distribution, and editable artifacts. For consuming instructions from an installed package, use the agent-plugins skill.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Package an Agent Plugin
|
|
7
|
+
|
|
8
|
+
Package instructions beside the Python code they describe so the library and
|
|
9
|
+
its Agent Plugin share one release.
|
|
10
|
+
|
|
11
|
+
## Build the smallest complete integration
|
|
12
|
+
|
|
13
|
+
For a single-package project, keep the plugin at the project root:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
my-package/
|
|
17
|
+
|-- plugin.json
|
|
18
|
+
|-- pyproject.toml
|
|
19
|
+
|-- skills/
|
|
20
|
+
| `-- use-my-package/
|
|
21
|
+
| `-- SKILL.md
|
|
22
|
+
`-- src/
|
|
23
|
+
`-- my_package/
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Create `plugin.json`:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
31
|
+
"name": "my-package",
|
|
32
|
+
"description": "Use My Package from Python."
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Create `skills/use-my-package/SKILL.md` with a discriminating description and
|
|
37
|
+
the shortest complete workflow an agent needs:
|
|
38
|
+
|
|
39
|
+
```md
|
|
40
|
+
---
|
|
41
|
+
name: use-my-package
|
|
42
|
+
description: Use My Package to read and transform project records from Python.
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
# Use My Package
|
|
46
|
+
|
|
47
|
+
Import `my_package`, open the project input, and call `transform()`.
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Configure an existing uv_build project in `pyproject.toml`:
|
|
51
|
+
|
|
52
|
+
```toml
|
|
53
|
+
[build-system]
|
|
54
|
+
requires = ["agent-plugins", "uv_build"]
|
|
55
|
+
build-backend = "agent_plugins.build.uv_build"
|
|
56
|
+
|
|
57
|
+
[tool.agent-plugins]
|
|
58
|
+
root = "."
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Preview the exact selection, then build:
|
|
62
|
+
|
|
63
|
+
```console
|
|
64
|
+
uv run --with agent-plugins agent-plugins plan .
|
|
65
|
+
uv build
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The plan must contain `plugin.json`, every intended file under `skills/`, and
|
|
69
|
+
`mcp.json` when configured. Add root-relative client extension files or other
|
|
70
|
+
plugin resources through `[tool.agent-plugins].include`.
|
|
71
|
+
|
|
72
|
+
## Verify the installed handoff
|
|
73
|
+
|
|
74
|
+
Read the wheel in an isolated environment, using the Python distribution name
|
|
75
|
+
from `[project].name`:
|
|
76
|
+
|
|
77
|
+
```console
|
|
78
|
+
uvx --with dist/my_package-0.1.0-py3-none-any.whl \
|
|
79
|
+
agent-plugins read my-package
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Confirm the reported distribution version, plugin metadata, bounded inventory,
|
|
83
|
+
and skill instructions. Use
|
|
84
|
+
[artifact verification](references/verify-artifacts.md) for exhaustive inventory
|
|
85
|
+
comparison. Put the public bootstrap in the package README:
|
|
86
|
+
|
|
87
|
+
```console
|
|
88
|
+
uvx --with my-package agent-plugins read my-package
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Keep `agent-plugins` in `[build-system].requires` for packaging. Add it to
|
|
92
|
+
`[project].dependencies` when installed Python code calls `agent_plugins`
|
|
93
|
+
directly at runtime.
|
|
94
|
+
|
|
95
|
+
## Choose a different build path
|
|
96
|
+
|
|
97
|
+
- For Hatchling, monorepo roots, include patterns, custom backends, or an
|
|
98
|
+
externally built wheel, read
|
|
99
|
+
[build variants](references/build-variants.md).
|
|
100
|
+
- For wheel, source distribution, editable, document, and Agent Skills checks,
|
|
101
|
+
read [artifact verification](references/verify-artifacts.md).
|
|
102
|
+
- For `mcp.json`, read the
|
|
103
|
+
[MCP integration guide](https://peter-gy.github.io/agent-plugins/integrations/mcp-servers).
|
|
104
|
+
- For reverse-domain client directories, read the
|
|
105
|
+
[client extension guide](https://peter-gy.github.io/agent-plugins/integrations/client-extensions).
|
|
106
|
+
|
|
107
|
+
Use the `agent-plugins` skill when the repository work is complete and the task
|
|
108
|
+
becomes consuming an installed package's instructions or resources.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Build variants
|
|
2
|
+
|
|
3
|
+
## Hatchling
|
|
4
|
+
|
|
5
|
+
Wrap an existing Hatchling project with the bundled adapter:
|
|
6
|
+
|
|
7
|
+
```toml
|
|
8
|
+
[build-system]
|
|
9
|
+
requires = ["agent-plugins", "hatchling"]
|
|
10
|
+
build-backend = "agent_plugins.build.hatchling"
|
|
11
|
+
|
|
12
|
+
[tool.agent-plugins]
|
|
13
|
+
root = "."
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The adapter preserves the delegate's wheel, source distribution, and editable
|
|
17
|
+
behavior while adding the selected Agent Plugin and installation marker.
|
|
18
|
+
|
|
19
|
+
## Monorepo roots
|
|
20
|
+
|
|
21
|
+
Resolve `root` relative to the `pyproject.toml` that owns the build. For this
|
|
22
|
+
layout, the Python package points back to the repository plugin root:
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
repository/
|
|
26
|
+
|-- plugin.json
|
|
27
|
+
|-- skills/
|
|
28
|
+
`-- packages/
|
|
29
|
+
`-- python/
|
|
30
|
+
`-- pyproject.toml
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```toml
|
|
34
|
+
[tool.agent-plugins]
|
|
35
|
+
root = "../.."
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Additional selected files
|
|
39
|
+
|
|
40
|
+
The build always selects `plugin.json`, the complete `skills/` tree, and
|
|
41
|
+
`mcp.json` when present. Select other root-relative files explicitly:
|
|
42
|
+
|
|
43
|
+
```toml
|
|
44
|
+
[tool.agent-plugins]
|
|
45
|
+
root = "."
|
|
46
|
+
include = ["bin/**", "com.example.client/**"]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Every include pattern must remain inside the plugin root and match at least one
|
|
50
|
+
filesystem entry. A matched directory contributes its regular files.
|
|
51
|
+
|
|
52
|
+
## Prebuilt wheels
|
|
53
|
+
|
|
54
|
+
When another backend owns the wheel, attach the configured Agent Plugin after
|
|
55
|
+
that build:
|
|
56
|
+
|
|
57
|
+
```console
|
|
58
|
+
agent-plugins attach-wheel dist/my_package-0.1.0-py3-none-any.whl \
|
|
59
|
+
--project .
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The command atomically replaces the input wheel after the complete attached
|
|
63
|
+
artifact succeeds. Use `--output-dir` to preserve the source wheel. The Python
|
|
64
|
+
API exposes the same operation:
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
import agent_plugins as ap
|
|
68
|
+
|
|
69
|
+
result = ap.attach_wheel(
|
|
70
|
+
"dist/my_package-0.1.0-py3-none-any.whl",
|
|
71
|
+
project=".",
|
|
72
|
+
)
|
|
73
|
+
print(result.output)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
A custom delegate must expose wheel, source distribution, and editable build
|
|
77
|
+
hooks together with their corresponding `get_requires_for_build_*` hooks.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Verify package artifacts
|
|
2
|
+
|
|
3
|
+
Treat source and installed inspection as two views of the same selected plugin:
|
|
4
|
+
|
|
5
|
+
```python
|
|
6
|
+
import agent_plugins as ap
|
|
7
|
+
|
|
8
|
+
source = ap.Plugin.from_project(".")
|
|
9
|
+
installed = ap.locate("my-package")
|
|
10
|
+
|
|
11
|
+
assert source.manifest.name == installed.manifest.name
|
|
12
|
+
assert [path.relative_to(source.path) for path in source.files] == [
|
|
13
|
+
path.relative_to(installed.path) for path in installed.files
|
|
14
|
+
]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Verify every release boundary:
|
|
18
|
+
|
|
19
|
+
1. Run `agent-plugins plan PROJECT` and inspect every selected path.
|
|
20
|
+
2. Build a wheel and source distribution through the configured adapter, or
|
|
21
|
+
attach the plugin to the externally built wheel.
|
|
22
|
+
3. Rebuild a wheel from the source distribution.
|
|
23
|
+
4. Install the direct and rebuilt wheels in clean environments.
|
|
24
|
+
5. Run `agent-plugins read my-package` against both installed wheels.
|
|
25
|
+
6. Install the project as editable and confirm `locate()` resolves the authored
|
|
26
|
+
plugin root.
|
|
27
|
+
7. Compare source and installed file inventories and bytes.
|
|
28
|
+
8. Access `manifest.name`, every `skill.source`, and `mcp.servers` when present
|
|
29
|
+
to execute supported document validation.
|
|
30
|
+
9. Confirm each `skill.file("SKILL.md")` and referenced resource is selected.
|
|
31
|
+
10. Run an Agent Skills validator against every authored skill directory.
|
|
32
|
+
|
|
33
|
+
Let `AgentPluginError` fail missing configuration, unusable paths, or discovery.
|
|
34
|
+
Let `ValidationError` fail invalid manifest, MCP, or skill documents. Artifact
|
|
35
|
+
verification should exercise the CLI through the installed console script as
|
|
36
|
+
well as the Python API.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agent-plugins
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Ship Agent Plugins with Python packages and inspect their installed files
|
|
5
5
|
Author: Péter Ferenc Gyarmati
|
|
6
6
|
Author-email: Péter Ferenc Gyarmati <dev.petergy@gmail.com>
|
|
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.13
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.14
|
|
14
14
|
Classifier: Typing :: Typed
|
|
15
|
-
Requires-Dist: tomli
|
|
15
|
+
Requires-Dist: tomli>=1.0.3 ; python_full_version < '3.11'
|
|
16
16
|
Requires-Python: >=3.10, <3.15
|
|
17
17
|
Project-URL: Documentation, https://peter-gy.github.io/agent-plugins/
|
|
18
18
|
Project-URL: Issues, https://github.com/peter-gy/agent-plugins/issues
|
|
@@ -48,6 +48,19 @@ Description-Content-Type: text/markdown
|
|
|
48
48
|
|
|
49
49
|
The [Agent Plugins format](https://agent-plugins.org/) defines the directory: a manifest, [Agent Skills](https://agentskills.io/specification) for instructions and resources, [Model Context Protocol (MCP)](https://modelcontextprotocol.io/specification) server configuration for tools, and client extensions. This library packages that directory and makes it discoverable through Python metadata. Agent clients choose which components to activate.
|
|
50
50
|
|
|
51
|
+
## Read the bundled guidance
|
|
52
|
+
|
|
53
|
+
Run `agent-plugins` without arguments to read its own installed plugin:
|
|
54
|
+
|
|
55
|
+
```console
|
|
56
|
+
uvx agent-plugins
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The output contains two version-matched skills. `agent-plugins` explains how to
|
|
60
|
+
read instructions from Python packages that already ship an Agent Plugin.
|
|
61
|
+
`package-agent-plugin` explains how to add Agent Plugin packaging to a Python
|
|
62
|
+
project.
|
|
63
|
+
|
|
51
64
|
## Package your plugin
|
|
52
65
|
|
|
53
66
|
Keep `plugin.json` and `skills/` beside your code. For a project using the [uv build backend](https://docs.astral.sh/uv/concepts/build-backend/), configure `pyproject.toml`:
|
|
@@ -77,20 +90,27 @@ Attachment updates the wheel in place. Pass `--output-dir` to preserve the input
|
|
|
77
90
|
|
|
78
91
|
## Inspect an installed plugin
|
|
79
92
|
|
|
80
|
-
|
|
93
|
+
Load the complete version-matched guidance shipped by a package:
|
|
81
94
|
|
|
82
95
|
```console
|
|
83
|
-
|
|
96
|
+
uvx --with my-package agent-plugins read my-package
|
|
84
97
|
```
|
|
85
98
|
|
|
99
|
+
The first `my-package` tells uv which distribution to install. The second
|
|
100
|
+
identifies the installed Agent Plugin to read.
|
|
101
|
+
|
|
102
|
+
Use the Python API when the package is already installed in the current
|
|
103
|
+
environment:
|
|
104
|
+
|
|
86
105
|
```python
|
|
87
106
|
import agent_plugins as ap
|
|
88
107
|
|
|
89
108
|
plugin = ap.locate("agent-plugins")
|
|
90
|
-
|
|
109
|
+
consumer_skill = plugin.skill("agent-plugins")
|
|
110
|
+
packaging_skill = plugin.skill("package-agent-plugin")
|
|
91
111
|
|
|
92
|
-
print(
|
|
93
|
-
print(
|
|
112
|
+
print(consumer_skill.source)
|
|
113
|
+
print(packaging_skill.source)
|
|
94
114
|
```
|
|
95
115
|
|
|
96
116
|
Pass your library's distribution name to `locate()` to inspect its plugin. Use [`Plugin.from_project()`](https://peter-gy.github.io/agent-plugins/guide/inspect-project) to inspect the selected source files before building.
|
|
@@ -27,6 +27,19 @@
|
|
|
27
27
|
|
|
28
28
|
The [Agent Plugins format](https://agent-plugins.org/) defines the directory: a manifest, [Agent Skills](https://agentskills.io/specification) for instructions and resources, [Model Context Protocol (MCP)](https://modelcontextprotocol.io/specification) server configuration for tools, and client extensions. This library packages that directory and makes it discoverable through Python metadata. Agent clients choose which components to activate.
|
|
29
29
|
|
|
30
|
+
## Read the bundled guidance
|
|
31
|
+
|
|
32
|
+
Run `agent-plugins` without arguments to read its own installed plugin:
|
|
33
|
+
|
|
34
|
+
```console
|
|
35
|
+
uvx agent-plugins
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The output contains two version-matched skills. `agent-plugins` explains how to
|
|
39
|
+
read instructions from Python packages that already ship an Agent Plugin.
|
|
40
|
+
`package-agent-plugin` explains how to add Agent Plugin packaging to a Python
|
|
41
|
+
project.
|
|
42
|
+
|
|
30
43
|
## Package your plugin
|
|
31
44
|
|
|
32
45
|
Keep `plugin.json` and `skills/` beside your code. For a project using the [uv build backend](https://docs.astral.sh/uv/concepts/build-backend/), configure `pyproject.toml`:
|
|
@@ -56,20 +69,27 @@ Attachment updates the wheel in place. Pass `--output-dir` to preserve the input
|
|
|
56
69
|
|
|
57
70
|
## Inspect an installed plugin
|
|
58
71
|
|
|
59
|
-
|
|
72
|
+
Load the complete version-matched guidance shipped by a package:
|
|
60
73
|
|
|
61
74
|
```console
|
|
62
|
-
|
|
75
|
+
uvx --with my-package agent-plugins read my-package
|
|
63
76
|
```
|
|
64
77
|
|
|
78
|
+
The first `my-package` tells uv which distribution to install. The second
|
|
79
|
+
identifies the installed Agent Plugin to read.
|
|
80
|
+
|
|
81
|
+
Use the Python API when the package is already installed in the current
|
|
82
|
+
environment:
|
|
83
|
+
|
|
65
84
|
```python
|
|
66
85
|
import agent_plugins as ap
|
|
67
86
|
|
|
68
87
|
plugin = ap.locate("agent-plugins")
|
|
69
|
-
|
|
88
|
+
consumer_skill = plugin.skill("agent-plugins")
|
|
89
|
+
packaging_skill = plugin.skill("package-agent-plugin")
|
|
70
90
|
|
|
71
|
-
print(
|
|
72
|
-
print(
|
|
91
|
+
print(consumer_skill.source)
|
|
92
|
+
print(packaging_skill.source)
|
|
73
93
|
```
|
|
74
94
|
|
|
75
95
|
Pass your library's distribution name to `locate()` to inspect its plugin. Use [`Plugin.from_project()`](https://peter-gy.github.io/agent-plugins/guide/inspect-project) to inspect the selected source files before building.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "agent-plugins"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.3"
|
|
4
4
|
description = "Ship Agent Plugins with Python packages and inspect their installed files"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = "Apache-2.0"
|
|
7
7
|
license-files = ["LICENSE"]
|
|
8
8
|
requires-python = ">=3.10,<3.15"
|
|
9
|
-
dependencies = ["tomli
|
|
9
|
+
dependencies = ["tomli>=1.0.3; python_version < '3.11'"]
|
|
10
10
|
classifiers = [
|
|
11
11
|
"Programming Language :: Python :: 3.10",
|
|
12
12
|
"Programming Language :: Python :: 3.11",
|
|
@@ -30,7 +30,7 @@ agent-plugins = "agent_plugins._cli:main"
|
|
|
30
30
|
|
|
31
31
|
[build-system]
|
|
32
32
|
requires = [
|
|
33
|
-
"tomli
|
|
33
|
+
"tomli>=1.0.3; python_version < '3.11'",
|
|
34
34
|
"uv_build==0.12.2",
|
|
35
35
|
]
|
|
36
36
|
build-backend = "agent_plugins.build.uv_build"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "agent-plugins"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.3"
|
|
4
4
|
description = "Ship Agent Plugins with Python packages and inspect their installed files"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = "Apache-2.0"
|
|
@@ -10,7 +10,7 @@ authors = [
|
|
|
10
10
|
]
|
|
11
11
|
requires-python = ">=3.10,<3.15"
|
|
12
12
|
dependencies = [
|
|
13
|
-
"tomli
|
|
13
|
+
"tomli>=1.0.3; python_version < '3.11'",
|
|
14
14
|
]
|
|
15
15
|
classifiers = [
|
|
16
16
|
"Programming Language :: Python :: 3.10",
|
|
@@ -31,7 +31,7 @@ agent-plugins = "agent_plugins._cli:main"
|
|
|
31
31
|
|
|
32
32
|
[build-system]
|
|
33
33
|
requires = [
|
|
34
|
-
"tomli
|
|
34
|
+
"tomli>=1.0.3; python_version < '3.11'",
|
|
35
35
|
"uv_build==0.12.2",
|
|
36
36
|
]
|
|
37
37
|
build-backend = "agent_plugins.build.uv_build"
|
|
@@ -12,19 +12,25 @@ from ._build.plan import BuildPlan, build_plan
|
|
|
12
12
|
from ._build.wheel import WheelAttachment, attach_wheel
|
|
13
13
|
from ._discovery import installed, locate
|
|
14
14
|
from ._errors import AgentPluginError
|
|
15
|
+
from ._read import render_read
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
def main(argv: Sequence[str] | None = None) -> int:
|
|
18
19
|
"""Run the Agent Plugins command-line interface."""
|
|
19
|
-
|
|
20
|
+
values = tuple(sys.argv[1:] if argv is None else argv)
|
|
21
|
+
arguments = _parser().parse_args(values or ("read", "agent-plugins"))
|
|
20
22
|
try:
|
|
21
23
|
if arguments.command == "list":
|
|
22
24
|
_list_plugins(as_json=arguments.json)
|
|
23
25
|
elif arguments.command == "locate":
|
|
24
26
|
print(locate(arguments.distribution).path)
|
|
27
|
+
elif arguments.command == "read":
|
|
28
|
+
sys.stdout.write(
|
|
29
|
+
render_read(arguments.distribution, skill_name=arguments.skill)
|
|
30
|
+
)
|
|
25
31
|
elif arguments.command == "plan":
|
|
26
32
|
_print_plan(build_plan(arguments.project), as_json=arguments.json)
|
|
27
|
-
|
|
33
|
+
elif arguments.command == "attach-wheel":
|
|
28
34
|
result = attach_wheel(
|
|
29
35
|
arguments.wheel,
|
|
30
36
|
project=arguments.project,
|
|
@@ -37,6 +43,8 @@ def main(argv: Sequence[str] | None = None) -> int:
|
|
|
37
43
|
f"{signature.as_posix()}",
|
|
38
44
|
file=sys.stderr,
|
|
39
45
|
)
|
|
46
|
+
else: # pragma: no cover - argparse owns the command choices
|
|
47
|
+
raise AssertionError(f"Unexpected command: {arguments.command!r}")
|
|
40
48
|
except AgentPluginError as error:
|
|
41
49
|
print(f"agent-plugins: error: {error}", file=sys.stderr)
|
|
42
50
|
return 1
|
|
@@ -46,7 +54,7 @@ def main(argv: Sequence[str] | None = None) -> int:
|
|
|
46
54
|
def _parser() -> argparse.ArgumentParser:
|
|
47
55
|
parser = argparse.ArgumentParser(
|
|
48
56
|
prog="agent-plugins",
|
|
49
|
-
description="
|
|
57
|
+
description="Read, package, and inspect Agent Plugins in Python distributions.",
|
|
50
58
|
)
|
|
51
59
|
commands = parser.add_subparsers(dest="command", required=True)
|
|
52
60
|
|
|
@@ -64,6 +72,15 @@ def _parser() -> argparse.ArgumentParser:
|
|
|
64
72
|
"distribution", help="Installed Python distribution name."
|
|
65
73
|
)
|
|
66
74
|
|
|
75
|
+
read_parser = commands.add_parser(
|
|
76
|
+
"read",
|
|
77
|
+
help="Print one installed plugin and its Agent Skill instructions.",
|
|
78
|
+
)
|
|
79
|
+
read_parser.add_argument("distribution", help="Installed Python distribution name.")
|
|
80
|
+
read_parser.add_argument(
|
|
81
|
+
"--skill", help="Print one named skill instead of every packaged skill."
|
|
82
|
+
)
|
|
83
|
+
|
|
67
84
|
plan_parser = commands.add_parser(
|
|
68
85
|
"plan", help="List files selected by [tool.agent-plugins]."
|
|
69
86
|
)
|
|
@@ -18,6 +18,10 @@ def locate(distribution_name: str) -> Plugin:
|
|
|
18
18
|
Raises:
|
|
19
19
|
AgentPluginError: The distribution has no usable Agent Plugin marker.
|
|
20
20
|
"""
|
|
21
|
+
return _locate(distribution_name)[1]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _locate(distribution_name: str) -> tuple[metadata.Distribution, Plugin]:
|
|
21
25
|
if not distribution_name:
|
|
22
26
|
raise AgentPluginError("A distribution name is required")
|
|
23
27
|
|
|
@@ -28,7 +32,7 @@ def locate(distribution_name: str) -> Plugin:
|
|
|
28
32
|
f"Python distribution {distribution_name!r} is not installed"
|
|
29
33
|
) from None
|
|
30
34
|
|
|
31
|
-
return _root(distribution, distribution_name)
|
|
35
|
+
return distribution, _root(distribution, distribution_name)
|
|
32
36
|
|
|
33
37
|
|
|
34
38
|
def installed() -> dict[str, Plugin]:
|