MCPcopy Create free account
hub / github.com/cortexkit/magic-context / getSelfVersion

Function getSelfVersion

packages/cli/src/lib/diagnostics-pi.ts:134–147  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

132}
133
134function getSelfVersion(): string {
135 const req = createRequire(import.meta.url);
136 for (const relPath of ["../../package.json", "../package.json"]) {
137 try {
138 const pkg = req(relPath) as { version?: unknown };
139 if (typeof pkg.version === "string" && pkg.version.length > 0) {
140 return pkg.version;
141 }
142 } catch {
143 // Try next layout (src vs bundled dist).
144 }
145 }
146 return "unknown";
147}
148
149function fileSize(path: string): number {
150 try {

Callers 1

collectDiagnosticsFunction · 0.70

Calls 1

reqFunction · 0.85

Tested by

no test coverage detected