MCPcopy
hub / github.com/coder/mux / getClientVersion

Function getClientVersion

src/node/services/policyService.ts:30–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28 | { kind: "none" };
29
30async function getClientVersion(): Promise<string> {
31 // Prefer Electron's app version when available (authoritative in packaged apps).
32 if (process.versions.electron) {
33 try {
34 // Intentionally lazy import to keep CLI/server mode light.
35 // eslint-disable-next-line no-restricted-syntax
36 const { app } = await import("electron");
37 return app.getVersion();
38 } catch {
39 // Ignore and fall back.
40 }
41 }
42
43 // Fallback for CLI/headless.
44 if (typeof packageJson.version === "string") {
45 return packageJson.version;
46 }
47
48 return "0.0.0";
49}
50
51function isRemotePolicySource(source: string): boolean {
52 return source.startsWith("http://") || source.startsWith("https://");

Callers 1

refreshPolicyOnceMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected