ProjectsDocumentation Index
Fetch the complete documentation index at: https://glide-9da73dea.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
@glideco/smart-router rail candidates into the parley-protocol three-tier vocabulary: turbo, fast, and batch. Agents can present these tiers in a chooser UI, pass a tier preference to payments.initiate, or ignore tiers entirely — backward-compatible with vanilla MPP.
Pure functions, no IO.
Install
Why tiers
The smart-router returns a ranked list of rails sorted by fee. That list is the right output for the dispatcher, but it’s the wrong surface for agents that need to give users a choice. “Tempo USDC — 0.01 — 200ms” are both valid options, but they mean different things to a user who’s about to pay a contractor. Parley tiers give that list a name. The three tiers cover the practical range:turbo— p95 latency ≤ 500ms, fee penalty acceptable.fast— p95 latency ≤ 5s, lowest fee within that ceiling.batch— p95 latency ≤ 10 min, cheapest path overall.
fast as ≤ 500ms rather than ≤ 5s.
API surface
buildParleyTiers(candidates, thresholds?): ParleyTier[]
pickPreferredTier(tiers, preference): ParleyTier | undefined
Returns the best candidate for the requested tier. If that tier has no candidates, falls back in the order:
turbo→fast→batchfast→turbo→batchbatch→fast→turbo
classifyTier(latencyP95Ms, thresholds?): ParleyTierName | undefined
Classify a single latency value without building the full tier list. Returns undefined when the latency exceeds the batch ceiling.
Confidence flagging
Rail candidates carry aconfidence field (0–1) set by the smart-router from observed success rate. buildParleyTiers preserves confidence on each ParleyTier. Low-confidence rails will rank behind higher-confidence rails with equal fee + latency, and the caller can choose to display a warning to the user when confidence < 0.8.
Reading list
@glideco/smart-router— produces theRouteCandidate[]list you convert toRailCandidate[]for this package.- Source on GitHub