Skip to content

feat(marketplace): support project-level marketplaces with override warning - #224

Merged
christso merged 12 commits into
mainfrom
feat/223-project-level-marketplaces
Mar 9, 2026
Merged

feat(marketplace): support project-level marketplaces with override warning#224
christso merged 12 commits into
mainfrom
feat/223-project-level-marketplaces

Conversation

@christso

@christso christso commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Closes #223

Summary

  • Add --scope <user|project> to plugin marketplace add (default: user) — writes to .allagents/marketplaces.json in workspace root when project
  • Add --scope <user|project> to plugin marketplace list — filters by scope; omitting shows both scopes merged
  • Add --scope <user|project> to plugin marketplace remove — removes from specified scope; omitting removes from both
  • Runtime plugin resolution (plugin@marketplace) uses merged registries with project-over-user precedence
  • Override warning emitted when project marketplace shadows a user marketplace of the same name
  • marketplace browse and marketplace update also support project-level marketplaces

E2E Test Plan

# Setup
mkdir -p /tmp/aa-e2e/.allagents
echo "plugins: []" > /tmp/aa-e2e/.allagents/workspace.yaml
mkdir -p /tmp/aa-e2e-mp/plugins/test-plugin
echo '{}' > /tmp/aa-e2e-mp/plugins/test-plugin/plugin.json
cd /tmp/aa-e2e

# Test add --scope project
allagents plugin marketplace add /tmp/aa-e2e-mp --scope project
cat .allagents/marketplaces.json  # verify project registry created

# Test add with default scope (user)
allagents plugin marketplace add /tmp/aa-e2e-mp

# Test list (no flag) — shows both scopes merged + override warning
allagents plugin marketplace list

# Test list --scope project — only project entries
allagents plugin marketplace list --scope project

# Test list --scope user — only user entries
allagents plugin marketplace list --scope user

# Test browse — finds plugins from project marketplace
allagents plugin marketplace browse aa-e2e-mp

# Test remove --scope project — user entry survives
allagents plugin marketplace remove aa-e2e-mp --scope project
allagents plugin marketplace list  # shows user only

# Test re-add project, remove --scope user — project entry survives
allagents plugin marketplace add /tmp/aa-e2e-mp --scope project
allagents plugin marketplace remove aa-e2e-mp --scope user
allagents plugin marketplace list  # shows project only

# Test remove (no flag) — removes from both scopes
allagents plugin marketplace add /tmp/aa-e2e-mp --scope user
allagents plugin marketplace remove aa-e2e-mp
allagents plugin marketplace list  # shows nothing

# Test add --scope project without workspace — should error
cd /tmp && allagents plugin marketplace add /tmp/aa-e2e-mp --scope project
# Expected: "Error: No workspace found in current directory."

# Cleanup
rm -rf /tmp/aa-e2e /tmp/aa-e2e-mp

🤖 Generated with Claude Code

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Mar 9, 2026

Copy link
Copy Markdown

Deploying allagents with  Cloudflare Pages  Cloudflare Pages

Latest commit: d229456
Status: ✅  Deploy successful!
Preview URL: https://c88aaaba.allagents.pages.dev
Branch Preview URL: https://feat-223-project-level-marke.allagents.pages.dev

View logs

@christso

christso commented Mar 9, 2026

Copy link
Copy Markdown
Contributor Author

E2E Manual Test Results ✅

All 10 scenarios pass. Build, then run from a temp workspace:

# Setup
mkdir -p /tmp/aa-e2e-223/.allagents
echo "plugins: []" > /tmp/aa-e2e-223/.allagents/workspace.yaml
mkdir -p /tmp/aa-e2e-223-mp/plugins/hello-plugin
echo '{"name":"hello-plugin"}' > /tmp/aa-e2e-223-mp/plugins/hello-plugin/plugin.json
cd /tmp/aa-e2e-223

# Test 1: add --scope project → creates .allagents/marketplaces.json in workspace
allagents plugin marketplace add /tmp/aa-e2e-223-mp --scope project
cat .allagents/marketplaces.json  # verify project registry

# Test 2: add with default scope (user)
allagents plugin marketplace add /tmp/aa-e2e-223-mp

# Test 3: list (no flag) → shows both scopes merged + override warning
allagents plugin marketplace list

# Test 4: list --scope project → only project entries
allagents plugin marketplace list --scope project

# Test 5: list --scope user → only user entries
allagents plugin marketplace list --scope user

# Test 6: browse → finds plugins from project marketplace
allagents plugin marketplace browse aa-e2e-223-mp

# Test 7: remove --scope project → user entry survives
allagents plugin marketplace remove aa-e2e-223-mp --scope project
allagents plugin marketplace list  # shows user only

# Test 8: re-add project, remove --scope user → project entry survives
allagents plugin marketplace add /tmp/aa-e2e-223-mp --scope project
allagents plugin marketplace remove aa-e2e-223-mp --scope user
allagents plugin marketplace list  # shows project only

# Test 9: re-add user, remove (no flag) → removes from both
allagents plugin marketplace add /tmp/aa-e2e-223-mp --scope user
allagents plugin marketplace remove aa-e2e-223-mp
allagents plugin marketplace list  # shows nothing

# Test 10: add --scope project without workspace → error
cd /tmp && allagents plugin marketplace add /tmp/aa-e2e-223-mp --scope project
# Expected: "Error: No workspace found in current directory."

# Cleanup
rm -rf /tmp/aa-e2e-223 /tmp/aa-e2e-223-mp

Scope defaults

Command --scope omitted --scope user --scope project
add writes to user writes to user writes to project
list shows both user only project only
remove removes from both user only project only

Results

Test Scenario Result
1 add --scope project creates project registry
2 add (no scope) writes to user registry
3 list (no flag) shows all scopes + override warning
4 list --scope project shows only project entries
5 list --scope user shows only user entries
6 browse finds plugins from project marketplace
7 remove --scope project removes only project entry
8 remove --scope user removes only user entry
9 remove (no flag) removes from both scopes
10 add --scope project without workspace errors cleanly

Unit tests: 926 pass, 0 fail (930 total, 4 skipped)

@christso
christso merged commit 9060586 into main Mar 9, 2026
1 check passed
@christso
christso deleted the feat/223-project-level-marketplaces branch March 9, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support project-level marketplaces with override warning

1 participant