UNPKG

@withpica/mcp-server

Version:

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

99 lines • 4.37 kB
/** * ADR-333 — plain words for a relationship (who looks after whose * catalogue), as the assistant tools say them. * * The MCP package cannot import the app, so this keeps its own copy of what * the screens say: the type labels and statuses (from * lib/services/portfolio-relationship-model.ts), the screen addresses (from * lib/config/relationship-paths.ts), and the status and history sentences * (from app/inspect/lib/relationship-copy.ts). The tools and the screens * cannot say different things without * lib/services/__tests__/relationship-scope-mcp-parity.test.ts failing: it * compares every constant here with the app's and runs both sentence * builders over every status and event kind. * * Pure: no imports. */ export declare const GRANTABLE_RELATIONSHIP_TYPES: readonly ["co_owner", "administrator", "representative", "viewer"]; export type RelationshipTypeName = (typeof GRANTABLE_RELATIONSHIP_TYPES)[number]; export declare const RELATIONSHIP_TYPE_LABELS: Record<RelationshipTypeName, string>; export declare const RELATIONSHIP_STATUSES: readonly ["proposed", "active", "declined", "revoked", "stepped_down", "expired", "suspended"]; export type RelationshipStatusName = (typeof RELATIONSHIP_STATUSES)[number]; /** What a type may do, said to the catalogue's owner. */ export declare const TYPE_DOES: Record<RelationshipTypeName, string>; /** The same allowances, said to the organisation that holds them. */ export declare const TYPE_DOES_FOR_ORG: Record<RelationshipTypeName, string>; export declare const RELATIONSHIPS_PATH = "/inspect/relationships"; export declare function relationshipPath(relationshipId: string): string; export declare const INVITATIONS_FOR_YOU_PATH = "/inspect/relationships#invitations-for-you"; export declare function relationshipActivityPath(granteeOrgId?: string): string; /** Hand-overs (ADR-333 D5); the app's are lib/config/handover-paths.ts. */ export declare const HANDOVERS_PATH = "/inspect/handovers"; export declare function handoverPath(handoverId: string): string; export declare const NEW_HANDOVER_PATH = "/inspect/handovers/new"; export type ReaderSide = "grantor" | "grantee"; /** The fields statusLine reads (a RelationshipRecord satisfies it). */ export interface RelationshipForCopy { status: RelationshipStatusName; proposedBySide: ReaderSide; grantorOrgName: string; granteeOrgName: string; proposedAt: string; respondedAt: string | null; endedAt: string | null; endReason: string | null; proposalExpiresAt: string | null; suspendedAt: string | null; scope: { termEndsOn: string | null; }; } export interface StatusLine { text: string; /** The reader has to answer it. */ needsYou: boolean; } /** Where a relationship stands, for the side reading it. */ export declare function statusLine(r: RelationshipForCopy, reader: ReaderSide): StatusLine; /** The fields eventLine reads (a RelationshipEventRecord satisfies it). */ export interface RelationshipEventForCopy { kind: string; actorSide: "grantor" | "grantee" | "system" | "platform"; actorDisplayName: string | null; grantorOrgName: string; granteeOrgName: string; type: RelationshipTypeName; reason: string | null; action: string | null; entityType: string | null; scope: { termEndsOn: string | null; }; detail?: Record<string, unknown>; } /** One audit row as a sentence: who did what, through which relationship. */ export declare function eventLine(e: RelationshipEventForCopy): string; /** The fields scopeSummary reads. */ export interface ScopeForCopy { half: "both" | "composition" | "master"; territories: string[]; termStartsOn: string | null; termEndsOn: string | null; money: boolean; directory: boolean; catalogue: "whole" | "chosen"; workIds?: string[]; recordingIds?: string[]; songsChosen?: number; recordingsChosen?: number; } /** * The scope in one line for the side reading it: what, which side, where, * when, money and (administrators) the directory. Territories are ISO codes * here ("GB, IE"); the screens spell the country names. */ export declare function scopeSummary(scope: ScopeForCopy, type: RelationshipTypeName, reader: { side: ReaderSide; grantorName: string; }): string; //# sourceMappingURL=relationship-copy.d.ts.map