@mitsein-ai/cli 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "ofetch": "^1.4.1",
9
9
  "undici": "^8.0.2"
10
10
  },
11
- "description": "Mitsein CLI \u2014 dev tooling, API helpers, and workflow automation",
11
+ "description": "Mitsein CLI dev tooling, API helpers, and workflow automation",
12
12
  "devDependencies": {
13
13
  "@types/bun": "latest",
14
14
  "typescript": "^5.3.3"
@@ -46,5 +46,5 @@
46
46
  "typecheck": "tsc --noEmit"
47
47
  },
48
48
  "type": "module",
49
- "version": "0.1.4"
49
+ "version": "0.1.5"
50
50
  }
@@ -4,14 +4,24 @@ import { fileURLToPath } from 'node:url';
4
4
  import { emit } from '../core/output.js';
5
5
 
6
6
  export function getPackageVersion(): string {
7
+ // Try reading package.json at multiple candidate paths
8
+ // (works from both source and compiled locations)
7
9
  const __dirname = dirname(fileURLToPath(import.meta.url));
8
- const pkgPath = join(__dirname, '..', '..', 'package.json');
9
- try {
10
- const pkg = JSON.parse(readFileSync(pkgPath, 'utf8')) as { version?: string };
11
- return pkg.version ?? '0.1.0-dev';
12
- } catch {
13
- return '0.1.0-dev';
10
+ const candidates = [
11
+ join(__dirname, '..', 'package.json'), // dist/index.js → package.json
12
+ join(__dirname, '..', '..', 'package.json'), // src/commands/version.ts package.json
13
+ ];
14
+ for (const pkgPath of candidates) {
15
+ try {
16
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf8')) as { version?: string; name?: string };
17
+ if (pkg.name === '@mitsein-ai/cli' && pkg.version) {
18
+ return pkg.version;
19
+ }
20
+ } catch {
21
+ // try next
22
+ }
14
23
  }
24
+ return '0.1.0-dev';
15
25
  }
16
26
 
17
27
  export function runVersion(): void {