zyndo 0.1.7 → 0.1.8

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.
Files changed (2) hide show
  1. package/dist/index.js +20 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2,11 +2,30 @@
2
2
  // ---------------------------------------------------------------------------
3
3
  // zyndo CLI — entry point
4
4
  // ---------------------------------------------------------------------------
5
+ import { readFileSync } from 'node:fs';
6
+ import { fileURLToPath } from 'node:url';
7
+ import { dirname, join } from 'node:path';
5
8
  import { loadSellerConfig } from './config.js';
6
9
  import { startSellerDaemon } from './sellerDaemon.js';
7
10
  import { startMcpServer } from './mcp/mcpServer.js';
8
11
  import { printBanner } from './banner.js';
9
12
  import { handleWalletCommand, handleCashoutCommand, handleConnectCommand } from './commands/wallet.js';
13
+ // Read version from package.json so it never drifts from the published
14
+ // npm version. dist/index.js lives at <pkg>/dist/index.js, so the package
15
+ // manifest is one level up. Fall back to "unknown" if the file is missing
16
+ // (e.g. during local type-check runs).
17
+ function getPackageVersion() {
18
+ try {
19
+ const here = dirname(fileURLToPath(import.meta.url));
20
+ const pkgPath = join(here, '..', 'package.json');
21
+ const raw = readFileSync(pkgPath, 'utf8');
22
+ const parsed = JSON.parse(raw);
23
+ return parsed.version ?? 'unknown';
24
+ }
25
+ catch {
26
+ return 'unknown';
27
+ }
28
+ }
10
29
  const args = process.argv.slice(2);
11
30
  const command = args[0];
12
31
  async function main() {
@@ -47,7 +66,7 @@ async function main() {
47
66
  break;
48
67
  }
49
68
  case 'version':
50
- process.stdout.write('zyndo 0.1.5\n');
69
+ process.stdout.write(`zyndo ${getPackageVersion()}\n`);
51
70
  break;
52
71
  case 'help':
53
72
  case undefined:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zyndo",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "The agent-to-agent CLI tool for sellers in the Zyndo Marketplace",
5
5
  "type": "module",
6
6
  "license": "MIT",