MCPcopy Create free account
hub / github.com/WJX20/claude-code / formatResolutionError

Function formatResolutionError

src/utils/plugins/pluginInstallationHelpers.ts:304–327  ·  view source on GitHub ↗
(
  r: ResolutionResult & { ok: false },
)

Source from the content-addressed store, hash-verified

302 * for UI users too).
303 */
304export function formatResolutionError(
305 r: ResolutionResult & { ok: false },
306): string {
307 switch (r.reason) {
308 case 'cycle':
309 return `Dependency cycle: ${r.chain.join(' → ')}`
310 case 'cross-marketplace': {
311 const depMkt = parsePluginIdentifier(r.dependency).marketplace
312 const where = depMkt
313 ? `marketplace "${depMkt}"`
314 : 'a different marketplace'
315 const hint = depMkt
316 ? ` Add "${depMkt}" to allowCrossMarketplaceDependenciesOn in the ROOT marketplace's marketplace.json (the marketplace of the plugin you're installing — only its allowlist applies; no transitive trust).`
317 : ''
318 return `Dependency "${r.dependency}" (required by ${r.requiredBy}) is in ${where}, which is not in the allowlist — cross-marketplace dependencies are blocked by default. Install it manually first.${hint}`
319 }
320 case 'not-found': {
321 const { marketplace: depMkt } = parsePluginIdentifier(r.missing)
322 return depMkt
323 ? `Dependency "${r.missing}" (required by ${r.requiredBy}) not found. Is the "${depMkt}" marketplace added?`
324 : `Dependency "${r.missing}" (required by ${r.requiredBy}) not found in any configured marketplace`
325 }
326 }
327}
328
329/**
330 * Core plugin install logic, shared by the CLI path (`installPluginOp`) and

Callers 2

installPluginOpFunction · 0.85

Calls 1

parsePluginIdentifierFunction · 0.85

Tested by

no test coverage detected