UNPKG

@withpica/mcp-server

Version:

MCP Server for withPICA — enables AI assistants to interact with your withPICA music catalog

33 lines • 1.19 kB
// Copyright (c) 2025-2026 Withpica Ltd. All rights reserved. const EMPTY_PRESSURE = { hints: [], integrity: null }; /** * Assess one entity's registration-integrity gaps and render them as * completion hints + a raw integrity block. Never throws. */ export async function buildIntegrityPressure(pica, entityType, entityId) { if (!entityId) return EMPTY_PRESSURE; try { const assessment = await pica.integrity.assessEntity(entityType, entityId); const gaps = assessment?.gaps ?? []; const hints = gaps.map((gap) => ({ gap: gap.code.toLowerCase(), suggestion: `${gap.label} — ${gap.action_hint}`, severity: gap.severity, })); return { hints, integrity: { gaps, waived_count: assessment?.waived_count ?? 0, }, }; } catch { // Best-effort — pressure is advisory, never blocks the write it's // attached to. Includes SDK ApiError, network failures, and orgs // where the assessor isn't yet reachable. return EMPTY_PRESSURE; } } //# sourceMappingURL=integrity-hints.js.map