feat(claude): support marketplace source matrix - #314
Conversation
Validate and emit every documented distributed plugin source while preserving the generated relative default and archive authentication rules.
🦋 Changeset detectedLatest commit: a19b571 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a19b5710cb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const internalRelative = | ||
| declared.startsWith('./') && | ||
| !declared.split('/').includes('..'); |
There was a problem hiding this comment.
Reject backslash traversal in relative sources
On Windows desktop, a source such as ./plugin\..\outside passes this check because only / delimits the searched segments, but Windows resolves it outside the marketplace directory. This contradicts the diagnostic's containment guarantee and can make the emitted marketplace load an adjacent directory; split on both slash forms, as the new git-subdir validation already does, and apply the same rule in the schema.
Useful? React with 👍 / 👎.
| "source": { "const": "archive" }, | ||
| "url": { | ||
| "format": "uri", | ||
| "pattern": "^https://(?!(?:localhost|[^/]+\\.localhost|127(?:\\.[0-9]{1,3}){3}|169\\.254(?:\\.[0-9]{1,3}){2}|metadata(?:\\.google(?:\\.internal)?)?|metadata\\.azure\\.internal|instance-data\\.ec2\\.internal)(?::[0-9]+)?/)", |
There was a problem hiding this comment.
Allow origin-root archive URLs
When an archive is served directly from an origin and the author specifies an equivalent URL such as https://artifacts.example.test, isSafeArchiveUrl() accepts it, but this schema pattern requires a literal / after the authority. The subsequent validateMarketplace call therefore rejects the generated document and prevents the marketplace from being emitted; permit end-of-string after the authority or normalize the URL before validation.
Useful? React with 👍 / 👎.
* fix(claude): validate numeric config bounds in artifacts (#287 r3911238592) * fix(claude): reject marketplace backslash traversal (#314 r3918535243) * fix(claude): validate authority-only archive hosts (#314 r3918535249) * fix(replay): preserve invocation provenance in renderers (#322 r3919341927) * fix(replay): derive workspace from cursor roots (#322 r3919341940) * fix(dev): invalidate watcher on chmod changes (#329 r3919499846) * chore: add framework review fixes changeset
Summary
Slice 3 (part 3/3) of the #187 Claude parity pass: full marketplace plugin source matrix support in the authored
claude.marketplaceoverlay.ClaudeMarketplacePluginSource: relative path string,github, giturl,git+pathsubdir,npm,archive, andcommand— each with plan-time validation andclaude.marketplace.plugin.source.*dotted diagnostics.shafor github/git sources,sha256:prefixed digest for npm/archive, HTTPS-only archive URLs, commandmoderestricted to documented values.headers/headersHelperrestriction forarchivesources (stillinapplicablediagnostics on all other source types).marketplace.schema.jsonexpanded to a closed union over all source forms, withallOfconditionals (bare-name source requirespluginRoot;headers/headersHelperrequire archive source). Re-pinned in PROVENANCE with updated bytes/sha256.claude-2.1.250.json):sourceMatrixrows markedsupportedwith dated doc citations.claude plugin validate --strictaccepts a marketplace document exercising every source form; negative proofs confirm the CLI rejects short SHAs, HTTP archive URLs, and unknown command modes.Revisions
adapterRevision: claude1.15.0→1.16.0, unified plugin1.14.0→1.15.0(serial after feat(claude): pin distribution policy capability evidence (#187) #308/feat(claude): complete marketplace manifest contract (#187) #310).Test plan
pnpm -w typecheckpnpm -w lintPart of #187.