inkmap-mcp 0.3.10 → 0.3.11

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inkmap-codex",
3
- "version": "0.3.10",
3
+ "version": "0.3.11",
4
4
  "description": "Interactive two-way Markdown mind map (markmap), Mermaid flowchart & XMind outline editor | 双向编辑 Markdown 思维导图、脑图、流程图与大纲",
5
5
  "homepage": "https://zhiyuanv.com/software.html",
6
6
  "repository": "https://github.com/zhiyuanvision-lang/InkMap",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "inkmap-codex",
4
- "version": "0.3.10",
4
+ "version": "0.3.11",
5
5
  "description": "Interactive two-way Markdown mind map (markmap), Mermaid flowchart & XMind outline editor | 双向编辑 Markdown 思维导图、脑图、流程图与大纲",
6
6
  "homepage": "https://zhiyuanv.com/software.html",
7
7
  "repository": "https://github.com/zhiyuanvision-lang/InkMap",
@@ -68,10 +68,10 @@ var inject = ["slots", "sidebarRight", "sidebarRightTabs"];
68
68
  var zh = () => {
69
69
  const docLang = typeof document !== "undefined" ? document.documentElement?.lang || "" : "";
70
70
  const navLang = typeof navigator !== "undefined" ? navigator.language || "" : "";
71
- if (/^zh\b/i.test(docLang || navLang)) return true;
71
+ if (/^zh(?:[-_.]|$)/i.test(docLang || navLang)) return true;
72
72
  try {
73
73
  const opts = Intl.DateTimeFormat().resolvedOptions();
74
- if (/^zh\b/i.test(opts.locale || "")) return true;
74
+ if (/^zh(?:[-_.]|$)/i.test(opts.locale || "")) return true;
75
75
  if (/^(Asia\/(Shanghai|Chongqing|Chungking|Harbin|Urumqi|Beijing)|PRC)$/i.test(opts.timeZone || "")) return true;
76
76
  } catch {
77
77
  }
@@ -80,6 +80,7 @@ var zh = () => {
80
80
  var label = () => zh() ? "\u7528 Inkmap \u6253\u5F00" : "Open in Inkmap";
81
81
  var desktop = () => location.protocol === "dsh-app:" && location.hostname === "app";
82
82
  var actionClass = "inkmap-harness-open";
83
+ var LEASE_RENEW_MS = 5 * 6e4;
83
84
  var request = (method, body) => fetch(route, {
84
85
  method,
85
86
  headers: { "content-type": "application/json" },
@@ -99,11 +100,17 @@ function apply(ctx) {
99
100
  }
100
101
  return data;
101
102
  });
103
+ const renewal = setInterval(() => {
104
+ void opened.then(({ lease }) => request("POST", { action: "renew", lease })).catch(() => {
105
+ });
106
+ }, LEASE_RENEW_MS);
102
107
  void opened.catch(() => {
108
+ clearInterval(renewal);
103
109
  tab.signal.removeEventListener("abort", release);
104
110
  sessions.delete(tab.signal);
105
111
  });
106
112
  function release() {
113
+ clearInterval(renewal);
107
114
  tab.signal.removeEventListener("abort", release);
108
115
  sessions.delete(tab.signal);
109
116
  void opened.then(({ lease }) => request("DELETE", { lease })).catch(() => {
@@ -168,7 +175,11 @@ function apply(ctx) {
168
175
  try {
169
176
  const mode = data.mode === "buy" ? "buy" : "restore";
170
177
  const action = mode === "buy" ? "buy" : "sign-in";
171
- const response = await request("POST", { lease: view.lease, action });
178
+ const response = await request("POST", {
179
+ lease: view.lease,
180
+ action,
181
+ ...typeof data.locale === "string" && { locale: data.locale }
182
+ });
172
183
  if (!response.ok) throw new Error("Inkmap sign-in is unavailable");
173
184
  const url = billingFlowUrl((await response.json()).url, YUNFAN_BILLING_ORIGIN, mode);
174
185
  if (!mounted || tab.signal.aborted) return;