()
| 201 | // ── Version + path helpers ────────────────────────────────────────── |
| 202 | |
| 203 | function getSelfVersion(): string { |
| 204 | // createRequire resolves relative to this module. In source layout this file |
| 205 | // lives at src/cli/diagnostics.ts; in bundled layout at dist/cli.js. |
| 206 | const require = createRequire(import.meta.url); |
| 207 | for (const relPath of ["../../package.json", "../package.json"]) { |
| 208 | try { |
| 209 | const pkg = require(relPath) as { version?: unknown }; |
| 210 | if (typeof pkg.version === "string" && pkg.version.length > 0) { |
| 211 | return pkg.version; |
| 212 | } |
| 213 | } catch { |
| 214 | // Try next path. |
| 215 | } |
| 216 | } |
| 217 | return "unknown"; |
| 218 | } |
| 219 | |
| 220 | function getPluginCacheInfo(): { path: string; cached?: string; latest?: string } { |
| 221 | const [path = ""] = getOpenCodePluginCacheRoots(); |
no outgoing calls
no test coverage detected