Skip to content

feat(core): add local agent marketplace foundation - #60821

Draft
dobord wants to merge 2 commits into
anomalyco:devfrom
dobord:marketplace-agents
Draft

dobord wants to merge 2 commits into
anomalyco:devfrom
dobord:marketplace-agents

Conversation

@dobord

@dobord dobord commented Oct 31, 2026 •

Copy link
Copy Markdown

Issue for this PR

Part of #28696. First slice of the contribution requested in #60816.

Design discussion: #28696 (comment)

Draft pending upstream agreement on storage ownership and the experimental catalog contract in #28696. The migration must not land before that agreement.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds the experimental Core building block for local agent catalogs: a catalog manifest schema, a proposed SQLite registry, revision-bound one-time plans, installation/removal, and explicit config-document projection. Registry state, installed snapshots and process-local plans are owned by Core.

Agent identities are projected as marketplace/<package-key>/<local-name>, keeping package agents separate from built-in and ordinary user-config agents. The provisional catalog discriminator is opencode.marketplace/experimental.

This slice is 10 files and about 610 added lines. After design approval, the next PR will register the service in Instance and project documents through explicit experimental Location-config opt-in, respecting global: false and publishing config updates after committed mutations. It will exercise actual agent visibility and removal through the existing config plugin. A subsequent API/client and CLI change will expose the workflow to users.

How did you verify your code works?

  • bun run check passed, including the mandatory pre-push hook.
  • Core typecheck:tsc passed.
  • 66 Marketplace/config-agent/migration tests passed. Coverage includes reviewed snapshot isolation, concurrent revision conflicts, one-time consumption, expiry without sleeping, namespaced package identities, strict local catalog validation, restart persistence and incremental database upgrade. The regression test uses the actual config-agent plugin and verifies built-in/user prompts, models and permissions remain unchanged.
  • bun run script/migration.ts --check passed.

Visual

<svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72" fill="none">
  <style>@keyframes pulse{0%,100%{opacity:.4}50%{opacity:1}}.flow{animation:pulse 2.4s ease-in-out infinite}@media(prefers-reduced-motion:reduce){.flow{animation:none}}</style>
  <g stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
    <path d="M17 16h29l9 9v31H17V16Zm29 0v10h9M25 35h22M25 44h17" opacity=".7"/>
    <path class="flow" d="M65 36h29m-5-5 5 5-5 5"/>
    <rect x="105" y="16" width="40" height="40" rx="5" opacity=".6"/>
    <path d="M114 27h22M114 36h16m-16 9 5 5 14-14"/>
    <path class="flow" d="M155 36h29m-5-5 5 5-5 5"/>
    <ellipse cx="211" cy="20" rx="16" ry="6" opacity=".7"/>
    <path d="M195 20v28c0 8 32 8 32 0V20m-32 14c0 8 32 8 32 0" opacity=".7"/>
  </g>
</svg>

Screenshots / recordings

Core service only; the app/TUI contribution will include screenshots with its UI changes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests and type check pass, but nothing in OpenCode uses this yet, so I could only check it through its tests. I ran the new marketplace and migration tests (28 pass) and typecheck:tsc in packages/core (clean). A search shows nothing outside the new files uses MarketplaceLocal yet.

Public API: all additions, backwards compatible:

  • a new persistent marketplace_registry SQLite table, with migration 20261031060845_marketplace_local
  • a new @opencode/schema/marketplace entrypoint (Name, AgentItem, Catalog, Key, Installed, State, Plan)
  • a new on-disk catalog format, opencode.marketplace/v1

The table and the catalog format are hard to change once they ship.

Concerns:

  • Design not settled: you note that approval on #28696 is still pending. This slice already commits a migration, a storage shape (one JSON row) and a catalog file format, and later slices may want to change them. It would help to settle the direction there before landing the persistent parts.
  • Not reachable yet: the service is built but not reachable from Location config, the server or the CLI. Until a follow-up wires it in, it's code and a database table nobody uses. If it isn't wired in this PR, the description should state the plan for adding that.
  • Clashes with existing agents: see the inline comment on the clash check.
  • Package boundary: see the inline comment on State/Plan.

Related: #28696

Comment thread packages/core/src/marketplace.ts Resolved
Comment thread packages/schema/src/marketplace.ts Resolved
@dobord
dobord marked this pull request as draft October 31, 2026 06:52
@dobord

dobord commented Oct 31, 2026

Copy link
Copy Markdown
Author

Addressed the two inline comments in 6fd5402:

  • Package agent IDs are now qualified as marketplace/<package-key>/<local-name>. A regression through the actual config-agent plugin verifies that built-in/user prompts, models and permissions remain unchanged; different packages can both define review safely.
  • Moved Key, Installed, State and Plan into Core. Schema now contains only the external catalog manifest contracts.

I also changed the provisional catalog discriminator to opencode.marketplace/experimental and converted this PR to draft. The migration and persistence shape remain pending agreement in #28696, not ready to land.

The description now spells out the next integration: Instance registration, explicit experimental Location-config opt-in, respecting global: false, config-update notification after commits, and a runtime agent visibility/removal test; API/client and CLI entrypoints follow separately.

Verification: 66 tests passed, Core typecheck:tsc and migration-generation checks passed, and the mandatory pre-push full bun run check passed.

This branch has not been deployed

No deployments
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.

1 participant