tokentracker-cli 0.5.8 → 0.5.10
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 +1 -1
- package/src/commands/init.js +2 -1
- package/src/commands/serve.js +12 -0
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -43,7 +43,7 @@ const {
|
|
|
43
43
|
probeOpenclawSessionPluginState,
|
|
44
44
|
} = require("../lib/openclaw-session-plugin");
|
|
45
45
|
const { resolveTrackerPaths } = require("../lib/tracker-paths");
|
|
46
|
-
const { resolveRuntimeConfig } = require("../lib/runtime-config");
|
|
46
|
+
const { resolveRuntimeConfig, DEFAULT_BASE_URL } = require("../lib/runtime-config");
|
|
47
47
|
const {
|
|
48
48
|
BOLD,
|
|
49
49
|
DIM,
|
|
@@ -257,6 +257,7 @@ async function runSetup({
|
|
|
257
257
|
|
|
258
258
|
const config = {
|
|
259
259
|
installedAt,
|
|
260
|
+
baseUrl: DEFAULT_BASE_URL,
|
|
260
261
|
};
|
|
261
262
|
|
|
262
263
|
await writeJson(configPath, config);
|
package/src/commands/serve.js
CHANGED
|
@@ -26,6 +26,18 @@ async function cmdServe(argv) {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
// 0.1 Ensure config.json baseUrl matches the canonical default
|
|
30
|
+
try {
|
|
31
|
+
const { DEFAULT_BASE_URL } = require("../lib/runtime-config");
|
|
32
|
+
const { readJson, writeJson } = require("../lib/fs");
|
|
33
|
+
const cfgPath = path.join(trackerDir, "config.json");
|
|
34
|
+
const cfg = await readJson(cfgPath);
|
|
35
|
+
if (cfg && cfg.baseUrl !== DEFAULT_BASE_URL) {
|
|
36
|
+
cfg.baseUrl = DEFAULT_BASE_URL;
|
|
37
|
+
await writeJson(cfgPath, cfg);
|
|
38
|
+
}
|
|
39
|
+
} catch { /* ignore */ }
|
|
40
|
+
|
|
29
41
|
// 1. Optional sync
|
|
30
42
|
if (opts.sync) {
|
|
31
43
|
process.stdout.write("Syncing local data...\n");
|