@aturi.to/waypoints 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +86 -0
- package/dist/index.cjs +1351 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +262 -0
- package/dist/index.d.ts +262 -0
- package/dist/index.js +1327 -0
- package/dist/index.js.map +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/waypoints.data.ts","../src/uriParser.ts","../src/reverseParsers.ts","../src/resolve.ts"],"names":["identifier"],"mappings":";;;AA+DO,IAAM,eAAA,GAAkE;AAAA,EAC7E,gBAAA,EAAkB;AAAA,IAChB,EAAA,EAAI,gBAAA;AAAA,IACJ,IAAA,EAAM,iBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,EAAA,EAAI,eAAA;AAAA,IACJ,IAAA,EAAM,cAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,OAAA,EAAS;AAAA,IACP,EAAA,EAAI,SAAA;AAAA,IACJ,IAAA,EAAM,SAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,EAAA,EAAI,QAAA;AAAA,IACJ,IAAA,EAAM,QAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,KAAA,EAAO;AAAA,IACL,EAAA,EAAI,OAAA;AAAA,IACJ,IAAA,EAAM,OAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,OAAA,EAAS;AAAA,IACP,EAAA,EAAI,SAAA;AAAA,IACJ,IAAA,EAAM,UAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,EAAA,EAAI,QAAA;AAAA,IACJ,IAAA,EAAM,QAAA;AAAA,IACN,WAAA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index.cjs","sourcesContent":["export type WaypointType = 'post' | 'profile' | 'list' | 'record' | 'unknown';\n\n/**\n * Keys identifying which \"data family\" a waypoint belongs to for auto-redirect\n * purposes. Two waypoints can only be the endpoints of an auto-redirect when\n * they share at least one family key (i.e. they render the same underlying\n * atproto collections). Display groupings live in `WAYPOINT_CATEGORIES_DATA`\n * and are independent of this.\n */\nexport type RedirectCompatFamily =\n | 'bluesky-social'\n | 'standard-site'\n | 'tangled'\n | 'margin'\n | 'grain'\n | 'pinksky'\n | 'semble'\n | 'streamplace'\n | 'popfeed'\n | 'sifa'\n | 'blento';\n\nexport type WaypointData = {\n id: string;\n name: string;\n description: string | ((collection?: string, type?: WaypointType) => string);\n getUrl: (handle: string, collection?: string, rkey?: string, did?: string) => string | null;\n supportedTypes: WaypointType[];\n category: string;\n /**\n * Data families this waypoint participates in. Auto-redirect rules are only\n * emitted between waypoints that share at least one family. An empty array\n * means the waypoint can never be an auto-redirect source *or* destination\n * (dev tools / generic record viewers land here by design).\n */\n redirectCompat: RedirectCompatFamily[];\n /**\n * NSID prefixes that signal this waypoint is meaningfully usable for the\n * target repo. When set, the extension can call describeRepo on the target\n * DID and check whether any of the user's collections start with one of\n * these prefixes — if none do, the waypoint is flagged as \"no records\n * found\" in the popup and demoted in smart recommendations.\n *\n * Use trailing-dot prefixes for whole namespaces (e.g. `'sh.tangled.'`)\n * or full NSIDs for single-collection apps. Atmosphere apps typically\n * declare a reversed-domain prefix (`semble.so` → `so.semble.`) so the\n * popup can flag accounts that haven't published any of that app's\n * records. Omit the field entirely for generic explorers (PDSls,\n * atp.tools, Aturi) — those stay in the \"unknown\" / no-opinion state.\n */\n expectedCollections?: string[];\n};\n\nexport type CompatFamilyMeta = {\n id: RedirectCompatFamily;\n name: string;\n description: string;\n};\n\n/**\n * Registry of compat families. `description` is shown in the options UI so the\n * user understands what each \"Favorite for X\" controls.\n */\nexport const COMPAT_FAMILIES: Record<RedirectCompatFamily, CompatFamilyMeta> = {\n 'bluesky-social': {\n id: 'bluesky-social',\n name: 'Bluesky clients',\n description: 'Apps that render bsky posts, profiles, and lists at /profile/:handle.',\n },\n 'standard-site': {\n id: 'standard-site',\n name: 'Publications',\n description: 'Readers for Standard Site and Leaflet publications.',\n },\n tangled: {\n id: 'tangled',\n name: 'Tangled',\n description: 'Tangled repositories and related records.',\n },\n margin: {\n id: 'margin',\n name: 'Margin',\n description: 'Annotations, highlights, and bookmarks on margin.at.',\n },\n grain: {\n id: 'grain',\n name: 'Grain',\n description: 'Photo galleries on grain.social.',\n },\n pinksky: {\n id: 'pinksky',\n name: 'Pinkleap',\n description: 'Pinkleap browsing experience.',\n },\n semble: {\n id: 'semble',\n name: 'Semble',\n description: 'Semble profiles.',\n },\n streamplace: {\n id: 'streamplace',\n name: 'Streamplace',\n description: 'Streamplace profiles.',\n },\n popfeed: {\n id: 'popfeed',\n name: 'Popfeed',\n description: 'Popfeed profiles.',\n },\n sifa: {\n id: 'sifa',\n name: 'Sifa',\n description: 'Sifa profiles.',\n },\n blento: {\n id: 'blento',\n name: 'Blento',\n description: 'Blento profiles.',\n },\n};\n\nexport const COMPAT_FAMILY_ORDER: RedirectCompatFamily[] = [\n 'bluesky-social',\n 'standard-site',\n 'pinksky',\n 'tangled',\n 'margin',\n 'grain',\n 'semble',\n 'streamplace',\n 'popfeed',\n 'sifa',\n 'blento',\n];\n\nexport type WaypointCategoryData = {\n id: string;\n name: string;\n description?: string;\n defaultWaypointId: string;\n subcategories?: WaypointCategoryData[];\n};\n\nexport type CategorizedWaypointsData = {\n category: WaypointCategoryData;\n waypoints: WaypointData[];\n};\n\nexport const WAYPOINT_DESTINATIONS_DATA: Record<string, WaypointData> = {\n aturi: {\n id: 'aturi',\n name: 'Aturi',\n description: (collection) => {\n if (collection === 'app.bsky.feed.post') return 'View post on aturi.to';\n if (collection === 'app.bsky.graph.list') return 'View list on aturi.to';\n if (collection?.startsWith('site.standard.') || collection?.startsWith('pub.leaflet.')) {\n return 'View document on aturi.to';\n }\n if (collection) return 'View record on aturi.to';\n return 'View profile on aturi.to';\n },\n getUrl: (handle, collection, rkey, did) => {\n if (collection && rkey) {\n if (collection === 'app.bsky.feed.post') {\n return `https://aturi.to/profile/${handle}/post/${rkey}`;\n }\n if (collection === 'app.bsky.graph.list') {\n return `https://aturi.to/profile/${handle}/lists/${rkey}`;\n }\n // Generic AT-record viewer; prefer the DID (stable across handle changes)\n // when one is available, falling back to the handle otherwise.\n const identifier = did || handle;\n return `https://aturi.to/profile/${identifier}/${collection}/${rkey}`;\n }\n return `https://aturi.to/profile/${handle}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'atmosphereApps',\n redirectCompat: ['bluesky-social', 'standard-site'],\n },\n\n anisota: {\n id: 'anisota',\n name: 'Anisota',\n description: (collection) => {\n if (collection === 'app.bsky.feed.post') return 'View post on anisota.net';\n if (collection === 'app.bsky.graph.list') return 'View list on anisota.net';\n if (collection?.startsWith('site.standard.') || collection?.startsWith('pub.leaflet.')) {\n return 'View document on anisota.net';\n }\n return 'View profile on anisota.net';\n },\n getUrl: (handle, collection, rkey, did) => {\n if (collection && rkey) {\n if (collection === 'app.bsky.feed.post') {\n return `https://anisota.net/profile/${handle}/post/${rkey}`;\n }\n if (collection === 'app.bsky.graph.list') {\n return `https://anisota.net/profile/${handle}/lists/${rkey}`;\n }\n if (collection.startsWith('site.standard.') || collection.startsWith('pub.leaflet.')) {\n // Anisota's document viewer addresses records by DID when available.\n const identifier = did || handle;\n return `https://anisota.net/profile/${identifier}/document/${rkey}`;\n }\n return `https://anisota.net/profile/${handle}`;\n }\n return `https://anisota.net/profile/${handle}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'blueskyClients',\n redirectCompat: ['bluesky-social', 'standard-site'],\n expectedCollections: ['app.bsky.', 'net.anisota.'],\n },\n\n bluesky: {\n id: 'bluesky',\n name: 'Bluesky',\n description: (collection) => {\n if (collection === 'app.bsky.feed.post') return 'View post on bsky.app';\n if (collection === 'app.bsky.graph.list') return 'View list on bsky.app';\n return 'View profile on bsky.app';\n },\n getUrl: (handle, collection, rkey) => {\n if (collection && rkey) {\n if (collection === 'app.bsky.feed.post') {\n return `https://bsky.app/profile/${handle}/post/${rkey}`;\n }\n return `https://bsky.app/profile/${handle}`;\n }\n return `https://bsky.app/profile/${handle}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'blueskyClients',\n redirectCompat: ['bluesky-social'],\n expectedCollections: ['app.bsky.'],\n },\n\n blacksky: {\n id: 'blacksky',\n name: 'Blacksky',\n description: (collection) => {\n if (collection === 'app.bsky.feed.post') return 'View post on blacksky.community';\n if (collection === 'app.bsky.graph.list') return 'View list on blacksky.community';\n return 'View profile on blacksky.community';\n },\n getUrl: (handle, collection, rkey) => {\n if (collection && rkey) {\n if (collection === 'app.bsky.feed.post') {\n return `https://blacksky.community/profile/${handle}/post/${rkey}`;\n }\n return `https://blacksky.community/profile/${handle}`;\n }\n return `https://blacksky.community/profile/${handle}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'blueskyForks',\n redirectCompat: ['bluesky-social'],\n expectedCollections: ['app.bsky.'],\n },\n\n reddwarf: {\n id: 'reddwarf',\n name: 'Red Dwarf',\n description: (collection) => {\n if (collection === 'app.bsky.feed.post') return 'View post on reddwarf.app';\n if (collection === 'app.bsky.graph.list') return 'View list on reddwarf.app';\n return 'View profile on reddwarf.app';\n },\n getUrl: (handle, collection, rkey) => {\n if (collection && rkey) {\n if (collection === 'app.bsky.feed.post') {\n return `https://reddwarf.app/profile/${handle}/post/${rkey}`;\n }\n return `https://reddwarf.app/profile/${handle}`;\n }\n return `https://reddwarf.app/profile/${handle}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'blueskyForks',\n redirectCompat: ['bluesky-social'],\n expectedCollections: ['app.bsky.'],\n },\n\n leaflet: {\n id: 'leaflet',\n name: 'Leaflet',\n description: 'View profile on leaflet.pub',\n getUrl: (handle) => {\n return `https://leaflet.pub/p/${handle}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'publications',\n redirectCompat: ['standard-site'],\n expectedCollections: ['pub.leaflet.', 'site.standard.'],\n },\n\n pdsls: {\n id: 'pdsls',\n name: 'PDSls',\n description: 'View raw record on pdsls.dev',\n getUrl: (handle, collection, rkey, did) => {\n const identifier = did || handle;\n if (collection && rkey) {\n return `https://pdsls.dev/at://${identifier}/${collection}/${rkey}`;\n }\n return `https://pdsls.dev/at://${identifier}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'devTools',\n redirectCompat: [],\n },\n\n aturiExplore: {\n id: 'aturiExplore',\n name: 'Aturi Explore',\n description: (collection) => {\n if (collection) return 'Inspect record on aturi.to/explore';\n return 'Browse repo on aturi.to/explore';\n },\n getUrl: (handle, collection, rkey, did) => {\n // The explorer keys URLs by DID when available so handle changes don't\n // break shared links. Falls back to the handle when no DID was passed.\n const identifier = did || handle;\n if (collection && rkey) {\n return `https://aturi.to/explore/${identifier}/${collection}/${encodeURIComponent(rkey)}`;\n }\n if (collection) {\n return `https://aturi.to/explore/${identifier}/${collection}`;\n }\n return `https://aturi.to/explore/${identifier}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'devTools',\n redirectCompat: [],\n },\n\n atptools: {\n id: 'atptools',\n name: 'atp.tools',\n description: 'View raw record on atp.tools',\n getUrl: (handle, collection, rkey, did) => {\n const identifier = did || handle;\n if (collection && rkey) {\n return `https://atp.tools/at:/${identifier}/${collection}/${rkey}`;\n }\n return `https://atp.tools/at:/${identifier}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'devTools',\n redirectCompat: [],\n },\n\n bluepy: {\n id: 'bluepy',\n name: 'Bluepy',\n description: (collection) => {\n if (collection === 'app.bsky.feed.post') return 'View post on bluepy.social';\n if (collection === 'app.bsky.graph.list') return 'View list on bluepy.social';\n if (collection) return 'View record on bluepy.social';\n return 'View profile on bluepy.social';\n },\n getUrl: (handle, collection, rkey, did) => {\n const identifier = did || handle;\n if (collection && rkey) {\n return `https://bluepy.social/at://${identifier}/${collection}/${rkey}`;\n }\n return `https://bluepy.social/at://${identifier}/app.bsky.actor.profile/self`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'blueskyClients',\n redirectCompat: ['bluesky-social'],\n expectedCollections: ['app.bsky.'],\n },\n\n witchsky: {\n id: 'witchsky',\n name: 'Witchsky',\n description: (collection) => {\n if (collection === 'app.bsky.feed.post') return 'View post on witchsky.app';\n if (collection === 'app.bsky.graph.list') return 'View list on witchsky.app';\n return 'View profile on witchsky.app';\n },\n getUrl: (handle, collection, rkey) => {\n if (collection && rkey) {\n if (collection === 'app.bsky.feed.post') {\n return `https://witchsky.app/profile/${handle}/post/${rkey}`;\n }\n return `https://witchsky.app/profile/${handle}`;\n }\n return `https://witchsky.app/profile/${handle}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'blueskyForks',\n redirectCompat: ['bluesky-social'],\n expectedCollections: ['app.bsky.'],\n },\n\n catsky: {\n id: 'catsky',\n name: 'Catsky',\n description: (collection) => {\n if (collection === 'app.bsky.feed.post') return 'View post on catsky.social';\n if (collection === 'app.bsky.graph.list') return 'View list on catsky.social';\n return 'View profile on catsky.social';\n },\n getUrl: (handle, collection, rkey) => {\n if (collection && rkey) {\n if (collection === 'app.bsky.feed.post') {\n return `https://catsky.social/profile/${handle}/post/${rkey}`;\n }\n return `https://catsky.social/profile/${handle}`;\n }\n return `https://catsky.social/profile/${handle}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'blueskyForks',\n redirectCompat: ['bluesky-social'],\n expectedCollections: ['app.bsky.'],\n },\n\n deer: {\n id: 'deer',\n name: 'Deer',\n description: (collection) => {\n if (collection === 'app.bsky.feed.post') return 'View post on deer.social';\n if (collection === 'app.bsky.graph.list') return 'View list on deer.social';\n return 'View profile on deer.social';\n },\n getUrl: (handle, collection, rkey) => {\n if (collection && rkey) {\n if (collection === 'app.bsky.feed.post') {\n return `https://deer.social/profile/${handle}/post/${rkey}`;\n }\n return `https://deer.social/profile/${handle}`;\n }\n return `https://deer.social/profile/${handle}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'blueskyForks',\n redirectCompat: ['bluesky-social'],\n expectedCollections: ['app.bsky.'],\n },\n\n tangled: {\n id: 'tangled',\n name: 'Tangled',\n description: 'View profile on tangled.org',\n getUrl: (handle) => {\n return `https://tangled.org/${handle}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'atmosphereApps',\n redirectCompat: ['tangled'],\n expectedCollections: ['sh.tangled.'],\n },\n\n\n pinksky: {\n id: 'pinksky',\n name: 'Pinkleap',\n description: (collection) => {\n if (collection === 'app.bsky.feed.post') return 'View post on pinkleap.app';\n return 'View profile on pinkleap.app';\n },\n getUrl: (handle, collection, rkey, did) => {\n if (collection && rkey) {\n if (collection === 'app.bsky.feed.post') {\n const identifier = did || handle;\n const atUri = `at://${identifier}/${collection}/${rkey}`;\n const encodedUri = encodeURIComponent(atUri);\n const encodedDid = encodeURIComponent(identifier);\n return `https://pinkleap.app/feed?uri=${encodedUri}&src=profile&index=1&did=${encodedDid}&showThreads=${encodedDid}`;\n }\n return `https://pinkleap.app/profile/${handle}`;\n }\n return `https://pinkleap.app/profile/${handle}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'atmosphereApps',\n redirectCompat: ['pinksky'],\n expectedCollections: ['app.bsky.'],\n },\n\n margin: {\n id: 'margin',\n name: 'Margin',\n description: (collection) => {\n if (collection === 'at.margin.annotation') return 'View annotation on margin.at';\n if (collection === 'at.margin.highlight') return 'View highlight on margin.at';\n if (collection === 'at.margin.bookmark') return 'View bookmark on margin.at';\n if (collection?.startsWith('at.margin.')) return 'View on margin.at';\n return 'View profile on margin.at';\n },\n getUrl: (handle, collection, rkey, did) => {\n if (collection && rkey && collection.startsWith('at.margin.')) {\n const recordType = collection.replace('at.margin.', '');\n const identifier = did || handle;\n\n if (recordType === 'annotation' || recordType === 'highlight' || recordType === 'bookmark') {\n const handleLooksLikeDomain = handle.includes('.') && !handle.startsWith('did:');\n const domain = handleLooksLikeDomain ? handle : identifier;\n\n return `https://margin.at/${domain}/${recordType}/${rkey}`;\n }\n\n return `https://margin.at/profile/${identifier}`;\n }\n\n const identifier = did || handle;\n return `https://margin.at/profile/${identifier}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'atmosphereApps',\n redirectCompat: ['margin'],\n expectedCollections: ['at.margin.'],\n },\n\n semble: {\n id: 'semble',\n name: 'Semble',\n description: 'View profile on semble.so',\n getUrl: (handle) => {\n return `https://semble.so/profile/${handle}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'atmosphereApps',\n redirectCompat: ['semble'],\n expectedCollections: ['so.semble.'],\n },\n\n streamplace: {\n id: 'streamplace',\n name: 'Streamplace',\n description: 'View profile on stream.place',\n getUrl: (handle) => {\n return `https://stream.place/${handle}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'atmosphereApps',\n redirectCompat: ['streamplace'],\n expectedCollections: ['place.stream.'],\n },\n\n grain: {\n id: 'grain',\n name: 'Grain',\n description: (collection) => {\n if (collection === 'social.grain.gallery') return 'View gallery on grain.social';\n return 'View profile on grain.social';\n },\n getUrl: (handle, collection, rkey, did) => {\n const identifier = did || handle;\n if (collection === 'social.grain.gallery' && rkey) {\n return `https://grain.social/profile/${identifier}/gallery/${rkey}`;\n }\n return `https://grain.social/profile/${identifier}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'atmosphereApps',\n redirectCompat: ['grain'],\n expectedCollections: ['social.grain.'],\n },\n\n popfeed: {\n id: 'popfeed',\n name: 'Popfeed',\n description: 'View profile on popfeed.social',\n getUrl: (handle, collection, rkey, did) => {\n const identifier = did || handle;\n return `https://popfeed.social/profile/${identifier}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'atmosphereApps',\n redirectCompat: ['popfeed'],\n expectedCollections: ['social.popfeed.'],\n },\n\n sifa: {\n id: 'sifa',\n name: 'Sifa',\n description: 'View profile on sifa.id',\n getUrl: (handle) => {\n return `https://sifa.id/p/${handle}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'atmosphereApps',\n redirectCompat: ['sifa'],\n expectedCollections: ['id.sifa.'],\n },\n\n blento: {\n id: 'blento',\n name: 'Blento',\n description: 'View profile on blento.app',\n getUrl: (handle) => {\n return `https://blento.app/${handle}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'atmosphereApps',\n redirectCompat: ['blento'],\n expectedCollections: ['app.blento.'],\n },\n\n anisotaReader: {\n id: 'anisotaReader',\n name: 'Anisota Reader',\n description: (collection) => {\n if (collection?.startsWith('site.standard.') || collection?.startsWith('pub.leaflet.')) {\n return 'Read document on anisota.net';\n }\n return 'View publications on anisota.net';\n },\n getUrl: (handle, collection, rkey, did) => {\n if (collection && rkey) {\n if (collection.startsWith('site.standard.') || collection.startsWith('pub.leaflet.')) {\n const identifier = did || handle;\n return `https://anisota.net/profile/${identifier}/document/${rkey}`;\n }\n }\n return `https://anisota.net/profile/${handle}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'publications',\n redirectCompat: ['standard-site'],\n expectedCollections: ['pub.leaflet.', 'site.standard.'],\n },\n\n offprint: {\n id: 'offprint',\n name: 'Offprint',\n description: (collection) => {\n if (collection?.startsWith('site.standard.') || collection?.startsWith('pub.leaflet.')) {\n return 'Read document on offprint.app';\n }\n return 'View on offprint.app';\n },\n getUrl: (handle, collection, rkey, did) => {\n // offprint only has record-level URLs; without a collection+rkey there's\n // no meaningful destination, so hide the waypoint in profile-only views.\n if (!collection || !rkey) return null;\n const identifier = did || handle;\n return `https://offprint.app/${identifier}/${collection}/${rkey}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'publications',\n redirectCompat: ['standard-site'],\n expectedCollections: ['pub.leaflet.', 'site.standard.'],\n },\n\n pckt: {\n id: 'pckt',\n name: 'pckt',\n description: (collection) => {\n if (collection?.startsWith('site.standard.') || collection?.startsWith('pub.leaflet.')) {\n return 'Read document on pckt.blog';\n }\n return 'View on pckt.blog';\n },\n getUrl: (handle, collection, rkey, did) => {\n // pckt only has record-level URLs; without a collection+rkey there's no\n // meaningful destination, so hide the waypoint in profile-only views.\n if (!collection || !rkey) return null;\n const identifier = did || handle;\n return `https://pckt.blog/${identifier}/${collection}/${rkey}`;\n },\n supportedTypes: ['post', 'profile', 'list', 'record'],\n category: 'publications',\n redirectCompat: ['standard-site'],\n expectedCollections: ['pub.leaflet.', 'site.standard.'],\n },\n};\n\nexport const WAYPOINT_ORDER = [\n 'anisota',\n 'bluesky',\n 'bluepy',\n 'blacksky',\n 'reddwarf',\n 'leaflet',\n 'aturi',\n 'pinksky',\n 'margin',\n 'semble',\n 'streamplace',\n 'grain',\n 'popfeed',\n 'sifa',\n 'blento',\n 'anisotaReader',\n 'offprint',\n 'pckt',\n 'aturiExplore',\n 'pdsls',\n 'tangled',\n 'atptools',\n 'witchsky',\n 'catsky',\n 'deer',\n];\n\nexport function getWaypointDataForType(type: WaypointType): WaypointData[] {\n return WAYPOINT_ORDER\n .map(id => WAYPOINT_DESTINATIONS_DATA[id])\n .filter(waypoint => waypoint.supportedTypes.includes(type));\n}\n\nexport function getWaypointCountData(): number {\n return WAYPOINT_ORDER.length;\n}\n\nexport const WAYPOINT_CATEGORIES_DATA: Record<string, WaypointCategoryData> = {\n blueskyClients: {\n id: 'blueskyClients',\n name: 'Bluesky Clients',\n description: 'Official and alternative Bluesky clients',\n defaultWaypointId: 'bluesky',\n subcategories: [{\n id: 'blueskyForks',\n name: 'Bluesky Forks',\n description: 'Community-built Bluesky variants',\n defaultWaypointId: 'blacksky',\n }],\n },\n blueskyForks: {\n id: 'blueskyForks',\n name: 'Bluesky Forks',\n description: 'Community-built Bluesky variants',\n defaultWaypointId: 'blacksky',\n },\n publications: {\n id: 'publications',\n name: 'Publications',\n description: 'Readers for Standard Site and Leaflet publications',\n defaultWaypointId: 'leaflet',\n },\n atmosphereApps: {\n id: 'atmosphereApps',\n name: 'Atmosphere',\n description: 'Apps built on the AT Protocol',\n defaultWaypointId: 'tangled',\n },\n devTools: {\n id: 'devTools',\n name: 'Dev Tools',\n description: 'Tools for developers and debugging',\n defaultWaypointId: 'aturiExplore',\n },\n};\n\nexport const CATEGORY_ORDER = [\n 'blueskyClients',\n 'blueskyForks',\n 'publications',\n 'atmosphereApps',\n 'devTools',\n];\n\nexport function getCategorizedWaypointsData(type: WaypointType): CategorizedWaypointsData[] {\n const availableWaypoints = getWaypointDataForType(type);\n const categorized: CategorizedWaypointsData[] = [];\n\n // Categories that are declared as subcategories of another category should\n // not also appear as standalone top-level categories. Their waypoints will\n // be rendered nested under their parent by the picker.\n const subcategoryIds = new Set<string>();\n for (const category of Object.values(WAYPOINT_CATEGORIES_DATA)) {\n for (const subcat of category.subcategories ?? []) {\n subcategoryIds.add(subcat.id);\n }\n }\n\n for (const categoryId of CATEGORY_ORDER) {\n if (subcategoryIds.has(categoryId)) continue;\n\n const category = WAYPOINT_CATEGORIES_DATA[categoryId];\n const waypoints = availableWaypoints.filter(w => w.category === categoryId);\n\n if (waypoints.length > 0) {\n categorized.push({ category, waypoints });\n }\n }\n\n return categorized;\n}\n\ntype RecommendedConfig = {\n waypointIds: string[];\n label?: string;\n};\n\nconst RECOMMENDED_WAYPOINTS: Record<string, RecommendedConfig> = {\n 'app.bsky.feed.post': {\n waypointIds: ['bluesky', 'anisota', 'blacksky'],\n label: 'Recommended for Posts',\n },\n 'profile': {\n waypointIds: ['bluesky', 'anisota'],\n label: 'Recommended for Profiles',\n },\n 'app.bsky.graph.list': {\n waypointIds: ['bluesky', 'anisota'],\n label: 'Recommended for Lists',\n },\n 'community.lexicon.calendar.event': {\n waypointIds: ['aturiExplore', 'pdsls', 'atptools'],\n label: 'Recommended for Events',\n },\n 'sh.tangled.repo': {\n waypointIds: ['tangled'],\n label: 'Recommended for Repos',\n },\n 'record': {\n waypointIds: ['aturiExplore', 'pdsls', 'atptools'],\n label: 'Recommended for Records',\n },\n};\n\n/**\n * Recommendations keyed by collection NSID prefix. When a collection is checked,\n * we walk its dotted segments from longest to shortest looking for a registered\n * prefix (e.g. `standard.site.blog.entry` matches `standard.site`). Use this for\n * apps/lexicons that own a whole namespace and have a consistent set of compatible\n * waypoints across all of their record types.\n */\nconst RECOMMENDED_NAMESPACE_PREFIXES: Record<string, RecommendedConfig> = {\n 'site.standard': {\n waypointIds: ['leaflet', 'anisotaReader', 'offprint', 'pckt', 'pdsls'],\n label: 'Recommended for Publications',\n },\n 'pub.leaflet': {\n waypointIds: ['leaflet', 'anisotaReader', 'offprint', 'pckt', 'pdsls'],\n label: 'Recommended for Publications',\n },\n 'sh.tangled': {\n waypointIds: ['tangled', 'pdsls', 'atptools'],\n label: 'Recommended for Tangled',\n },\n 'at.margin': {\n waypointIds: ['margin', 'pdsls', 'atptools'],\n label: 'Recommended for Margin',\n },\n 'social.grain': {\n waypointIds: ['grain', 'pdsls', 'atptools'],\n label: 'Recommended for Grain',\n },\n};\n\nfunction findNamespacePrefixMatch(collection: string): RecommendedConfig | undefined {\n const segments = collection.split('.');\n for (let i = segments.length - 1; i >= 2; i--) {\n const prefix = segments.slice(0, i).join('.');\n if (RECOMMENDED_NAMESPACE_PREFIXES[prefix]) {\n return RECOMMENDED_NAMESPACE_PREFIXES[prefix];\n }\n }\n return undefined;\n}\n\nexport function getRecommendedWaypointsData(\n type: WaypointType,\n collection?: string\n): { waypoints: WaypointData[]; label: string } {\n let config: RecommendedConfig | undefined;\n\n if (collection && RECOMMENDED_WAYPOINTS[collection]) {\n config = RECOMMENDED_WAYPOINTS[collection];\n } else if (collection) {\n config = findNamespacePrefixMatch(collection);\n }\n\n if (!config && RECOMMENDED_WAYPOINTS[type]) {\n config = RECOMMENDED_WAYPOINTS[type];\n }\n\n if (!config) {\n config = {\n waypointIds: ['bluesky'],\n label: 'Recommended',\n };\n }\n\n const waypoints = config.waypointIds\n .map(id => WAYPOINT_DESTINATIONS_DATA[id])\n .filter(Boolean);\n\n return {\n waypoints,\n label: config.label || 'Recommended',\n };\n}\n\nexport function getFeaturedWaypointData(\n type: WaypointType,\n collection?: string\n): WaypointData | null {\n const { waypoints } = getRecommendedWaypointsData(type, collection);\n return waypoints[0] || null;\n}\n\n/**\n * Result of comparing a waypoint's `expectedCollections` against the set of\n * NSIDs found in the target repo.\n *\n * - 'present' — the user has at least one record under a matching prefix.\n * - 'absent' — the waypoint declared collections but none are in the repo.\n * - 'unknown' — the waypoint didn't declare any expectations, or we\n * haven't scanned the repo yet (e.g. scan disabled, no DID).\n */\nexport type WaypointActivity = 'present' | 'absent' | 'unknown';\n\n/**\n * Classify a waypoint against the set of collection NSIDs known to exist on\n * the target repo. Prefix-matches each entry in `expectedCollections` against\n * `repoCollections`. Returns 'unknown' when the waypoint has no declared\n * expectations or the caller passed `null` for `repoCollections` (i.e. scan\n * disabled or still in flight).\n */\nexport function waypointActivity(\n waypoint: Pick<WaypointData, 'expectedCollections'>,\n repoCollections: ReadonlySet<string> | null,\n): WaypointActivity {\n if (!repoCollections) return 'unknown';\n const expected = waypoint.expectedCollections;\n if (!expected || expected.length === 0) return 'unknown';\n for (const c of repoCollections) {\n for (const prefix of expected) {\n if (c === prefix || c.startsWith(prefix)) return 'present';\n }\n }\n return 'absent';\n}\n","export type ParsedURI = {\n type: 'post' | 'profile' | 'list' | 'record' | 'unknown';\n uri: string;\n handle: string;\n did?: string;\n collection?: string;\n rkey?: string;\n error?: string;\n};\n\n/**\n * Parse URL path segments into structured AT URI data\n * Examples:\n * - /alice.bsky.social -> profile\n * - /alice.bsky.social/app.bsky.feed.post/3k7qw... -> post\n * - /did:plc:xxx/app.bsky.graph.list/abc -> list\n */\nexport function parseURI(handle: string, collection?: string, rkey?: string): ParsedURI {\n // Handle is required\n if (!handle) {\n return {\n type: 'unknown',\n uri: '',\n handle: '',\n error: 'Handle or DID is required',\n };\n }\n\n // Profile case (no collection/rkey)\n if (!collection && !rkey) {\n return {\n type: 'profile',\n uri: `at://${handle}`,\n handle,\n did: handle.startsWith('did:') ? handle : undefined,\n };\n }\n\n // Record case (has collection and rkey)\n if (collection && rkey) {\n let type: 'post' | 'list' | 'record' = 'record';\n \n if (collection === 'app.bsky.feed.post') {\n type = 'post';\n } else if (collection === 'app.bsky.graph.list') {\n type = 'list';\n }\n // All other collections are treated as generic records\n\n return {\n type,\n uri: `at://${handle}/${collection}/${rkey}`,\n handle,\n did: handle.startsWith('did:') ? handle : undefined,\n collection,\n rkey,\n };\n }\n\n // Invalid case\n return {\n type: 'unknown',\n uri: '',\n handle,\n error: 'Invalid URI structure',\n };\n}\n\n/**\n * Resolve a handle to a DID using the Bluesky API\n */\nexport async function resolveHandle(handle: string): Promise<string | null> {\n if (handle.startsWith('did:')) {\n return handle;\n }\n\n try {\n const apiUrl = process.env.NEXT_PUBLIC_BSKY_API_URL || 'https://public.api.bsky.app';\n const response = await fetch(\n `${apiUrl}/xrpc/com.atproto.identity.resolveHandle?handle=${encodeURIComponent(handle)}`\n );\n\n if (!response.ok) {\n return null;\n }\n\n const data = await response.json();\n return data.did || null;\n } catch (error) {\n console.error('Error resolving handle:', error);\n return null;\n }\n}\n\n/**\n * Get display name from handle or DID\n */\nexport function getDisplayName(handle: string, did?: string): string {\n if (handle.startsWith('did:')) {\n return did ? `@${did.slice(0, 16)}...` : 'Unknown';\n }\n return `@${handle}`;\n}\n\n\n","import type { ParsedURI } from './uriParser';\n\nexport type SourceApp =\n | 'bluesky'\n | 'bluepy'\n | 'blacksky'\n | 'reddwarf'\n | 'witchsky'\n | 'catsky'\n | 'deer'\n | 'anisota'\n | 'pinksky'\n | 'leaflet'\n | 'tangled'\n | 'margin'\n | 'pdsls'\n | 'atptools'\n | 'semble'\n | 'streamplace'\n | 'grain'\n | 'popfeed'\n | 'sifa'\n | 'blento'\n | 'offprint'\n | 'pckt'\n | 'headDetected';\n\nexport type ReverseMatch = {\n source: SourceApp;\n parsed: ParsedURI;\n};\n\ntype HostConfig = {\n source: SourceApp;\n hosts: string[];\n};\n\n/**\n * Hosts that share the Bluesky-style `/profile/:handle[/(post|lists)/:rkey]` layout.\n */\nconst BLUESKY_FAMILY: HostConfig[] = [\n { source: 'bluesky', hosts: ['bsky.app'] },\n { source: 'blacksky', hosts: ['blacksky.community'] },\n { source: 'reddwarf', hosts: ['reddwarf.app'] },\n { source: 'witchsky', hosts: ['witchsky.app'] },\n { source: 'catsky', hosts: ['catsky.social'] },\n { source: 'deer', hosts: ['deer.social'] },\n { source: 'anisota', hosts: ['anisota.net'] },\n];\n\nfunction normalizeHost(host: string): string {\n return host.toLowerCase().replace(/^www\\./, '');\n}\n\nfunction matchBlueskyFamily(host: string, parts: string[]): ReverseMatch | null {\n const entry = BLUESKY_FAMILY.find(f => f.hosts.includes(host));\n if (!entry) return null;\n\n if (parts[0] !== 'profile' || !parts[1]) return null;\n const handle = parts[1];\n const did = handle.startsWith('did:') ? handle : undefined;\n\n if (!parts[2]) {\n return {\n source: entry.source,\n parsed: {\n type: 'profile',\n uri: `at://${handle}`,\n handle,\n did,\n },\n };\n }\n\n if (parts[2] === 'post' && parts[3]) {\n return {\n source: entry.source,\n parsed: {\n type: 'post',\n uri: `at://${handle}/app.bsky.feed.post/${parts[3]}`,\n handle,\n did,\n collection: 'app.bsky.feed.post',\n rkey: parts[3],\n },\n };\n }\n\n if ((parts[2] === 'lists' || parts[2] === 'list') && parts[3]) {\n return {\n source: entry.source,\n parsed: {\n type: 'list',\n uri: `at://${handle}/app.bsky.graph.list/${parts[3]}`,\n handle,\n did,\n collection: 'app.bsky.graph.list',\n rkey: parts[3],\n },\n };\n }\n\n return {\n source: entry.source,\n parsed: {\n type: 'profile',\n uri: `at://${handle}`,\n handle,\n did,\n },\n };\n}\n\nfunction inferType(collection: string): 'post' | 'list' | 'record' {\n if (collection === 'app.bsky.feed.post') return 'post';\n if (collection === 'app.bsky.graph.list') return 'list';\n return 'record';\n}\n\nfunction matchPinksky(host: string, parts: string[], search: URLSearchParams): ReverseMatch | null {\n if (host !== 'pinkleap.app') return null;\n\n if (parts[0] === 'feed') {\n const uri = search.get('uri');\n if (uri && uri.startsWith('at://')) {\n const stripped = uri.slice('at://'.length);\n const [handle, collection, rkey] = stripped.split('/');\n if (handle) {\n const did = handle.startsWith('did:') ? handle : undefined;\n if (collection && rkey) {\n return {\n source: 'pinksky',\n parsed: {\n type: inferType(collection),\n uri,\n handle,\n did,\n collection,\n rkey,\n },\n };\n }\n return {\n source: 'pinksky',\n parsed: { type: 'profile', uri: `at://${handle}`, handle, did },\n };\n }\n }\n }\n\n if (parts[0] === 'profile' && parts[1]) {\n const handle = parts[1];\n const did = handle.startsWith('did:') ? handle : undefined;\n return {\n source: 'pinksky',\n parsed: { type: 'profile', uri: `at://${handle}`, handle, did },\n };\n }\n\n return null;\n}\n\nfunction matchLeaflet(host: string, parts: string[]): ReverseMatch | null {\n if (host !== 'leaflet.pub') return null;\n if (parts[0] !== 'p' || !parts[1]) return null;\n const handle = parts[1];\n const did = handle.startsWith('did:') ? handle : undefined;\n return {\n source: 'leaflet',\n parsed: { type: 'profile', uri: `at://${handle}`, handle, did },\n };\n}\n\nfunction matchTangled(host: string, parts: string[]): ReverseMatch | null {\n if (host !== 'tangled.org') return null;\n if (!parts[0]) return null;\n const handle = parts[0];\n const did = handle.startsWith('did:') ? handle : undefined;\n return {\n source: 'tangled',\n parsed: { type: 'profile', uri: `at://${handle}`, handle, did },\n };\n}\n\nfunction matchMargin(host: string, parts: string[]): ReverseMatch | null {\n if (host !== 'margin.at') return null;\n\n if (parts[0] === 'profile' && parts[1]) {\n const handle = parts[1];\n const did = handle.startsWith('did:') ? handle : undefined;\n return {\n source: 'margin',\n parsed: { type: 'profile', uri: `at://${handle}`, handle, did },\n };\n }\n\n if (parts[0] && parts[1] && parts[2]) {\n const recordType = parts[1];\n if (recordType === 'annotation' || recordType === 'highlight' || recordType === 'bookmark') {\n const handle = parts[0];\n const did = handle.startsWith('did:') ? handle : undefined;\n const collection = `at.margin.${recordType}`;\n const rkey = parts[2];\n return {\n source: 'margin',\n parsed: {\n type: 'record',\n uri: `at://${handle}/${collection}/${rkey}`,\n handle,\n did,\n collection,\n rkey,\n },\n };\n }\n }\n\n return null;\n}\n\n/**\n * Parse a path segment of the form `at://identifier[/collection/rkey]` or\n * `at:/identifier[/collection/rkey]` used by pdsls.dev and atp.tools.\n *\n * The leading `at://` or `at:/` is collapsed by the URL parser so the raw\n * `pathname` exposes it as `/at:/identifier/...`. We accept both forms.\n */\nfunction parseAtUriPath(pathname: string): {\n handle: string;\n collection?: string;\n rkey?: string;\n} | null {\n const cleaned = pathname.replace(/^\\/+/, '');\n const match = cleaned.match(/^at:\\/{1,2}(.+)$/);\n if (!match) return null;\n const rest = match[1];\n const segments = rest.split('/').filter(Boolean);\n if (segments.length === 0) return null;\n return {\n handle: segments[0],\n collection: segments[1],\n rkey: segments[2],\n };\n}\n\nfunction matchPdsls(host: string, pathname: string): ReverseMatch | null {\n if (host !== 'pdsls.dev') return null;\n const atUri = parseAtUriPath(pathname);\n if (!atUri) return null;\n const { handle, collection, rkey } = atUri;\n const did = handle.startsWith('did:') ? handle : undefined;\n\n if (collection && rkey) {\n return {\n source: 'pdsls',\n parsed: {\n type: inferType(collection),\n uri: `at://${handle}/${collection}/${rkey}`,\n handle,\n did,\n collection,\n rkey,\n },\n };\n }\n\n return {\n source: 'pdsls',\n parsed: { type: 'profile', uri: `at://${handle}`, handle, did },\n };\n}\n\nfunction matchAtpTools(host: string, pathname: string): ReverseMatch | null {\n if (host !== 'atp.tools') return null;\n const atUri = parseAtUriPath(pathname);\n if (!atUri) return null;\n const { handle, collection, rkey } = atUri;\n const did = handle.startsWith('did:') ? handle : undefined;\n\n if (collection && rkey) {\n return {\n source: 'atptools',\n parsed: {\n type: inferType(collection),\n uri: `at://${handle}/${collection}/${rkey}`,\n handle,\n did,\n collection,\n rkey,\n },\n };\n }\n\n return {\n source: 'atptools',\n parsed: { type: 'profile', uri: `at://${handle}`, handle, did },\n };\n}\n\nfunction matchBluepy(host: string, pathname: string): ReverseMatch | null {\n if (host !== 'bluepy.social') return null;\n const atUri = parseAtUriPath(pathname);\n if (!atUri) return null;\n const { handle, collection, rkey } = atUri;\n const did = handle.startsWith('did:') ? handle : undefined;\n\n if (collection === 'app.bsky.actor.profile') {\n return {\n source: 'bluepy',\n parsed: { type: 'profile', uri: `at://${handle}`, handle, did },\n };\n }\n\n if (collection && rkey) {\n return {\n source: 'bluepy',\n parsed: {\n type: inferType(collection),\n uri: `at://${handle}/${collection}/${rkey}`,\n handle,\n did,\n collection,\n rkey,\n },\n };\n }\n\n return {\n source: 'bluepy',\n parsed: { type: 'profile', uri: `at://${handle}`, handle, did },\n };\n}\n\nfunction matchSemble(host: string, parts: string[]): ReverseMatch | null {\n if (host !== 'semble.so') return null;\n if (parts[0] !== 'profile' || !parts[1]) return null;\n const handle = parts[1];\n const did = handle.startsWith('did:') ? handle : undefined;\n return {\n source: 'semble',\n parsed: { type: 'profile', uri: `at://${handle}`, handle, did },\n };\n}\n\nfunction matchStreamplace(host: string, parts: string[]): ReverseMatch | null {\n if (host !== 'stream.place') return null;\n if (!parts[0]) return null;\n const handle = parts[0];\n const did = handle.startsWith('did:') ? handle : undefined;\n return {\n source: 'streamplace',\n parsed: { type: 'profile', uri: `at://${handle}`, handle, did },\n };\n}\n\nfunction matchGrain(host: string, parts: string[]): ReverseMatch | null {\n if (host !== 'grain.social') return null;\n if (parts[0] !== 'profile' || !parts[1]) return null;\n const handle = parts[1];\n const did = handle.startsWith('did:') ? handle : undefined;\n\n if (parts[2] === 'gallery' && parts[3]) {\n return {\n source: 'grain',\n parsed: {\n type: 'record',\n uri: `at://${handle}/social.grain.gallery/${parts[3]}`,\n handle,\n did,\n collection: 'social.grain.gallery',\n rkey: parts[3],\n },\n };\n }\n\n return {\n source: 'grain',\n parsed: { type: 'profile', uri: `at://${handle}`, handle, did },\n };\n}\n\nfunction matchPopfeed(host: string, parts: string[]): ReverseMatch | null {\n if (host !== 'popfeed.social') return null;\n if (parts[0] !== 'profile' || !parts[1]) return null;\n const handle = parts[1];\n const did = handle.startsWith('did:') ? handle : undefined;\n return {\n source: 'popfeed',\n parsed: { type: 'profile', uri: `at://${handle}`, handle, did },\n };\n}\n\nfunction matchSifa(host: string, parts: string[]): ReverseMatch | null {\n if (host !== 'sifa.id') return null;\n if (parts[0] !== 'p' || !parts[1]) return null;\n const handle = parts[1];\n const did = handle.startsWith('did:') ? handle : undefined;\n return {\n source: 'sifa',\n parsed: { type: 'profile', uri: `at://${handle}`, handle, did },\n };\n}\n\nfunction matchBlento(host: string, parts: string[]): ReverseMatch | null {\n if (host !== 'blento.app') return null;\n if (!parts[0]) return null;\n const handle = parts[0];\n const did = handle.startsWith('did:') ? handle : undefined;\n return {\n source: 'blento',\n parsed: { type: 'profile', uri: `at://${handle}`, handle, did },\n };\n}\n\n/**\n * Reverse-match any supported Aturi waypoint site URL back into a structured\n * ParsedURI (handle/collection/rkey). Returns `null` if the URL isn't on a\n * supported site or isn't a shape we recognize.\n */\nexport function matchSupportedUrl(url: URL): ReverseMatch | null {\n const host = normalizeHost(url.hostname);\n const parts = url.pathname.split('/').filter(Boolean);\n const search = url.searchParams;\n\n return (\n matchBlueskyFamily(host, parts) ||\n matchPinksky(host, parts, search) ||\n matchLeaflet(host, parts) ||\n matchTangled(host, parts) ||\n matchMargin(host, parts) ||\n matchPdsls(host, url.pathname) ||\n matchAtpTools(host, url.pathname) ||\n matchBluepy(host, url.pathname) ||\n matchSemble(host, parts) ||\n matchStreamplace(host, parts) ||\n matchGrain(host, parts) ||\n matchPopfeed(host, parts) ||\n matchSifa(host, parts) ||\n matchBlento(host, parts)\n );\n}\n\n/**\n * Parse an AT URI string (e.g. \"at://did:plc:abc123/collection/rkey\") into\n * its components. Used by head-based detection when an AT URI is found in\n * a <link> tag's href attribute.\n */\nexport function parseAtUri(uri: string): ReverseMatch | null {\n if (!uri.startsWith('at://')) return null;\n const rest = uri.slice('at://'.length);\n const segments = rest.split('/').filter(Boolean);\n if (segments.length === 0) return null;\n\n const handle = segments[0];\n const did = handle.startsWith('did:') ? handle : undefined;\n const collection = segments[1];\n const rkey = segments[2];\n\n if (collection && rkey) {\n return {\n source: 'headDetected' as SourceApp,\n parsed: {\n type: inferType(collection),\n uri,\n handle,\n did,\n collection,\n rkey,\n },\n };\n }\n\n return {\n source: 'headDetected' as SourceApp,\n parsed: { type: 'profile', uri: `at://${handle}`, handle, did },\n };\n}\n\n/**\n * All host names we know how to reverse-parse. Used by the popup + background\n * worker to decide if a tab is \"relevant\" before doing more expensive work.\n */\nexport const SUPPORTED_HOSTS: string[] = [\n ...BLUESKY_FAMILY.flatMap(e => e.hosts),\n 'pinkleap.app',\n 'leaflet.pub',\n 'tangled.org',\n 'margin.at',\n 'pdsls.dev',\n 'atp.tools',\n 'bluepy.social',\n 'semble.so',\n 'stream.place',\n 'grain.social',\n 'popfeed.social',\n 'sifa.id',\n 'blento.app',\n];\n","import {\n WAYPOINT_DESTINATIONS_DATA,\n WAYPOINT_ORDER,\n getRecommendedWaypointsData,\n type WaypointType,\n} from './waypoints.data';\nimport {\n matchSupportedUrl,\n parseAtUri,\n type SourceApp,\n} from './reverseParsers';\nimport type { ParsedURI } from './uriParser';\n\nexport type ResolvedWaypoint = {\n id: string;\n name: string;\n category: string;\n url: string;\n};\n\nexport type ResolvedRecommendation = {\n ids: string[];\n label: string;\n};\n\nexport type ResolveResult = {\n parsed: ParsedURI;\n source: SourceApp;\n did: string | null;\n didResolved: boolean;\n waypoints: ResolvedWaypoint[];\n recommended: ResolvedRecommendation;\n};\n\n/**\n * Waypoints whose `getUrl` only produces a useful destination when a DID is\n * available. These are filtered out unless a DID is known. Mirrors the hosted\n * aturi.to/api/resolve route exactly.\n */\nexport const DID_REQUIRED_WAYPOINTS: ReadonlySet<string> = new Set([\n 'pdsls',\n 'atptools',\n 'margin',\n 'grain',\n 'popfeed',\n]);\n\nexport type BuildWaypointsOptions = {\n /** DID to pass to each waypoint's getUrl. Falls back to `parsed.did`. */\n did?: string;\n /** Waypoint id to omit (e.g. the source app the user is already on). */\n excludeSourceId?: string;\n};\n\n/**\n * Turn a parsed AT URI into the list of waypoints that can render it plus the\n * recommended set, applying the DID-required filter and dropping waypoints\n * whose getUrl returns null. This is the framework-agnostic core of the\n * hosted resolve endpoint.\n */\nexport function buildWaypointsForParsed(\n parsed: ParsedURI,\n options: BuildWaypointsOptions = {},\n): { waypoints: ResolvedWaypoint[]; recommended: ResolvedRecommendation } {\n const did = options.did ?? parsed.did;\n const exclude = options.excludeSourceId;\n const type: WaypointType = parsed.type === 'unknown' ? 'profile' : parsed.type;\n\n const waypoints = WAYPOINT_ORDER.map((id) => WAYPOINT_DESTINATIONS_DATA[id])\n .filter((w): w is NonNullable<typeof w> => !!w)\n .filter((w) => w.id !== exclude)\n .filter((w) => w.supportedTypes.includes(type))\n .map((w): ResolvedWaypoint | null => {\n if (DID_REQUIRED_WAYPOINTS.has(w.id) && !did) return null;\n const url = w.getUrl(parsed.handle, parsed.collection, parsed.rkey, did);\n if (!url) return null;\n return { id: w.id, name: w.name, category: w.category, url };\n })\n .filter((w): w is ResolvedWaypoint => !!w);\n\n const recommendedRaw = getRecommendedWaypointsData(type, parsed.collection);\n const availableIds = new Set(waypoints.map((w) => w.id));\n const ids = recommendedRaw.waypoints\n .map((w) => w.id)\n .filter((id) => id !== exclude && availableIds.has(id));\n\n return { waypoints, recommended: { ids, label: recommendedRaw.label } };\n}\n\n/**\n * Resolve an AT URI string (e.g. \"at://did:plc:abc/app.bsky.feed.post/rkey\")\n * directly into its waypoints. Returns null if the string isn't a valid AT URI.\n */\nexport function resolveAtUri(uri: string): ResolveResult | null {\n const match = parseAtUri(uri);\n if (!match) return null;\n const { parsed, source } = match;\n const { waypoints, recommended } = buildWaypointsForParsed(parsed);\n return {\n parsed,\n source,\n did: parsed.did ?? null,\n didResolved: false,\n waypoints,\n recommended,\n };\n}\n\nexport type ResolveUrlOptions = {\n /**\n * When the URL pattern isn't recognized, fetch the page and look for a\n * `<link href=\"at://…\">` in <head>. Off by default to keep the resolver\n * isomorphic (no network unless explicitly requested).\n */\n fetchHead?: boolean;\n /** Timeout for the optional head probe. Defaults to 4000ms. */\n fetchHeadTimeoutMs?: number;\n /**\n * Resolve a handle to a DID so DID-only waypoints (pdsls, atptools, margin,\n * grain, popfeed) are included. Pass `resolveHandle` from this package, or\n * your own implementation.\n */\n resolveHandle?: (handle: string) => Promise<string | null>;\n};\n\n/**\n * Resolve a pasted/shared page URL back into the AT URI it represents and the\n * waypoints that can render it. Uses local URL-pattern matching by default;\n * optionally falls back to a `<head>` link probe and/or handle→DID resolution.\n *\n * The source app's own waypoint is omitted from the result (you're already\n * there), mirroring the extension popup and hosted endpoint.\n */\nexport async function resolveUrl(\n url: string | URL,\n options: ResolveUrlOptions = {},\n): Promise<ResolveResult | null> {\n let target: URL;\n try {\n target = typeof url === 'string' ? new URL(url) : url;\n } catch {\n return null;\n }\n if (!/^https?:$/.test(target.protocol)) return null;\n\n let match = matchSupportedUrl(target);\n if (!match && options.fetchHead) {\n const headUri = await detectAtUriInHead(\n target.toString(),\n options.fetchHeadTimeoutMs ?? 4000,\n );\n if (headUri) match = parseAtUri(headUri);\n }\n if (!match) return null;\n\n const { parsed, source } = match;\n let did = parsed.did;\n let didResolved = false;\n if (!did && options.resolveHandle) {\n try {\n const resolved = await options.resolveHandle(parsed.handle);\n if (resolved) {\n did = resolved;\n didResolved = true;\n }\n } catch {\n // Swallow; DID-required waypoints will simply be omitted from the result.\n }\n }\n\n const { waypoints, recommended } = buildWaypointsForParsed(parsed, {\n did,\n excludeSourceId: source,\n });\n return {\n parsed: { ...parsed, did },\n source,\n did: did ?? null,\n didResolved,\n waypoints,\n recommended,\n };\n}\n\nexport type ResolveApiInput = {\n url?: string;\n atUri?: string;\n /** Set false to skip the server-side <head> probe. */\n headDetect?: boolean;\n};\n\nexport type ResolveApiParsed = {\n type: WaypointType;\n uri: string;\n handle: string;\n did: string | null;\n collection: string | null;\n rkey: string | null;\n};\n\nexport type ResolveApiSuccess = {\n ok: true;\n inputKind: 'atUri' | 'url';\n detectedVia: 'atUri' | 'urlPattern' | 'headLink' | null;\n source: SourceApp;\n isKnownHost: boolean;\n parsed: ResolveApiParsed;\n didResolved: boolean;\n recommended: ResolvedRecommendation;\n waypoints: ResolvedWaypoint[];\n};\n\nexport type ResolveApiFailure = {\n ok: false;\n input?: string | null;\n inputKind?: 'atUri' | 'url';\n isKnownHost?: boolean;\n reason?: string;\n message?: string;\n error?: string;\n};\n\nexport type ResolveApiResponse = ResolveApiSuccess | ResolveApiFailure;\n\nexport type ResolveViaApiOptions = {\n /** Defaults to the hosted endpoint, https://aturi.to/api/resolve. */\n endpoint?: string;\n /** Custom fetch implementation (e.g. a polyfill or instrumented client). */\n fetch?: typeof fetch;\n signal?: AbortSignal;\n};\n\n/**\n * Typed client for the hosted resolve endpoint. Use this when you want the\n * server to do the work — notably the <head> link probe, which needs to fetch\n * the target page (something you may not want to do from the browser for CORS\n * reasons). Returns the same response shape the route emits.\n */\nexport async function resolveViaApi(\n input: ResolveApiInput,\n options: ResolveViaApiOptions = {},\n): Promise<ResolveApiResponse> {\n const endpoint = options.endpoint ?? 'https://aturi.to/api/resolve';\n const fetchImpl = options.fetch ?? fetch;\n const params = new URLSearchParams();\n if (input.atUri) {\n params.set('atUri', input.atUri);\n } else if (input.url) {\n params.set('url', input.url);\n } else {\n throw new Error('resolveViaApi requires either `url` or `atUri`');\n }\n if (input.headDetect === false) params.set('headDetect', 'false');\n\n const res = await fetchImpl(`${endpoint}?${params.toString()}`, {\n method: 'GET',\n headers: { Accept: 'application/json' },\n signal: options.signal,\n });\n return (await res.json()) as ResolveApiResponse;\n}\n\n/**\n * Best-effort <head> probe for a `<link href=\"at://…\">`. Reads the response as\n * text, scans the document head, and returns the first AT URI found. Returns\n * null on any error, non-HTML content, or timeout.\n */\nasync function detectAtUriInHead(\n url: string,\n timeoutMs: number,\n): Promise<string | null> {\n if (typeof fetch === 'undefined') return null;\n const controller =\n typeof AbortController !== 'undefined' ? new AbortController() : null;\n const timeout = controller\n ? setTimeout(() => controller.abort(), timeoutMs)\n : null;\n try {\n const response = await fetch(url, {\n signal: controller?.signal,\n redirect: 'follow',\n headers: {\n 'User-Agent':\n 'Mozilla/5.0 (compatible; AturiResolver/1.0; +https://aturi.to)',\n Accept:\n 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.5',\n },\n });\n if (!response.ok) return null;\n\n const ct = response.headers.get('content-type') || '';\n if (!/text\\/html|application\\/xhtml/i.test(ct)) return null;\n\n const html = await response.text();\n const headMatch = html.match(/<head[\\s\\S]*?<\\/head>/i);\n const haystack = headMatch ? headMatch[0] : html.slice(0, 256 * 1024);\n const linkRe =\n /<link\\b[^>]*\\bhref\\s*=\\s*[\"'](at:\\/\\/[^\"']+)[\"'][^>]*>/gi;\n let m: RegExpExecArray | null;\n while ((m = linkRe.exec(haystack)) !== null) {\n if (m[1].startsWith('at://')) return m[1];\n }\n return null;\n } catch {\n return null;\n } finally {\n if (timeout) clearTimeout(timeout);\n }\n}\n"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
type WaypointType = 'post' | 'profile' | 'list' | 'record' | 'unknown';
|
|
2
|
+
/**
|
|
3
|
+
* Keys identifying which "data family" a waypoint belongs to for auto-redirect
|
|
4
|
+
* purposes. Two waypoints can only be the endpoints of an auto-redirect when
|
|
5
|
+
* they share at least one family key (i.e. they render the same underlying
|
|
6
|
+
* atproto collections). Display groupings live in `WAYPOINT_CATEGORIES_DATA`
|
|
7
|
+
* and are independent of this.
|
|
8
|
+
*/
|
|
9
|
+
type RedirectCompatFamily = 'bluesky-social' | 'standard-site' | 'tangled' | 'margin' | 'grain' | 'pinksky' | 'semble' | 'streamplace' | 'popfeed' | 'sifa' | 'blento';
|
|
10
|
+
type WaypointData = {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
description: string | ((collection?: string, type?: WaypointType) => string);
|
|
14
|
+
getUrl: (handle: string, collection?: string, rkey?: string, did?: string) => string | null;
|
|
15
|
+
supportedTypes: WaypointType[];
|
|
16
|
+
category: string;
|
|
17
|
+
/**
|
|
18
|
+
* Data families this waypoint participates in. Auto-redirect rules are only
|
|
19
|
+
* emitted between waypoints that share at least one family. An empty array
|
|
20
|
+
* means the waypoint can never be an auto-redirect source *or* destination
|
|
21
|
+
* (dev tools / generic record viewers land here by design).
|
|
22
|
+
*/
|
|
23
|
+
redirectCompat: RedirectCompatFamily[];
|
|
24
|
+
/**
|
|
25
|
+
* NSID prefixes that signal this waypoint is meaningfully usable for the
|
|
26
|
+
* target repo. When set, the extension can call describeRepo on the target
|
|
27
|
+
* DID and check whether any of the user's collections start with one of
|
|
28
|
+
* these prefixes — if none do, the waypoint is flagged as "no records
|
|
29
|
+
* found" in the popup and demoted in smart recommendations.
|
|
30
|
+
*
|
|
31
|
+
* Use trailing-dot prefixes for whole namespaces (e.g. `'sh.tangled.'`)
|
|
32
|
+
* or full NSIDs for single-collection apps. Atmosphere apps typically
|
|
33
|
+
* declare a reversed-domain prefix (`semble.so` → `so.semble.`) so the
|
|
34
|
+
* popup can flag accounts that haven't published any of that app's
|
|
35
|
+
* records. Omit the field entirely for generic explorers (PDSls,
|
|
36
|
+
* atp.tools, Aturi) — those stay in the "unknown" / no-opinion state.
|
|
37
|
+
*/
|
|
38
|
+
expectedCollections?: string[];
|
|
39
|
+
};
|
|
40
|
+
type CompatFamilyMeta = {
|
|
41
|
+
id: RedirectCompatFamily;
|
|
42
|
+
name: string;
|
|
43
|
+
description: string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Registry of compat families. `description` is shown in the options UI so the
|
|
47
|
+
* user understands what each "Favorite for X" controls.
|
|
48
|
+
*/
|
|
49
|
+
declare const COMPAT_FAMILIES: Record<RedirectCompatFamily, CompatFamilyMeta>;
|
|
50
|
+
declare const COMPAT_FAMILY_ORDER: RedirectCompatFamily[];
|
|
51
|
+
type WaypointCategoryData = {
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
description?: string;
|
|
55
|
+
defaultWaypointId: string;
|
|
56
|
+
subcategories?: WaypointCategoryData[];
|
|
57
|
+
};
|
|
58
|
+
type CategorizedWaypointsData = {
|
|
59
|
+
category: WaypointCategoryData;
|
|
60
|
+
waypoints: WaypointData[];
|
|
61
|
+
};
|
|
62
|
+
declare const WAYPOINT_DESTINATIONS_DATA: Record<string, WaypointData>;
|
|
63
|
+
declare const WAYPOINT_ORDER: string[];
|
|
64
|
+
declare function getWaypointDataForType(type: WaypointType): WaypointData[];
|
|
65
|
+
declare function getWaypointCountData(): number;
|
|
66
|
+
declare const WAYPOINT_CATEGORIES_DATA: Record<string, WaypointCategoryData>;
|
|
67
|
+
declare const CATEGORY_ORDER: string[];
|
|
68
|
+
declare function getCategorizedWaypointsData(type: WaypointType): CategorizedWaypointsData[];
|
|
69
|
+
declare function getRecommendedWaypointsData(type: WaypointType, collection?: string): {
|
|
70
|
+
waypoints: WaypointData[];
|
|
71
|
+
label: string;
|
|
72
|
+
};
|
|
73
|
+
declare function getFeaturedWaypointData(type: WaypointType, collection?: string): WaypointData | null;
|
|
74
|
+
/**
|
|
75
|
+
* Result of comparing a waypoint's `expectedCollections` against the set of
|
|
76
|
+
* NSIDs found in the target repo.
|
|
77
|
+
*
|
|
78
|
+
* - 'present' — the user has at least one record under a matching prefix.
|
|
79
|
+
* - 'absent' — the waypoint declared collections but none are in the repo.
|
|
80
|
+
* - 'unknown' — the waypoint didn't declare any expectations, or we
|
|
81
|
+
* haven't scanned the repo yet (e.g. scan disabled, no DID).
|
|
82
|
+
*/
|
|
83
|
+
type WaypointActivity = 'present' | 'absent' | 'unknown';
|
|
84
|
+
/**
|
|
85
|
+
* Classify a waypoint against the set of collection NSIDs known to exist on
|
|
86
|
+
* the target repo. Prefix-matches each entry in `expectedCollections` against
|
|
87
|
+
* `repoCollections`. Returns 'unknown' when the waypoint has no declared
|
|
88
|
+
* expectations or the caller passed `null` for `repoCollections` (i.e. scan
|
|
89
|
+
* disabled or still in flight).
|
|
90
|
+
*/
|
|
91
|
+
declare function waypointActivity(waypoint: Pick<WaypointData, 'expectedCollections'>, repoCollections: ReadonlySet<string> | null): WaypointActivity;
|
|
92
|
+
|
|
93
|
+
type ParsedURI = {
|
|
94
|
+
type: 'post' | 'profile' | 'list' | 'record' | 'unknown';
|
|
95
|
+
uri: string;
|
|
96
|
+
handle: string;
|
|
97
|
+
did?: string;
|
|
98
|
+
collection?: string;
|
|
99
|
+
rkey?: string;
|
|
100
|
+
error?: string;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Parse URL path segments into structured AT URI data
|
|
104
|
+
* Examples:
|
|
105
|
+
* - /alice.bsky.social -> profile
|
|
106
|
+
* - /alice.bsky.social/app.bsky.feed.post/3k7qw... -> post
|
|
107
|
+
* - /did:plc:xxx/app.bsky.graph.list/abc -> list
|
|
108
|
+
*/
|
|
109
|
+
declare function parseURI(handle: string, collection?: string, rkey?: string): ParsedURI;
|
|
110
|
+
/**
|
|
111
|
+
* Resolve a handle to a DID using the Bluesky API
|
|
112
|
+
*/
|
|
113
|
+
declare function resolveHandle(handle: string): Promise<string | null>;
|
|
114
|
+
/**
|
|
115
|
+
* Get display name from handle or DID
|
|
116
|
+
*/
|
|
117
|
+
declare function getDisplayName(handle: string, did?: string): string;
|
|
118
|
+
|
|
119
|
+
type SourceApp = 'bluesky' | 'bluepy' | 'blacksky' | 'reddwarf' | 'witchsky' | 'catsky' | 'deer' | 'anisota' | 'pinksky' | 'leaflet' | 'tangled' | 'margin' | 'pdsls' | 'atptools' | 'semble' | 'streamplace' | 'grain' | 'popfeed' | 'sifa' | 'blento' | 'offprint' | 'pckt' | 'headDetected';
|
|
120
|
+
type ReverseMatch = {
|
|
121
|
+
source: SourceApp;
|
|
122
|
+
parsed: ParsedURI;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Reverse-match any supported Aturi waypoint site URL back into a structured
|
|
126
|
+
* ParsedURI (handle/collection/rkey). Returns `null` if the URL isn't on a
|
|
127
|
+
* supported site or isn't a shape we recognize.
|
|
128
|
+
*/
|
|
129
|
+
declare function matchSupportedUrl(url: URL): ReverseMatch | null;
|
|
130
|
+
/**
|
|
131
|
+
* Parse an AT URI string (e.g. "at://did:plc:abc123/collection/rkey") into
|
|
132
|
+
* its components. Used by head-based detection when an AT URI is found in
|
|
133
|
+
* a <link> tag's href attribute.
|
|
134
|
+
*/
|
|
135
|
+
declare function parseAtUri(uri: string): ReverseMatch | null;
|
|
136
|
+
/**
|
|
137
|
+
* All host names we know how to reverse-parse. Used by the popup + background
|
|
138
|
+
* worker to decide if a tab is "relevant" before doing more expensive work.
|
|
139
|
+
*/
|
|
140
|
+
declare const SUPPORTED_HOSTS: string[];
|
|
141
|
+
|
|
142
|
+
type ResolvedWaypoint = {
|
|
143
|
+
id: string;
|
|
144
|
+
name: string;
|
|
145
|
+
category: string;
|
|
146
|
+
url: string;
|
|
147
|
+
};
|
|
148
|
+
type ResolvedRecommendation = {
|
|
149
|
+
ids: string[];
|
|
150
|
+
label: string;
|
|
151
|
+
};
|
|
152
|
+
type ResolveResult = {
|
|
153
|
+
parsed: ParsedURI;
|
|
154
|
+
source: SourceApp;
|
|
155
|
+
did: string | null;
|
|
156
|
+
didResolved: boolean;
|
|
157
|
+
waypoints: ResolvedWaypoint[];
|
|
158
|
+
recommended: ResolvedRecommendation;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Waypoints whose `getUrl` only produces a useful destination when a DID is
|
|
162
|
+
* available. These are filtered out unless a DID is known. Mirrors the hosted
|
|
163
|
+
* aturi.to/api/resolve route exactly.
|
|
164
|
+
*/
|
|
165
|
+
declare const DID_REQUIRED_WAYPOINTS: ReadonlySet<string>;
|
|
166
|
+
type BuildWaypointsOptions = {
|
|
167
|
+
/** DID to pass to each waypoint's getUrl. Falls back to `parsed.did`. */
|
|
168
|
+
did?: string;
|
|
169
|
+
/** Waypoint id to omit (e.g. the source app the user is already on). */
|
|
170
|
+
excludeSourceId?: string;
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Turn a parsed AT URI into the list of waypoints that can render it plus the
|
|
174
|
+
* recommended set, applying the DID-required filter and dropping waypoints
|
|
175
|
+
* whose getUrl returns null. This is the framework-agnostic core of the
|
|
176
|
+
* hosted resolve endpoint.
|
|
177
|
+
*/
|
|
178
|
+
declare function buildWaypointsForParsed(parsed: ParsedURI, options?: BuildWaypointsOptions): {
|
|
179
|
+
waypoints: ResolvedWaypoint[];
|
|
180
|
+
recommended: ResolvedRecommendation;
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* Resolve an AT URI string (e.g. "at://did:plc:abc/app.bsky.feed.post/rkey")
|
|
184
|
+
* directly into its waypoints. Returns null if the string isn't a valid AT URI.
|
|
185
|
+
*/
|
|
186
|
+
declare function resolveAtUri(uri: string): ResolveResult | null;
|
|
187
|
+
type ResolveUrlOptions = {
|
|
188
|
+
/**
|
|
189
|
+
* When the URL pattern isn't recognized, fetch the page and look for a
|
|
190
|
+
* `<link href="at://…">` in <head>. Off by default to keep the resolver
|
|
191
|
+
* isomorphic (no network unless explicitly requested).
|
|
192
|
+
*/
|
|
193
|
+
fetchHead?: boolean;
|
|
194
|
+
/** Timeout for the optional head probe. Defaults to 4000ms. */
|
|
195
|
+
fetchHeadTimeoutMs?: number;
|
|
196
|
+
/**
|
|
197
|
+
* Resolve a handle to a DID so DID-only waypoints (pdsls, atptools, margin,
|
|
198
|
+
* grain, popfeed) are included. Pass `resolveHandle` from this package, or
|
|
199
|
+
* your own implementation.
|
|
200
|
+
*/
|
|
201
|
+
resolveHandle?: (handle: string) => Promise<string | null>;
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* Resolve a pasted/shared page URL back into the AT URI it represents and the
|
|
205
|
+
* waypoints that can render it. Uses local URL-pattern matching by default;
|
|
206
|
+
* optionally falls back to a `<head>` link probe and/or handle→DID resolution.
|
|
207
|
+
*
|
|
208
|
+
* The source app's own waypoint is omitted from the result (you're already
|
|
209
|
+
* there), mirroring the extension popup and hosted endpoint.
|
|
210
|
+
*/
|
|
211
|
+
declare function resolveUrl(url: string | URL, options?: ResolveUrlOptions): Promise<ResolveResult | null>;
|
|
212
|
+
type ResolveApiInput = {
|
|
213
|
+
url?: string;
|
|
214
|
+
atUri?: string;
|
|
215
|
+
/** Set false to skip the server-side <head> probe. */
|
|
216
|
+
headDetect?: boolean;
|
|
217
|
+
};
|
|
218
|
+
type ResolveApiParsed = {
|
|
219
|
+
type: WaypointType;
|
|
220
|
+
uri: string;
|
|
221
|
+
handle: string;
|
|
222
|
+
did: string | null;
|
|
223
|
+
collection: string | null;
|
|
224
|
+
rkey: string | null;
|
|
225
|
+
};
|
|
226
|
+
type ResolveApiSuccess = {
|
|
227
|
+
ok: true;
|
|
228
|
+
inputKind: 'atUri' | 'url';
|
|
229
|
+
detectedVia: 'atUri' | 'urlPattern' | 'headLink' | null;
|
|
230
|
+
source: SourceApp;
|
|
231
|
+
isKnownHost: boolean;
|
|
232
|
+
parsed: ResolveApiParsed;
|
|
233
|
+
didResolved: boolean;
|
|
234
|
+
recommended: ResolvedRecommendation;
|
|
235
|
+
waypoints: ResolvedWaypoint[];
|
|
236
|
+
};
|
|
237
|
+
type ResolveApiFailure = {
|
|
238
|
+
ok: false;
|
|
239
|
+
input?: string | null;
|
|
240
|
+
inputKind?: 'atUri' | 'url';
|
|
241
|
+
isKnownHost?: boolean;
|
|
242
|
+
reason?: string;
|
|
243
|
+
message?: string;
|
|
244
|
+
error?: string;
|
|
245
|
+
};
|
|
246
|
+
type ResolveApiResponse = ResolveApiSuccess | ResolveApiFailure;
|
|
247
|
+
type ResolveViaApiOptions = {
|
|
248
|
+
/** Defaults to the hosted endpoint, https://aturi.to/api/resolve. */
|
|
249
|
+
endpoint?: string;
|
|
250
|
+
/** Custom fetch implementation (e.g. a polyfill or instrumented client). */
|
|
251
|
+
fetch?: typeof fetch;
|
|
252
|
+
signal?: AbortSignal;
|
|
253
|
+
};
|
|
254
|
+
/**
|
|
255
|
+
* Typed client for the hosted resolve endpoint. Use this when you want the
|
|
256
|
+
* server to do the work — notably the <head> link probe, which needs to fetch
|
|
257
|
+
* the target page (something you may not want to do from the browser for CORS
|
|
258
|
+
* reasons). Returns the same response shape the route emits.
|
|
259
|
+
*/
|
|
260
|
+
declare function resolveViaApi(input: ResolveApiInput, options?: ResolveViaApiOptions): Promise<ResolveApiResponse>;
|
|
261
|
+
|
|
262
|
+
export { type BuildWaypointsOptions, CATEGORY_ORDER, COMPAT_FAMILIES, COMPAT_FAMILY_ORDER, type CategorizedWaypointsData, type CompatFamilyMeta, DID_REQUIRED_WAYPOINTS, type ParsedURI, type RedirectCompatFamily, type ResolveApiFailure, type ResolveApiInput, type ResolveApiParsed, type ResolveApiResponse, type ResolveApiSuccess, type ResolveResult, type ResolveUrlOptions, type ResolveViaApiOptions, type ResolvedRecommendation, type ResolvedWaypoint, type ReverseMatch, SUPPORTED_HOSTS, type SourceApp, WAYPOINT_CATEGORIES_DATA, WAYPOINT_DESTINATIONS_DATA, WAYPOINT_ORDER, type WaypointActivity, type WaypointCategoryData, type WaypointData, type WaypointType, buildWaypointsForParsed, getCategorizedWaypointsData, getDisplayName, getFeaturedWaypointData, getRecommendedWaypointsData, getWaypointCountData, getWaypointDataForType, matchSupportedUrl, parseAtUri, parseURI, resolveAtUri, resolveHandle, resolveUrl, resolveViaApi, waypointActivity };
|