-
Notifications
You must be signed in to change notification settings - Fork 67
feat: Marketplace integration -- read marketplace.json for plugin discovery + governance #503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
6ae68ac
Initial plan
Copilot de937eb
Initial plan for marketplace integration
Copilot 73aa977
feat: marketplace integration core implementation
Copilot b4a69cc
docs: add marketplace integration guide and CLI reference
Copilot 704e4fd
docs: fix marketplace.json format and lockfile field names to match i…
Copilot fcd0ae7
docs: fix git-subdir and relative source descriptions to match resolver
Copilot a080607
feat: add marketplace unit tests and docs
Copilot 23ce07d
refactor: address code review feedback
Copilot 47a318a
Merge branch 'main' into copilot/feat-marketplace-integration
danielmeppiel e814a88
fix: address all 12 PR review comments on marketplace integration
danielmeppiel ac1afbb
fix: Copilot CLI format compatibility and marketplace provenance bugs
danielmeppiel d0371ed
feat: scope marketplace search to QUERY@MARKETPLACE format
danielmeppiel 78be748
docs: update CLI reference and plugins guide for scoped search syntax
danielmeppiel 40cc5bf
Merge branch 'main' into copilot/feat-marketplace-integration
danielmeppiel 163f5e5
refactor: use centralized path_security for marketplace traversal checks
danielmeppiel 7d2e000
docs: add path safety rule to copilot-instructions.md
danielmeppiel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,3 +72,4 @@ apm_modules/ | |
| build/tmp/ | ||
| scout-pipeline-result.png | ||
| .copilot/ | ||
| .playwright-mcp/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,155 @@ | ||
| --- | ||
| title: "Marketplaces" | ||
| sidebar: | ||
| order: 5 | ||
| --- | ||
|
|
||
| Marketplaces are curated indexes of plugins hosted as GitHub repositories. Each marketplace contains a `marketplace.json` file that maps plugin names to source locations. APM resolves these entries to Git URLs, so plugins installed from marketplaces get the same version locking, security scanning, and governance as any other APM dependency. | ||
|
|
||
| ## How marketplaces work | ||
|
|
||
| A marketplace is a GitHub repository with a `marketplace.json` at its root. The file lists plugins with their source type and location: | ||
|
|
||
| ```json | ||
| { | ||
| "name": "Acme Plugins", | ||
| "plugins": [ | ||
| { | ||
| "name": "code-review", | ||
| "description": "Automated code review agent", | ||
| "source": { "type": "github", "repo": "acme/code-review-plugin" } | ||
| }, | ||
| { | ||
| "name": "style-guide", | ||
| "source": { "type": "url", "url": "https://github.com/acme/style-guide.git" } | ||
| }, | ||
| { | ||
| "name": "eslint-rules", | ||
| "source": { "type": "git-subdir", "repo": "acme/monorepo", "subdir": "plugins/eslint-rules" } | ||
| }, | ||
| { | ||
| "name": "local-tools", | ||
| "source": "./tools/local-plugin" | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| Both Copilot CLI and Claude Code `marketplace.json` formats are supported. Copilot CLI uses `"repository"` and `"ref"` fields; Claude Code uses `"source"` (string or object). APM normalizes entries from either format into its canonical dependency representation. | ||
|
|
||
| ### Supported source types | ||
|
|
||
| | Type | Description | Example | | ||
| |------|-------------|---------| | ||
| | `github` | GitHub `owner/repo` shorthand | `acme/code-review-plugin` | | ||
| | `url` | Full HTTPS or SSH Git URL | `https://github.com/acme/style-guide.git` | | ||
| | `git-subdir` | Subdirectory within a Git repository (`repo` + `subdir`) | `acme/monorepo` + `plugins/eslint-rules` | | ||
| | String `source` | Subdirectory within the marketplace repository itself | `./tools/local-plugin` | | ||
|
|
||
| npm sources are not supported. Copilot CLI format uses `"repository"` and optional `"ref"` fields instead of `"source"`. | ||
|
|
||
| ## Register a marketplace | ||
|
|
||
| ```bash | ||
| apm marketplace add acme/plugin-marketplace | ||
| ``` | ||
|
|
||
| This registers the marketplace and fetches its `marketplace.json`. By default APM tracks the `main` branch. | ||
|
|
||
| **Options:** | ||
| - `--name/-n` -- Custom display name for the marketplace | ||
| - `--branch/-b` -- Branch to track (default: `main`) | ||
|
|
||
| ```bash | ||
| # Register with a custom name on a specific branch | ||
| apm marketplace add acme/plugin-marketplace --name acme-plugins --branch release | ||
| ``` | ||
|
|
||
| ## List registered marketplaces | ||
|
|
||
| ```bash | ||
| apm marketplace list | ||
| ``` | ||
|
|
||
| Shows all registered marketplaces with their source repository and branch. | ||
|
|
||
| ## Browse plugins | ||
|
|
||
| View all plugins available in a specific marketplace: | ||
|
|
||
| ```bash | ||
| apm marketplace browse acme-plugins | ||
| ``` | ||
|
|
||
| ## Search a marketplace | ||
|
|
||
| Search plugins by name or description in a specific marketplace using `QUERY@MARKETPLACE`: | ||
|
|
||
| ```bash | ||
| apm search "code review@skills" | ||
| ``` | ||
|
|
||
| **Options:** | ||
| - `--limit` -- Maximum results to return (default: 20) | ||
|
|
||
| ```bash | ||
| apm search "linting@awesome-copilot" --limit 5 | ||
| ``` | ||
|
|
||
| The `@MARKETPLACE` scope is required -- this avoids name collisions when different | ||
| marketplaces contain plugins with the same name. To see everything in a marketplace, | ||
| use `apm marketplace browse <name>` instead. | ||
|
|
||
| ## Install from a marketplace | ||
|
|
||
| Use the `NAME@MARKETPLACE` syntax to install a plugin from a specific marketplace: | ||
|
|
||
| ```bash | ||
| apm install code-review@acme-plugins | ||
| ``` | ||
|
|
||
| APM resolves the plugin name against the marketplace index, fetches the underlying Git repository, and installs it as a standard APM dependency. The resolved source appears in `apm.yml` and `apm.lock.yaml` just like any direct dependency. | ||
|
|
||
| For full `apm install` options, see [CLI Commands](../../reference/cli-commands/). | ||
|
|
||
| ## Provenance tracking | ||
|
|
||
| Marketplace-resolved plugins are tracked in `apm.lock.yaml` with full provenance: | ||
|
|
||
| ```yaml | ||
| apm_modules: | ||
| acme/code-review-plugin: | ||
| resolved: https://github.com/acme/code-review-plugin#main | ||
| commit: abc123def456789 | ||
| discovered_via: acme-plugins | ||
| marketplace_plugin_name: code-review | ||
| ``` | ||
|
|
||
| The `discovered_via` field records which marketplace was used for discovery. `marketplace_plugin_name` stores the original plugin name from the index. The `resolved` URL and `commit` pin the exact version, so builds remain reproducible regardless of marketplace availability. | ||
|
|
||
| ## Cache behavior | ||
|
|
||
| APM caches marketplace indexes locally with a 1-hour TTL. Within that window, commands like `search` and `browse` use the cached index. After expiry, APM fetches a fresh copy from the network. If the network request fails, APM falls back to the expired cache (stale-if-error) so commands still work offline. | ||
|
|
||
| Force a cache refresh: | ||
|
|
||
| ```bash | ||
| # Refresh a specific marketplace | ||
| apm marketplace update acme-plugins | ||
|
|
||
| # Refresh all registered marketplaces | ||
| apm marketplace update | ||
| ``` | ||
|
|
||
| ## Manage marketplaces | ||
|
|
||
| Remove a registered marketplace: | ||
|
|
||
| ```bash | ||
| apm marketplace remove acme-plugins | ||
|
|
||
| # Skip confirmation prompt | ||
| apm marketplace remove acme-plugins --yes | ||
| ``` | ||
|
|
||
| Removing a marketplace does not uninstall plugins previously installed from it. Those plugins remain pinned in `apm.lock.yaml` to their resolved Git sources. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.