feat(studio): make the marketplace Install actually install#73
Merged
Conversation
The studio Market page listed everything addable to a profile but the "Add to profile" picker only flashed a toast — it never wrote anything. This wires it end-to-end so installing a marketplace item edits the target profile.yaml for real. - src/lib/market-install.ts: installMarketItem() edits profile.yaml in place, idempotently, mirroring addMcpToProfile's validation + path guard. Routes each addKind to its home — skill → skills.npx, mcp → mcps (reuses addMcpToProfile), plugin → plugins, profile → inherits (expands a scalar into a list), workflow → playbooks. A bare CLI has no profile.yaml home, so it returns a `manual` command for the studio to surface instead. - dashboard-server: handleMarketInstall + POST /api/v1/market/install, on the existing write-side allowlist; busts the market cache on a real edit. - web: installMarketItem() api helper + Market.tsx wires the picker to call it, shows pending/success/already-present/manual/error in the toast, and invalidates the profiles/detail/market queries so the rest of the studio reflects the new membership. - Tests for every addKind (write + idempotency + traversal guard) and the handler's request validation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0178QDX7Jk7CkdGgH7uKfamv
CI was failing at the actions/checkout submodule step for every PR (and on main since #71): the resources/skills gitlink pinned 4274beaece3a38a4a7a85142b2f09f2b23e3ce89, which no longer exists on opencue/skills.git (force-pushed / GC'd), so `submodule update` aborted before lint/test/e2e could run. Bump the gitlink to a452e5d2892d59d766b1927c9d35a6f806bce79e, the current tip of the tracked `soul-main` branch, so checkout succeeds. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0178QDX7Jk7CkdGgH7uKfamv
buildUniversalSuggestions spreads UNIVERSAL_DEFAULTS over the caller's opts, but the defaults object was missing pinnedCompanions, which became a required key of `Required<Omit<BuildUniversalOptions, ...>>` once that field was added — so `tsc --noEmit` failed. Default it to UNIVERSAL_COMPANIONS (the documented default), so the spread actually supplies it and the type is satisfied. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0178QDX7Jk7CkdGgH7uKfamv
… skills) The previous bump pointed resources/skills at soul-main's tip, but that branch is mid-vault-migration and no longer contains skills the catalog references — e.g. core/profile.yaml uses tools/ccusage and tools/headroom, which exist only on the skills repo's `main` branch. That made every profile fail the e2e resolver dry-run (E3 missing reference). Repoint the gitlink to opencue/skills main (3c6b2569) and update .gitmodules to track `branch = main` so `--remote` refreshes stay on the canonical catalog. `cue validate --all` now passes (exit 0, warnings only). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0178QDX7Jk7CkdGgH7uKfamv
# Conflicts: # resources/skills # web/src/studio/views/Market.tsx
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.
What
The studio Market page already browses, searches, filters, sorts, stars, and "publishes" — but its central action was a stub: the Install → Add to profile picker only flashed a toast and never wrote anything. This PR makes the marketplace fully functional by wiring Install end-to-end so picking a profile actually edits that profile's
profile.yaml.How
Backend
src/lib/market-install.ts— newinstallMarketItem()that editsprofiles/<name>/profile.yamlin place, idempotently, mirroringaddMcpToProfile's profile validation + path-traversal guard. Each item type routes to its real home:skillskills.npx({ repo, skills: [name] }, repo parsed from the install command)mcpmcps(reuses the existingaddMcpToProfile)pluginpluginsprofileinherits(expands a scalarinherits: coreinto a list)workflowplaybooksclimanualcommand for the UI to surfaceskills:/npx:scaffold when absent.dashboard-server.ts—handleMarketInstall()+POST /api/v1/market/installon the existing write-side allowlist; busts the market cache on a real edit.Frontend
api.ts—installMarketItem()helper +MarketInstallResulttype.Market.tsx— the picker now calls the endpoint and reports pending / success / already-present / manual (CLI) / error in the toast, then invalidates theprofiles-full,profile-detail, andmarketqueries so the rest of the studio reflects the new membership. Local unpublished drafts are blocked from install with a clear message.Tests
market-install.test.ts— every addKind (write + idempotency), scalar-inheritsexpansion, self-inherit guard, CLI manual path, traversal + missing-profile rejection. Runs against a throwawayCUE_PROFILES_DIRfixture, never the realprofiles/.dashboard-server.test.ts— request validation for the new handler (missing-id,invalid-add-kind,missing-profile, CLI manual).All new tests pass (
bun test), the web app builds (vite build), andbiome lintis clean on the changed files. The pre-existing suite failures (missing generatedresources/mcps/configs/+ network-gated tests) are unchanged by this PR.🤖 Generated with Claude Code
Generated by Claude Code