aicp-tracker 1.0.1 → 1.0.3
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/bin/setup.js +13 -1
- package/package.json +1 -1
- package/src/log-parser.js +1 -1
package/bin/setup.js
CHANGED
|
@@ -4,6 +4,18 @@
|
|
|
4
4
|
// Runs on `npm install` (postinstall). Skipped in CI environments.
|
|
5
5
|
if (process.env.CI || process.env.npm_config_yes) process.exit(0);
|
|
6
6
|
|
|
7
|
+
// Skip interactive setup on upgrade if already fully configured.
|
|
8
|
+
// The user can always re-run manually: aicp-tracker setup
|
|
9
|
+
const isPostinstall = process.env.npm_lifecycle_event === 'postinstall';
|
|
10
|
+
if (isPostinstall) {
|
|
11
|
+
let existing = null;
|
|
12
|
+
try { existing = require('../src/config').load(); } catch {}
|
|
13
|
+
if (existing?.apiKey && existing?.vcsUrl) {
|
|
14
|
+
console.log('\n [aicp-tracker] Already configured — skipping setup. Run `aicp-tracker setup` to reconfigure.\n');
|
|
15
|
+
process.exit(0);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
7
19
|
const { prompt } = require('enquirer');
|
|
8
20
|
const { execSync } = require('child_process');
|
|
9
21
|
const fs = require('fs');
|
|
@@ -12,7 +24,7 @@ const path = require('path');
|
|
|
12
24
|
const config = require('../src/config');
|
|
13
25
|
const daemon = require('../src/daemon');
|
|
14
26
|
|
|
15
|
-
const API_URL = '
|
|
27
|
+
const API_URL = 'https://aicp-tracker.duckdns.org';
|
|
16
28
|
const TASK_NAME = 'AI Code Pulse Tracker';
|
|
17
29
|
|
|
18
30
|
const PLANS = [
|
package/package.json
CHANGED
package/src/log-parser.js
CHANGED
|
@@ -88,7 +88,7 @@ function parseNewLines(filePath) {
|
|
|
88
88
|
enterprise_usd_per_token: null,
|
|
89
89
|
|
|
90
90
|
service_tier: usage.service_tier || null,
|
|
91
|
-
speed: usage.cache_creation_input_tokens > 0 ? 'fast' : 'normal',
|
|
91
|
+
speed: usage.speed || (usage.cache_creation_input_tokens > 0 ? 'fast' : 'normal'),
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
|