@alphafox/cli 0.2.0 → 0.3.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/README.md +42 -4
- package/dist/auth/loopback-callback.js +6 -6
- package/dist/catalog/command-tree.d.ts +1 -0
- package/dist/catalog/command-tree.js +5 -3
- package/dist/catalog/validate-body.d.ts +22 -0
- package/dist/catalog/validate-body.js +98 -0
- package/dist/commands/request-body.d.ts +21 -0
- package/dist/commands/request-body.js +92 -0
- package/dist/commands/run.js +113 -10
- package/dist/engine-backtest/errors.d.ts +18 -0
- package/dist/engine-backtest/errors.js +26 -0
- package/dist/engine-backtest/fetch-runtime.d.ts +38 -0
- package/dist/engine-backtest/fetch-runtime.js +170 -0
- package/dist/engine-backtest/native-import.d.ts +1 -0
- package/dist/engine-backtest/native-import.js +10 -0
- package/dist/engine-backtest/parse-args.d.ts +6 -0
- package/dist/engine-backtest/parse-args.js +281 -0
- package/dist/engine-backtest/persist.d.ts +32 -0
- package/dist/engine-backtest/persist.js +94 -0
- package/dist/engine-backtest/replay-timeframe.d.ts +16 -0
- package/dist/engine-backtest/replay-timeframe.js +48 -0
- package/dist/engine-backtest/resolve-packages.d.ts +27 -0
- package/dist/engine-backtest/resolve-packages.js +288 -0
- package/dist/engine-backtest/run-command.d.ts +38 -0
- package/dist/engine-backtest/run-command.js +540 -0
- package/dist/engine-backtest/types.d.ts +249 -0
- package/dist/engine-backtest/types.js +2 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +16 -1
- package/dist/install/exec.d.ts +13 -0
- package/dist/install/exec.js +77 -0
- package/dist/install/package-root.d.ts +4 -0
- package/dist/install/package-root.js +59 -0
- package/dist/install/types.d.ts +69 -0
- package/dist/install/types.js +26 -0
- package/dist/install/wizard.d.ts +21 -0
- package/dist/install/wizard.js +330 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/.nojekyll +0 -0
- package/docs/alphafox-cli-installation-guide.md +105 -0
- package/docs/favicon.svg +4 -0
- package/docs/index.html +748 -0
- package/docs/logo/alphafox-mark.svg +4 -0
- package/docs/logo/alphafox-wordmark-black-en.svg +17 -0
- package/docs/logo/alphafox-wordmark-white-en.svg +16 -0
- package/docs/release-supply-chain.md +10 -2
- package/package.json +7 -2
- package/skills/account/SKILL.md +2 -2
- package/skills/admin/SKILL.md +2 -2
- package/skills/alphafox-shared/SKILL.md +22 -1
- package/skills/auth/SKILL.md +1 -1
- package/skills/engine-backtest/SKILL.md +71 -0
- package/skills/exchange/SKILL.md +2 -2
- package/skills/market/SKILL.md +1 -1
- package/skills/notification/SKILL.md +2 -2
- package/skills/strategy/SKILL.md +10 -2
- package/skills/trading/SKILL.md +6 -3
- package/vendor/backtest-runner/NOTICE.md +1 -0
- package/vendor/backtest-runner/README.md +97 -0
- package/vendor/backtest-runner/index.d.ts +423 -0
- package/vendor/backtest-runner/index.mjs +59 -0
- package/vendor/backtest-runner/lib/abortable.mjs +23 -0
- package/vendor/backtest-runner/lib/cache.mjs +159 -0
- package/vendor/backtest-runner/lib/coverage.mjs +238 -0
- package/vendor/backtest-runner/lib/encode.mjs +28 -0
- package/vendor/backtest-runner/lib/exchanges.mjs +143 -0
- package/vendor/backtest-runner/lib/proxy.mjs +78 -0
- package/vendor/backtest-runner/lib/scenario.mjs +66 -0
- package/vendor/backtest-runner/lib/series.mjs +370 -0
- package/vendor/backtest-runner/lib/tape-loader.mjs +614 -0
- package/vendor/backtest-runner/lib/timeframes.mjs +55 -0
- package/vendor/backtest-runner/package.json +13 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type FetchRuntimeHooks } from "./fetch-runtime";
|
|
2
|
+
import type { BacktestRunnerModule, BacktestWasmModule } from "./types";
|
|
3
|
+
export type PackageKind = "wasm" | "runner";
|
|
4
|
+
export interface ResolvedPackagePath {
|
|
5
|
+
readonly kind: PackageKind;
|
|
6
|
+
readonly specifier: string;
|
|
7
|
+
readonly filePath: string;
|
|
8
|
+
readonly source: "env_dir" | "engine_root" | "sibling" | "vendor" | "blob";
|
|
9
|
+
}
|
|
10
|
+
export interface ResolvePackageHooks extends FetchRuntimeHooks {
|
|
11
|
+
readonly requireResolve?: (specifier: string) => string;
|
|
12
|
+
readonly importModule?: (fileUrl: string) => Promise<unknown>;
|
|
13
|
+
readonly exists?: (path: string) => boolean;
|
|
14
|
+
readonly readFile?: (path: string) => string;
|
|
15
|
+
readonly cliRoot?: string;
|
|
16
|
+
readonly callerFilename?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function findCliRoot(startDir: string, hooks?: ResolvePackageHooks): string | undefined;
|
|
19
|
+
export declare function resolveBacktestPackagePath(kind: PackageKind, env?: NodeJS.ProcessEnv, hooks?: ResolvePackageHooks): ResolvedPackagePath;
|
|
20
|
+
export declare function loadBacktestWasm(env?: NodeJS.ProcessEnv, hooks?: ResolvePackageHooks): Promise<{
|
|
21
|
+
readonly module: BacktestWasmModule;
|
|
22
|
+
readonly resolved: ResolvedPackagePath;
|
|
23
|
+
}>;
|
|
24
|
+
export declare function loadBacktestRunner(env?: NodeJS.ProcessEnv, hooks?: ResolvePackageHooks): Promise<{
|
|
25
|
+
readonly module: BacktestRunnerModule;
|
|
26
|
+
readonly resolved: ResolvedPackagePath;
|
|
27
|
+
}>;
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findCliRoot = findCliRoot;
|
|
4
|
+
exports.resolveBacktestPackagePath = resolveBacktestPackagePath;
|
|
5
|
+
exports.loadBacktestWasm = loadBacktestWasm;
|
|
6
|
+
exports.loadBacktestRunner = loadBacktestRunner;
|
|
7
|
+
const node_fs_1 = require("node:fs");
|
|
8
|
+
const node_module_1 = require("node:module");
|
|
9
|
+
const node_path_1 = require("node:path");
|
|
10
|
+
const node_url_1 = require("node:url");
|
|
11
|
+
const errors_1 = require("./errors");
|
|
12
|
+
const fetch_runtime_1 = require("./fetch-runtime");
|
|
13
|
+
const native_import_1 = require("./native-import");
|
|
14
|
+
const WASM_SPEC = "@alphafoxai/backtest-wasm/node";
|
|
15
|
+
const RUNNER_SPEC = "@alphafoxai/backtest-runner";
|
|
16
|
+
const PACKAGE_DESCRIPTORS = {
|
|
17
|
+
wasm: {
|
|
18
|
+
specifier: WASM_SPEC,
|
|
19
|
+
envKey: "ALPHAFOX_BACKTEST_WASM_DIR",
|
|
20
|
+
npmName: "backtest-wasm",
|
|
21
|
+
exportKey: "./node",
|
|
22
|
+
useMainFallback: false,
|
|
23
|
+
entryCandidates: ["node.mjs", "node.js", "node.cjs"],
|
|
24
|
+
installHint: "Set ALPHAFOX_BACKTEST_WASM_DIR / ALPHAFOX_ENGINE_ROOT, or ALPHAFOX_USE_LOCAL_BACKTEST=1 with a sibling Engine build. Otherwise the CLI downloads the Node runtime from Vercel Blob.",
|
|
25
|
+
},
|
|
26
|
+
runner: {
|
|
27
|
+
specifier: RUNNER_SPEC,
|
|
28
|
+
envKey: "ALPHAFOX_BACKTEST_RUNNER_DIR",
|
|
29
|
+
npmName: "backtest-runner",
|
|
30
|
+
exportKey: ".",
|
|
31
|
+
useMainFallback: true,
|
|
32
|
+
entryCandidates: ["index.mjs", "index.js", "index.cjs"],
|
|
33
|
+
installHint: "The tape runner is bundled with the CLI. Override with ALPHAFOX_BACKTEST_RUNNER_DIR / ALPHAFOX_ENGINE_ROOT.",
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
function existsPath(path, hooks) {
|
|
37
|
+
return hooks?.exists ? hooks.exists(path) : (0, node_fs_1.existsSync)(path);
|
|
38
|
+
}
|
|
39
|
+
function readText(path, hooks) {
|
|
40
|
+
return hooks?.readFile ? hooks.readFile(path) : (0, node_fs_1.readFileSync)(path, "utf8");
|
|
41
|
+
}
|
|
42
|
+
function callerFilename(hooks) {
|
|
43
|
+
return hooks?.callerFilename ?? __filename;
|
|
44
|
+
}
|
|
45
|
+
function findCliRoot(startDir, hooks) {
|
|
46
|
+
if (hooks?.cliRoot)
|
|
47
|
+
return hooks.cliRoot;
|
|
48
|
+
let dir = startDir;
|
|
49
|
+
for (let i = 0; i < 10; i += 1) {
|
|
50
|
+
const pkgPath = (0, node_path_1.join)(dir, "package.json");
|
|
51
|
+
if (existsPath(pkgPath, hooks)) {
|
|
52
|
+
try {
|
|
53
|
+
const pkg = JSON.parse(readText(pkgPath, hooks));
|
|
54
|
+
if (pkg.name === "@alphafox/cli")
|
|
55
|
+
return dir;
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
// keep walking
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const parent = (0, node_path_1.dirname)(dir);
|
|
62
|
+
if (parent === dir)
|
|
63
|
+
break;
|
|
64
|
+
dir = parent;
|
|
65
|
+
}
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
function entryFromPackageDir(dir, kind, hooks) {
|
|
69
|
+
if (!existsPath(dir, hooks))
|
|
70
|
+
return undefined;
|
|
71
|
+
const descriptor = PACKAGE_DESCRIPTORS[kind];
|
|
72
|
+
const pkgPath = (0, node_path_1.join)(dir, "package.json");
|
|
73
|
+
if (existsPath(pkgPath, hooks)) {
|
|
74
|
+
try {
|
|
75
|
+
const req = (0, node_module_1.createRequire)(pkgPath);
|
|
76
|
+
return req.resolve(descriptor.specifier);
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
// fall through to known filenames
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
const pkg = JSON.parse(readText(pkgPath, hooks));
|
|
83
|
+
const exp = pkg.exports?.[descriptor.exportKey];
|
|
84
|
+
const mainFallback = descriptor.useMainFallback ? pkg.main : undefined;
|
|
85
|
+
const file = typeof exp === "string"
|
|
86
|
+
? exp
|
|
87
|
+
: exp && typeof exp === "object"
|
|
88
|
+
? String(exp.default ??
|
|
89
|
+
exp.import ??
|
|
90
|
+
mainFallback ??
|
|
91
|
+
"")
|
|
92
|
+
: (mainFallback ?? "");
|
|
93
|
+
if (file) {
|
|
94
|
+
const abs = (0, node_path_1.join)(dir, file);
|
|
95
|
+
if (existsPath(abs, hooks))
|
|
96
|
+
return abs;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
// ignore malformed package.json
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
for (const name of descriptor.entryCandidates) {
|
|
104
|
+
const abs = (0, node_path_1.join)(dir, name);
|
|
105
|
+
if (existsPath(abs, hooks))
|
|
106
|
+
return abs;
|
|
107
|
+
}
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
function toAbsDir(raw) {
|
|
111
|
+
return (0, node_path_1.isAbsolute)(raw) ? raw : (0, node_path_1.join)(process.cwd(), raw);
|
|
112
|
+
}
|
|
113
|
+
function shouldUseLocalOverride(env) {
|
|
114
|
+
return env.ALPHAFOX_USE_LOCAL_BACKTEST === "1";
|
|
115
|
+
}
|
|
116
|
+
function hasExplicitLocalDir(kind, env) {
|
|
117
|
+
return Boolean(env[PACKAGE_DESCRIPTORS[kind].envKey]?.trim() ||
|
|
118
|
+
env.ALPHAFOX_ENGINE_ROOT?.trim() ||
|
|
119
|
+
shouldUseLocalOverride(env));
|
|
120
|
+
}
|
|
121
|
+
function resolveBacktestPackagePath(kind, env = process.env, hooks) {
|
|
122
|
+
const descriptor = PACKAGE_DESCRIPTORS[kind];
|
|
123
|
+
const { specifier, envKey, npmName } = descriptor;
|
|
124
|
+
const tried = [];
|
|
125
|
+
const envDir = env[envKey]?.trim();
|
|
126
|
+
if (envDir) {
|
|
127
|
+
const abs = toAbsDir(envDir);
|
|
128
|
+
const entry = entryFromPackageDir(abs, kind, hooks);
|
|
129
|
+
if (entry) {
|
|
130
|
+
return { kind, specifier, filePath: entry, source: "env_dir" };
|
|
131
|
+
}
|
|
132
|
+
throw new errors_1.EngineBacktestError({
|
|
133
|
+
type: "runtime",
|
|
134
|
+
subtype: "package_unresolved",
|
|
135
|
+
message: `Cannot resolve ${specifier} from ${envKey}=${abs}`,
|
|
136
|
+
hint: `Point ${envKey} at the npm/${npmName} package directory (must contain ${descriptor.entryCandidates[0]}).`,
|
|
137
|
+
details: { specifier, envKey, dir: abs, tried },
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
tried.push(`${envKey}:(unset)`);
|
|
141
|
+
const engineRoot = env.ALPHAFOX_ENGINE_ROOT?.trim();
|
|
142
|
+
if (engineRoot) {
|
|
143
|
+
const dir = (0, node_path_1.join)(toAbsDir(engineRoot), "npm", npmName);
|
|
144
|
+
const entry = entryFromPackageDir(dir, kind, hooks);
|
|
145
|
+
if (entry) {
|
|
146
|
+
return { kind, specifier, filePath: entry, source: "engine_root" };
|
|
147
|
+
}
|
|
148
|
+
throw new errors_1.EngineBacktestError({
|
|
149
|
+
type: "runtime",
|
|
150
|
+
subtype: "package_unresolved",
|
|
151
|
+
message: `Cannot resolve ${specifier} from ALPHAFOX_ENGINE_ROOT=${engineRoot}`,
|
|
152
|
+
hint: `Expected ${dir} to contain the ${npmName} package.`,
|
|
153
|
+
details: { specifier, dir, tried },
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
tried.push("ALPHAFOX_ENGINE_ROOT:(unset)");
|
|
157
|
+
if (shouldUseLocalOverride(env)) {
|
|
158
|
+
const cliRoot = findCliRoot((0, node_path_1.dirname)(callerFilename(hooks)), hooks);
|
|
159
|
+
if (cliRoot) {
|
|
160
|
+
const dir = (0, node_path_1.join)(cliRoot, "..", "alphafox-engine", "npm", npmName);
|
|
161
|
+
const entry = entryFromPackageDir(dir, kind, hooks);
|
|
162
|
+
if (entry) {
|
|
163
|
+
return { kind, specifier, filePath: entry, source: "sibling" };
|
|
164
|
+
}
|
|
165
|
+
tried.push(`sibling:${dir}`);
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
tried.push("sibling:(cli root not found)");
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
tried.push("sibling:(requires ALPHAFOX_USE_LOCAL_BACKTEST=1)");
|
|
173
|
+
}
|
|
174
|
+
throw new errors_1.EngineBacktestError({
|
|
175
|
+
type: "runtime",
|
|
176
|
+
subtype: "package_unresolved",
|
|
177
|
+
message: `Cannot resolve ${specifier}`,
|
|
178
|
+
hint: descriptor.installHint,
|
|
179
|
+
details: { specifier, tried },
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
function resolveVendoredRunner(hooks) {
|
|
183
|
+
const cliRoot = findCliRoot((0, node_path_1.dirname)(callerFilename(hooks)), hooks);
|
|
184
|
+
if (!cliRoot) {
|
|
185
|
+
throw new errors_1.EngineBacktestError({
|
|
186
|
+
type: "runtime",
|
|
187
|
+
subtype: "package_unresolved",
|
|
188
|
+
message: `Cannot resolve ${RUNNER_SPEC} from the vendored runner`,
|
|
189
|
+
hint: PACKAGE_DESCRIPTORS.runner.installHint,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
const dir = (0, node_path_1.join)(cliRoot, "vendor", "backtest-runner");
|
|
193
|
+
const entry = entryFromPackageDir(dir, "runner", hooks);
|
|
194
|
+
if (!entry) {
|
|
195
|
+
throw new errors_1.EngineBacktestError({
|
|
196
|
+
type: "runtime",
|
|
197
|
+
subtype: "package_unresolved",
|
|
198
|
+
message: `Cannot resolve ${RUNNER_SPEC} from ${dir}`,
|
|
199
|
+
hint: PACKAGE_DESCRIPTORS.runner.installHint,
|
|
200
|
+
details: { specifier: RUNNER_SPEC, dir },
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
return {
|
|
204
|
+
kind: "runner",
|
|
205
|
+
specifier: RUNNER_SPEC,
|
|
206
|
+
filePath: entry,
|
|
207
|
+
source: "vendor",
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
async function importFile(filePath, hooks) {
|
|
211
|
+
const url = (0, node_url_1.pathToFileURL)(filePath).href;
|
|
212
|
+
if (hooks?.importModule) {
|
|
213
|
+
return hooks.importModule(url);
|
|
214
|
+
}
|
|
215
|
+
return (0, native_import_1.importNativeModule)(url);
|
|
216
|
+
}
|
|
217
|
+
function assertWasmModule(mod, filePath) {
|
|
218
|
+
if (!mod ||
|
|
219
|
+
typeof mod !== "object" ||
|
|
220
|
+
typeof mod.createNodeBacktestClient !== "function") {
|
|
221
|
+
throw new errors_1.EngineBacktestError({
|
|
222
|
+
type: "runtime",
|
|
223
|
+
subtype: "package_invalid",
|
|
224
|
+
message: `${WASM_SPEC} does not export createNodeBacktestClient`,
|
|
225
|
+
details: { filePath },
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
return mod;
|
|
229
|
+
}
|
|
230
|
+
function assertRunnerModule(mod, filePath) {
|
|
231
|
+
if (!mod || typeof mod !== "object") {
|
|
232
|
+
throw new errors_1.EngineBacktestError({
|
|
233
|
+
type: "runtime",
|
|
234
|
+
subtype: "package_invalid",
|
|
235
|
+
message: `${RUNNER_SPEC} is not a module`,
|
|
236
|
+
details: { filePath },
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
const m = mod;
|
|
240
|
+
for (const name of [
|
|
241
|
+
"loadTape",
|
|
242
|
+
"assembleScenario",
|
|
243
|
+
"resolveTapeExchange",
|
|
244
|
+
]) {
|
|
245
|
+
if (typeof m[name] !== "function") {
|
|
246
|
+
throw new errors_1.EngineBacktestError({
|
|
247
|
+
type: "runtime",
|
|
248
|
+
subtype: "package_invalid",
|
|
249
|
+
message: `${RUNNER_SPEC} does not export ${name}`,
|
|
250
|
+
details: { filePath },
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
if (!m.DEFAULT_EXECUTION_MODEL) {
|
|
255
|
+
throw new errors_1.EngineBacktestError({
|
|
256
|
+
type: "runtime",
|
|
257
|
+
subtype: "package_invalid",
|
|
258
|
+
message: `${RUNNER_SPEC} does not export DEFAULT_EXECUTION_MODEL`,
|
|
259
|
+
details: { filePath },
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
return m;
|
|
263
|
+
}
|
|
264
|
+
async function loadBacktestWasm(env = process.env, hooks) {
|
|
265
|
+
if (hasExplicitLocalDir("wasm", env)) {
|
|
266
|
+
const resolved = resolveBacktestPackagePath("wasm", env, hooks);
|
|
267
|
+
const mod = assertWasmModule(await importFile(resolved.filePath, hooks), resolved.filePath);
|
|
268
|
+
return { module: mod, resolved };
|
|
269
|
+
}
|
|
270
|
+
const runtime = await (0, fetch_runtime_1.ensureBlobRuntime)(env, hooks);
|
|
271
|
+
const mod = assertWasmModule(await importFile(runtime.nodeEntry, hooks), runtime.nodeEntry);
|
|
272
|
+
return {
|
|
273
|
+
module: mod,
|
|
274
|
+
resolved: {
|
|
275
|
+
kind: "wasm",
|
|
276
|
+
specifier: WASM_SPEC,
|
|
277
|
+
filePath: runtime.nodeEntry,
|
|
278
|
+
source: "blob",
|
|
279
|
+
},
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
async function loadBacktestRunner(env = process.env, hooks) {
|
|
283
|
+
const resolved = hasExplicitLocalDir("runner", env)
|
|
284
|
+
? resolveBacktestPackagePath("runner", env, hooks)
|
|
285
|
+
: resolveVendoredRunner(hooks);
|
|
286
|
+
const mod = assertRunnerModule(await importFile(resolved.filePath, hooks), resolved.filePath);
|
|
287
|
+
return { module: mod, resolved };
|
|
288
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ApiRequestOptions, ApiResponse } from "../http/client";
|
|
2
|
+
import { loadTokens } from "../keychain/store";
|
|
3
|
+
import { type ResolvePackageHooks } from "./resolve-packages";
|
|
4
|
+
import type { BacktestRunnerModule, BacktestWasmModule, EngineBacktestRunArgs, EngineBacktestRunSuccess } from "./types";
|
|
5
|
+
export interface EngineBacktestCliFlags {
|
|
6
|
+
readonly profile?: string;
|
|
7
|
+
readonly format: "json" | "jsonl" | "text";
|
|
8
|
+
readonly yes: boolean;
|
|
9
|
+
readonly dryRun: boolean;
|
|
10
|
+
readonly noInput: boolean;
|
|
11
|
+
readonly unsafeCustomEndpoint?: string;
|
|
12
|
+
readonly jq?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface EngineBacktestRunDeps {
|
|
15
|
+
readonly loadTape?: BacktestRunnerModule["loadTape"];
|
|
16
|
+
readonly assembleScenario?: BacktestRunnerModule["assembleScenario"];
|
|
17
|
+
readonly resolveTapeExchange?: BacktestRunnerModule["resolveTapeExchange"];
|
|
18
|
+
readonly defaultExecutionModel?: BacktestRunnerModule["DEFAULT_EXECUTION_MODEL"];
|
|
19
|
+
readonly createNodeBacktestClient?: BacktestWasmModule["createNodeBacktestClient"];
|
|
20
|
+
readonly apiRequest?: (options: ApiRequestOptions, env?: NodeJS.ProcessEnv) => Promise<ApiResponse>;
|
|
21
|
+
readonly loadTokens?: typeof loadTokens;
|
|
22
|
+
readonly readFile?: (path: string) => string;
|
|
23
|
+
readonly cwd?: string;
|
|
24
|
+
readonly randomUUID?: () => string;
|
|
25
|
+
readonly writeLine?: (value: unknown) => void;
|
|
26
|
+
readonly resolveHooks?: ResolvePackageHooks;
|
|
27
|
+
}
|
|
28
|
+
export declare function loadConfigValue(raw: string, options?: {
|
|
29
|
+
readonly cwd?: string;
|
|
30
|
+
readonly readFile?: (path: string) => string;
|
|
31
|
+
}): unknown;
|
|
32
|
+
export declare function executeEngineBacktestRun(args: EngineBacktestRunArgs, flags: EngineBacktestCliFlags, env?: NodeJS.ProcessEnv, deps?: EngineBacktestRunDeps): Promise<EngineBacktestRunSuccess>;
|
|
33
|
+
export declare function engineBacktestHelpData(): {
|
|
34
|
+
readonly name: string;
|
|
35
|
+
readonly usage: string[];
|
|
36
|
+
readonly notes: string[];
|
|
37
|
+
};
|
|
38
|
+
export declare function cmdEngineBacktest(args: string[], flags: EngineBacktestCliFlags, env?: NodeJS.ProcessEnv, deps?: EngineBacktestRunDeps): Promise<number>;
|