Repository navigation
Commit c8826be
authored
feat: build one Agent Plugins package for several clients (#42)
* feat: build one Agent Plugins package for several clients
The codex target builds an Agent Plugins package with one client profile
and one marketplace, and the agent-plugins target builds packages with
none. Codex, Copilot, VS Code and Cursor all read the format, so a plugin
built once can serve them all, given each client's marketplace file and
client-only files.
Add `clients` to the agent-plugins target (ADR 0002):
- `clients: { codex: {}, copilot: {} }` writes each client's marketplace:
Codex .agents/plugins/marketplace.json, Copilot
.github/plugin/marketplace.json. `clients.<client>.manifest` and
`plugins.<name>.clients.<client>.entry` are deep-merged into them. The
shared `entry` and target `manifest` are config errors on agent-plugins
that name the client-scoped field instead.
- Client-only kinds a listed client loads are selected by default and
written to its extension directory: Copilot agents go to
com.github.copilot/agents/, with .md, .markdown and .mdc renamed to
NAME.agent.md. Any other file in agents/, or two files that land on
the same path, fail the build.
- A client-only kind that no listed client loads stays a config error,
and the message names the client that would load it. A file of such a
kind that arrives another way, such as additionalFiles, fails the
build. Client names are checked strictly, a client set to undefined
counts as not listed, and `clients` is rejected on other targets.
- validate checks each client marketplace present: entries, including
structured local Codex sources, must point at a package whose
plugin.json has the same name. Copilot needs a marketplace owner, and
its agents need NAME.agent.md names and valid frontmatter.
- src/package-clients.ts holds each client's namespace, marketplace,
file placement and validation, with citations to the client docs.
- The engine gains two optional hooks, clientMarketplaces and placeFile.
Other targets don't set them, and Glean's claude, cursor and codex
output is byte-identical (191 files).
Verified end to end with the Glean plugin: Copilot CLI 1.0.100 and Codex
0.160.1 both install it from their marketplace in the same output.
* fix: route hooks through client placement and normalize additionalFiles paths
With clients set, hooks/hooks.json from additionalFiles skipped the client-only guard and shipped at the package root. A target that defines placeFile now places hooks too.
An additionalFiles destination starting with ./ could silently replace a placed file. Destinations are now normalized, and the collision check keys on the output path.
Also: reword client-only errors to say pluginpack doesn't place the kind yet, test that metadata.owner wins over metadata.author for Copilot, and document the manifest and entry errors, Copilot agent checks, and new marketplace collisions in README, CLAUDE.md and the config skill.
* test: cover path normalization in the engine and legacy sources1 parent 9ca5066 commit c8826be
16 files changed
Lines changed: 1596 additions & 86 deletions
File tree
- docs/adr
- skills/authoring-pluginpack-config
- src
- targets
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
| |||
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
108 | | - | |
109 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
110 | 115 | | |
111 | 116 | | |
112 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
59 | 67 | | |
60 | 68 | | |
61 | 69 | | |
| |||
74 | 82 | | |
75 | 83 | | |
76 | 84 | | |
77 | | - | |
78 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
79 | 88 | | |
80 | 89 | | |
81 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
| |||
0 commit comments