pandev 2.4.1

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/bin/pandev.js +52 -0
  2. package/package.json +29 -0
package/bin/pandev.js ADDED
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ // Тонкий лаунчер npx-канала. Всё содержательное живёт в платформенном пакете:
4
+ // тот же Java-бинарь (jlink-рантайм + jar), что ставится через Homebrew.
5
+ // Лаунчер только выбирает пакет под платформу и запускает его в B2C-режиме
6
+ // (PANDEV_B2C=1): команды cost на верхнем уровне, без login и демона.
7
+ const { spawnSync } = require('child_process');
8
+ const path = require('path');
9
+
10
+ const PLATFORMS = {
11
+ 'darwin arm64': '@pandev_metrics/cli-darwin-arm64',
12
+ 'darwin x64': '@pandev_metrics/cli-darwin-x64',
13
+ 'linux x64': '@pandev_metrics/cli-linux-x64',
14
+ };
15
+
16
+ const key = `${process.platform} ${process.arch}`;
17
+ const args = process.argv.slice(2);
18
+
19
+ if (args[0] === '--version' || args[0] === '-v' || args[0] === 'version') {
20
+ console.log('pandev ' + require('../package.json').version);
21
+ process.exit(0);
22
+ }
23
+
24
+ const pkgName = PLATFORMS[key];
25
+ if (!pkgName) {
26
+ console.error(`pandev: prebuilt binary for "${key}" is not published to npm yet.`);
27
+ if (process.platform === 'win32') {
28
+ console.error('On Windows install the beta via PowerShell:');
29
+ console.error(' iwr https://raw.githubusercontent.com/pandev-metriks/homebrew-pandev-cli-beta/main/install-experimental.ps1 -UseBasicParsing | iex');
30
+ }
31
+ process.exit(1);
32
+ }
33
+
34
+ let bin;
35
+ try {
36
+ bin = path.join(path.dirname(require.resolve(pkgName + '/package.json')), 'bin', 'pandev');
37
+ } catch (e) {
38
+ console.error(`pandev: platform package ${pkgName} is not installed.`);
39
+ console.error('npm skips it when os/cpu do not match; reinstall with matching platform,');
40
+ console.error('or check that optional dependencies are not disabled (--no-optional).');
41
+ process.exit(1);
42
+ }
43
+
44
+ const r = spawnSync(bin, args, {
45
+ stdio: 'inherit',
46
+ env: { ...process.env, PANDEV_B2C: '1' },
47
+ });
48
+ if (r.error) {
49
+ console.error('pandev: failed to start the bundled binary: ' + r.error.message);
50
+ process.exit(1);
51
+ }
52
+ process.exit(r.status === null ? 1 : r.status);
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "pandev",
3
+ "version": "2.4.1",
4
+ "description": "Local report on what your AI agents cost — by task, branch, prompt and file. No login, no daemon, no network.",
5
+ "bin": {
6
+ "pandev": "bin/pandev.js"
7
+ },
8
+ "files": [
9
+ "bin"
10
+ ],
11
+ "engines": {
12
+ "node": ">=18"
13
+ },
14
+ "license": "UNLICENSED",
15
+ "homepage": "https://pandev.io",
16
+ "keywords": [
17
+ "claude",
18
+ "claude-code",
19
+ "ai",
20
+ "tokens",
21
+ "cost",
22
+ "usage"
23
+ ],
24
+ "optionalDependencies": {
25
+ "@pandev_metrics/cli-darwin-arm64": "2.4.1",
26
+ "@pandev_metrics/cli-darwin-x64": "2.4.1",
27
+ "@pandev_metrics/cli-linux-x64": "2.4.1"
28
+ }
29
+ }