@aturi.to/waypoints 0.1.3 → 0.1.4
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/README.md +106 -2
- package/dist/icons.cjs +106 -0
- package/dist/icons.cjs.map +1 -0
- package/dist/icons.d.cts +80 -0
- package/dist/icons.d.ts +80 -0
- package/dist/icons.js +73 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.cjs +28 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +28 -1
- package/dist/index.js.map +1 -1
- package/package.json +22 -3
package/dist/index.js
CHANGED
|
@@ -142,7 +142,12 @@ var WAYPOINT_DESTINATIONS_DATA = {
|
|
|
142
142
|
// query). What's declared here is the interoperable subset every caller can
|
|
143
143
|
// rely on; the extras are Anisota-only and unrepresentable in this field.
|
|
144
144
|
composeIntent: socialAppComposeIntent("https://anisota.net"),
|
|
145
|
-
|
|
145
|
+
// Bluesky-shaped records only. anisota.net also reads Standard Site and
|
|
146
|
+
// Leaflet documents, but that role belongs to `anisotaReader`: listing both
|
|
147
|
+
// under `standard-site` put two entries for the same site in every
|
|
148
|
+
// "Publications" destination list, and this one's `expectedCollections`
|
|
149
|
+
// already says it does not claim those collections.
|
|
150
|
+
redirectCompat: ["bluesky-social"],
|
|
146
151
|
expectedCollections: ["app.bsky.", "net.anisota."]
|
|
147
152
|
},
|
|
148
153
|
bluesky: {
|
|
@@ -950,14 +955,24 @@ function appendComposeText(base, textParam, text) {
|
|
|
950
955
|
return `${base}?${textParam}=${encodeURIComponent(text)}`;
|
|
951
956
|
}
|
|
952
957
|
|
|
958
|
+
// src/requestDeadline.ts
|
|
959
|
+
var UPSTREAM_USER_AGENT = "aturi.to (+https://aturi.to/mcp)";
|
|
960
|
+
function identifyingHeaders(existing) {
|
|
961
|
+
const headers = existing;
|
|
962
|
+
if (typeof window !== "undefined") return headers;
|
|
963
|
+
return { ...headers, "User-Agent": UPSTREAM_USER_AGENT };
|
|
964
|
+
}
|
|
965
|
+
|
|
953
966
|
// src/upstreamFetch.ts
|
|
954
967
|
var RETRY_DELAY_MS = 250;
|
|
955
968
|
async function upstreamFetch(url, { timeoutMs = 8e3, retries = 1, ...init } = {}) {
|
|
956
969
|
let lastError;
|
|
957
970
|
for (let attempt = 0; attempt <= retries; attempt++) {
|
|
958
971
|
try {
|
|
972
|
+
const headers = identifyingHeaders(init.headers);
|
|
959
973
|
return await fetch(url, {
|
|
960
974
|
...init,
|
|
975
|
+
...headers ? { headers } : {},
|
|
961
976
|
signal: AbortSignal.timeout(timeoutMs)
|
|
962
977
|
});
|
|
963
978
|
} catch (error) {
|
|
@@ -988,6 +1003,14 @@ function parseURI(handle, collection, rkey) {
|
|
|
988
1003
|
did: handle.startsWith("did:") ? handle : void 0
|
|
989
1004
|
};
|
|
990
1005
|
}
|
|
1006
|
+
if (collection === "space") {
|
|
1007
|
+
return {
|
|
1008
|
+
type: "unknown",
|
|
1009
|
+
uri: "",
|
|
1010
|
+
handle,
|
|
1011
|
+
error: "Space URIs are not public records"
|
|
1012
|
+
};
|
|
1013
|
+
}
|
|
991
1014
|
if (collection && rkey) {
|
|
992
1015
|
let type = "record";
|
|
993
1016
|
if (collection === "app.bsky.feed.post") {
|
|
@@ -1237,6 +1260,7 @@ function parseAtUriPath(pathname) {
|
|
|
1237
1260
|
const rest = match[1];
|
|
1238
1261
|
const segments = rest.split("/").filter(Boolean);
|
|
1239
1262
|
if (segments.length === 0) return null;
|
|
1263
|
+
if (segments[1] === "space") return null;
|
|
1240
1264
|
return {
|
|
1241
1265
|
handle: segments[0],
|
|
1242
1266
|
collection: segments[1],
|
|
@@ -1446,6 +1470,7 @@ function matchTaproot(host, pathname) {
|
|
|
1446
1470
|
if (!m) return null;
|
|
1447
1471
|
const segments = m[1].split("/").filter(Boolean);
|
|
1448
1472
|
if (segments.length === 0) return null;
|
|
1473
|
+
if (segments[1] === "space") return null;
|
|
1449
1474
|
const handle = segments[0];
|
|
1450
1475
|
const collection = segments[1];
|
|
1451
1476
|
const rkey = segments[2];
|
|
@@ -1472,6 +1497,7 @@ function matchAturi(host, parts) {
|
|
|
1472
1497
|
if (host !== "aturi.to") return null;
|
|
1473
1498
|
const isIdentifier = (seg2) => !!seg2 && (seg2.startsWith("did:") || seg2.includes("."));
|
|
1474
1499
|
if (parts[0] === "explore" && isIdentifier(parts[1])) {
|
|
1500
|
+
if (parts[2] === "space") return null;
|
|
1475
1501
|
const handle = parts[1];
|
|
1476
1502
|
const did = handle.startsWith("did:") ? handle : void 0;
|
|
1477
1503
|
const collection = parts[2];
|
|
@@ -1554,6 +1580,7 @@ function parseAtUri(uri) {
|
|
|
1554
1580
|
const rest = uri.slice("at://".length);
|
|
1555
1581
|
const segments = rest.split("/").filter(Boolean);
|
|
1556
1582
|
if (segments.length === 0) return null;
|
|
1583
|
+
if (segments[1] === "space") return null;
|
|
1557
1584
|
const handle = segments[0];
|
|
1558
1585
|
const did = handle.startsWith("did:") ? handle : void 0;
|
|
1559
1586
|
const collection = segments[1];
|