@backtest-kit/cli 19.6.0 → 19.7.0

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
@@ -146,6 +146,7 @@ function treeKill(pid, signalOrCallback, callback) {
146
146
  }
147
147
 
148
148
  const DRAIN_MAX_AWAIT = 250;
149
+ const KILL_SYMBOL = Symbol.for("backtest-kit-kill");
149
150
  const drainStream = (stream) => new Promise((resolve) => {
150
151
  if (stream.writableLength === 0) {
151
152
  stream.write("", () => resolve());
@@ -164,6 +165,7 @@ const flushStream = (stream) => {
164
165
  return drainStream(stream);
165
166
  };
166
167
  const kill = functoolsKit.singleshot(async (code = -1) => {
168
+ globalThis[KILL_SYMBOL] = 1;
167
169
  await Promise.race([
168
170
  Promise.all([
169
171
  flushStream(process.stdout),
@@ -462,6 +464,10 @@ const SETUP_ADAPTER_FN = () => {
462
464
  BacktestKit.StateLive.usePersist();
463
465
  BacktestKit.StateBacktest.useLocal();
464
466
  }
467
+ {
468
+ BacktestKit.DictionaryLive.usePersist();
469
+ BacktestKit.DictionaryBacktest.useLocal();
470
+ }
465
471
  {
466
472
  BacktestKit.Markdown.useDummy();
467
473
  BacktestKit.Log.useJsonl();
@@ -487,6 +493,7 @@ class SetupUtils {
487
493
  BacktestKit.Report.enable();
488
494
  BacktestKit.Dump.enable();
489
495
  BacktestKit.State.enable();
496
+ BacktestKit.Dictionary.enable();
490
497
  BacktestKit.Memory.enable();
491
498
  }
492
499
  if (!cli.configConnectionService.hasConfig("setup.config")) {
@@ -512,6 +519,7 @@ class SetupUtils {
512
519
  BacktestKit.Report.disable();
513
520
  BacktestKit.Dump.disable();
514
521
  BacktestKit.State.disable();
522
+ BacktestKit.Dictionary.disable();
515
523
  BacktestKit.Memory.disable();
516
524
  }
517
525
  {
@@ -535,6 +543,7 @@ class SetupUtils {
535
543
  BacktestKit.PersistMemoryAdapter.clear();
536
544
  BacktestKit.PersistRecentAdapter.clear();
537
545
  BacktestKit.PersistStateAdapter.clear();
546
+ BacktestKit.PersistDictionaryAdapter.clear();
538
547
  BacktestKit.PersistSessionAdapter.clear();
539
548
  BacktestKit.PersistStrategyAdapter.clear();
540
549
  }
@@ -3731,7 +3740,7 @@ const main$j = async () => {
3731
3740
  if (MODES.some((mode) => values[mode])) {
3732
3741
  return;
3733
3742
  }
3734
- process.stdout.write(`@backtest-kit/cli ${"19.6.0"}\n`);
3743
+ process.stdout.write(`@backtest-kit/cli ${"19.7.0"}\n`);
3735
3744
  process.stdout.write("\n");
3736
3745
  process.stdout.write(`Run with --help to see available commands.\n`);
3737
3746
  process.stdout.write("\n");
@@ -5661,7 +5670,7 @@ const main$1 = async () => {
5661
5670
  if (!values.help) {
5662
5671
  return;
5663
5672
  }
5664
- process.stdout.write(`@backtest-kit/cli ${"19.6.0"}\n\n`);
5673
+ process.stdout.write(`@backtest-kit/cli ${"19.7.0"}\n\n`);
5665
5674
  process.stdout.write(HELP_TEXT);
5666
5675
  process.exit(0);
5667
5676
  };
@@ -5675,7 +5684,7 @@ const main = async () => {
5675
5684
  if (!values.version) {
5676
5685
  return;
5677
5686
  }
5678
- process.stdout.write(`@backtest-kit/cli ${"19.6.0"}\n`);
5687
+ process.stdout.write(`@backtest-kit/cli ${"19.7.0"}\n`);
5679
5688
  process.exit(0);
5680
5689
  };
5681
5690
  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, listenExit, emitters, OrderDeletedError, OrderRejectedError, OrderTransientError, GeneralExpectedError, Notification, Cron, Recent, Storage, Markdown, Report, Dump, State, Memory, MarkdownWriter, ReportWriter, PersistSignalAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistPartialAdapter, PersistBreakevenAdapter, PersistCandleAdapter, PersistStorageAdapter, PersistNotificationAdapter, PersistLogAdapter, PersistMeasureAdapter, PersistIntervalAdapter, PersistMemoryAdapter, PersistRecentAdapter, PersistStateAdapter, PersistSessionAdapter, PersistStrategyAdapter, 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, listenOrderFill, listenOrderReject, listenOrderContinue, listenOrderStop, listenSignalNotify, Exchange, runInMockContext, addSweepSchema, Sweep } from 'backtest-kit';
3
+ import { setConfig, listenExit, emitters, OrderDeletedError, OrderRejectedError, OrderTransientError, GeneralExpectedError, Notification, Cron, Recent, Storage, Markdown, Report, Dump, State, Dictionary, Memory, MarkdownWriter, ReportWriter, PersistSignalAdapter, PersistRiskAdapter, PersistScheduleAdapter, PersistPartialAdapter, PersistBreakevenAdapter, PersistCandleAdapter, PersistStorageAdapter, PersistNotificationAdapter, PersistLogAdapter, PersistMeasureAdapter, PersistIntervalAdapter, PersistMemoryAdapter, PersistRecentAdapter, PersistStateAdapter, PersistDictionaryAdapter, PersistSessionAdapter, PersistStrategyAdapter, Log, StorageLive, StorageBacktest, NotificationLive, NotificationBacktest, RecentLive, RecentBacktest, Broker, SessionLive, SessionBacktest, MemoryLive, MemoryBacktest, StateLive, StateBacktest, DictionaryLive, DictionaryBacktest, 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, listenOrderFill, listenOrderReject, listenOrderContinue, listenOrderStop, listenSignalNotify, Exchange, runInMockContext, addSweepSchema, Sweep } from 'backtest-kit';
4
4
  import { singleshot, sleep, getErrorMessage, errorData, BehaviorSubject, Subject, str, compose, createAwaiter, execpool, queued, randomString, TIMEOUT_SYMBOL, typo, retry, trycatch, ttl, Source, memoize, isObject } from 'functools-kit';
5
5
  import { exec, spawn } from 'child_process';
6
6
  import fs, { constants, realpathSync } from 'fs';
@@ -121,6 +121,7 @@ function treeKill(pid, signalOrCallback, callback) {
121
121
  }
122
122
 
123
123
  const DRAIN_MAX_AWAIT = 250;
124
+ const KILL_SYMBOL = Symbol.for("backtest-kit-kill");
124
125
  const drainStream = (stream) => new Promise((resolve) => {
125
126
  if (stream.writableLength === 0) {
126
127
  stream.write("", () => resolve());
@@ -139,6 +140,7 @@ const flushStream = (stream) => {
139
140
  return drainStream(stream);
140
141
  };
141
142
  const kill = singleshot(async (code = -1) => {
143
+ globalThis[KILL_SYMBOL] = 1;
142
144
  await Promise.race([
143
145
  Promise.all([
144
146
  flushStream(process.stdout),
@@ -437,6 +439,10 @@ const SETUP_ADAPTER_FN = () => {
437
439
  StateLive.usePersist();
438
440
  StateBacktest.useLocal();
439
441
  }
442
+ {
443
+ DictionaryLive.usePersist();
444
+ DictionaryBacktest.useLocal();
445
+ }
440
446
  {
441
447
  Markdown.useDummy();
442
448
  Log.useJsonl();
@@ -462,6 +468,7 @@ class SetupUtils {
462
468
  Report.enable();
463
469
  Dump.enable();
464
470
  State.enable();
471
+ Dictionary.enable();
465
472
  Memory.enable();
466
473
  }
467
474
  if (!cli.configConnectionService.hasConfig("setup.config")) {
@@ -487,6 +494,7 @@ class SetupUtils {
487
494
  Report.disable();
488
495
  Dump.disable();
489
496
  State.disable();
497
+ Dictionary.disable();
490
498
  Memory.disable();
491
499
  }
492
500
  {
@@ -510,6 +518,7 @@ class SetupUtils {
510
518
  PersistMemoryAdapter.clear();
511
519
  PersistRecentAdapter.clear();
512
520
  PersistStateAdapter.clear();
521
+ PersistDictionaryAdapter.clear();
513
522
  PersistSessionAdapter.clear();
514
523
  PersistStrategyAdapter.clear();
515
524
  }
@@ -3699,7 +3708,7 @@ const main$j = async () => {
3699
3708
  if (MODES.some((mode) => values[mode])) {
3700
3709
  return;
3701
3710
  }
3702
- process.stdout.write(`@backtest-kit/cli ${"19.6.0"}\n`);
3711
+ process.stdout.write(`@backtest-kit/cli ${"19.7.0"}\n`);
3703
3712
  process.stdout.write("\n");
3704
3713
  process.stdout.write(`Run with --help to see available commands.\n`);
3705
3714
  process.stdout.write("\n");
@@ -5629,7 +5638,7 @@ const main$1 = async () => {
5629
5638
  if (!values.help) {
5630
5639
  return;
5631
5640
  }
5632
- process.stdout.write(`@backtest-kit/cli ${"19.6.0"}\n\n`);
5641
+ process.stdout.write(`@backtest-kit/cli ${"19.7.0"}\n\n`);
5633
5642
  process.stdout.write(HELP_TEXT);
5634
5643
  process.exit(0);
5635
5644
  };
@@ -5643,7 +5652,7 @@ const main = async () => {
5643
5652
  if (!values.version) {
5644
5653
  return;
5645
5654
  }
5646
- process.stdout.write(`@backtest-kit/cli ${"19.6.0"}\n`);
5655
+ process.stdout.write(`@backtest-kit/cli ${"19.7.0"}\n`);
5647
5656
  process.exit(0);
5648
5657
  };
5649
5658
  main();
@@ -15,17 +15,17 @@
15
15
  "@types/node": "25.6.0"
16
16
  },
17
17
  "dependencies": {
18
- "@backtest-kit/cli": "19.6.0",
19
- "@backtest-kit/graph": "19.6.0",
20
- "@backtest-kit/pinets": "19.6.0",
21
- "@backtest-kit/signals": "19.6.0",
22
- "@backtest-kit/ui": "19.6.0",
18
+ "@backtest-kit/cli": "19.7.0",
19
+ "@backtest-kit/graph": "19.7.0",
20
+ "@backtest-kit/pinets": "19.7.0",
21
+ "@backtest-kit/signals": "19.7.0",
22
+ "@backtest-kit/ui": "19.7.0",
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": "6.0.0",
28
- "backtest-kit": "19.6.0",
28
+ "backtest-kit": "19.7.0",
29
29
  "dayjs": "1.11.20",
30
30
  "functools-kit": "5.0.0",
31
31
  "garch": "2.0.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backtest-kit/cli",
3
- "version": "19.6.0",
3
+ "version": "19.7.0",
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": "19.6.0",
67
- "@backtest-kit/ollama": "19.6.0",
68
- "@backtest-kit/pinets": "19.6.0",
69
- "@backtest-kit/signals": "19.6.0",
70
- "@backtest-kit/ui": "19.6.0",
66
+ "@backtest-kit/graph": "19.7.0",
67
+ "@backtest-kit/ollama": "19.7.0",
68
+ "@backtest-kit/pinets": "19.7.0",
69
+ "@backtest-kit/signals": "19.7.0",
70
+ "@backtest-kit/ui": "19.7.0",
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": "19.6.0",
78
+ "backtest-kit": "19.7.0",
79
79
  "glob": "11.0.1",
80
80
  "markdown-it": "14.1.1",
81
81
  "rimraf": "6.0.1",
@@ -85,21 +85,21 @@
85
85
  "ts-morph": "27.0.2",
86
86
  "tslib": "2.7.0",
87
87
  "typedoc": "0.27.9",
88
- "pinets": "0.9.33",
88
+ "pinets": "0.9.34",
89
89
  "ccxt": "4.5.39",
90
90
  "worker-testbed": "4.0.0"
91
91
  },
92
92
  "peerDependencies": {
93
93
  "@babel/plugin-transform-modules-umd": "^7.27.1",
94
94
  "@babel/standalone": "^7.29.1",
95
- "@backtest-kit/graph": "^19.6.0",
96
- "@backtest-kit/ollama": "^19.6.0",
97
- "@backtest-kit/pinets": "^19.6.0",
98
- "@backtest-kit/signals": "^19.6.0",
99
- "@backtest-kit/ui": "^19.6.0",
100
- "pinets": "^0.9.33",
95
+ "@backtest-kit/graph": "^19.7.0",
96
+ "@backtest-kit/ollama": "^19.7.0",
97
+ "@backtest-kit/pinets": "^19.7.0",
98
+ "@backtest-kit/signals": "^19.7.0",
99
+ "@backtest-kit/ui": "^19.7.0",
100
+ "pinets": "^0.9.34",
101
101
  "ccxt": "^4.5.39",
102
- "backtest-kit": "^19.6.0",
102
+ "backtest-kit": "^19.7.0",
103
103
  "markdown-it": "^14.1.1",
104
104
  "typescript": "^5.0.0"
105
105
  },
@@ -13,12 +13,12 @@
13
13
  "license": "ISC",
14
14
  "type": "commonjs",
15
15
  "dependencies": {
16
- "@backtest-kit/cli": "^19.6.0",
17
- "@backtest-kit/graph": "^19.6.0",
18
- "@backtest-kit/pinets": "^19.6.0",
19
- "@backtest-kit/ui": "^19.6.0",
16
+ "@backtest-kit/cli": "^19.7.0",
17
+ "@backtest-kit/graph": "^19.7.0",
18
+ "@backtest-kit/pinets": "^19.7.0",
19
+ "@backtest-kit/ui": "^19.7.0",
20
20
  "agent-swarm-kit": "^6.0.0",
21
- "backtest-kit": "^19.6.0",
21
+ "backtest-kit": "^19.7.0",
22
22
  "functools-kit": "^5.0.0",
23
23
  "garch": "^2.0.0",
24
24
  "get-moment-stamp": "^3.0.0",