@appsoftwareltd/etherpk-mcp 0.9.4 → 0.9.6
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/dist/main.js +47 -4
- package/dist/main.js.map +1 -1
- package/dist/map-picture-page.js +100 -65
- package/package.json +5 -5
package/dist/main.js
CHANGED
|
@@ -629,6 +629,21 @@ function assetChunkCount(size) {
|
|
|
629
629
|
}
|
|
630
630
|
var DAY = 864e5;
|
|
631
631
|
365 * DAY, 30 * DAY, 7 * DAY;
|
|
632
|
+
/** Whether `text` is a short link a Sync Server opens: one of Google's share links. */
|
|
633
|
+
function isShortMapLink(text) {
|
|
634
|
+
let url;
|
|
635
|
+
try {
|
|
636
|
+
url = new URL(text.trim());
|
|
637
|
+
} catch {
|
|
638
|
+
return false;
|
|
639
|
+
}
|
|
640
|
+
if (url.protocol !== "https:" || url.username !== "" || url.password !== "" || url.port !== "") return false;
|
|
641
|
+
const host = url.hostname.toLowerCase();
|
|
642
|
+
if (host === "maps.app.goo.gl") return /^\/[A-Za-z0-9_-]+\/?$/.test(url.pathname);
|
|
643
|
+
if (host === "goo.gl") return /^\/maps\/[A-Za-z0-9_-]+\/?$/.test(url.pathname);
|
|
644
|
+
return false;
|
|
645
|
+
}
|
|
646
|
+
z.strictObject({ url: z.string().trim().max(200).refine(isShortMapLink, "not a short map link") });
|
|
632
647
|
var latitude = z.number().min(-90).max(90);
|
|
633
648
|
var longitude = z.number().min(-180).max(180);
|
|
634
649
|
z.strictObject({
|
|
@@ -641,6 +656,14 @@ z.strictObject({
|
|
|
641
656
|
/** The reader's language, two letters, for the names of places. */
|
|
642
657
|
lang: z.string().regex(/^[a-z]{2}$/).optional()
|
|
643
658
|
});
|
|
659
|
+
z.strictObject({
|
|
660
|
+
point: z.strictObject({
|
|
661
|
+
lat: latitude,
|
|
662
|
+
lon: longitude
|
|
663
|
+
}),
|
|
664
|
+
/** The reader's language, two letters, for the name of the place. */
|
|
665
|
+
lang: z.string().regex(/^[a-z]{2}$/).optional()
|
|
666
|
+
});
|
|
644
667
|
/** A place's address fields, as Photon names them. Anything else a service sends is dropped. */
|
|
645
668
|
var placeProperties = z.object({
|
|
646
669
|
name: z.string().optional(),
|
|
@@ -694,7 +717,7 @@ function looksLikeAgentSetupCode(value) {
|
|
|
694
717
|
}
|
|
695
718
|
var package_default = {
|
|
696
719
|
name: "@appsoftwareltd/etherpk-mcp",
|
|
697
|
-
version: "0.9.
|
|
720
|
+
version: "0.9.6",
|
|
698
721
|
license: "Elastic-2.0",
|
|
699
722
|
description: "EtherPK Headless Client: an MCP server over a synced knowledge graph, run beside the agent on the user's own machine.",
|
|
700
723
|
type: "module",
|
|
@@ -1669,6 +1692,24 @@ function createSyncApi(deps) {
|
|
|
1669
1692
|
body: JSON.stringify(request),
|
|
1670
1693
|
signal
|
|
1671
1694
|
}),
|
|
1695
|
+
/**
|
|
1696
|
+
* The place nearest a point, to offer a name for a place set down by hand (ADR 0119,
|
|
1697
|
+
* amendment of 2026-10-10). Answered and refused as `searchPlaces` is, with at most one place.
|
|
1698
|
+
*/
|
|
1699
|
+
reversePlace: (request, signal) => call("/api/v1/sync/maps/reverse", {
|
|
1700
|
+
method: "POST",
|
|
1701
|
+
body: JSON.stringify(request),
|
|
1702
|
+
signal
|
|
1703
|
+
}),
|
|
1704
|
+
/**
|
|
1705
|
+
* The full link a short map link leads to, which a browser page cannot follow itself (ADR
|
|
1706
|
+
* 0119, amendment of 2026-10-10). Any signed-in account may ask.
|
|
1707
|
+
*/
|
|
1708
|
+
openMapLink: (request, signal) => call("/api/v1/sync/maps/link", {
|
|
1709
|
+
method: "POST",
|
|
1710
|
+
body: JSON.stringify(request),
|
|
1711
|
+
signal
|
|
1712
|
+
}),
|
|
1672
1713
|
createGraph: () => call("/api/v1/sync/graphs", { method: "POST" }),
|
|
1673
1714
|
listGraphs: () => call("/api/v1/sync/graphs").then((r) => r.graphs),
|
|
1674
1715
|
/** Graphs plus the owned-storage rollup (one request - same endpoint as listGraphs). */
|
|
@@ -6015,7 +6056,8 @@ function backlinksFor(db, concept) {
|
|
|
6015
6056
|
sourceConcept: h.sourceConcept,
|
|
6016
6057
|
sourceKind: h.sourceKind,
|
|
6017
6058
|
refs: [],
|
|
6018
|
-
bodyNames: []
|
|
6059
|
+
bodyNames: [],
|
|
6060
|
+
sourceIsTarget: h.page_id === pageId
|
|
6019
6061
|
};
|
|
6020
6062
|
groups.set(h.sourceConcept, group);
|
|
6021
6063
|
}
|
|
@@ -13178,9 +13220,10 @@ function createThemeRenderer(theme, includes) {
|
|
|
13178
13220
|
*/
|
|
13179
13221
|
/**
|
|
13180
13222
|
* Bumped when the way a map is drawn changes, so a site published again holds the new picture
|
|
13181
|
-
* under a new name rather than a cached one under the old.
|
|
13223
|
+
* under a new name rather than a cached one under the old. 2: a name that would run past the
|
|
13224
|
+
* picture's edge is shortened with an ellipsis.
|
|
13182
13225
|
*/
|
|
13183
|
-
var MAP_PICTURE_VERSION =
|
|
13226
|
+
var MAP_PICTURE_VERSION = 2;
|
|
13184
13227
|
/** A picture's file name: from what the map holds and how it is drawn, so an unchanged map publishes the same file. */
|
|
13185
13228
|
async function mapPictureName(source) {
|
|
13186
13229
|
const digest = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(`${MAP_PICTURE_VERSION}\n${source}`));
|