feat(marketplace): support multi-profile marketplace outputs#1281
Open
henrydennis wants to merge 1 commit into
Open
feat(marketplace): support multi-profile marketplace outputs#1281henrydennis wants to merge 1 commit into
henrydennis wants to merge 1 commit into
Conversation
Author
|
@microsoft-github-policy-service agree |
74a3a20 to
7778108
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds multi-profile marketplace builds so apm pack can emit multiple marketplace artifacts (Claude + optional Codex) from a single marketplace: block, while keeping backwards compatibility with the existing Claude .claude-plugin/marketplace.json behavior.
Changes:
- Introduces marketplace output profiles (
claude,codex) and output-specific mappers, moving format composition out of the builder. - Extends the marketplace YAML schema to support
marketplace.outputs,marketplace.claude,marketplace.codex, plus conditionalpackage.categoryfor Codex. - Updates pack/orchestrator rendering and init/docs/tests to support and validate multi-output behavior and Claude-only CLI override.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/marketplace/test_local_path_compose.py | Adds Codex composition/write tests and verifies Claude output omits Codex-only fields. |
| tests/unit/marketplace/test_builder.py | Updates tests for renamed --marketplace-output plumbing in build options. |
| tests/unit/marketplace/test_apm_yml_marketplace_loader.py | Adds schema/output-profile parsing + validation coverage for multi-output and Codex category requirement. |
| tests/unit/core/test_build_orchestrator.py | Validates orchestrator/producer writes multiple outputs and applies CLI override only to Claude. |
| tests/unit/commands/test_marketplace_init.py | Confirms init template and warnings mention Codex output + gitignore patterns. |
| tests/integration/test_pack_unified.py | Integration coverage for pack writing Codex output when selected. |
| src/apm_cli/marketplace/yml_schema.py | Implements outputs, per-output blocks, and conditional package validation (category for Codex). |
| src/apm_cli/marketplace/output_profiles.py | Adds centralized profile registry for output capabilities and defaults. |
| src/apm_cli/marketplace/output_mappers.py | Introduces Claude/Codex mappers and shared mapping helpers. |
| src/apm_cli/marketplace/init_template.py | Documents multi-output config in the scaffolded marketplace block. |
| src/apm_cli/marketplace/diagnostics.py | Extracts shared build diagnostics type used by mappers/reports. |
| src/apm_cli/marketplace/builder.py | Refactors builder to map/write per-profile and returns multi-output BuildReport. |
| src/apm_cli/core/build_orchestrator.py | Orchestrates resolving once and writing each selected marketplace profile; applies CLI override only to Claude. |
| src/apm_cli/commands/pack.py | Renders per-profile marketplace output lines; clarifies CLI override scope. |
| src/apm_cli/commands/marketplace/init.py | Updates next-steps messaging for optional Codex output and multiple generated artifacts. |
| src/apm_cli/commands/marketplace/init.py | Expands .gitignore checks to cover both Claude and Codex default output paths. |
| docs/src/content/docs/reference/cli-commands.md | Documents multi-output behavior and Claude-only --marketplace-output semantics. |
| docs/src/content/docs/guides/pack-distribute.md | Updates pack guide to describe selectable marketplace outputs. |
| docs/src/content/docs/guides/marketplace-authoring.md | Documents marketplace.outputs, Codex output shape/requirements, and updated examples. |
7778108 to
e23fe82
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
TL;DR
apm packcan now build more than one marketplace artifact from the samemarketplace:block. Claude/Anthropic output remains the default and keeps the existing.claude-plugin/marketplace.jsonbehavior, while maintainers can opt into Codex repo marketplace output withmarketplace.outputs: [claude, codex].Problem
Marketplace authoring was effectively single-output: the schema and builder assumed one Claude-compatible
marketplace.jsonpath. That made it awkward to support another repo marketplace shape without either duplicating resolution logic or letting Codex-specific fields leak into the Claude artifact.There was also an ambiguous boundary around
--marketplace-output: once multiple artifacts exist, the CLI override needs to target the Claude/Anthropic compatibility artifact only, not whichever configured path happens to compare equal to a legacy field.Approach
MarketplaceOutputProfileentries forclaudeandcodex, including profile-specific config namespace, mapper name, required package fields, and whether the CLI output override applies.ClaudeMarketplaceMapperandCodexMarketplaceMapper; keep resolution and writing inMarketplaceBuilder.MarketplaceProducerto resolve packages once, then write every selected profile and return aBuildReportcontaining all per-profile output reports.marketplace.outputs,marketplace.claude.output,marketplace.codex.output, and package-levelcategoryrequired only when Codex output is selected.Implementation
src/apm_cli/marketplace/yml_schema.pyparsesoutputs, output-specific config blocks, andcategory, while preserving legacyoutput:as shorthand forclaude.output.src/apm_cli/marketplace/output_profiles.pycentralizes output capabilities;supports_cli_output_overrideis true only for the Claude profile.src/apm_cli/marketplace/output_mappers.pyowns format-specific JSON shape, so builder no longer contains both Claude and Codex field-mapping logic.src/apm_cli/marketplace/builder.pynow writes one profile at a time and returnsBuildReport(outputs=(...)); compatibility accessors such asreport.output_pathandreport.resolvedcontinue to work for single-output callers.src/apm_cli/core/build_orchestrator.pyloops over selected profiles, applies--marketplace-outputonly to profiles that support it, and keeps all profile reports in the marketplace producer payload.src/apm_cli/commands/pack.pyrenders each marketplace output line separately, including the profile name.Behavior
flowchart TD A["apm.yml marketplace block"] --> B["MarketplaceConfig"] B --> C["MarketplaceProducer"] C --> D["MarketplaceBuilder.resolve()"] D --> E["ResolvedPackage tuple"] B --> F["MarketplaceOutputProfile registry"] F --> G["claude profile"] F --> H["codex profile"] E --> I["ClaudeMarketplaceMapper"] E --> J["CodexMarketplaceMapper"] I --> K[".claude-plugin/marketplace.json"] J --> L[".agents/plugins/marketplace.json"]Example authoring config:
Trade-offs
BuildReportis now multi-output internally, but keeps single-output compatibility properties to avoid forcing unrelated marketplace callers to change immediately.categoryis validated at schema load time whencodexis selected, so maintainers get an early error instead of a partially written artifact.--marketplace-outputremains Claude-only by design. Codex output path is configured declaratively throughmarketplace.codex.output, which avoids one CLI flag having two different meanings.Validation
How to test
apm.ymlwithmarketplace.outputs: [claude, codex]and local package entries that includecategory.apm pack --offline..claude-plugin/marketplace.jsonand.agents/plugins/marketplace.jsonare written.apm pack --marketplace-output ./build/marketplace.jsonand confirm only the Claude artifact path is overridden.