@solongate/proxy 0.82.31 → 0.82.33
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/dist/api-client/policies.d.ts +63 -0
- package/dist/commands/index.js +4 -0
- package/dist/index.js +599 -451
- package/dist/tui/index.js +587 -447
- package/dist/tui/panels/DryRun.d.ts +5 -0
- package/package.json +1 -1
|
@@ -81,3 +81,66 @@ export declare function dryRun(body: {
|
|
|
81
81
|
from?: number;
|
|
82
82
|
to?: number;
|
|
83
83
|
}): Promise<DryRunResult>;
|
|
84
|
+
export interface BacktestSummary {
|
|
85
|
+
evaluated: number;
|
|
86
|
+
would_allow: number;
|
|
87
|
+
would_deny: number;
|
|
88
|
+
newly_blocked: number;
|
|
89
|
+
newly_allowed: number;
|
|
90
|
+
unchanged: number;
|
|
91
|
+
}
|
|
92
|
+
export interface BacktestPerRule {
|
|
93
|
+
rule_id: string;
|
|
94
|
+
matched: number;
|
|
95
|
+
newly_blocked: number;
|
|
96
|
+
newly_allowed: number;
|
|
97
|
+
}
|
|
98
|
+
export interface BacktestPerTool {
|
|
99
|
+
tool: string;
|
|
100
|
+
evaluated: number;
|
|
101
|
+
changed: number;
|
|
102
|
+
newly_blocked: number;
|
|
103
|
+
newly_allowed: number;
|
|
104
|
+
}
|
|
105
|
+
export interface BacktestPerAgent {
|
|
106
|
+
agent: string;
|
|
107
|
+
evaluated: number;
|
|
108
|
+
changed: number;
|
|
109
|
+
newly_blocked: number;
|
|
110
|
+
newly_allowed: number;
|
|
111
|
+
}
|
|
112
|
+
export interface BacktestBucket {
|
|
113
|
+
bucket: number;
|
|
114
|
+
evaluated: number;
|
|
115
|
+
newly_blocked: number;
|
|
116
|
+
newly_allowed: number;
|
|
117
|
+
}
|
|
118
|
+
export interface BacktestSample {
|
|
119
|
+
id: string;
|
|
120
|
+
tool: string;
|
|
121
|
+
agent: string;
|
|
122
|
+
preview: string;
|
|
123
|
+
original: string;
|
|
124
|
+
predicted: string;
|
|
125
|
+
matched_rule_id: string | null;
|
|
126
|
+
created_at: string | number;
|
|
127
|
+
}
|
|
128
|
+
export interface BacktestResult {
|
|
129
|
+
mode: 'bulk';
|
|
130
|
+
engine: string;
|
|
131
|
+
sampled?: number;
|
|
132
|
+
limit?: number;
|
|
133
|
+
summary: BacktestSummary;
|
|
134
|
+
per_rule: BacktestPerRule[];
|
|
135
|
+
per_tool: BacktestPerTool[];
|
|
136
|
+
per_agent: BacktestPerAgent[];
|
|
137
|
+
timeseries: BacktestBucket[];
|
|
138
|
+
samples: BacktestSample[];
|
|
139
|
+
}
|
|
140
|
+
export declare function backtest(body: {
|
|
141
|
+
rules: PolicyRule[] | Partial<PolicyRule>[];
|
|
142
|
+
mode?: PolicyMode;
|
|
143
|
+
limit?: number;
|
|
144
|
+
from?: number;
|
|
145
|
+
to?: number;
|
|
146
|
+
}): Promise<BacktestResult>;
|
package/dist/commands/index.js
CHANGED
|
@@ -157,6 +157,7 @@ var policies_exports = {};
|
|
|
157
157
|
__export(policies_exports, {
|
|
158
158
|
active: () => active,
|
|
159
159
|
addRule: () => addRule,
|
|
160
|
+
backtest: () => backtest,
|
|
160
161
|
create: () => create,
|
|
161
162
|
dryRun: () => dryRun,
|
|
162
163
|
get: () => get,
|
|
@@ -206,6 +207,9 @@ function setActive(policyId) {
|
|
|
206
207
|
function dryRun(body) {
|
|
207
208
|
return request("POST", "/policies/dry-run", { body });
|
|
208
209
|
}
|
|
210
|
+
function backtest(body) {
|
|
211
|
+
return request("POST", "/policies/backtest", { body });
|
|
212
|
+
}
|
|
209
213
|
|
|
210
214
|
// src/api-client/settings.ts
|
|
211
215
|
var settings_exports = {};
|