@backtest-kit/cli 8.5.0 → 9.1.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/README.md CHANGED
@@ -298,7 +298,7 @@ import {
298
298
  addFrameSchema,
299
299
  addStrategySchema,
300
300
  Backtest,
301
- Cache,
301
+ warmCandles,
302
302
  } from "backtest-kit";
303
303
  import ccxt from "ccxt";
304
304
 
@@ -336,12 +336,14 @@ for (const symbol of symbols) {
336
336
  //
337
337
  // Optional
338
338
  //
339
- // await Cache.warmup(["1m", "15m", "1h"], {
340
- // exchangeName: "binance",
341
- // frameName: "feb-2026",
339
+ // await warmCandles({
340
+ // exchangeName: "binance,
341
+ // from: new Date("2026-01-01T00:00:00Z"),
342
+ // to: new Date("2026-01-31T23:59:59Z"),
343
+ // interval: "1m",
342
344
  // symbol,
343
- // });
344
- //
345
+ // })
346
+
345
347
 
346
348
  Backtest.background(symbol, {
347
349
  strategyName: "my-strategy",
package/build/index.cjs CHANGED
@@ -335,6 +335,23 @@ class ResolveService {
335
335
  }
336
336
  _is_launched = true;
337
337
  };
338
+ this.attachEntry = async (jsPath) => {
339
+ this.loggerService.log("resolveService attachEntry", {
340
+ jsPath
341
+ });
342
+ if (_is_launched) {
343
+ throw new Error("Entry point is already attached. Multiple entry points are not allowed.");
344
+ }
345
+ const absolutePath = path.resolve(jsPath);
346
+ const cwd = process.cwd();
347
+ await fs$1.access(absolutePath, fs.constants.F_OK | fs.constants.R_OK);
348
+ dotenv.config({ path: path.join(cwd, '.env'), override: true, quiet: true });
349
+ {
350
+ this.loaderService.import(absolutePath);
351
+ await entrySubject.next(absolutePath);
352
+ }
353
+ _is_launched = true;
354
+ };
338
355
  }
339
356
  }
340
357
 
@@ -681,6 +698,9 @@ const notifyFinish = functoolsKit.singleshot(() => {
681
698
  });
682
699
 
683
700
  const getEntry = (metaUrl) => {
701
+ if (!process.argv[1]) {
702
+ return "";
703
+ }
684
704
  const metaPath = url.fileURLToPath(metaUrl);
685
705
  const realArgv = fs.realpathSync(process.argv[1]);
686
706
  return path.resolve(realArgv) === path.resolve(metaPath);
@@ -3031,7 +3051,7 @@ const main$g = async () => {
3031
3051
  if (MODES.some((mode) => values[mode])) {
3032
3052
  return;
3033
3053
  }
3034
- process.stdout.write(`@backtest-kit/cli ${"8.5.0"}\n`);
3054
+ process.stdout.write(`@backtest-kit/cli ${"9.1.0"}\n`);
3035
3055
  process.stdout.write("\n");
3036
3056
  process.stdout.write(`Run with --help to see available commands.\n`);
3037
3057
  process.stdout.write("\n");
@@ -3326,7 +3346,7 @@ const main$a = async () => {
3326
3346
  await cli.moduleConnectionService.loadModule(MODE_MODULE[mode]);
3327
3347
  listenFinish();
3328
3348
  createGracefulShutdown(mode)();
3329
- await cli.resolveService.attachJavascript(entryPoint);
3349
+ await cli.resolveService.attachEntry(entryPoint);
3330
3350
  };
3331
3351
  main$a();
3332
3352
 
@@ -4034,7 +4054,7 @@ const main$1 = async () => {
4034
4054
  if (!values.help) {
4035
4055
  return;
4036
4056
  }
4037
- process.stdout.write(`@backtest-kit/cli ${"8.5.0"}\n\n`);
4057
+ process.stdout.write(`@backtest-kit/cli ${"9.1.0"}\n\n`);
4038
4058
  process.stdout.write(HELP_TEXT);
4039
4059
  process.exit(0);
4040
4060
  };
@@ -4048,7 +4068,7 @@ const main = async () => {
4048
4068
  if (!values.version) {
4049
4069
  return;
4050
4070
  }
4051
- process.stdout.write(`@backtest-kit/cli ${"8.5.0"}\n`);
4071
+ process.stdout.write(`@backtest-kit/cli ${"9.1.0"}\n`);
4052
4072
  process.exit(0);
4053
4073
  };
4054
4074
  main();
package/build/index.mjs CHANGED
@@ -310,6 +310,23 @@ class ResolveService {
310
310
  }
311
311
  _is_launched = true;
312
312
  };
313
+ this.attachEntry = async (jsPath) => {
314
+ this.loggerService.log("resolveService attachEntry", {
315
+ jsPath
316
+ });
317
+ if (_is_launched) {
318
+ throw new Error("Entry point is already attached. Multiple entry points are not allowed.");
319
+ }
320
+ const absolutePath = path.resolve(jsPath);
321
+ const cwd = process.cwd();
322
+ await access(absolutePath, constants.F_OK | constants.R_OK);
323
+ dotenv.config({ path: path.join(cwd, '.env'), override: true, quiet: true });
324
+ {
325
+ this.loaderService.import(absolutePath);
326
+ await entrySubject.next(absolutePath);
327
+ }
328
+ _is_launched = true;
329
+ };
313
330
  }
314
331
  }
315
332
 
@@ -656,6 +673,9 @@ const notifyFinish = singleshot(() => {
656
673
  });
657
674
 
658
675
  const getEntry = (metaUrl) => {
676
+ if (!process.argv[1]) {
677
+ return "";
678
+ }
659
679
  const metaPath = fileURLToPath(metaUrl);
660
680
  const realArgv = realpathSync(process.argv[1]);
661
681
  return path.resolve(realArgv) === path.resolve(metaPath);
@@ -3002,7 +3022,7 @@ const main$g = async () => {
3002
3022
  if (MODES.some((mode) => values[mode])) {
3003
3023
  return;
3004
3024
  }
3005
- process.stdout.write(`@backtest-kit/cli ${"8.5.0"}\n`);
3025
+ process.stdout.write(`@backtest-kit/cli ${"9.1.0"}\n`);
3006
3026
  process.stdout.write("\n");
3007
3027
  process.stdout.write(`Run with --help to see available commands.\n`);
3008
3028
  process.stdout.write("\n");
@@ -3297,7 +3317,7 @@ const main$a = async () => {
3297
3317
  await cli.moduleConnectionService.loadModule(MODE_MODULE[mode]);
3298
3318
  listenFinish();
3299
3319
  createGracefulShutdown(mode)();
3300
- await cli.resolveService.attachJavascript(entryPoint);
3320
+ await cli.resolveService.attachEntry(entryPoint);
3301
3321
  };
3302
3322
  main$a();
3303
3323
 
@@ -4005,7 +4025,7 @@ const main$1 = async () => {
4005
4025
  if (!values.help) {
4006
4026
  return;
4007
4027
  }
4008
- process.stdout.write(`@backtest-kit/cli ${"8.5.0"}\n\n`);
4028
+ process.stdout.write(`@backtest-kit/cli ${"9.1.0"}\n\n`);
4009
4029
  process.stdout.write(HELP_TEXT);
4010
4030
  process.exit(0);
4011
4031
  };
@@ -4019,7 +4039,7 @@ const main = async () => {
4019
4039
  if (!values.version) {
4020
4040
  return;
4021
4041
  }
4022
- process.stdout.write(`@backtest-kit/cli ${"8.5.0"}\n`);
4042
+ process.stdout.write(`@backtest-kit/cli ${"9.1.0"}\n`);
4023
4043
  process.exit(0);
4024
4044
  };
4025
4045
  main();
@@ -15,17 +15,17 @@
15
15
  "@types/node": "25.6.0"
16
16
  },
17
17
  "dependencies": {
18
- "@backtest-kit/cli": "8.5.0",
19
- "@backtest-kit/graph": "8.5.0",
20
- "@backtest-kit/pinets": "8.5.0",
21
- "@backtest-kit/signals": "8.5.0",
22
- "@backtest-kit/ui": "8.5.0",
18
+ "@backtest-kit/cli": "9.1.0",
19
+ "@backtest-kit/graph": "9.1.0",
20
+ "@backtest-kit/pinets": "9.1.0",
21
+ "@backtest-kit/signals": "9.1.0",
22
+ "@backtest-kit/ui": "9.1.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": "2.6.0",
28
- "backtest-kit": "8.5.0",
28
+ "backtest-kit": "9.1.0",
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": "8.5.0",
3
+ "version": "9.1.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": "8.5.0",
67
- "@backtest-kit/ollama": "8.5.0",
68
- "@backtest-kit/pinets": "8.5.0",
69
- "@backtest-kit/signals": "8.5.0",
70
- "@backtest-kit/ui": "8.5.0",
66
+ "@backtest-kit/graph": "9.1.0",
67
+ "@backtest-kit/ollama": "9.1.0",
68
+ "@backtest-kit/pinets": "9.1.0",
69
+ "@backtest-kit/signals": "9.1.0",
70
+ "@backtest-kit/ui": "9.1.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": "8.5.0",
78
+ "backtest-kit": "9.1.0",
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": "^8.5.0",
94
- "@backtest-kit/ollama": "^8.5.0",
95
- "@backtest-kit/pinets": "^8.5.0",
96
- "@backtest-kit/signals": "^8.5.0",
97
- "@backtest-kit/ui": "^8.5.0",
98
- "backtest-kit": "^8.5.0",
93
+ "@backtest-kit/graph": "^9.1.0",
94
+ "@backtest-kit/ollama": "^9.1.0",
95
+ "@backtest-kit/pinets": "^9.1.0",
96
+ "@backtest-kit/signals": "^9.1.0",
97
+ "@backtest-kit/ui": "^9.1.0",
98
+ "backtest-kit": "^9.1.0",
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": "^8.5.0",
17
- "@backtest-kit/graph": "^8.5.0",
18
- "@backtest-kit/pinets": "^8.5.0",
19
- "@backtest-kit/ui": "^8.5.0",
16
+ "@backtest-kit/cli": "^9.1.0",
17
+ "@backtest-kit/graph": "^9.1.0",
18
+ "@backtest-kit/pinets": "^9.1.0",
19
+ "@backtest-kit/ui": "^9.1.0",
20
20
  "agent-swarm-kit": "^2.6.0",
21
- "backtest-kit": "^8.5.0",
21
+ "backtest-kit": "^9.1.0",
22
22
  "functools-kit": "^2.3.0",
23
23
  "garch": "^1.2.3",
24
24
  "get-moment-stamp": "^1.1.2",
package/types.d.ts CHANGED
@@ -222,6 +222,7 @@ declare class ResolveService implements IResolve {
222
222
  attachPine: (pinePath: string) => Promise<string>;
223
223
  attachStrategy: (jsPath: string) => Promise<void>;
224
224
  attachJavascript: (jsPath: string) => Promise<void>;
225
+ attachEntry: (jsPath: string) => Promise<void>;
225
226
  }
226
227
 
227
228
  declare class ErrorService {