@backtest-kit/cli 9.8.0 → 9.8.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.
package/build/index.cjs CHANGED
@@ -383,6 +383,9 @@ class SetupUtils {
383
383
  BacktestKit.RecentLive.clear();
384
384
  BacktestKit.RecentBacktest.clear();
385
385
  }
386
+ {
387
+ BacktestKit.Broker.clear();
388
+ }
386
389
  };
387
390
  this.update = () => {
388
391
  cli.loggerService.debug("SetupUtils update");
@@ -3220,7 +3223,7 @@ const main$g = async () => {
3220
3223
  if (MODES.some((mode) => values[mode])) {
3221
3224
  return;
3222
3225
  }
3223
- process.stdout.write(`@backtest-kit/cli ${"9.8.0"}\n`);
3226
+ process.stdout.write(`@backtest-kit/cli ${"9.8.1"}\n`);
3224
3227
  process.stdout.write("\n");
3225
3228
  process.stdout.write(`Run with --help to see available commands.\n`);
3226
3229
  process.stdout.write("\n");
@@ -3505,12 +3508,6 @@ const main$a = async () => {
3505
3508
  if (!entryPoints.length) {
3506
3509
  throw new Error("At least one entry point is required");
3507
3510
  }
3508
- for (const entryPoint of entryPoints) {
3509
- if (values.noFlush) {
3510
- continue;
3511
- }
3512
- await flush(entryPoint);
3513
- }
3514
3511
  await cli.configConnectionService.loadConfig("setup.config");
3515
3512
  {
3516
3513
  const loader = await cli.configConnectionService.loadConfig("loader.config");
@@ -3527,12 +3524,22 @@ const main$a = async () => {
3527
3524
  }
3528
3525
  cli.frontendProviderService.connect();
3529
3526
  cli.telegramProviderService.connect();
3527
+ const cwd = process.cwd();
3530
3528
  {
3531
- const cwd = process.cwd();
3532
3529
  dotenv.config({ path: path.join(cwd, '.env'), override: true, quiet: true });
3533
3530
  }
3534
3531
  if (entryPoints.length === 1) {
3535
- process.chdir(path.dirname(path.resolve(entryPoints[0])));
3532
+ const absolutePath = path.resolve(entryPoints[0]);
3533
+ const moduleRoot = path.dirname(absolutePath);
3534
+ process.chdir(moduleRoot);
3535
+ cwd !== moduleRoot && Setup.update();
3536
+ dotenv.config({ path: path.join(moduleRoot, '.env'), override: true, quiet: true });
3537
+ }
3538
+ for (const entryPoint of entryPoints) {
3539
+ if (values.noFlush) {
3540
+ continue;
3541
+ }
3542
+ await flush(entryPoint);
3536
3543
  }
3537
3544
  await cli.moduleConnectionService.loadModule(MODE_MODULE[mode]);
3538
3545
  listenFinish();
@@ -4303,7 +4310,7 @@ const main$1 = async () => {
4303
4310
  if (!values.help) {
4304
4311
  return;
4305
4312
  }
4306
- process.stdout.write(`@backtest-kit/cli ${"9.8.0"}\n\n`);
4313
+ process.stdout.write(`@backtest-kit/cli ${"9.8.1"}\n\n`);
4307
4314
  process.stdout.write(HELP_TEXT);
4308
4315
  process.exit(0);
4309
4316
  };
@@ -4317,7 +4324,7 @@ const main = async () => {
4317
4324
  if (!values.version) {
4318
4325
  return;
4319
4326
  }
4320
- process.stdout.write(`@backtest-kit/cli ${"9.8.0"}\n`);
4327
+ process.stdout.write(`@backtest-kit/cli ${"9.8.1"}\n`);
4321
4328
  process.exit(0);
4322
4329
  };
4323
4330
  main();
package/build/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import * as BacktestKit from 'backtest-kit';
3
- import { setConfig, Notification, Recent, Storage, Markdown, Report, Dump, State, Memory, MarkdownWriter, ReportWriter, PersistSignalAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistPartialAdapter, PersistBreakevenAdapter, PersistCandleAdapter, PersistStorageAdapter, PersistNotificationAdapter, PersistLogAdapter, PersistMeasureAdapter, PersistIntervalAdapter, PersistMemoryAdapter, PersistRecentAdapter, PersistStateAdapter, PersistSessionAdapter, Log, StorageLive, StorageBacktest, NotificationLive, NotificationBacktest, RecentLive, RecentBacktest, SessionLive, SessionBacktest, MemoryLive, MemoryBacktest, StateLive, StateBacktest, listExchangeSchema, addExchangeSchema, roundTicks, listFrameSchema, addFrameSchema, listenDoneLive, listenDoneBacktest, shutdown, listenSignal, listStrategySchema, overrideExchangeSchema, Backtest, System, Cache, Interval, alignToInterval, addWalkerSchema, overrideWalkerSchema, Walker, listenDoneWalker, Live, getCandles, checkCandles, warmCandles, listenRisk, listenStrategyCommit, listenSync, listenSignalNotify, Exchange } from 'backtest-kit';
3
+ import { setConfig, Notification, Recent, Storage, Markdown, Report, Dump, State, Memory, MarkdownWriter, ReportWriter, PersistSignalAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistPartialAdapter, PersistBreakevenAdapter, PersistCandleAdapter, PersistStorageAdapter, PersistNotificationAdapter, PersistLogAdapter, PersistMeasureAdapter, PersistIntervalAdapter, PersistMemoryAdapter, PersistRecentAdapter, PersistStateAdapter, PersistSessionAdapter, Log, StorageLive, StorageBacktest, NotificationLive, NotificationBacktest, RecentLive, RecentBacktest, Broker, SessionLive, SessionBacktest, MemoryLive, MemoryBacktest, StateLive, StateBacktest, listExchangeSchema, addExchangeSchema, roundTicks, listFrameSchema, addFrameSchema, listenDoneLive, listenDoneBacktest, shutdown, listenSignal, listStrategySchema, overrideExchangeSchema, Backtest, System, Cache, Interval, alignToInterval, addWalkerSchema, overrideWalkerSchema, Walker, listenDoneWalker, Live, getCandles, checkCandles, warmCandles, listenRisk, listenStrategyCommit, listenSync, listenSignalNotify, Exchange } from 'backtest-kit';
4
4
  import { getErrorMessage, errorData, singleshot, str, BehaviorSubject, compose, createAwaiter, execpool, queued, sleep, randomString, TIMEOUT_SYMBOL, typo, retry, trycatch, memoize, isObject } from 'functools-kit';
5
5
  import fs, { constants, realpathSync } from 'fs';
6
6
  import * as stackTrace from 'stack-trace';
@@ -358,6 +358,9 @@ class SetupUtils {
358
358
  RecentLive.clear();
359
359
  RecentBacktest.clear();
360
360
  }
361
+ {
362
+ Broker.clear();
363
+ }
361
364
  };
362
365
  this.update = () => {
363
366
  cli.loggerService.debug("SetupUtils update");
@@ -3191,7 +3194,7 @@ const main$g = async () => {
3191
3194
  if (MODES.some((mode) => values[mode])) {
3192
3195
  return;
3193
3196
  }
3194
- process.stdout.write(`@backtest-kit/cli ${"9.8.0"}\n`);
3197
+ process.stdout.write(`@backtest-kit/cli ${"9.8.1"}\n`);
3195
3198
  process.stdout.write("\n");
3196
3199
  process.stdout.write(`Run with --help to see available commands.\n`);
3197
3200
  process.stdout.write("\n");
@@ -3476,12 +3479,6 @@ const main$a = async () => {
3476
3479
  if (!entryPoints.length) {
3477
3480
  throw new Error("At least one entry point is required");
3478
3481
  }
3479
- for (const entryPoint of entryPoints) {
3480
- if (values.noFlush) {
3481
- continue;
3482
- }
3483
- await flush(entryPoint);
3484
- }
3485
3482
  await cli.configConnectionService.loadConfig("setup.config");
3486
3483
  {
3487
3484
  const loader = await cli.configConnectionService.loadConfig("loader.config");
@@ -3498,12 +3495,22 @@ const main$a = async () => {
3498
3495
  }
3499
3496
  cli.frontendProviderService.connect();
3500
3497
  cli.telegramProviderService.connect();
3498
+ const cwd = process.cwd();
3501
3499
  {
3502
- const cwd = process.cwd();
3503
3500
  dotenv.config({ path: path.join(cwd, '.env'), override: true, quiet: true });
3504
3501
  }
3505
3502
  if (entryPoints.length === 1) {
3506
- process.chdir(path.dirname(path.resolve(entryPoints[0])));
3503
+ const absolutePath = path.resolve(entryPoints[0]);
3504
+ const moduleRoot = path.dirname(absolutePath);
3505
+ process.chdir(moduleRoot);
3506
+ cwd !== moduleRoot && Setup.update();
3507
+ dotenv.config({ path: path.join(moduleRoot, '.env'), override: true, quiet: true });
3508
+ }
3509
+ for (const entryPoint of entryPoints) {
3510
+ if (values.noFlush) {
3511
+ continue;
3512
+ }
3513
+ await flush(entryPoint);
3507
3514
  }
3508
3515
  await cli.moduleConnectionService.loadModule(MODE_MODULE[mode]);
3509
3516
  listenFinish();
@@ -4274,7 +4281,7 @@ const main$1 = async () => {
4274
4281
  if (!values.help) {
4275
4282
  return;
4276
4283
  }
4277
- process.stdout.write(`@backtest-kit/cli ${"9.8.0"}\n\n`);
4284
+ process.stdout.write(`@backtest-kit/cli ${"9.8.1"}\n\n`);
4278
4285
  process.stdout.write(HELP_TEXT);
4279
4286
  process.exit(0);
4280
4287
  };
@@ -4288,7 +4295,7 @@ const main = async () => {
4288
4295
  if (!values.version) {
4289
4296
  return;
4290
4297
  }
4291
- process.stdout.write(`@backtest-kit/cli ${"9.8.0"}\n`);
4298
+ process.stdout.write(`@backtest-kit/cli ${"9.8.1"}\n`);
4292
4299
  process.exit(0);
4293
4300
  };
4294
4301
  main();
@@ -15,17 +15,17 @@
15
15
  "@types/node": "25.6.0"
16
16
  },
17
17
  "dependencies": {
18
- "@backtest-kit/cli": "9.8.0",
19
- "@backtest-kit/graph": "9.8.0",
20
- "@backtest-kit/pinets": "9.8.0",
21
- "@backtest-kit/signals": "9.8.0",
22
- "@backtest-kit/ui": "9.8.0",
18
+ "@backtest-kit/cli": "9.8.1",
19
+ "@backtest-kit/graph": "9.8.1",
20
+ "@backtest-kit/pinets": "9.8.1",
21
+ "@backtest-kit/signals": "9.8.1",
22
+ "@backtest-kit/ui": "9.8.1",
23
23
  "@tavily/core": "0.7.2",
24
24
  "@tensorflow/tfjs": "4.22.0",
25
25
  "@tensorflow/tfjs-backend-wasm": "4.22.0",
26
26
  "@tensorflow/tfjs-core": "4.22.0",
27
27
  "agent-swarm-kit": "2.6.0",
28
- "backtest-kit": "9.8.0",
28
+ "backtest-kit": "9.8.1",
29
29
  "dayjs": "1.11.20",
30
30
  "functools-kit": "2.3.0",
31
31
  "garch": "1.2.3",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backtest-kit/cli",
3
- "version": "9.8.0",
3
+ "version": "9.8.1",
4
4
  "description": "Zero-boilerplate CLI runner for backtest-kit strategies. Run backtests, paper trading, and live bots with candle cache warming, web dashboard, and Telegram notifications — no setup code required.",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",
@@ -63,11 +63,11 @@
63
63
  "devDependencies": {
64
64
  "@babel/plugin-transform-modules-umd": "7.27.1",
65
65
  "@babel/standalone": "7.29.1",
66
- "@backtest-kit/graph": "9.8.0",
67
- "@backtest-kit/ollama": "9.8.0",
68
- "@backtest-kit/pinets": "9.8.0",
69
- "@backtest-kit/signals": "9.8.0",
70
- "@backtest-kit/ui": "9.8.0",
66
+ "@backtest-kit/graph": "9.8.1",
67
+ "@backtest-kit/ollama": "9.8.1",
68
+ "@backtest-kit/pinets": "9.8.1",
69
+ "@backtest-kit/signals": "9.8.1",
70
+ "@backtest-kit/ui": "9.8.1",
71
71
  "@rollup/plugin-replace": "6.0.3",
72
72
  "@rollup/plugin-typescript": "11.1.6",
73
73
  "@types/image-size": "0.7.0",
@@ -75,7 +75,7 @@
75
75
  "@types/mustache": "4.2.6",
76
76
  "@types/node": "22.9.0",
77
77
  "@types/stack-trace": "0.0.33",
78
- "backtest-kit": "9.8.0",
78
+ "backtest-kit": "9.8.1",
79
79
  "glob": "11.0.1",
80
80
  "markdown-it": "14.1.1",
81
81
  "rimraf": "6.0.1",
@@ -90,12 +90,12 @@
90
90
  "peerDependencies": {
91
91
  "@babel/plugin-transform-modules-umd": "^7.27.1",
92
92
  "@babel/standalone": "^7.29.1",
93
- "@backtest-kit/graph": "^9.8.0",
94
- "@backtest-kit/ollama": "^9.8.0",
95
- "@backtest-kit/pinets": "^9.8.0",
96
- "@backtest-kit/signals": "^9.8.0",
97
- "@backtest-kit/ui": "^9.8.0",
98
- "backtest-kit": "^9.8.0",
93
+ "@backtest-kit/graph": "^9.8.1",
94
+ "@backtest-kit/ollama": "^9.8.1",
95
+ "@backtest-kit/pinets": "^9.8.1",
96
+ "@backtest-kit/signals": "^9.8.1",
97
+ "@backtest-kit/ui": "^9.8.1",
98
+ "backtest-kit": "^9.8.1",
99
99
  "markdown-it": "^14.1.1",
100
100
  "typescript": "^5.0.0"
101
101
  },
@@ -13,12 +13,12 @@
13
13
  "license": "ISC",
14
14
  "type": "commonjs",
15
15
  "dependencies": {
16
- "@backtest-kit/cli": "^9.8.0",
17
- "@backtest-kit/graph": "^9.8.0",
18
- "@backtest-kit/pinets": "^9.8.0",
19
- "@backtest-kit/ui": "^9.8.0",
16
+ "@backtest-kit/cli": "^9.8.1",
17
+ "@backtest-kit/graph": "^9.8.1",
18
+ "@backtest-kit/pinets": "^9.8.1",
19
+ "@backtest-kit/ui": "^9.8.1",
20
20
  "agent-swarm-kit": "^2.6.0",
21
- "backtest-kit": "^9.8.0",
21
+ "backtest-kit": "^9.8.1",
22
22
  "functools-kit": "^2.3.0",
23
23
  "garch": "^1.2.3",
24
24
  "get-moment-stamp": "^1.1.2",