MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / hopLabel

Function hopLabel

src/ui-server/api/steps.ts:1720–1734  ·  view source on GitHub ↗

The words on a hop that was not a plain call — the Flow strip's connector label, in short.

(meta: Record<string, unknown>, synthesized: boolean)

Source from the content-addressed store, hash-verified

1718
1719/** The words on a hop that was not a plain call — the Flow strip's connector label, in short. */
1720function hopLabel(meta: Record<string, unknown>, synthesized: boolean): string {
1721 const parts: string[] = [];
1722 if (typeof meta.synthesizedBy === 'string') parts.push(`via ${meta.synthesizedBy}`);
1723 else if (synthesized) parts.push('inferred');
1724 if (meta.channel === 'server-action') parts.push('server action');
1725 if (meta.channel === 'http' && typeof meta.method === 'string') parts.push(`${meta.method} ${typeof meta.href === 'string' ? meta.href : ''}`.trim());
1726 if (meta.tier === 'client→server') parts.push('to the server');
1727 else if (meta.tier === 'server→client') parts.push('from the server');
1728 if (meta.resolvedBy === 'receiver-type') parts.push('by the receiver’s declared type');
1729 if (typeof meta.event === 'string') parts.push(`${meta.channel === 'queue' ? 'job' : meta.channel === 'socket' ? 'message' : 'event'} ${meta.event}`);
1730 if (typeof meta.queue === 'string') parts.push(`queue ${meta.queue}`);
1731 if (meta.bridge === 'react-native') parts.push(`React Native bridge${typeof meta.module === 'string' ? ` · ${meta.module}` : ''}`);
1732 if (typeof meta.registeredAt === 'string') parts.push(`registered at ${meta.registeredAt}`);
1733 return parts.join(' · ');
1734}
1735
1736/** Source order of two hops: a hop written inside the other's call runs first; else by position; another file sorts after. */
1737function hopCompare(a: HopSite | undefined, b: HopSite | undefined): number {

Callers 1

linkFunction · 0.70

Calls 2

pushMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected