Lines 1648-1688javascript
1648 /* @__PURE__ */ jsxs10(Text10, { color: meta.color, children: [
1652 /* @__PURE__ */ jsx10(Text10, { bold: true, color: meta.color, children: name }),
1653 /* @__PURE__ */ jsx10(Box10, { flexGrow: 1 }),
1654 /* @__PURE__ */ jsx10(Text10, { dimColor: true, children: detail })
1658// src/client/use-daemon.ts
1659import { useEffect as useEffect3, useMemo, useRef as useRef2, useState as useState3 } from "react";
1661// src/client/daemon-rpc-client.ts
1662import { Cause, Context, Duration, Effect, Fiber, Layer, ManagedRuntime, Schedule, Stream } from "effect";
1663import { RpcClient, RpcSerialization } from "effect/unstable/rpc";
1664import * as Socket from "effect/unstable/socket/Socket";
1665var TokmonRpcClient = class extends Context.Service()(
1666 "tokmon/client/DaemonRpcClient/TokmonRpcClient"
1669var dynamicImport = new Function("specifier", "return import(specifier)");
1670function toWsUrl(baseUrl, token) {
HighEval
Package source references dynamic code evaluation.
dist/bootstrap-ink-QHJOOWIW.jsView on unpkg · L1668 MediumDynamic Require
Package source references dynamic require/import behavior.
dist/bootstrap-ink-QHJOOWIW.jsView on unpkg · L1668 1671 const base = typeof window === "undefined" ? void 0 : window.location.origin;
1672 const url = new URL(baseUrl, base);
1673 if (url.protocol === "http:") url.protocol = "ws:";
1674 else if (url.protocol === "https:") url.protocol = "wss:";
1675 if (url.protocol !== "ws:" && url.protocol !== "wss:") {
1676 throw new Error(`unsupported daemon RPC protocol: ${url.protocol}`);
1678 url.pathname = TOKMON_WS_PATH;
1679 if (token) url.searchParams.set("wsToken", token);
1680 return url.toString();
1682function shouldUseNodeTransport(transport) {
1683 if (transport === "node") return true;
1684 if (transport === "browser") return false;
1685 return typeof window === "undefined";
1687async function socketLayerFor(url, transport) {
1688 if (shouldUseNodeTransport(transport)) {