@genkaku/dsh-worker-plugin 0.1.14 → 0.1.15

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.
Files changed (2) hide show
  1. package/lib/client.js +24 -4
  2. package/package.json +6 -3
package/lib/client.js CHANGED
@@ -402,7 +402,7 @@ function Page() {
402
402
  import_dsh_client_ui_primitives.Switch,
403
403
  {
404
404
  checked: status.publishAddress === true,
405
- disabled: busy === "publish",
405
+ disabled: busy === "publish" || status.publishForced === true || status.reachable !== true && status.publishAddress !== true,
406
406
  label: t("Publish this worker on-chain", "\u5C07\u6B64 worker \u767C\u4F48\u5230\u93C8\u4E0A\u76EE\u9304"),
407
407
  onChange: (next) => {
408
408
  void setPublish(next);
@@ -411,9 +411,12 @@ function Page() {
411
411
  )
412
412
  ] }),
413
413
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { ...dim, fontSize: 12, marginTop: 2 }, children: status.reachable !== true ? t(
414
- "This machine has no public address, so listing it would create an entry nobody can dial. Peers on the same network can still connect.",
415
- "\u9019\u53F0\u6A5F\u5668\u6C92\u6709\u516C\u7DB2\u4F4D\u5740\uFF0C\u767C\u4F48\u53EA\u6703\u7522\u751F\u4E00\u689D\u6C92\u4EBA\u9023\u5F97\u4E0A\u7684\u7D00\u9304\u3002\u540C\u7DB2\u6BB5\u7684 peer \u4ECD\u53EF\u9023\u7DDA\u3002"
416
- ) : status.publishAddress === true ? t(
414
+ "This machine has no public address, so this switch is off until it gets one: listing it would create an entry nobody can dial. Peers on the same network can still connect.",
415
+ "\u9019\u53F0\u6A5F\u5668\u6C92\u6709\u516C\u7DB2\u4F4D\u5740\uFF0C\u56E0\u6B64\u958B\u95DC\u76EE\u524D\u7121\u6CD5\u958B\u555F\uFF1A\u767C\u4F48\u53EA\u6703\u7522\u751F\u4E00\u689D\u6C92\u4EBA\u9023\u5F97\u4E0A\u7684\u7D00\u9304\u3002\u540C\u7DB2\u6BB5\u7684 peer \u4ECD\u53EF\u9023\u7DDA\u3002"
416
+ ) : status.publishForced === true ? t(
417
+ "Forced on by this profile (publishAddress), so it cannot be turned off here.",
418
+ "\u6B64 profile \u5DF2\u5F37\u5236\u958B\u555F\uFF08publishAddress\uFF09\uFF0C\u7121\u6CD5\u5728\u6B64\u95DC\u9589\u3002"
419
+ ) : status.published === true ? t(
417
420
  "Listed. Your public IP is written to the chain and stays readable forever, even after you turn this off.",
418
421
  "\u5DF2\u5217\u51FA\u3002\u4F60\u7684\u516C\u7DB2 IP \u6703\u5BEB\u9032\u93C8\u4E0A\uFF0C\u5373\u4F7F\u65E5\u5F8C\u95DC\u9589\uFF0C\u4ECD\u7136\u6C38\u4E45\u53EF\u8B80\u3002"
419
422
  ) : t(
@@ -523,6 +526,23 @@ function Page() {
523
526
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: dim, children: t("Wallet", "\u9322\u5305") }),
524
527
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: status.wallet ?? "\u2014" })
525
528
  ] }),
529
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: row, children: [
530
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: dim, children: t("Connection", "\u9023\u7DDA\u65B9\u5F0F") }),
531
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
532
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: dot(status.transport === "direct") }),
533
+ status.transport === "direct" ? t("libp2p direct", "libp2p \u76F4\u9023") : status.transport === "relay" ? t("seed VM relay", "seed VM \u4E2D\u7E7C") : t("LAN only", "\u50C5\u9650\u540C\u7DB2\u6BB5")
534
+ ] })
535
+ ] }),
536
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { ...dim, fontSize: 12, marginTop: 2 }, children: status.transport === "direct" ? t(
537
+ "Clients reach this worker directly over libp2p.",
538
+ "\u4F7F\u7528\u8005\u900F\u904E libp2p \u76F4\u63A5\u9023\u5230\u9019\u53F0 worker\u3002"
539
+ ) : status.transport === "relay" ? t(
540
+ "Direct dialing is not possible from the internet, so traffic is forwarded through the GenKaKu seed VM. Clients try a direct connection first, then fall back to the relay.",
541
+ "\u9019\u53F0\u6A5F\u5668\u7121\u6CD5\u88AB\u516C\u7DB2\u76F4\u9023\uFF0C\u56E0\u6B64\u6D41\u91CF\u6703\u7D93\u7531 GenKaKu seed VM \u8F49\u9001\u3002\u4F7F\u7528\u8005\u6703\u5148\u5617\u8A66\u76F4\u9023\uFF0C\u5931\u6557\u5F8C\u624D\u8D70\u4E2D\u7E7C\u3002"
542
+ ) : t(
543
+ "Only peers on the same network can connect. A relay appears once the seed VM is reachable.",
544
+ "\u76EE\u524D\u53EA\u6709\u540C\u7DB2\u6BB5\u7684 peer \u80FD\u9023\u7DDA\u3002\u9023\u4E0A seed VM \u5F8C\u6703\u81EA\u52D5\u53D6\u5F97\u4E2D\u7E7C\u4F4D\u5740\u3002"
545
+ ) }),
526
546
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: row, children: [
527
547
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: dim, children: t("Active sessions", "\u9032\u884C\u4E2D session") }),
528
548
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: status.activeSessions ?? 0 })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genkaku/dsh-worker-plugin",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "Share this machine's Ollama models on the GenKaKu network",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -38,8 +38,8 @@
38
38
  }
39
39
  },
40
40
  "dependencies": {
41
- "@genkaku/protocol": "0.1.10",
42
- "@genkaku/dsh-runtime": "0.1.13"
41
+ "@genkaku/protocol": "0.1.11",
42
+ "@genkaku/dsh-runtime": "0.1.14"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "@deepseek-ai/cordis": "^4.1.0"
@@ -68,6 +68,9 @@
68
68
  "usdc",
69
69
  "base"
70
70
  ],
71
+ "engines": {
72
+ "node": ">=22"
73
+ },
71
74
  "scripts": {
72
75
  "build": "tsc -p tsconfig.json && node ../../scripts/build-client.mjs . @genkaku/dsh-worker-plugin",
73
76
  "typecheck": "tsc -p tsconfig.json --noEmit"