| 28 | | { kind: "none" }; |
| 29 | |
| 30 | async 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 | |
| 51 | function isRemotePolicySource(source: string): boolean { |
| 52 | return source.startsWith("http://") || source.startsWith("https://"); |