@senpi-ai/runtime 1.0.79 → 1.0.81
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/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +45 -1
- package/dist/index.js.map +1 -1
- package/dist/runtime/auto-update/coordinator.d.ts +11 -1
- package/dist/runtime/auto-update/coordinator.d.ts.map +1 -1
- package/dist/runtime/auto-update/coordinator.js +69 -11
- package/dist/runtime/auto-update/coordinator.js.map +1 -1
- package/dist/runtime/auto-update/state-store.d.ts +12 -3
- package/dist/runtime/auto-update/state-store.d.ts.map +1 -1
- package/dist/runtime/auto-update/state-store.js +16 -4
- package/dist/runtime/auto-update/state-store.js.map +1 -1
- package/dist/runtime/auto-update/types.d.ts +1 -4
- package/dist/runtime/auto-update/types.d.ts.map +1 -1
- package/dist/runtime/auto-update/types.js +5 -6
- package/dist/runtime/auto-update/types.js.map +1 -1
- package/dist/runtime/runtime-schema.d.ts +72 -72
- package/dist/scanners/implementations/market-regime.d.ts +1 -1
- package/dist/senpi/client.d.ts +2 -1
- package/dist/senpi/client.d.ts.map +1 -1
- package/dist/senpi/client.js +26 -0
- package/dist/senpi/client.js.map +1 -1
- package/dist/senpi/index.d.ts +1 -1
- package/dist/senpi/index.d.ts.map +1 -1
- package/dist/senpi/types.d.ts +30 -0
- package/dist/senpi/types.d.ts.map +1 -1
- package/openclaw.plugin.json +5 -5
- package/package.json +1 -1
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/** Whether the updater installs updates automatically or only sends notifications. */
|
|
2
2
|
export type AutoUpdateMode = "notify-only" | "auto-apply";
|
|
3
|
-
/** Strategy for restarting the process after an update (currently unused -- restart is via config bump). */
|
|
4
|
-
export type AutoUpdateRestartStrategy = "manual" | "process-exit";
|
|
5
3
|
/** Classification of the semver distance between the current and latest version. */
|
|
6
4
|
export type AutoUpdateKind = "none" | "patch" | "minor" | "major";
|
|
7
5
|
/** Whether the gateway can be restarted automatically after an update. */
|
|
@@ -21,7 +19,6 @@ export interface AutoUpdateConfig {
|
|
|
21
19
|
allowMinor: boolean;
|
|
22
20
|
/** Hard policy: always `false`. Major versions require manual update. */
|
|
23
21
|
allowMajor: boolean;
|
|
24
|
-
restartStrategy: AutoUpdateRestartStrategy;
|
|
25
22
|
failureBackoffMinutes: number;
|
|
26
23
|
maxBackoffMinutes: number;
|
|
27
24
|
/** Internal key written by the auto-updater to trigger gateway restart via config reload. */
|
|
@@ -93,7 +90,7 @@ export declare const AUTO_UPDATE_STATE_FILE = "auto-update-state.json";
|
|
|
93
90
|
* Parse and normalise the raw `autoUpdate` config block from the plugin config.
|
|
94
91
|
*
|
|
95
92
|
* When the block is `undefined` (user omitted it), all defaults apply:
|
|
96
|
-
* enabled, auto-apply mode,
|
|
93
|
+
* enabled, auto-apply mode, 1-minute poll interval, 30-second startup delay.
|
|
97
94
|
* Numeric values are clamped to safe ranges. `allowMajor` is always forced to `false`.
|
|
98
95
|
*
|
|
99
96
|
* @param value - Raw `autoUpdate` value from the plugin config (may be undefined).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/runtime/auto-update/types.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,YAAY,CAAC;AAE1D,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/runtime/auto-update/types.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,YAAY,CAAC;AAE1D,oFAAoF;AACpF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAElE,0EAA0E;AAC1E,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,WAAW,gBAAg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AAU,GAAG,WAAW,GAAG,UAAU,CAAC;AAEjF;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,cAAc,CAAC;IAC/B,aAAa,EAAE,cAAc,CAAC;IAC9B,MAAM,EAAE,gBAAgB,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,wBAAwB,EAAE,MAAM,EAAE,CAAC;IACnC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC;AAED,0EAA0E;AAC1E,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAc/D;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAmBxE;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,cAAc,GAC5B,eAAe,CAUjB"}
|
|
@@ -13,7 +13,7 @@ function clamp(value, min, max) {
|
|
|
13
13
|
* Parse and normalise the raw `autoUpdate` config block from the plugin config.
|
|
14
14
|
*
|
|
15
15
|
* When the block is `undefined` (user omitted it), all defaults apply:
|
|
16
|
-
* enabled, auto-apply mode,
|
|
16
|
+
* enabled, auto-apply mode, 1-minute poll interval, 30-second startup delay.
|
|
17
17
|
* Numeric values are clamped to safe ranges. `allowMajor` is always forced to `false`.
|
|
18
18
|
*
|
|
19
19
|
* @param value - Raw `autoUpdate` value from the plugin config (may be undefined).
|
|
@@ -27,15 +27,14 @@ export function resolveAutoUpdateConfig(value) {
|
|
|
27
27
|
return {
|
|
28
28
|
enabled: toBool(raw.enabled, true),
|
|
29
29
|
mode,
|
|
30
|
-
pollIntervalMinutes: clamp(toFinite(raw.pollIntervalMinutes,
|
|
31
|
-
startupDelaySeconds: clamp(toFinite(raw.startupDelaySeconds,
|
|
30
|
+
pollIntervalMinutes: clamp(toFinite(raw.pollIntervalMinutes, 1), 1, 24 * 60),
|
|
31
|
+
startupDelaySeconds: clamp(toFinite(raw.startupDelaySeconds, 30), 5, 15 * 60),
|
|
32
32
|
allowPatch: toBool(raw.allowPatch, true),
|
|
33
33
|
allowMinor: toBool(raw.allowMinor, true),
|
|
34
34
|
// Hard policy requirement.
|
|
35
35
|
allowMajor: false,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
maxBackoffMinutes: clamp(toFinite(raw.maxBackoffMinutes, 12 * 60), 5, 7 * 24 * 60),
|
|
36
|
+
failureBackoffMinutes: clamp(toFinite(raw.failureBackoffMinutes, 2), 1, 24 * 60),
|
|
37
|
+
maxBackoffMinutes: clamp(toFinite(raw.maxBackoffMinutes, 30), 1, 7 * 24 * 60),
|
|
39
38
|
lastRestartTrigger: typeof raw.lastRestartTrigger === "string" ? raw.lastRestartTrigger : undefined,
|
|
40
39
|
};
|
|
41
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/runtime/auto-update/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/runtime/auto-update/types.ts"],"names":[],"mappings":"AA8FA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAE/D,SAAS,MAAM,CAAC,KAAc,EAAE,QAAiB;IAC/C,OAAO,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,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AAE,KAAK;QACjB,qBAAqB,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC;QAChF,iBAAiB,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,iBAAiB,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;QAC7E,kBAAkB,EAAE,OAAO,GAAG,CAAC,kBAAkB,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC,SAAS;KACpG,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAC1C,cAAsB,EACtB,aAA6B;IAE7B,OAAO;QACL,sBAAsB,EAAE,cAAc;QACtC,qBAAqB,EAAE,cAAc;QACrC,aAAa,EAAE,EAAE;QACjB,mBAAmB,EAAE,CAAC;QACtB,aAAa;QACb,iBAAiB,EAAE,SAAS;QAC5B,wBAAwB,EAAE,EAAE;KAC7B,CAAC;AACJ,CAAC"}
|
|
@@ -175,20 +175,20 @@ declare const actionEntrySchema: z.ZodObject<{
|
|
|
175
175
|
type: z.ZodLiteral<"strategy">;
|
|
176
176
|
value: z.ZodString;
|
|
177
177
|
}, "strip", z.ZodTypeAny, {
|
|
178
|
-
value: string;
|
|
179
178
|
type: "strategy";
|
|
180
|
-
}, {
|
|
181
179
|
value: string;
|
|
180
|
+
}, {
|
|
182
181
|
type: "strategy";
|
|
182
|
+
value: string;
|
|
183
183
|
}>, z.ZodObject<{
|
|
184
184
|
type: z.ZodLiteral<"asset-trend">;
|
|
185
185
|
value: z.ZodString;
|
|
186
186
|
}, "strip", z.ZodTypeAny, {
|
|
187
|
-
value: string;
|
|
188
187
|
type: "asset-trend";
|
|
189
|
-
}, {
|
|
190
188
|
value: string;
|
|
189
|
+
}, {
|
|
191
190
|
type: "asset-trend";
|
|
191
|
+
value: string;
|
|
192
192
|
}>]>, "many">>;
|
|
193
193
|
decision_prompt: z.ZodOptional<z.ZodString>;
|
|
194
194
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -221,20 +221,20 @@ declare const actionEntrySchema: z.ZodObject<{
|
|
|
221
221
|
type: z.ZodLiteral<"strategy">;
|
|
222
222
|
value: z.ZodString;
|
|
223
223
|
}, "strip", z.ZodTypeAny, {
|
|
224
|
-
value: string;
|
|
225
224
|
type: "strategy";
|
|
226
|
-
}, {
|
|
227
225
|
value: string;
|
|
226
|
+
}, {
|
|
228
227
|
type: "strategy";
|
|
228
|
+
value: string;
|
|
229
229
|
}>, z.ZodObject<{
|
|
230
230
|
type: z.ZodLiteral<"asset-trend">;
|
|
231
231
|
value: z.ZodString;
|
|
232
232
|
}, "strip", z.ZodTypeAny, {
|
|
233
|
-
value: string;
|
|
234
233
|
type: "asset-trend";
|
|
235
|
-
}, {
|
|
236
234
|
value: string;
|
|
235
|
+
}, {
|
|
237
236
|
type: "asset-trend";
|
|
237
|
+
value: string;
|
|
238
238
|
}>]>, "many">>;
|
|
239
239
|
decision_prompt: z.ZodOptional<z.ZodString>;
|
|
240
240
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -267,20 +267,20 @@ declare const actionEntrySchema: z.ZodObject<{
|
|
|
267
267
|
type: z.ZodLiteral<"strategy">;
|
|
268
268
|
value: z.ZodString;
|
|
269
269
|
}, "strip", z.ZodTypeAny, {
|
|
270
|
-
value: string;
|
|
271
270
|
type: "strategy";
|
|
272
|
-
}, {
|
|
273
271
|
value: string;
|
|
272
|
+
}, {
|
|
274
273
|
type: "strategy";
|
|
274
|
+
value: string;
|
|
275
275
|
}>, z.ZodObject<{
|
|
276
276
|
type: z.ZodLiteral<"asset-trend">;
|
|
277
277
|
value: z.ZodString;
|
|
278
278
|
}, "strip", z.ZodTypeAny, {
|
|
279
|
-
value: string;
|
|
280
279
|
type: "asset-trend";
|
|
281
|
-
}, {
|
|
282
280
|
value: string;
|
|
281
|
+
}, {
|
|
283
282
|
type: "asset-trend";
|
|
283
|
+
value: string;
|
|
284
284
|
}>]>, "many">>;
|
|
285
285
|
decision_prompt: z.ZodOptional<z.ZodString>;
|
|
286
286
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -480,20 +480,20 @@ export declare const runtimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
480
480
|
type: z.ZodLiteral<"strategy">;
|
|
481
481
|
value: z.ZodString;
|
|
482
482
|
}, "strip", z.ZodTypeAny, {
|
|
483
|
-
value: string;
|
|
484
483
|
type: "strategy";
|
|
485
|
-
}, {
|
|
486
484
|
value: string;
|
|
485
|
+
}, {
|
|
487
486
|
type: "strategy";
|
|
487
|
+
value: string;
|
|
488
488
|
}>, z.ZodObject<{
|
|
489
489
|
type: z.ZodLiteral<"asset-trend">;
|
|
490
490
|
value: z.ZodString;
|
|
491
491
|
}, "strip", z.ZodTypeAny, {
|
|
492
|
-
value: string;
|
|
493
492
|
type: "asset-trend";
|
|
494
|
-
}, {
|
|
495
493
|
value: string;
|
|
494
|
+
}, {
|
|
496
495
|
type: "asset-trend";
|
|
496
|
+
value: string;
|
|
497
497
|
}>]>, "many">>;
|
|
498
498
|
decision_prompt: z.ZodOptional<z.ZodString>;
|
|
499
499
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -526,20 +526,20 @@ export declare const runtimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
526
526
|
type: z.ZodLiteral<"strategy">;
|
|
527
527
|
value: z.ZodString;
|
|
528
528
|
}, "strip", z.ZodTypeAny, {
|
|
529
|
-
value: string;
|
|
530
529
|
type: "strategy";
|
|
531
|
-
}, {
|
|
532
530
|
value: string;
|
|
531
|
+
}, {
|
|
533
532
|
type: "strategy";
|
|
533
|
+
value: string;
|
|
534
534
|
}>, z.ZodObject<{
|
|
535
535
|
type: z.ZodLiteral<"asset-trend">;
|
|
536
536
|
value: z.ZodString;
|
|
537
537
|
}, "strip", z.ZodTypeAny, {
|
|
538
|
-
value: string;
|
|
539
538
|
type: "asset-trend";
|
|
540
|
-
}, {
|
|
541
539
|
value: string;
|
|
540
|
+
}, {
|
|
542
541
|
type: "asset-trend";
|
|
542
|
+
value: string;
|
|
543
543
|
}>]>, "many">>;
|
|
544
544
|
decision_prompt: z.ZodOptional<z.ZodString>;
|
|
545
545
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -572,20 +572,20 @@ export declare const runtimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
572
572
|
type: z.ZodLiteral<"strategy">;
|
|
573
573
|
value: z.ZodString;
|
|
574
574
|
}, "strip", z.ZodTypeAny, {
|
|
575
|
-
value: string;
|
|
576
575
|
type: "strategy";
|
|
577
|
-
}, {
|
|
578
576
|
value: string;
|
|
577
|
+
}, {
|
|
579
578
|
type: "strategy";
|
|
579
|
+
value: string;
|
|
580
580
|
}>, z.ZodObject<{
|
|
581
581
|
type: z.ZodLiteral<"asset-trend">;
|
|
582
582
|
value: z.ZodString;
|
|
583
583
|
}, "strip", z.ZodTypeAny, {
|
|
584
|
-
value: string;
|
|
585
584
|
type: "asset-trend";
|
|
586
|
-
}, {
|
|
587
585
|
value: string;
|
|
586
|
+
}, {
|
|
588
587
|
type: "asset-trend";
|
|
588
|
+
value: string;
|
|
589
589
|
}>]>, "many">>;
|
|
590
590
|
decision_prompt: z.ZodOptional<z.ZodString>;
|
|
591
591
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -789,20 +789,20 @@ export declare const runtimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
789
789
|
type: z.ZodLiteral<"strategy">;
|
|
790
790
|
value: z.ZodString;
|
|
791
791
|
}, "strip", z.ZodTypeAny, {
|
|
792
|
-
value: string;
|
|
793
792
|
type: "strategy";
|
|
794
|
-
}, {
|
|
795
793
|
value: string;
|
|
794
|
+
}, {
|
|
796
795
|
type: "strategy";
|
|
796
|
+
value: string;
|
|
797
797
|
}>, z.ZodObject<{
|
|
798
798
|
type: z.ZodLiteral<"asset-trend">;
|
|
799
799
|
value: z.ZodString;
|
|
800
800
|
}, "strip", z.ZodTypeAny, {
|
|
801
|
-
value: string;
|
|
802
801
|
type: "asset-trend";
|
|
803
|
-
}, {
|
|
804
802
|
value: string;
|
|
803
|
+
}, {
|
|
805
804
|
type: "asset-trend";
|
|
805
|
+
value: string;
|
|
806
806
|
}>]>, "many">>;
|
|
807
807
|
decision_prompt: z.ZodOptional<z.ZodString>;
|
|
808
808
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -835,20 +835,20 @@ export declare const runtimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
835
835
|
type: z.ZodLiteral<"strategy">;
|
|
836
836
|
value: z.ZodString;
|
|
837
837
|
}, "strip", z.ZodTypeAny, {
|
|
838
|
-
value: string;
|
|
839
838
|
type: "strategy";
|
|
840
|
-
}, {
|
|
841
839
|
value: string;
|
|
840
|
+
}, {
|
|
842
841
|
type: "strategy";
|
|
842
|
+
value: string;
|
|
843
843
|
}>, z.ZodObject<{
|
|
844
844
|
type: z.ZodLiteral<"asset-trend">;
|
|
845
845
|
value: z.ZodString;
|
|
846
846
|
}, "strip", z.ZodTypeAny, {
|
|
847
|
-
value: string;
|
|
848
847
|
type: "asset-trend";
|
|
849
|
-
}, {
|
|
850
848
|
value: string;
|
|
849
|
+
}, {
|
|
851
850
|
type: "asset-trend";
|
|
851
|
+
value: string;
|
|
852
852
|
}>]>, "many">>;
|
|
853
853
|
decision_prompt: z.ZodOptional<z.ZodString>;
|
|
854
854
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -881,20 +881,20 @@ export declare const runtimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
881
881
|
type: z.ZodLiteral<"strategy">;
|
|
882
882
|
value: z.ZodString;
|
|
883
883
|
}, "strip", z.ZodTypeAny, {
|
|
884
|
-
value: string;
|
|
885
884
|
type: "strategy";
|
|
886
|
-
}, {
|
|
887
885
|
value: string;
|
|
886
|
+
}, {
|
|
888
887
|
type: "strategy";
|
|
888
|
+
value: string;
|
|
889
889
|
}>, z.ZodObject<{
|
|
890
890
|
type: z.ZodLiteral<"asset-trend">;
|
|
891
891
|
value: z.ZodString;
|
|
892
892
|
}, "strip", z.ZodTypeAny, {
|
|
893
|
-
value: string;
|
|
894
893
|
type: "asset-trend";
|
|
895
|
-
}, {
|
|
896
894
|
value: string;
|
|
895
|
+
}, {
|
|
897
896
|
type: "asset-trend";
|
|
897
|
+
value: string;
|
|
898
898
|
}>]>, "many">>;
|
|
899
899
|
decision_prompt: z.ZodOptional<z.ZodString>;
|
|
900
900
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -1098,20 +1098,20 @@ export declare const runtimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1098
1098
|
type: z.ZodLiteral<"strategy">;
|
|
1099
1099
|
value: z.ZodString;
|
|
1100
1100
|
}, "strip", z.ZodTypeAny, {
|
|
1101
|
-
value: string;
|
|
1102
1101
|
type: "strategy";
|
|
1103
|
-
}, {
|
|
1104
1102
|
value: string;
|
|
1103
|
+
}, {
|
|
1105
1104
|
type: "strategy";
|
|
1105
|
+
value: string;
|
|
1106
1106
|
}>, z.ZodObject<{
|
|
1107
1107
|
type: z.ZodLiteral<"asset-trend">;
|
|
1108
1108
|
value: z.ZodString;
|
|
1109
1109
|
}, "strip", z.ZodTypeAny, {
|
|
1110
|
-
value: string;
|
|
1111
1110
|
type: "asset-trend";
|
|
1112
|
-
}, {
|
|
1113
1111
|
value: string;
|
|
1112
|
+
}, {
|
|
1114
1113
|
type: "asset-trend";
|
|
1114
|
+
value: string;
|
|
1115
1115
|
}>]>, "many">>;
|
|
1116
1116
|
decision_prompt: z.ZodOptional<z.ZodString>;
|
|
1117
1117
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -1144,20 +1144,20 @@ export declare const runtimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1144
1144
|
type: z.ZodLiteral<"strategy">;
|
|
1145
1145
|
value: z.ZodString;
|
|
1146
1146
|
}, "strip", z.ZodTypeAny, {
|
|
1147
|
-
value: string;
|
|
1148
1147
|
type: "strategy";
|
|
1149
|
-
}, {
|
|
1150
1148
|
value: string;
|
|
1149
|
+
}, {
|
|
1151
1150
|
type: "strategy";
|
|
1151
|
+
value: string;
|
|
1152
1152
|
}>, z.ZodObject<{
|
|
1153
1153
|
type: z.ZodLiteral<"asset-trend">;
|
|
1154
1154
|
value: z.ZodString;
|
|
1155
1155
|
}, "strip", z.ZodTypeAny, {
|
|
1156
|
-
value: string;
|
|
1157
1156
|
type: "asset-trend";
|
|
1158
|
-
}, {
|
|
1159
1157
|
value: string;
|
|
1158
|
+
}, {
|
|
1160
1159
|
type: "asset-trend";
|
|
1160
|
+
value: string;
|
|
1161
1161
|
}>]>, "many">>;
|
|
1162
1162
|
decision_prompt: z.ZodOptional<z.ZodString>;
|
|
1163
1163
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -1190,20 +1190,20 @@ export declare const runtimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1190
1190
|
type: z.ZodLiteral<"strategy">;
|
|
1191
1191
|
value: z.ZodString;
|
|
1192
1192
|
}, "strip", z.ZodTypeAny, {
|
|
1193
|
-
value: string;
|
|
1194
1193
|
type: "strategy";
|
|
1195
|
-
}, {
|
|
1196
1194
|
value: string;
|
|
1195
|
+
}, {
|
|
1197
1196
|
type: "strategy";
|
|
1197
|
+
value: string;
|
|
1198
1198
|
}>, z.ZodObject<{
|
|
1199
1199
|
type: z.ZodLiteral<"asset-trend">;
|
|
1200
1200
|
value: z.ZodString;
|
|
1201
1201
|
}, "strip", z.ZodTypeAny, {
|
|
1202
|
-
value: string;
|
|
1203
1202
|
type: "asset-trend";
|
|
1204
|
-
}, {
|
|
1205
1203
|
value: string;
|
|
1204
|
+
}, {
|
|
1206
1205
|
type: "asset-trend";
|
|
1206
|
+
value: string;
|
|
1207
1207
|
}>]>, "many">>;
|
|
1208
1208
|
decision_prompt: z.ZodOptional<z.ZodString>;
|
|
1209
1209
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -1407,20 +1407,20 @@ export declare const runtimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1407
1407
|
type: z.ZodLiteral<"strategy">;
|
|
1408
1408
|
value: z.ZodString;
|
|
1409
1409
|
}, "strip", z.ZodTypeAny, {
|
|
1410
|
-
value: string;
|
|
1411
1410
|
type: "strategy";
|
|
1412
|
-
}, {
|
|
1413
1411
|
value: string;
|
|
1412
|
+
}, {
|
|
1414
1413
|
type: "strategy";
|
|
1414
|
+
value: string;
|
|
1415
1415
|
}>, z.ZodObject<{
|
|
1416
1416
|
type: z.ZodLiteral<"asset-trend">;
|
|
1417
1417
|
value: z.ZodString;
|
|
1418
1418
|
}, "strip", z.ZodTypeAny, {
|
|
1419
|
-
value: string;
|
|
1420
1419
|
type: "asset-trend";
|
|
1421
|
-
}, {
|
|
1422
1420
|
value: string;
|
|
1421
|
+
}, {
|
|
1423
1422
|
type: "asset-trend";
|
|
1423
|
+
value: string;
|
|
1424
1424
|
}>]>, "many">>;
|
|
1425
1425
|
decision_prompt: z.ZodOptional<z.ZodString>;
|
|
1426
1426
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -1453,20 +1453,20 @@ export declare const runtimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1453
1453
|
type: z.ZodLiteral<"strategy">;
|
|
1454
1454
|
value: z.ZodString;
|
|
1455
1455
|
}, "strip", z.ZodTypeAny, {
|
|
1456
|
-
value: string;
|
|
1457
1456
|
type: "strategy";
|
|
1458
|
-
}, {
|
|
1459
1457
|
value: string;
|
|
1458
|
+
}, {
|
|
1460
1459
|
type: "strategy";
|
|
1460
|
+
value: string;
|
|
1461
1461
|
}>, z.ZodObject<{
|
|
1462
1462
|
type: z.ZodLiteral<"asset-trend">;
|
|
1463
1463
|
value: z.ZodString;
|
|
1464
1464
|
}, "strip", z.ZodTypeAny, {
|
|
1465
|
-
value: string;
|
|
1466
1465
|
type: "asset-trend";
|
|
1467
|
-
}, {
|
|
1468
1466
|
value: string;
|
|
1467
|
+
}, {
|
|
1469
1468
|
type: "asset-trend";
|
|
1469
|
+
value: string;
|
|
1470
1470
|
}>]>, "many">>;
|
|
1471
1471
|
decision_prompt: z.ZodOptional<z.ZodString>;
|
|
1472
1472
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -1499,20 +1499,20 @@ export declare const runtimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1499
1499
|
type: z.ZodLiteral<"strategy">;
|
|
1500
1500
|
value: z.ZodString;
|
|
1501
1501
|
}, "strip", z.ZodTypeAny, {
|
|
1502
|
-
value: string;
|
|
1503
1502
|
type: "strategy";
|
|
1504
|
-
}, {
|
|
1505
1503
|
value: string;
|
|
1504
|
+
}, {
|
|
1506
1505
|
type: "strategy";
|
|
1506
|
+
value: string;
|
|
1507
1507
|
}>, z.ZodObject<{
|
|
1508
1508
|
type: z.ZodLiteral<"asset-trend">;
|
|
1509
1509
|
value: z.ZodString;
|
|
1510
1510
|
}, "strip", z.ZodTypeAny, {
|
|
1511
|
-
value: string;
|
|
1512
1511
|
type: "asset-trend";
|
|
1513
|
-
}, {
|
|
1514
1512
|
value: string;
|
|
1513
|
+
}, {
|
|
1515
1514
|
type: "asset-trend";
|
|
1515
|
+
value: string;
|
|
1516
1516
|
}>]>, "many">>;
|
|
1517
1517
|
decision_prompt: z.ZodOptional<z.ZodString>;
|
|
1518
1518
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -1716,20 +1716,20 @@ export declare const runtimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1716
1716
|
type: z.ZodLiteral<"strategy">;
|
|
1717
1717
|
value: z.ZodString;
|
|
1718
1718
|
}, "strip", z.ZodTypeAny, {
|
|
1719
|
-
value: string;
|
|
1720
1719
|
type: "strategy";
|
|
1721
|
-
}, {
|
|
1722
1720
|
value: string;
|
|
1721
|
+
}, {
|
|
1723
1722
|
type: "strategy";
|
|
1723
|
+
value: string;
|
|
1724
1724
|
}>, z.ZodObject<{
|
|
1725
1725
|
type: z.ZodLiteral<"asset-trend">;
|
|
1726
1726
|
value: z.ZodString;
|
|
1727
1727
|
}, "strip", z.ZodTypeAny, {
|
|
1728
|
-
value: string;
|
|
1729
1728
|
type: "asset-trend";
|
|
1730
|
-
}, {
|
|
1731
1729
|
value: string;
|
|
1730
|
+
}, {
|
|
1732
1731
|
type: "asset-trend";
|
|
1732
|
+
value: string;
|
|
1733
1733
|
}>]>, "many">>;
|
|
1734
1734
|
decision_prompt: z.ZodOptional<z.ZodString>;
|
|
1735
1735
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -1762,20 +1762,20 @@ export declare const runtimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1762
1762
|
type: z.ZodLiteral<"strategy">;
|
|
1763
1763
|
value: z.ZodString;
|
|
1764
1764
|
}, "strip", z.ZodTypeAny, {
|
|
1765
|
-
value: string;
|
|
1766
1765
|
type: "strategy";
|
|
1767
|
-
}, {
|
|
1768
1766
|
value: string;
|
|
1767
|
+
}, {
|
|
1769
1768
|
type: "strategy";
|
|
1769
|
+
value: string;
|
|
1770
1770
|
}>, z.ZodObject<{
|
|
1771
1771
|
type: z.ZodLiteral<"asset-trend">;
|
|
1772
1772
|
value: z.ZodString;
|
|
1773
1773
|
}, "strip", z.ZodTypeAny, {
|
|
1774
|
-
value: string;
|
|
1775
1774
|
type: "asset-trend";
|
|
1776
|
-
}, {
|
|
1777
1775
|
value: string;
|
|
1776
|
+
}, {
|
|
1778
1777
|
type: "asset-trend";
|
|
1778
|
+
value: string;
|
|
1779
1779
|
}>]>, "many">>;
|
|
1780
1780
|
decision_prompt: z.ZodOptional<z.ZodString>;
|
|
1781
1781
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -1808,20 +1808,20 @@ export declare const runtimeConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1808
1808
|
type: z.ZodLiteral<"strategy">;
|
|
1809
1809
|
value: z.ZodString;
|
|
1810
1810
|
}, "strip", z.ZodTypeAny, {
|
|
1811
|
-
value: string;
|
|
1812
1811
|
type: "strategy";
|
|
1813
|
-
}, {
|
|
1814
1812
|
value: string;
|
|
1813
|
+
}, {
|
|
1815
1814
|
type: "strategy";
|
|
1815
|
+
value: string;
|
|
1816
1816
|
}>, z.ZodObject<{
|
|
1817
1817
|
type: z.ZodLiteral<"asset-trend">;
|
|
1818
1818
|
value: z.ZodString;
|
|
1819
1819
|
}, "strip", z.ZodTypeAny, {
|
|
1820
|
-
value: string;
|
|
1821
1820
|
type: "asset-trend";
|
|
1822
|
-
}, {
|
|
1823
1821
|
value: string;
|
|
1822
|
+
}, {
|
|
1824
1823
|
type: "asset-trend";
|
|
1824
|
+
value: string;
|
|
1825
1825
|
}>]>, "many">>;
|
|
1826
1826
|
decision_prompt: z.ZodOptional<z.ZodString>;
|
|
1827
1827
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -41,9 +41,9 @@ export declare function analyzeAssetBias(candles: Candle[], emaFast: number, ema
|
|
|
41
41
|
* market intelligence.
|
|
42
42
|
*/
|
|
43
43
|
export declare function marketRegimeScanner(): import("../index.js").Scanner<{
|
|
44
|
+
assets?: string[] | undefined;
|
|
44
45
|
btcWeight?: number | undefined;
|
|
45
46
|
ethWeight?: number | undefined;
|
|
46
|
-
assets?: string[] | undefined;
|
|
47
47
|
emaFast?: number | undefined;
|
|
48
48
|
emaSlow?: number | undefined;
|
|
49
49
|
neutralThreshold?: number | undefined;
|
package/dist/senpi/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { McpTransport, SenpiClientConfig, CreatePositionRequest, CreatePositionResult, EditPositionResult, GetPositionResult, OpenPosition, GetStrategyResult, GetOpenOrdersResult, GetTraderHistoryOptions, TraderHistoryEntry, StrategyFundResult, ClosePositionsRequest, GetPnlHistoryOptions } from './types.js';
|
|
1
|
+
import type { McpTransport, SenpiClientConfig, CreatePositionRequest, CreatePositionResult, EditPositionResult, GetPositionResult, OpenPosition, GetStrategyResult, GetOpenOrdersResult, GetTraderHistoryOptions, TraderHistoryEntry, StrategyFundResult, ClosePositionsRequest, GetPnlHistoryOptions, ListStrategiesFilters, StrategySummary } from './types.js';
|
|
2
2
|
export declare class SenpiClient {
|
|
3
3
|
private readonly injectedTransport;
|
|
4
4
|
private readonly config;
|
|
@@ -66,6 +66,7 @@ export declare class SenpiClient {
|
|
|
66
66
|
*/
|
|
67
67
|
listOpenPositions(wallet: string): Promise<OpenPosition[]>;
|
|
68
68
|
getStrategy(wallet: string): Promise<GetStrategyResult | null>;
|
|
69
|
+
listStrategies(filters?: ListStrategiesFilters): Promise<StrategySummary[]>;
|
|
69
70
|
getOpenOrders(wallet: string): Promise<GetOpenOrdersResult[]>;
|
|
70
71
|
getTraderHistory(wallet: string, opts?: GetTraderHistoryOptions): Promise<TraderHistoryEntry[]>;
|
|
71
72
|
topUp(wallet: string, amount: number): Promise<StrategyFundResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/senpi/client.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EAGpB,kBAAkB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AAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAO9D,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAiB1G,eAAe,IAAI,OAAO,CAAC,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAmBxE,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC;CAKnF"}
|
package/dist/senpi/client.js
CHANGED
|
@@ -294,6 +294,32 @@ export class SenpiClient {
|
|
|
294
294
|
createdAt: asString(data.createdAt) ?? "",
|
|
295
295
|
};
|
|
296
296
|
}
|
|
297
|
+
async listStrategies(filters) {
|
|
298
|
+
const args = {};
|
|
299
|
+
if (filters?.strategyAddresses)
|
|
300
|
+
args.strategy_addresses = filters.strategyAddresses;
|
|
301
|
+
if (filters?.status)
|
|
302
|
+
args.status = filters.status;
|
|
303
|
+
if (filters?.strategyIds)
|
|
304
|
+
args.strategy_ids = filters.strategyIds;
|
|
305
|
+
if (filters?.strategyType)
|
|
306
|
+
args.strategy_type = filters.strategyType;
|
|
307
|
+
const raw = await this.callTool("strategy_list", args);
|
|
308
|
+
const data = unwrapEnvelope(raw);
|
|
309
|
+
const strategies = isRecord(data) && Array.isArray(data.strategies)
|
|
310
|
+
? data.strategies
|
|
311
|
+
: [];
|
|
312
|
+
return strategies.filter(isRecord).map((s) => ({
|
|
313
|
+
id: asString(s.id) ?? "",
|
|
314
|
+
strategyWalletAddress: asString(s.strategyWalletAddress) ?? "",
|
|
315
|
+
traderAddress: asString(s.traderAddress) ?? "",
|
|
316
|
+
status: asString(s.status) ?? "",
|
|
317
|
+
strategyType: asString(s.strategyType) ?? "",
|
|
318
|
+
strategyName: asString(s.strategyName) ?? asString(s.name) ?? "",
|
|
319
|
+
createdAt: asString(s.createdAt) ?? "",
|
|
320
|
+
totalFunded: asNumber(s.totalFunded) ?? 0,
|
|
321
|
+
}));
|
|
322
|
+
}
|
|
297
323
|
async getOpenOrders(wallet) {
|
|
298
324
|
const raw = await this.callTool("strategy_get_open_orders", { strategy_wallet: wallet });
|
|
299
325
|
const data = unwrapEnvelope(raw);
|