dsh-claude-design 2.12.0 → 2.12.2

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.
@@ -14,7 +14,7 @@
14
14
  <meta name="dc-babel-file" content="artifact-type/babel.min.js">
15
15
  <script>try{if(!document.documentElement.getAttribute("data-theme"))document.documentElement.setAttribute("data-theme",matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")}catch(e){}</script>
16
16
  <script id="appifact-mode">(function(){var h=document.documentElement;function s(){var t=h.getAttribute('data-theme');if(t==='light'||t==='dark'){h.setAttribute('data-mode',t)}else{h.removeAttribute('data-mode')}}s();if(typeof MutationObserver==='function'){new MutationObserver(s).observe(h,{attributes:true,attributeFilter:['data-theme']})}})();</script>
17
- <script type="module" crossorigin src="./assets/index-BCan_JNh.js"></script>
17
+ <script type="module" crossorigin src="./assets/index-B0Ur8XcL.js"></script>
18
18
  <link rel="stylesheet" crossorigin href="./assets/index-B-Upphbb.css">
19
19
  </head>
20
20
  <body>
@@ -918,13 +918,21 @@ function isTailnet(address) {
918
918
  const m = /^100\.(\d{1,3})\./.exec(address);
919
919
  return !!m && Number(m[1]) >= 64 && Number(m[1]) <= 127;
920
920
  }
921
- var isTunnel = (name) => /^(utun|tun|tap|wg|ppp|ipsec)\d/i.test(name);
921
+ var isTunnel = (name) => /(^|[^a-z0-9])(utun|tun|tap|wg|ppp|ipsec)\d*($|[^a-z0-9])/i.test(name) || /vpn|wintun|tunnel/i.test(name);
922
+ var ipv4Number = (address) => address.split(".").reduce((n, part) => n * 256 + Number(part), 0);
923
+ function isOwnNetwork(entry) {
924
+ if (!/^\d+\.\d+\.\d+\.\d+$/.test(entry.netmask)) return false;
925
+ const mask = ipv4Number(entry.netmask);
926
+ if (mask >= ipv4Number("255.255.255.252")) return true;
927
+ const address = ipv4Number(entry.address);
928
+ return ((address & mask) >>> 0) + 1 === address;
929
+ }
922
930
  function lanAddresses() {
923
931
  const out = /* @__PURE__ */ new Map();
924
932
  for (const [name, list] of Object.entries(os2.networkInterfaces())) {
925
933
  for (const entry of list ?? []) {
926
934
  if (entry.family !== "IPv4" || entry.internal || entry.address.startsWith("169.254.") || isBenchmarkRange(entry.address)) continue;
927
- const rank = isTailnet(entry.address) ? 2 : isTunnel(name) ? 1 : 0;
935
+ const rank = isTailnet(entry.address) ? 2 : isTunnel(name) || isOwnNetwork(entry) ? 1 : 0;
928
936
  out.set(entry.address, Math.min(rank, out.get(entry.address) ?? rank));
929
937
  }
930
938
  }
@@ -939,7 +947,10 @@ function answers(host, port) {
939
947
  };
940
948
  socket.setTimeout(300, () => done(false));
941
949
  socket.once("connect", () => done(true));
942
- socket.once("error", (error) => done(!["ECONNREFUSED", "EADDRNOTAVAIL", "EAFNOSUPPORT", "ENETUNREACH", "EHOSTUNREACH"].includes(error.code ?? "")));
950
+ socket.once(
951
+ "error",
952
+ (error) => done(!["ECONNREFUSED", "EADDRNOTAVAIL", "EAFNOSUPPORT", "ENETUNREACH", "EHOSTUNREACH", "EACCES", "EPERM"].includes(error.code ?? ""))
953
+ );
943
954
  });
944
955
  }
945
956
  async function answersAnyPort(address) {
@@ -985,6 +996,7 @@ function serverOrigin(host, port) {
985
996
  return `http://${shown2}:${port}`;
986
997
  }
987
998
  var pagePathOf = (kind, root) => `/${kind}/${createHash("sha256").update(path2.resolve(root)).digest("base64url").slice(0, 22)}/`;
999
+ var pageGone = (dir, owner) => owner ? `This page's files are no longer in ${dir}: the skill was moved, renamed or removed while its server ran. Stop the server and open the artifact again (the agent that opened it can do both).` : "This page's files are gone from the computer that shares it. Ask whoever shared it to open it again.";
988
1000
  function sendJson2(response, status, body, headers = {}) {
989
1001
  const text = JSON.stringify(body);
990
1002
  response.writeHead(status, {
@@ -4745,7 +4757,8 @@ data: ${JSON.stringify(event)}
4745
4757
  const info = real === null ? null : await fsp4.lstat(real).catch(() => null);
4746
4758
  if (file === null || real !== file || !info?.isFile()) {
4747
4759
  if (realDist === null && !invalid && parts[0] === "index.html") {
4748
- response.writeHead(503, { "Content-Type": "text/plain; charset=utf-8", "Cache-Control": "no-store" }).end("The editor page is missing; reinstall the skill.");
4760
+ stamp2(`the editor's files are gone from ${EDITOR_DIR}: the skill was moved, renamed or removed while this server ran`);
4761
+ response.writeHead(503, { "Content-Type": "text/plain; charset=utf-8", "Cache-Control": "no-store" }).end(pageGone(EDITOR_DIR, viewer.role === "owner"));
4749
4762
  return;
4750
4763
  }
4751
4764
  response.writeHead(404, { "Cache-Control": "no-store" }).end();