Relocate the ~6k-file docs tree from the repo root into plugins/document-navigator/docs/ so the plugin is self-contained and portable. docs/superpowers/ (specs and plans) stays at the repo root. Moved via cp+rm rather than git mv because directory rename() fails with EPERM on this WSL /mnt DrvFs mount; git rename-detection pairs the identical-content files at commit time. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
9.4 KiB
9.4 KiB
@suaveplan/ports - Global port database with shipping-lane routing, ETA estimation, and UN/LOCODE port lookups for sea ports, airports, and rail terminals.
Global port database with shipping-lane routing, ETA estimation, and UN/LOCODE port lookups for sea ports, airports, and rail terminals.
Documentation tree
- airports — Curated dataset of major international air-cargo airports, exported as the readonly
airportsarray. Each record confo…- airports — Curated dataset of major international air-cargo airports, exported as the readonly
airportsarray. Each record confo…
- airports — Curated dataset of major international air-cargo airports, exported as the readonly
- all-ports — Aggregates every curated dataset — sea ports, airports, and rail terminals — into a single readonly
allPortsarray an…- all-ports — Aggregates every curated dataset — sea ports, airports, and rail terminals — into a single readonly
allPortsarray an…
- all-ports — Aggregates every curated dataset — sea ports, airports, and rail terminals — into a single readonly
- rail-terminals — Curated dataset of major rail freight terminals — primarily the inland container hubs on the New Silk Road and Trans-Eu…
- rail-terminals — Curated dataset of major rail freight terminals — primarily the inland container hubs on the New Silk Road and Trans-Eu…
- sea-ports — Aggregates every regional sea-port dataset (
seaPortsAsia,seaPortsEurope,seaPortsAmericas,seaPortsAfricaMena,…- sea-ports — Aggregates every regional sea-port dataset (
seaPortsAsia,seaPortsEurope,seaPortsAmericas,seaPortsAfricaMena,…
- sea-ports — Aggregates every regional sea-port dataset (
- sea-ports-africa-mena — Curated dataset of major sea ports across Africa and the Middle East / North Africa region, exported as the readonly `s…
- sea-ports-africa-mena — Curated dataset of major sea ports across Africa and the Middle East / North Africa region, exported as the readonly `s…
- sea-ports-americas — Curated dataset of major sea ports across the Americas, exported as the readonly
seaPortsAmericasarray. Every record…- sea-ports-americas — Curated dataset of major sea ports across the Americas, exported as the readonly
seaPortsAmericasarray. Every record…
- sea-ports-americas — Curated dataset of major sea ports across the Americas, exported as the readonly
- sea-ports-asia — Curated dataset of major sea ports across Asia, exported as the readonly
seaPortsAsiaarray. Every record conforms to…- sea-ports-asia — Curated dataset of major sea ports across Asia, exported as the readonly
seaPortsAsiaarray. Every record conforms to…
- sea-ports-asia — Curated dataset of major sea ports across Asia, exported as the readonly
- sea-ports-europe — Curated dataset of major sea ports across Europe, exported as the readonly
seaPortsEuropearray. Every record conform…- sea-ports-europe — Curated dataset of major sea ports across Europe, exported as the readonly
seaPortsEuropearray. Every record conform…
- sea-ports-europe — Curated dataset of major sea ports across Europe, exported as the readonly
- sea-ports-oceania — Curated dataset of major sea ports across Oceania, exported as the readonly
seaPortsOceaniaarray. Every record confo…- sea-ports-oceania — Curated dataset of major sea ports across Oceania, exported as the readonly
seaPortsOceaniaarray. Every record confo…
- sea-ports-oceania — Curated dataset of major sea ports across Oceania, exported as the readonly
- shipping-lanes — Curated registry of major global shipping lanes — Asia–Europe via Suez, Asia–Europe via Cape, Transpacific, Transatlant…
- shipping-lanes — Curated registry of major global shipping lanes — Asia–Europe via Suez, Asia–Europe via Cape, Transpacific, Transatlant…
- distance — Wraps
@suaveplan/geo'sgreatCircleDistanceagainst a sphere whose radius matches the IUGG mean Earth radius (6 371…- distance — Wraps
@suaveplan/geo'sgreatCircleDistanceagainst a sphere whose radius matches the IUGG mean Earth radius (6 371…
- distance — Wraps
- error-codes — Declares the eight stable error codes emitted by
@suaveplan/portsand the matching typedPortsErrorsubclasses. Eve…- error-codes — Declares the eight stable error codes emitted by
@suaveplan/portsand the matching typedPortsErrorsubclasses. Eve…
- error-codes — Declares the eight stable error codes emitted by
- eta — Estimates the time of arrival for a vessel travelling along a
ShippingLane. Resolves an effective cruise speed from (…- eta — Estimates the time of arrival for a vessel travelling along a
ShippingLane. Resolves an effective cruise speed from (…
- eta — Estimates the time of arrival for a vessel travelling along a
- find-port — Provides the lookup surface for
@suaveplan/ports. Every public function consumes the curatedallPortsregistry by d…- find-port — Provides the lookup surface for
@suaveplan/ports. Every public function consumes the curatedallPortsregistry by d…
- find-port — Provides the lookup surface for
- lane-distance — Computes great-circle distance metrics for a
ShippingLane's waypoint chain.estimateLaneDistancesums every segment…- lane-distance — Computes great-circle distance metrics for a
ShippingLane's waypoint chain.estimateLaneDistancesums every segment…
- lane-distance — Computes great-circle distance metrics for a
- lane-lookup — Public lookup surface for the curated
shippingLanesregistry. Mirrors the port-lookup module in style: an O(1)Map…- lane-lookup — Public lookup surface for the curated
shippingLanesregistry. Mirrors the port-lookup module in style: an O(1)Map…
- lane-lookup — Public lookup surface for the curated
- lane-progress — Projects a vessel position onto a shipping lane and reports how much of the lane has been traversed, how much remains,…
- lane-progress — Projects a vessel position onto a shipping lane and reports how much of the lane has been traversed, how much remains,…
- nearest-port — Public proximity-search API.
findNearestPortreturns the single closest port to a coordinate;findPortsInRadiusret…- nearest-port — Public proximity-search API.
findNearestPortreturns the single closest port to a coordinate;findPortsInRadiusret…
- nearest-port — Public proximity-search API.
- otel — Wires
@suaveplan/ports' OpenTelemetry instrumentation: three counters that track lookup volume per kind, lane lookup…- otel — Wires
@suaveplan/ports' OpenTelemetry instrumentation: three counters that track lookup volume per kind, lane lookup…
- otel — Wires
- schemas — Defines Zod schemas for every public type emitted by
@suaveplan/ports. API plugins, message-queue handlers, and any o…- schemas — Defines Zod schemas for every public type emitted by
@suaveplan/ports. API plugins, message-queue handlers, and any o…
- schemas — Defines Zod schemas for every public type emitted by
- spatial-index —
PortSpatialIndexbuckets a port set by 5-degree latitude/longitude cells at construction time sofindNearestand `f…- spatial-index —
PortSpatialIndexbuckets a port set by 5-degree latitude/longitude cells at construction time sofindNearestand `f…
- spatial-index —
Install
bun add @suaveplan/ports
What's in the box
- Curated
Portregistry: ~100 sea ports across five regions, ~30 international cargo airports, ~30 rail freight terminals. - Lookups: by UN/LOCODE (
findPort/findPortStrict), by ISO country (findPortsByCountry), byPortType(findPortsByType), by name substring (searchPorts). - Proximity:
findNearestPortandfindPortsInRadius(5°-bucketedPortSpatialIndexunder the hood). - Curated
shippingLaneswaypoint graph for the major sea, rail, and air freight routes. - Lane distance (
estimateLaneDistance,cumulativeDistances), lane projection (findPositionOnLane), and ETA estimation (estimateETA). - 8-code typed error registry under the
PORTS.*namespace via@suaveplan/error. - Zod schemas for every public type under
./schemas/schemas. - OpenTelemetry instrumentation: three counters and three histograms
via
./otel/otel.
Quickstart
import {
findPort,
findNearestPort,
getShippingLaneStrict,
estimateETA,
} from "@suaveplan/ports";
const shanghai = findPort("CNSHA");
const nearestSea = findNearestPort({ latitude: 1.26, longitude: 103.82 });
const suez = getShippingLaneStrict("asia-europe-suez");
const eta = estimateETA(
{ latitude: 12.5, longitude: 43.3 },
suez,
14,
{ departureTime: new Date() }
);
console.log(eta.etaDate, eta.confidence);
Capability spec
See the canonical capability
specification (requirements + scenarios + **Verified by:** links).