@pgnio/helios-mcp 0.2.8 → 0.4.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 +19 -2
- package/dist/chunk-5LIHYXEF.mjs +4274 -0
- package/dist/chunk-LPDQG4WK.mjs +4274 -0
- package/dist/cli.js +2292 -1370
- package/dist/cli.mjs +8 -4
- package/dist/index.d.mts +1020 -141
- package/dist/index.d.ts +1020 -141
- package/dist/index.js +2245 -992
- package/dist/index.mjs +73 -3
- package/docs/ai-agent-indicators/00_columns.txt +3 -1
- package/docs/ai-agent-mcp/04_trading/01_tools.txt +2 -1
- package/package.json +9 -16
- package/dist/chunk-52XY4KRG.mjs +0 -3038
- package/dist/chunk-7EDI4KLD.mjs +0 -3042
- package/dist/chunk-EIAUO3XE.mjs +0 -2955
- package/dist/chunk-NCF7ASJB.mjs +0 -2986
- package/dist/chunk-NWGWXYTS.mjs +0 -2964
- package/dist/chunk-UHFLF3UG.mjs +0 -3051
- package/dist/chunk-UYCUR7QV.mjs +0 -2994
- package/dist/chunk-V453JYRN.mjs +0 -3051
- package/dist/chunk-WLCFIWFP.mjs +0 -3048
- package/dist/chunk-XE6HRID3.mjs +0 -2992
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ declare const agentDeviceStartInputSchema: z.ZodObject<{
|
|
|
10
10
|
"orders:cancel": "orders:cancel";
|
|
11
11
|
}>>;
|
|
12
12
|
constraints: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
13
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
requireApprovalProof: z.ZodOptional<z.ZodBoolean>;
|
|
13
15
|
}, z.core.$strip>;
|
|
14
16
|
declare const agentDeviceStartOutputSchema: z.ZodObject<{
|
|
15
17
|
deviceCode: z.ZodString;
|
|
@@ -67,11 +69,6 @@ declare const openPositionsSnapshotSchema: z.ZodObject<{
|
|
|
67
69
|
liquidationPrice: z.ZodOptional<z.ZodNumber>;
|
|
68
70
|
}, z.core.$strip>>;
|
|
69
71
|
}, z.core.$strip>;
|
|
70
|
-
declare const portfolioInputSchema: z.ZodObject<{
|
|
71
|
-
provider: z.ZodEnum<{
|
|
72
|
-
hyperliquid: "hyperliquid";
|
|
73
|
-
}>;
|
|
74
|
-
}, z.core.$strip>;
|
|
75
72
|
declare const portfolioSnapshotSchema: z.ZodObject<{
|
|
76
73
|
provider: z.ZodLiteral<"hyperliquid">;
|
|
77
74
|
totalBalance: z.ZodNumber;
|
|
@@ -94,30 +91,35 @@ declare const portfolioSnapshotSchema: z.ZodObject<{
|
|
|
94
91
|
}, z.core.$strip>>;
|
|
95
92
|
protectiveOrders: z.ZodArray<z.ZodObject<{
|
|
96
93
|
id: z.ZodString;
|
|
97
|
-
binanceOrderId: z.ZodOptional<z.ZodNumber
|
|
98
|
-
clientOrderId: z.ZodOptional<z.ZodString
|
|
94
|
+
binanceOrderId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
95
|
+
clientOrderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
99
96
|
symbol: z.ZodString;
|
|
100
97
|
side: z.ZodEnum<{
|
|
101
98
|
BUY: "BUY";
|
|
102
99
|
SELL: "SELL";
|
|
103
100
|
}>;
|
|
104
|
-
positionSide: z.ZodEnum<{
|
|
101
|
+
positionSide: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
105
102
|
LONG: "LONG";
|
|
106
103
|
SHORT: "SHORT";
|
|
107
104
|
BOTH: "BOTH";
|
|
108
|
-
}
|
|
105
|
+
}>>>, z.ZodTransform<"LONG" | "SHORT" | "BOTH", "LONG" | "SHORT" | "BOTH" | null | undefined>>;
|
|
109
106
|
status: z.ZodString;
|
|
110
107
|
kind: z.ZodEnum<{
|
|
111
108
|
STOP_LOSS: "STOP_LOSS";
|
|
112
109
|
TAKE_PROFIT: "TAKE_PROFIT";
|
|
113
110
|
}>;
|
|
114
|
-
groupId: z.ZodString
|
|
115
|
-
stopPrice: z.ZodOptional<z.ZodString
|
|
116
|
-
parentClientOrderId: z.ZodOptional<z.ZodString
|
|
117
|
-
assetId: z.ZodOptional<z.ZodNumber
|
|
118
|
-
createdAt: z.ZodString
|
|
111
|
+
groupId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
112
|
+
stopPrice: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>, z.ZodTransform<string | null | undefined, string | number | null | undefined>>;
|
|
113
|
+
parentClientOrderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
114
|
+
assetId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
115
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
119
116
|
}, z.core.$strip>>;
|
|
120
117
|
}, z.core.$strip>;
|
|
118
|
+
declare const portfolioInputSchema: z.ZodObject<{
|
|
119
|
+
provider: z.ZodEnum<{
|
|
120
|
+
hyperliquid: "hyperliquid";
|
|
121
|
+
}>;
|
|
122
|
+
}, z.core.$strip>;
|
|
121
123
|
declare const ledgerFillsInputSchema: z.ZodObject<{
|
|
122
124
|
window: z.ZodOptional<z.ZodEnum<{
|
|
123
125
|
"24h": "24h";
|
|
@@ -373,6 +375,7 @@ declare const submitTradeIntentInputSchema: z.ZodObject<{
|
|
|
373
375
|
}, z.core.$strip>>;
|
|
374
376
|
}, z.core.$strip>>;
|
|
375
377
|
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
378
|
+
idempotencyWindowSeconds: z.ZodOptional<z.ZodNumber>;
|
|
376
379
|
}, z.core.$strip>;
|
|
377
380
|
declare const submitTradeIntentResultSchema: z.ZodObject<{
|
|
378
381
|
status: z.ZodLiteral<"submitted">;
|
|
@@ -437,14 +440,23 @@ declare const closePositionInputSchema: z.ZodObject<{
|
|
|
437
440
|
}>>;
|
|
438
441
|
symbol: z.ZodString;
|
|
439
442
|
maxSlippageBps: z.ZodOptional<z.ZodNumber>;
|
|
443
|
+
fraction: z.ZodOptional<z.ZodNumber>;
|
|
440
444
|
}, z.core.$strip>;
|
|
441
445
|
declare const closePositionResultSchema: z.ZodObject<{
|
|
442
446
|
status: z.ZodLiteral<"submitted">;
|
|
447
|
+
outcome: z.ZodOptional<z.ZodEnum<{
|
|
448
|
+
closed: "closed";
|
|
449
|
+
no_position: "no_position";
|
|
450
|
+
}>>;
|
|
443
451
|
provider: z.ZodOptional<z.ZodEnum<{
|
|
444
452
|
hyperliquid: "hyperliquid";
|
|
445
453
|
}>>;
|
|
446
454
|
symbol: z.ZodString;
|
|
447
|
-
mode: z.
|
|
455
|
+
mode: z.ZodEnum<{
|
|
456
|
+
FULL: "FULL";
|
|
457
|
+
PARTIAL: "PARTIAL";
|
|
458
|
+
}>;
|
|
459
|
+
fraction: z.ZodOptional<z.ZodNumber>;
|
|
448
460
|
maxSlippageBps: z.ZodOptional<z.ZodNumber>;
|
|
449
461
|
}, z.core.$strip>;
|
|
450
462
|
declare const setTpSlInputSchema: z.ZodObject<{
|
|
@@ -533,6 +545,423 @@ declare const cancelOrderResultSchema: z.ZodObject<{
|
|
|
533
545
|
symbol: z.ZodString;
|
|
534
546
|
oid: z.ZodNumber;
|
|
535
547
|
}, z.core.$strip>;
|
|
548
|
+
/** Moves a resting order (data-bridge positions.modifyOrder): its limit price, or trigger price for a trigger order. */
|
|
549
|
+
declare const modifyOrderInputSchema: z.ZodObject<{
|
|
550
|
+
symbol: z.ZodString;
|
|
551
|
+
oid: z.ZodNumber;
|
|
552
|
+
price: z.ZodNumber;
|
|
553
|
+
size: z.ZodNumber;
|
|
554
|
+
}, z.core.$strip>;
|
|
555
|
+
declare const modifyOrderResultSchema: z.ZodObject<{
|
|
556
|
+
status: z.ZodLiteral<"modified">;
|
|
557
|
+
symbol: z.ZodString;
|
|
558
|
+
oid: z.ZodNumber;
|
|
559
|
+
price: z.ZodNumber;
|
|
560
|
+
size: z.ZodNumber;
|
|
561
|
+
}, z.core.$strip>;
|
|
562
|
+
/** One paper fill as the paper engine records it (data-bridge services/paper/engine.ts PaperFill). */
|
|
563
|
+
declare const paperFillSchema: z.ZodObject<{
|
|
564
|
+
ts: z.ZodNumber;
|
|
565
|
+
coin: z.ZodString;
|
|
566
|
+
kind: z.ZodString;
|
|
567
|
+
side: z.ZodNullable<z.ZodEnum<{
|
|
568
|
+
BUY: "BUY";
|
|
569
|
+
SELL: "SELL";
|
|
570
|
+
}>>;
|
|
571
|
+
size: z.ZodNumber;
|
|
572
|
+
price: z.ZodNumber;
|
|
573
|
+
fee: z.ZodNumber;
|
|
574
|
+
pnl: z.ZodNumber;
|
|
575
|
+
}, z.core.$strip>;
|
|
576
|
+
/** A paper portfolio: the live shape plus the paper account's own totals. */
|
|
577
|
+
declare const paperPortfolioSchema: z.ZodObject<{
|
|
578
|
+
provider: z.ZodLiteral<"hyperliquid">;
|
|
579
|
+
totalBalance: z.ZodNumber;
|
|
580
|
+
availableBalance: z.ZodNumber;
|
|
581
|
+
totalMargin: z.ZodNumber;
|
|
582
|
+
unrealizedPnl: z.ZodNumber;
|
|
583
|
+
positions: z.ZodArray<z.ZodObject<{
|
|
584
|
+
symbol: z.ZodString;
|
|
585
|
+
side: z.ZodEnum<{
|
|
586
|
+
LONG: "LONG";
|
|
587
|
+
SHORT: "SHORT";
|
|
588
|
+
}>;
|
|
589
|
+
size: z.ZodNumber;
|
|
590
|
+
entryPrice: z.ZodNumber;
|
|
591
|
+
markPrice: z.ZodNumber;
|
|
592
|
+
unrealizedPnl: z.ZodNumber;
|
|
593
|
+
margin: z.ZodNumber;
|
|
594
|
+
leverage: z.ZodNumber;
|
|
595
|
+
liquidationPrice: z.ZodOptional<z.ZodNumber>;
|
|
596
|
+
}, z.core.$strip>>;
|
|
597
|
+
protectiveOrders: z.ZodArray<z.ZodObject<{
|
|
598
|
+
id: z.ZodString;
|
|
599
|
+
binanceOrderId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
600
|
+
clientOrderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
601
|
+
symbol: z.ZodString;
|
|
602
|
+
side: z.ZodEnum<{
|
|
603
|
+
BUY: "BUY";
|
|
604
|
+
SELL: "SELL";
|
|
605
|
+
}>;
|
|
606
|
+
positionSide: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
607
|
+
LONG: "LONG";
|
|
608
|
+
SHORT: "SHORT";
|
|
609
|
+
BOTH: "BOTH";
|
|
610
|
+
}>>>, z.ZodTransform<"LONG" | "SHORT" | "BOTH", "LONG" | "SHORT" | "BOTH" | null | undefined>>;
|
|
611
|
+
status: z.ZodString;
|
|
612
|
+
kind: z.ZodEnum<{
|
|
613
|
+
STOP_LOSS: "STOP_LOSS";
|
|
614
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
615
|
+
}>;
|
|
616
|
+
groupId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
617
|
+
stopPrice: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>, z.ZodTransform<string | null | undefined, string | number | null | undefined>>;
|
|
618
|
+
parentClientOrderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
619
|
+
assetId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
620
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
621
|
+
}, z.core.$strip>>;
|
|
622
|
+
cash: z.ZodOptional<z.ZodNumber>;
|
|
623
|
+
realizedPnl: z.ZodOptional<z.ZodNumber>;
|
|
624
|
+
feesPaid: z.ZodOptional<z.ZodNumber>;
|
|
625
|
+
fundingPaid: z.ZodOptional<z.ZodNumber>;
|
|
626
|
+
liquidations: z.ZodOptional<z.ZodNumber>;
|
|
627
|
+
}, z.core.$strip>;
|
|
628
|
+
declare const agentMarketInputSchema: z.ZodObject<{
|
|
629
|
+
coins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
630
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
631
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
632
|
+
sort: z.ZodOptional<z.ZodEnum<{
|
|
633
|
+
rank: "rank";
|
|
634
|
+
volume: "volume";
|
|
635
|
+
move1h: "move1h";
|
|
636
|
+
move24h: "move24h";
|
|
637
|
+
funding: "funding";
|
|
638
|
+
lean: "lean";
|
|
639
|
+
edge: "edge";
|
|
640
|
+
}>>;
|
|
641
|
+
filter: z.ZodOptional<z.ZodEnum<{
|
|
642
|
+
turning: "turning";
|
|
643
|
+
falling: "falling";
|
|
644
|
+
stretched_up: "stretched_up";
|
|
645
|
+
stretched_down: "stretched_down";
|
|
646
|
+
sm_long: "sm_long";
|
|
647
|
+
sm_short: "sm_short";
|
|
648
|
+
discount: "discount";
|
|
649
|
+
}>>;
|
|
650
|
+
}, z.core.$strip>;
|
|
651
|
+
declare const agentMarketSchema: z.ZodObject<{
|
|
652
|
+
asOf: z.ZodNullable<z.ZodString>;
|
|
653
|
+
smAsOf: z.ZodNullable<z.ZodNumber>;
|
|
654
|
+
market: z.ZodObject<{
|
|
655
|
+
os: z.ZodNullable<z.ZodNumber>;
|
|
656
|
+
mti: z.ZodNullable<z.ZodNumber>;
|
|
657
|
+
Mti: z.ZodNullable<z.ZodNumber>;
|
|
658
|
+
}, z.core.$strip>;
|
|
659
|
+
total: z.ZodNumber;
|
|
660
|
+
offset: z.ZodNumber;
|
|
661
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
662
|
+
coin: z.ZodString;
|
|
663
|
+
rank: z.ZodNullable<z.ZodNumber>;
|
|
664
|
+
px: z.ZodNullable<z.ZodNumber>;
|
|
665
|
+
r15m: z.ZodNullable<z.ZodNumber>;
|
|
666
|
+
r1h: z.ZodNullable<z.ZodNumber>;
|
|
667
|
+
r24h: z.ZodNullable<z.ZodNumber>;
|
|
668
|
+
volUsd: z.ZodNullable<z.ZodNumber>;
|
|
669
|
+
fundAprPct: z.ZodNullable<z.ZodNumber>;
|
|
670
|
+
oiUsd: z.ZodNullable<z.ZodNumber>;
|
|
671
|
+
setup: z.ZodNullable<z.ZodEnum<{
|
|
672
|
+
"turning up from breakdown": "turning up from breakdown";
|
|
673
|
+
"falling, no turn yet": "falling, no turn yet";
|
|
674
|
+
"stretched up": "stretched up";
|
|
675
|
+
"stretched down": "stretched down";
|
|
676
|
+
neutral: "neutral";
|
|
677
|
+
}>>;
|
|
678
|
+
sm: z.ZodNullable<z.ZodObject<{
|
|
679
|
+
side: z.ZodNullable<z.ZodEnum<{
|
|
680
|
+
long: "long";
|
|
681
|
+
short: "short";
|
|
682
|
+
}>>;
|
|
683
|
+
share: z.ZodNumber;
|
|
684
|
+
edgePct: z.ZodNullable<z.ZodNumber>;
|
|
685
|
+
discount: z.ZodNullable<z.ZodEnum<{
|
|
686
|
+
strict: "strict";
|
|
687
|
+
fill: "fill";
|
|
688
|
+
}>>;
|
|
689
|
+
}, z.core.$strip>>;
|
|
690
|
+
}, z.core.$strip>>;
|
|
691
|
+
next: z.ZodNullable<z.ZodNumber>;
|
|
692
|
+
unknown: z.ZodArray<z.ZodString>;
|
|
693
|
+
}, z.core.$strip>;
|
|
694
|
+
declare const smartMoneyBoardInputSchema: z.ZodObject<{
|
|
695
|
+
view: z.ZodOptional<z.ZodEnum<{
|
|
696
|
+
discount: "discount";
|
|
697
|
+
conviction: "conviction";
|
|
698
|
+
flows: "flows";
|
|
699
|
+
pileins: "pileins";
|
|
700
|
+
}>>;
|
|
701
|
+
side: z.ZodOptional<z.ZodEnum<{
|
|
702
|
+
any: "any";
|
|
703
|
+
long: "long";
|
|
704
|
+
short: "short";
|
|
705
|
+
}>>;
|
|
706
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
707
|
+
}, z.core.$strip>;
|
|
708
|
+
declare const smartMoneyBoardSchema: z.ZodObject<{
|
|
709
|
+
asOf: z.ZodNullable<z.ZodNumber>;
|
|
710
|
+
view: z.ZodEnum<{
|
|
711
|
+
discount: "discount";
|
|
712
|
+
conviction: "conviction";
|
|
713
|
+
flows: "flows";
|
|
714
|
+
pileins: "pileins";
|
|
715
|
+
}>;
|
|
716
|
+
wallets: z.ZodNumber;
|
|
717
|
+
known: z.ZodNumber;
|
|
718
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
719
|
+
coin: z.ZodString;
|
|
720
|
+
side: z.ZodNullable<z.ZodEnum<{
|
|
721
|
+
long: "long";
|
|
722
|
+
short: "short";
|
|
723
|
+
}>>;
|
|
724
|
+
share: z.ZodNumber;
|
|
725
|
+
lean: z.ZodNumber;
|
|
726
|
+
sideUsd: z.ZodNumber;
|
|
727
|
+
heads: z.ZodNumber;
|
|
728
|
+
traders: z.ZodNumber;
|
|
729
|
+
entry: z.ZodNullable<z.ZodNumber>;
|
|
730
|
+
mark: z.ZodNullable<z.ZodNumber>;
|
|
731
|
+
edgePct: z.ZodNullable<z.ZodNumber>;
|
|
732
|
+
flow1hUsd: z.ZodNumber;
|
|
733
|
+
discount: z.ZodNullable<z.ZodEnum<{
|
|
734
|
+
strict: "strict";
|
|
735
|
+
fill: "fill";
|
|
736
|
+
}>>;
|
|
737
|
+
setup: z.ZodNullable<z.ZodEnum<{
|
|
738
|
+
"turning up from breakdown": "turning up from breakdown";
|
|
739
|
+
"falling, no turn yet": "falling, no turn yet";
|
|
740
|
+
"stretched up": "stretched up";
|
|
741
|
+
"stretched down": "stretched down";
|
|
742
|
+
neutral: "neutral";
|
|
743
|
+
}>>;
|
|
744
|
+
r24h: z.ZodNullable<z.ZodNumber>;
|
|
745
|
+
}, z.core.$strip>>;
|
|
746
|
+
pileIns: z.ZodArray<z.ZodObject<{
|
|
747
|
+
coin: z.ZodString;
|
|
748
|
+
side: z.ZodEnum<{
|
|
749
|
+
long: "long";
|
|
750
|
+
short: "short";
|
|
751
|
+
}>;
|
|
752
|
+
dir: z.ZodEnum<{
|
|
753
|
+
in: "in";
|
|
754
|
+
out: "out";
|
|
755
|
+
}>;
|
|
756
|
+
traders: z.ZodNumber;
|
|
757
|
+
totalUsd: z.ZodNumber;
|
|
758
|
+
weight: z.ZodNumber;
|
|
759
|
+
names: z.ZodArray<z.ZodString>;
|
|
760
|
+
first: z.ZodNumber;
|
|
761
|
+
last: z.ZodNumber;
|
|
762
|
+
}, z.core.$strip>>;
|
|
763
|
+
note: z.ZodNullable<z.ZodString>;
|
|
764
|
+
}, z.core.$strip>;
|
|
765
|
+
declare const smartMoneyMovesInputSchema: z.ZodObject<{
|
|
766
|
+
since: z.ZodOptional<z.ZodString>;
|
|
767
|
+
coin: z.ZodOptional<z.ZodString>;
|
|
768
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
769
|
+
all: "all";
|
|
770
|
+
entries: "entries";
|
|
771
|
+
exits: "exits";
|
|
772
|
+
}>>;
|
|
773
|
+
minUsd: z.ZodOptional<z.ZodNumber>;
|
|
774
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
775
|
+
}, z.core.$strip>;
|
|
776
|
+
declare const smMoveSchema: z.ZodObject<{
|
|
777
|
+
id: z.ZodString;
|
|
778
|
+
t: z.ZodNumber;
|
|
779
|
+
coin: z.ZodString;
|
|
780
|
+
kind: z.ZodEnum<{
|
|
781
|
+
open: "open";
|
|
782
|
+
add: "add";
|
|
783
|
+
reduce: "reduce";
|
|
784
|
+
close: "close";
|
|
785
|
+
flip: "flip";
|
|
786
|
+
}>;
|
|
787
|
+
side: z.ZodEnum<{
|
|
788
|
+
long: "long";
|
|
789
|
+
short: "short";
|
|
790
|
+
}>;
|
|
791
|
+
usd: z.ZodNumber;
|
|
792
|
+
px: z.ZodNumber;
|
|
793
|
+
lev: z.ZodNullable<z.ZodNumber>;
|
|
794
|
+
pnl: z.ZodNullable<z.ZodNumber>;
|
|
795
|
+
pnlPct: z.ZodNullable<z.ZodNumber>;
|
|
796
|
+
nick: z.ZodString;
|
|
797
|
+
rank: z.ZodNumber;
|
|
798
|
+
style: z.ZodString;
|
|
799
|
+
win: z.ZodNullable<z.ZodNumber>;
|
|
800
|
+
w: z.ZodNumber;
|
|
801
|
+
}, z.core.$strip>;
|
|
802
|
+
declare const smartMoneyMovesSchema: z.ZodObject<{
|
|
803
|
+
order: z.ZodEnum<{
|
|
804
|
+
newest: "newest";
|
|
805
|
+
oldest: "oldest";
|
|
806
|
+
}>;
|
|
807
|
+
moves: z.ZodArray<z.ZodObject<{
|
|
808
|
+
id: z.ZodString;
|
|
809
|
+
t: z.ZodNumber;
|
|
810
|
+
coin: z.ZodString;
|
|
811
|
+
kind: z.ZodEnum<{
|
|
812
|
+
open: "open";
|
|
813
|
+
add: "add";
|
|
814
|
+
reduce: "reduce";
|
|
815
|
+
close: "close";
|
|
816
|
+
flip: "flip";
|
|
817
|
+
}>;
|
|
818
|
+
side: z.ZodEnum<{
|
|
819
|
+
long: "long";
|
|
820
|
+
short: "short";
|
|
821
|
+
}>;
|
|
822
|
+
usd: z.ZodNumber;
|
|
823
|
+
px: z.ZodNumber;
|
|
824
|
+
lev: z.ZodNullable<z.ZodNumber>;
|
|
825
|
+
pnl: z.ZodNullable<z.ZodNumber>;
|
|
826
|
+
pnlPct: z.ZodNullable<z.ZodNumber>;
|
|
827
|
+
nick: z.ZodString;
|
|
828
|
+
rank: z.ZodNumber;
|
|
829
|
+
style: z.ZodString;
|
|
830
|
+
win: z.ZodNullable<z.ZodNumber>;
|
|
831
|
+
w: z.ZodNumber;
|
|
832
|
+
}, z.core.$strip>>;
|
|
833
|
+
next: z.ZodNullable<z.ZodString>;
|
|
834
|
+
more: z.ZodBoolean;
|
|
835
|
+
gap: z.ZodBoolean;
|
|
836
|
+
note: z.ZodNullable<z.ZodString>;
|
|
837
|
+
}, z.core.$strip>;
|
|
838
|
+
declare const smartMoneyCoinSchema: z.ZodObject<{
|
|
839
|
+
coin: z.ZodString;
|
|
840
|
+
asOf: z.ZodNullable<z.ZodNumber>;
|
|
841
|
+
sm: z.ZodNullable<z.ZodObject<{
|
|
842
|
+
coin: z.ZodString;
|
|
843
|
+
mark: z.ZodNullable<z.ZodNumber>;
|
|
844
|
+
long: z.ZodObject<{
|
|
845
|
+
usd: z.ZodNumber;
|
|
846
|
+
heads: z.ZodNumber;
|
|
847
|
+
traders: z.ZodNumber;
|
|
848
|
+
entry: z.ZodNullable<z.ZodNumber>;
|
|
849
|
+
}, z.core.$strip>;
|
|
850
|
+
short: z.ZodObject<{
|
|
851
|
+
usd: z.ZodNumber;
|
|
852
|
+
heads: z.ZodNumber;
|
|
853
|
+
traders: z.ZodNumber;
|
|
854
|
+
entry: z.ZodNullable<z.ZodNumber>;
|
|
855
|
+
}, z.core.$strip>;
|
|
856
|
+
lean: z.ZodNumber;
|
|
857
|
+
side: z.ZodNullable<z.ZodEnum<{
|
|
858
|
+
long: "long";
|
|
859
|
+
short: "short";
|
|
860
|
+
}>>;
|
|
861
|
+
share: z.ZodNumber;
|
|
862
|
+
edgePct: z.ZodNullable<z.ZodNumber>;
|
|
863
|
+
flow1hUsd: z.ZodNumber;
|
|
864
|
+
conviction: z.ZodNullable<z.ZodNumber>;
|
|
865
|
+
discount: z.ZodNullable<z.ZodEnum<{
|
|
866
|
+
strict: "strict";
|
|
867
|
+
fill: "fill";
|
|
868
|
+
}>>;
|
|
869
|
+
pileIn: z.ZodNullable<z.ZodObject<{
|
|
870
|
+
coin: z.ZodString;
|
|
871
|
+
side: z.ZodEnum<{
|
|
872
|
+
long: "long";
|
|
873
|
+
short: "short";
|
|
874
|
+
}>;
|
|
875
|
+
dir: z.ZodEnum<{
|
|
876
|
+
in: "in";
|
|
877
|
+
out: "out";
|
|
878
|
+
}>;
|
|
879
|
+
traders: z.ZodNumber;
|
|
880
|
+
totalUsd: z.ZodNumber;
|
|
881
|
+
weight: z.ZodNumber;
|
|
882
|
+
names: z.ZodArray<z.ZodString>;
|
|
883
|
+
first: z.ZodNumber;
|
|
884
|
+
last: z.ZodNumber;
|
|
885
|
+
}, z.core.$strip>>;
|
|
886
|
+
}, z.core.$strip>>;
|
|
887
|
+
market: z.ZodNullable<z.ZodObject<{
|
|
888
|
+
coin: z.ZodString;
|
|
889
|
+
rank: z.ZodNullable<z.ZodNumber>;
|
|
890
|
+
px: z.ZodNullable<z.ZodNumber>;
|
|
891
|
+
r15m: z.ZodNullable<z.ZodNumber>;
|
|
892
|
+
r1h: z.ZodNullable<z.ZodNumber>;
|
|
893
|
+
r24h: z.ZodNullable<z.ZodNumber>;
|
|
894
|
+
volUsd: z.ZodNullable<z.ZodNumber>;
|
|
895
|
+
fundAprPct: z.ZodNullable<z.ZodNumber>;
|
|
896
|
+
oiUsd: z.ZodNullable<z.ZodNumber>;
|
|
897
|
+
setup: z.ZodNullable<z.ZodEnum<{
|
|
898
|
+
"turning up from breakdown": "turning up from breakdown";
|
|
899
|
+
"falling, no turn yet": "falling, no turn yet";
|
|
900
|
+
"stretched up": "stretched up";
|
|
901
|
+
"stretched down": "stretched down";
|
|
902
|
+
neutral: "neutral";
|
|
903
|
+
}>>;
|
|
904
|
+
}, z.core.$strip>>;
|
|
905
|
+
moves: z.ZodArray<z.ZodObject<{
|
|
906
|
+
id: z.ZodString;
|
|
907
|
+
t: z.ZodNumber;
|
|
908
|
+
coin: z.ZodString;
|
|
909
|
+
kind: z.ZodEnum<{
|
|
910
|
+
open: "open";
|
|
911
|
+
add: "add";
|
|
912
|
+
reduce: "reduce";
|
|
913
|
+
close: "close";
|
|
914
|
+
flip: "flip";
|
|
915
|
+
}>;
|
|
916
|
+
side: z.ZodEnum<{
|
|
917
|
+
long: "long";
|
|
918
|
+
short: "short";
|
|
919
|
+
}>;
|
|
920
|
+
usd: z.ZodNumber;
|
|
921
|
+
px: z.ZodNumber;
|
|
922
|
+
lev: z.ZodNullable<z.ZodNumber>;
|
|
923
|
+
pnl: z.ZodNullable<z.ZodNumber>;
|
|
924
|
+
pnlPct: z.ZodNullable<z.ZodNumber>;
|
|
925
|
+
nick: z.ZodString;
|
|
926
|
+
rank: z.ZodNumber;
|
|
927
|
+
style: z.ZodString;
|
|
928
|
+
win: z.ZodNullable<z.ZodNumber>;
|
|
929
|
+
w: z.ZodNumber;
|
|
930
|
+
}, z.core.$strip>>;
|
|
931
|
+
note: z.ZodNullable<z.ZodString>;
|
|
932
|
+
}, z.core.$strip>;
|
|
933
|
+
declare const marketCandlesInputSchema: z.ZodObject<{
|
|
934
|
+
symbol: z.ZodString;
|
|
935
|
+
interval: z.ZodEnum<{
|
|
936
|
+
"1m": "1m";
|
|
937
|
+
"3m": "3m";
|
|
938
|
+
"5m": "5m";
|
|
939
|
+
"15m": "15m";
|
|
940
|
+
"30m": "30m";
|
|
941
|
+
"1h": "1h";
|
|
942
|
+
"2h": "2h";
|
|
943
|
+
"4h": "4h";
|
|
944
|
+
"6h": "6h";
|
|
945
|
+
"8h": "8h";
|
|
946
|
+
"12h": "12h";
|
|
947
|
+
"1d": "1d";
|
|
948
|
+
"1w": "1w";
|
|
949
|
+
"1M": "1M";
|
|
950
|
+
}>;
|
|
951
|
+
endTime: z.ZodOptional<z.ZodNumber>;
|
|
952
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
953
|
+
}, z.core.$strip>;
|
|
954
|
+
declare const marketCandlesSchema: z.ZodObject<{
|
|
955
|
+
candles: z.ZodArray<z.ZodObject<{
|
|
956
|
+
t: z.ZodNumber;
|
|
957
|
+
o: z.ZodNumber;
|
|
958
|
+
h: z.ZodNumber;
|
|
959
|
+
l: z.ZodNumber;
|
|
960
|
+
c: z.ZodNumber;
|
|
961
|
+
v: z.ZodNumber;
|
|
962
|
+
}, z.core.$strip>>;
|
|
963
|
+
complete: z.ZodBoolean;
|
|
964
|
+
}, z.core.$strip>;
|
|
536
965
|
type AgentDeviceStartInput = z.infer<typeof agentDeviceStartInputSchema>;
|
|
537
966
|
type AgentDeviceStartOutput = z.infer<typeof agentDeviceStartOutputSchema>;
|
|
538
967
|
type AgentTokenResponse = z.infer<typeof agentTokenResponseSchema>;
|
|
@@ -562,59 +991,63 @@ type DeleteTpSlResult = z.infer<typeof deleteTpSlResultSchema>;
|
|
|
562
991
|
type OpenOrder = z.infer<typeof openOrderSchema>;
|
|
563
992
|
type CancelOrderInput = z.infer<typeof cancelOrderInputSchema>;
|
|
564
993
|
type CancelOrderResult = z.infer<typeof cancelOrderResultSchema>;
|
|
994
|
+
type ModifyOrderInput = z.infer<typeof modifyOrderInputSchema>;
|
|
995
|
+
type ModifyOrderResult = z.infer<typeof modifyOrderResultSchema>;
|
|
996
|
+
type PaperFill = z.infer<typeof paperFillSchema>;
|
|
997
|
+
type PaperPortfolio = z.infer<typeof paperPortfolioSchema>;
|
|
998
|
+
type AgentMarketInput = z.infer<typeof agentMarketInputSchema>;
|
|
999
|
+
type AgentMarket = z.infer<typeof agentMarketSchema>;
|
|
1000
|
+
type SmartMoneyBoardInput = z.infer<typeof smartMoneyBoardInputSchema>;
|
|
1001
|
+
type SmartMoneyBoard = z.infer<typeof smartMoneyBoardSchema>;
|
|
1002
|
+
type SmartMoneyMovesInput = z.infer<typeof smartMoneyMovesInputSchema>;
|
|
1003
|
+
type SmMove = z.infer<typeof smMoveSchema>;
|
|
1004
|
+
type SmartMoneyMoves = z.infer<typeof smartMoneyMovesSchema>;
|
|
1005
|
+
type SmartMoneyCoin = z.infer<typeof smartMoneyCoinSchema>;
|
|
1006
|
+
type MarketCandlesInput = z.infer<typeof marketCandlesInputSchema>;
|
|
1007
|
+
type MarketCandles = z.infer<typeof marketCandlesSchema>;
|
|
565
1008
|
|
|
566
1009
|
type FetchLike = typeof fetch;
|
|
567
1010
|
interface HeliosAgentAuthClientOptions {
|
|
568
1011
|
baseUrl: string;
|
|
569
1012
|
fetch?: FetchLike;
|
|
570
|
-
headers?:
|
|
1013
|
+
headers?: Record<string, string>;
|
|
1014
|
+
/**
|
|
1015
|
+
* The hosted MCP's shared secret (identity's AGENT_START_SECRET), sent on device/start only. Without it identity
|
|
1016
|
+
* ignores `verified` and labels a well-known app name as unverified. CLIs leave it unset.
|
|
1017
|
+
*/
|
|
1018
|
+
startSecret?: string;
|
|
1019
|
+
}
|
|
1020
|
+
interface StartLoginOptions {
|
|
1021
|
+
/**
|
|
1022
|
+
* The address of the person the login is for (the hosted MCP's req.ip): identity counts hosted starts per address.
|
|
1023
|
+
* Sent only along with the start secret; without one it would mean nothing to identity, so it is left out.
|
|
1024
|
+
*/
|
|
1025
|
+
clientIp?: string;
|
|
1026
|
+
}
|
|
1027
|
+
interface ExchangeDeviceCodeOptions {
|
|
1028
|
+
/** The proof the approval answered with, for a login started with requireApprovalProof. */
|
|
1029
|
+
approvalProof?: string;
|
|
571
1030
|
}
|
|
572
1031
|
declare class HeliosAgentAuthClient {
|
|
573
1032
|
private readonly baseUrl;
|
|
574
1033
|
private readonly fetchImpl;
|
|
575
1034
|
private readonly headers;
|
|
1035
|
+
private readonly startSecret;
|
|
576
1036
|
constructor(options: HeliosAgentAuthClientOptions);
|
|
577
|
-
startLogin(input: AgentDeviceStartInput): Promise<AgentDeviceStartOutput>;
|
|
578
|
-
exchangeDeviceCode(deviceCode: string): Promise<AgentTokenResponse>;
|
|
1037
|
+
startLogin(input: AgentDeviceStartInput, options?: StartLoginOptions): Promise<AgentDeviceStartOutput>;
|
|
1038
|
+
exchangeDeviceCode(deviceCode: string, options?: ExchangeDeviceCodeOptions): Promise<AgentTokenResponse>;
|
|
579
1039
|
refreshSession(refreshToken: string): Promise<AgentTokenResponse>;
|
|
580
1040
|
private post;
|
|
581
1041
|
private parseJson;
|
|
582
1042
|
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
constructor(options: HeliosAgentDataBridgeClientOptions);
|
|
592
|
-
getWalletState(accessToken: string): Promise<WalletState>;
|
|
593
|
-
getOpenPositions(accessToken: string): Promise<OpenPositionsSnapshot>;
|
|
594
|
-
getPortfolio(accessToken: string, input: PortfolioInput): Promise<PortfolioSnapshot>;
|
|
595
|
-
getLedgerFills(accessToken: string, input?: LedgerFillsInput): Promise<LedgerFillsPage>;
|
|
596
|
-
getLedgerSummary(accessToken: string, input?: LedgerSummaryInput): Promise<LedgerSummary>;
|
|
597
|
-
getMarketSnapshot(accessToken: string, input?: MarketSnapshotInput): Promise<MarketSnapshot>;
|
|
598
|
-
getMarketSnapshotChunk(accessToken: string, input?: MarketSnapshotChunkInput): Promise<MarketSnapshotChunk>;
|
|
599
|
-
getMarketSymbolDetail(accessToken: string, input: MarketSymbolDetailInput): Promise<MarketSymbolDetail>;
|
|
600
|
-
submitTradeIntent(accessToken: string, input: SubmitTradeIntentInput): Promise<SubmitTradeIntentResult>;
|
|
601
|
-
closePosition(accessToken: string, input: ClosePositionInput): Promise<ClosePositionResult>;
|
|
602
|
-
setTpSl(accessToken: string, input: SetTpSlInput): Promise<SetTpSlResult>;
|
|
603
|
-
deleteTpSl(accessToken: string, input: DeleteTpSlInput): Promise<DeleteTpSlResult>;
|
|
604
|
-
getOpenOrders(accessToken: string): Promise<OpenOrder[]>;
|
|
605
|
-
cancelOrder(accessToken: string, input: CancelOrderInput): Promise<CancelOrderResult>;
|
|
606
|
-
private request;
|
|
607
|
-
private buildProcedureUrl;
|
|
608
|
-
private parseJson;
|
|
609
|
-
private unwrapResult;
|
|
610
|
-
private extractErrorCode;
|
|
611
|
-
private extractErrorMessage;
|
|
612
|
-
/**
|
|
613
|
-
* Unwrap a tRPC error envelope, handling the superjson `{ json: ... }` wrapper
|
|
614
|
-
* that the data-bridge applies via its transformer configuration.
|
|
615
|
-
*/
|
|
616
|
-
private unwrapTrpcError;
|
|
617
|
-
}
|
|
1043
|
+
/**
|
|
1044
|
+
* The Helios hosts a session came from. A session is only sent back to them, so a config that points the server at
|
|
1045
|
+
* another host never hands it the stored tokens. Optional: sessions stored before it was recorded still load.
|
|
1046
|
+
*/
|
|
1047
|
+
declare const agentSessionIssuerSchema: z.ZodObject<{
|
|
1048
|
+
identityServiceUrl: z.ZodString;
|
|
1049
|
+
dataBridgeUrl: z.ZodString;
|
|
1050
|
+
}, z.core.$strip>;
|
|
618
1051
|
declare const storedAgentSessionSchema: z.ZodObject<{
|
|
619
1052
|
accessToken: z.ZodString;
|
|
620
1053
|
refreshToken: z.ZodString;
|
|
@@ -630,6 +1063,10 @@ declare const storedAgentSessionSchema: z.ZodObject<{
|
|
|
630
1063
|
accessTokenExpiresAt: z.ZodString;
|
|
631
1064
|
createdAt: z.ZodString;
|
|
632
1065
|
lastRefreshedAt: z.ZodString;
|
|
1066
|
+
issuer: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1067
|
+
identityServiceUrl: z.ZodString;
|
|
1068
|
+
dataBridgeUrl: z.ZodString;
|
|
1069
|
+
}, z.core.$strip>>>;
|
|
633
1070
|
}, z.core.$strip>;
|
|
634
1071
|
declare const agentSessionViewSchema: z.ZodObject<{
|
|
635
1072
|
connected: z.ZodBoolean;
|
|
@@ -652,6 +1089,7 @@ declare const agentSessionViewSchema: z.ZodObject<{
|
|
|
652
1089
|
accessTokenExpiresAt: z.ZodOptional<z.ZodString>;
|
|
653
1090
|
lastRefreshedAt: z.ZodOptional<z.ZodString>;
|
|
654
1091
|
}, z.core.$strip>;
|
|
1092
|
+
type AgentSessionIssuer = z.infer<typeof agentSessionIssuerSchema>;
|
|
655
1093
|
type StoredAgentSession = z.infer<typeof storedAgentSessionSchema>;
|
|
656
1094
|
type AgentSessionView = z.infer<typeof agentSessionViewSchema>;
|
|
657
1095
|
interface AgentSessionStore {
|
|
@@ -660,6 +1098,203 @@ interface AgentSessionStore {
|
|
|
660
1098
|
clearSession(): Promise<void>;
|
|
661
1099
|
}
|
|
662
1100
|
|
|
1101
|
+
/** A device login waiting for the person to approve it, as a login store keeps it. */
|
|
1102
|
+
declare const pendingAgentLoginSchema$1: z.ZodObject<{
|
|
1103
|
+
status: z.ZodLiteral<"pending">;
|
|
1104
|
+
deviceCode: z.ZodString;
|
|
1105
|
+
userCode: z.ZodString;
|
|
1106
|
+
verificationUri: z.ZodString;
|
|
1107
|
+
verificationUriComplete: z.ZodString;
|
|
1108
|
+
expiresInSeconds: z.ZodNumber;
|
|
1109
|
+
pollIntervalSeconds: z.ZodNumber;
|
|
1110
|
+
requestedScope: z.ZodArray<z.ZodEnum<{
|
|
1111
|
+
"account:read": "account:read";
|
|
1112
|
+
"market:read": "market:read";
|
|
1113
|
+
"orders:write": "orders:write";
|
|
1114
|
+
"orders:cancel": "orders:cancel";
|
|
1115
|
+
}>>;
|
|
1116
|
+
startedAt: z.ZodString;
|
|
1117
|
+
}, z.core.$strip>;
|
|
1118
|
+
type PendingAgentLogin$1 = z.infer<typeof pendingAgentLoginSchema$1>;
|
|
1119
|
+
/** A session store that also keeps the device login in progress. */
|
|
1120
|
+
interface AgentLoginStore extends AgentSessionStore {
|
|
1121
|
+
getPendingLogin(): Promise<PendingAgentLogin$1 | null>;
|
|
1122
|
+
setPendingLogin(pendingLogin: PendingAgentLogin$1): Promise<void>;
|
|
1123
|
+
clearPendingLogin(): Promise<void>;
|
|
1124
|
+
}
|
|
1125
|
+
type AgentStartLoginResult = PendingAgentLogin$1;
|
|
1126
|
+
type AgentPendingLoginResult = AgentStartLoginResult & {
|
|
1127
|
+
connected: false;
|
|
1128
|
+
message: string;
|
|
1129
|
+
};
|
|
1130
|
+
type ConnectedResult = AgentSessionView & {
|
|
1131
|
+
status: 'connected';
|
|
1132
|
+
connected: true;
|
|
1133
|
+
};
|
|
1134
|
+
type AgentEnsureLoginResult = ConnectedResult | AgentPendingLoginResult;
|
|
1135
|
+
type AgentPollLoginResult = ConnectedResult | {
|
|
1136
|
+
status: 'pending' | 'rejected' | 'expired' | 'failed';
|
|
1137
|
+
connected: false;
|
|
1138
|
+
message: string;
|
|
1139
|
+
};
|
|
1140
|
+
interface AgentEnsureLoginOptions {
|
|
1141
|
+
clientName?: string;
|
|
1142
|
+
scope?: AgentDeviceStartInput['scope'];
|
|
1143
|
+
constraints?: AgentDeviceStartInput['constraints'];
|
|
1144
|
+
}
|
|
1145
|
+
/** What the person or agent is told at each step; each app words them for its own commands. */
|
|
1146
|
+
interface AgentAuthMessages {
|
|
1147
|
+
/** The prompt shown with a login in progress: where to approve it and what to do next. */
|
|
1148
|
+
loginPrompt(result: Pick<AgentStartLoginResult, 'verificationUriComplete' | 'userCode' | 'requestedScope'>): string;
|
|
1149
|
+
/** pollLogin with no login in progress and no session. */
|
|
1150
|
+
noLoginInProgress: string;
|
|
1151
|
+
/** pollLogin with a code that isn't the login in progress. */
|
|
1152
|
+
wrongCode: string;
|
|
1153
|
+
/** The server no longer knows the stored device code (invalid_grant), so a fresh login is needed. */
|
|
1154
|
+
staleLogin: string;
|
|
1155
|
+
/** No session, and this service can't start a login (deviceLogin false). */
|
|
1156
|
+
reconnect: string;
|
|
1157
|
+
}
|
|
1158
|
+
interface AgentAuthServiceOptions {
|
|
1159
|
+
client: HeliosAgentAuthClient;
|
|
1160
|
+
sessionStore: AgentLoginStore;
|
|
1161
|
+
messages: AgentAuthMessages;
|
|
1162
|
+
refreshWindowMs?: number;
|
|
1163
|
+
now?: () => Date;
|
|
1164
|
+
/** The client name a login is started with when the caller gives none. */
|
|
1165
|
+
defaultClientName: string;
|
|
1166
|
+
/**
|
|
1167
|
+
* False on the hosted MCP server (helios.pgn.io/mcp): the AI app signed in through OAuth and holds the tokens, so this
|
|
1168
|
+
* service never starts a device login of its own; an expired or revoked connection is an error the app answers by
|
|
1169
|
+
* reconnecting. Default true.
|
|
1170
|
+
*/
|
|
1171
|
+
deviceLogin?: boolean;
|
|
1172
|
+
/**
|
|
1173
|
+
* True: ensureLogin with a scope the stored session wasn't granted drops that session and starts a login for the wider
|
|
1174
|
+
* scope. False: the session is used as it is, and the server refuses what it isn't allowed. Default false.
|
|
1175
|
+
*/
|
|
1176
|
+
reloginForMissingScope?: boolean;
|
|
1177
|
+
}
|
|
1178
|
+
/**
|
|
1179
|
+
* Device login and session refresh for a Helios delegated agent (helios-cli and helios-agent-mcp). Both refresh and the
|
|
1180
|
+
* device-code exchange are single-flight: refresh tokens rotate and a device code is collected once, so a second
|
|
1181
|
+
* concurrent request with the same token or code would be refused and log the agent out.
|
|
1182
|
+
*/
|
|
1183
|
+
declare class AgentAuthService {
|
|
1184
|
+
protected readonly client: HeliosAgentAuthClient;
|
|
1185
|
+
protected readonly sessionStore: AgentLoginStore;
|
|
1186
|
+
private readonly messages;
|
|
1187
|
+
private readonly refreshWindowMs;
|
|
1188
|
+
private readonly now;
|
|
1189
|
+
private readonly defaultClientName;
|
|
1190
|
+
private readonly deviceLogin;
|
|
1191
|
+
private readonly reloginForMissingScope;
|
|
1192
|
+
/** The refresh in progress, which concurrent callers join. */
|
|
1193
|
+
private refreshInFlight;
|
|
1194
|
+
/** The device-code exchange in progress, which concurrent polls of the same login join. */
|
|
1195
|
+
private exchangeInFlight;
|
|
1196
|
+
constructor(options: AgentAuthServiceOptions);
|
|
1197
|
+
startLogin(input: AgentDeviceStartInput): Promise<AgentStartLoginResult>;
|
|
1198
|
+
resetSessionAndStartLogin(input: AgentDeviceStartInput): Promise<AgentStartLoginResult>;
|
|
1199
|
+
startRelogin(options?: AgentEnsureLoginOptions): Promise<AgentPendingLoginResult>;
|
|
1200
|
+
clearSessionState(): Promise<void>;
|
|
1201
|
+
/** After a 401 from Helios: drops the session and starts a fresh login. Null for any other error. */
|
|
1202
|
+
invalidateIfUnauthorized(error: unknown, options?: AgentEnsureLoginOptions): Promise<AgentPendingLoginResult | null>;
|
|
1203
|
+
/** After a 401 from Helios: refreshes the session even if it isn't near expiry. Null for any other error. */
|
|
1204
|
+
refreshSessionAfterUnauthorized(error: unknown): Promise<StoredAgentSession | null>;
|
|
1205
|
+
ensureLogin(options?: AgentEnsureLoginOptions): Promise<AgentEnsureLoginResult>;
|
|
1206
|
+
/**
|
|
1207
|
+
* Polls the stored pending login. A code, when given, must be that login's device code or the user code shown to the
|
|
1208
|
+
* person: a code from anywhere else (a prompt injection carrying a login someone else approved) is never exchanged, so
|
|
1209
|
+
* it can't swap the stored session for another account's.
|
|
1210
|
+
*/
|
|
1211
|
+
pollLogin(code?: string): Promise<AgentPollLoginResult>;
|
|
1212
|
+
whoami(): Promise<AgentSessionView>;
|
|
1213
|
+
getAccessToken(): Promise<string | null>;
|
|
1214
|
+
getPendingLoginState(): Promise<PendingAgentLogin$1 | null>;
|
|
1215
|
+
requireSession(): Promise<StoredAgentSession>;
|
|
1216
|
+
private loginInput;
|
|
1217
|
+
private pendingResult;
|
|
1218
|
+
private getValidSession;
|
|
1219
|
+
/**
|
|
1220
|
+
* Refreshes `seen` (the session the caller read), joining a refresh already in progress. `force` refreshes even a
|
|
1221
|
+
* session that isn't near expiry (Helios just answered 401 to it).
|
|
1222
|
+
*/
|
|
1223
|
+
private refreshStoredSession;
|
|
1224
|
+
private refreshOnce;
|
|
1225
|
+
private exchangePendingLogin;
|
|
1226
|
+
private exchangeOnce;
|
|
1227
|
+
private getPendingLogin;
|
|
1228
|
+
private clearPendingLoginIfMatches;
|
|
1229
|
+
}
|
|
1230
|
+
/**
|
|
1231
|
+
* After a 401 from Helios: refreshes the session and retries once with the new access token. If no refresh is possible,
|
|
1232
|
+
* or the retry is refused too, starts a fresh login and returns it. Rethrows anything else.
|
|
1233
|
+
*/
|
|
1234
|
+
declare function retryAfterUnauthorizedRefresh<T>(options: {
|
|
1235
|
+
authService: AgentAuthService;
|
|
1236
|
+
error: unknown;
|
|
1237
|
+
loginOptions: AgentEnsureLoginOptions;
|
|
1238
|
+
retry: (accessToken: string) => Promise<T>;
|
|
1239
|
+
}): Promise<T | AgentPendingLoginResult | null>;
|
|
1240
|
+
|
|
1241
|
+
interface HeliosAgentDataBridgeClientOptions {
|
|
1242
|
+
baseUrl: string;
|
|
1243
|
+
fetch?: FetchLike;
|
|
1244
|
+
}
|
|
1245
|
+
declare class HeliosAgentDataBridgeClient {
|
|
1246
|
+
private readonly baseUrl;
|
|
1247
|
+
private readonly fetchImpl;
|
|
1248
|
+
constructor(options: HeliosAgentDataBridgeClientOptions);
|
|
1249
|
+
getWalletState(accessToken: string): Promise<WalletState>;
|
|
1250
|
+
getOpenPositions(accessToken: string): Promise<OpenPositionsSnapshot>;
|
|
1251
|
+
getPortfolio(accessToken: string, input: PortfolioInput): Promise<PortfolioSnapshot>;
|
|
1252
|
+
getLedgerFills(accessToken: string, input?: LedgerFillsInput): Promise<LedgerFillsPage>;
|
|
1253
|
+
getLedgerSummary(accessToken: string, input?: LedgerSummaryInput): Promise<LedgerSummary>;
|
|
1254
|
+
getMarketSnapshot(accessToken: string, input?: MarketSnapshotInput): Promise<MarketSnapshot>;
|
|
1255
|
+
getMarketSnapshotChunk(accessToken: string, input?: MarketSnapshotChunkInput): Promise<MarketSnapshotChunk>;
|
|
1256
|
+
getMarketSymbolDetail(accessToken: string, input: MarketSymbolDetailInput): Promise<MarketSymbolDetail>;
|
|
1257
|
+
/** The lean market table: price, two returns, volume, funding, open interest, setup label and the smart money lean. */
|
|
1258
|
+
getAgentMarket(accessToken: string, input?: AgentMarketInput): Promise<AgentMarket>;
|
|
1259
|
+
getMarketCandles(accessToken: string, input: MarketCandlesInput): Promise<MarketCandles>;
|
|
1260
|
+
/** The research wallets' smart money board (conviction, discount, flows or pile-ins). */
|
|
1261
|
+
getSmartMoneyBoard(accessToken: string, input?: SmartMoneyBoardInput): Promise<SmartMoneyBoard>;
|
|
1262
|
+
/** Their trades by nickname: the latest, or only what came after an earlier call's `next`. */
|
|
1263
|
+
getSmartMoneyMoves(accessToken: string, input?: SmartMoneyMovesInput): Promise<SmartMoneyMoves>;
|
|
1264
|
+
/** One coin: their book, its market row and their latest trades on it. */
|
|
1265
|
+
getSmartMoneyCoin(accessToken: string, coin: string): Promise<SmartMoneyCoin>;
|
|
1266
|
+
submitTradeIntent(accessToken: string, input: SubmitTradeIntentInput): Promise<SubmitTradeIntentResult>;
|
|
1267
|
+
closePosition(accessToken: string, input: ClosePositionInput): Promise<ClosePositionResult>;
|
|
1268
|
+
setTpSl(accessToken: string, input: SetTpSlInput): Promise<SetTpSlResult>;
|
|
1269
|
+
deleteTpSl(accessToken: string, input: DeleteTpSlInput): Promise<DeleteTpSlResult>;
|
|
1270
|
+
getOpenOrders(accessToken: string): Promise<OpenOrder[]>;
|
|
1271
|
+
cancelOrder(accessToken: string, input: CancelOrderInput): Promise<CancelOrderResult>;
|
|
1272
|
+
modifyOrder(accessToken: string, input: ModifyOrderInput): Promise<ModifyOrderResult>;
|
|
1273
|
+
getPaperPortfolio(accessToken: string, accountId?: string): Promise<PaperPortfolio>;
|
|
1274
|
+
/** A paper market order; answers with its fills (none when nothing filled). */
|
|
1275
|
+
submitPaperIntent(accessToken: string, input: SubmitTradeIntentInput, accountId?: string): Promise<PaperFill[]>;
|
|
1276
|
+
/** Closes all or part of a paper position; no fills when there was none. */
|
|
1277
|
+
closePaperPosition(accessToken: string, input: ClosePositionInput, accountId?: string): Promise<PaperFill[]>;
|
|
1278
|
+
setPaperTpSl(accessToken: string, input: SetTpSlInput, accountId?: string): Promise<SetTpSlResult>;
|
|
1279
|
+
deletePaperTpSl(accessToken: string, input: DeleteTpSlInput, accountId?: string): Promise<DeleteTpSlResult>;
|
|
1280
|
+
getPaperLedgerFills(accessToken: string, input?: LedgerFillsInput, accountId?: string): Promise<LedgerFillsPage>;
|
|
1281
|
+
/** Starts the paper account over with `startingBalance` USD (data-bridge's default when omitted). */
|
|
1282
|
+
resetPaperAccount(accessToken: string, startingBalance?: number, accountId?: string): Promise<void>;
|
|
1283
|
+
private request;
|
|
1284
|
+
private buildProcedureUrl;
|
|
1285
|
+
private parseJson;
|
|
1286
|
+
/** The result of a mutation older data-bridges answer with nothing; null when there is none. */
|
|
1287
|
+
private tryUnwrapResult;
|
|
1288
|
+
private unwrapResult;
|
|
1289
|
+
private extractErrorCode;
|
|
1290
|
+
private extractErrorMessage;
|
|
1291
|
+
/**
|
|
1292
|
+
* Unwrap a tRPC error envelope, handling the superjson `{ json: ... }` wrapper
|
|
1293
|
+
* that the data-bridge applies via its transformer configuration.
|
|
1294
|
+
*/
|
|
1295
|
+
private unwrapTrpcError;
|
|
1296
|
+
}
|
|
1297
|
+
|
|
663
1298
|
declare function getDefaultHeliosAgentMcpSessionPath(): string;
|
|
664
1299
|
declare const pendingAgentLoginSchema: z.ZodObject<{
|
|
665
1300
|
status: z.ZodLiteral<"pending">;
|
|
@@ -676,19 +1311,30 @@ declare const pendingAgentLoginSchema: z.ZodObject<{
|
|
|
676
1311
|
"orders:cancel": "orders:cancel";
|
|
677
1312
|
}>>;
|
|
678
1313
|
startedAt: z.ZodString;
|
|
1314
|
+
issuer: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1315
|
+
identityServiceUrl: z.ZodString;
|
|
1316
|
+
dataBridgeUrl: z.ZodString;
|
|
1317
|
+
}, z.core.$strip>>>;
|
|
679
1318
|
}, z.core.$strip>;
|
|
680
1319
|
type PendingAgentLogin = z.infer<typeof pendingAgentLoginSchema>;
|
|
681
|
-
interface AgentMcpSessionStore extends
|
|
1320
|
+
interface AgentMcpSessionStore extends AgentLoginStore {
|
|
682
1321
|
getActiveProvider(): Promise<Provider | null>;
|
|
683
1322
|
setActiveProvider(provider: Provider): Promise<void>;
|
|
684
1323
|
clearActiveProvider(): Promise<void>;
|
|
685
1324
|
getPendingLogin(): Promise<PendingAgentLogin | null>;
|
|
686
1325
|
setPendingLogin(pendingLogin: PendingAgentLogin): Promise<void>;
|
|
687
|
-
|
|
1326
|
+
}
|
|
1327
|
+
interface FileAgentSessionStoreOptions {
|
|
1328
|
+
/**
|
|
1329
|
+
* The hosts this server sends tokens to. Sessions and logins are stored with it and only read back for the same hosts,
|
|
1330
|
+
* so pointing the server at another Helios (a staging URL, an edited .mcp.json) never sends it the stored tokens.
|
|
1331
|
+
*/
|
|
1332
|
+
issuer?: AgentSessionIssuer | null;
|
|
688
1333
|
}
|
|
689
1334
|
declare class FileAgentSessionStore implements AgentMcpSessionStore {
|
|
690
1335
|
private readonly filePath;
|
|
691
|
-
|
|
1336
|
+
private readonly issuer;
|
|
1337
|
+
constructor(filePath?: string, options?: FileAgentSessionStoreOptions);
|
|
692
1338
|
getSession(): Promise<StoredAgentSession | null>;
|
|
693
1339
|
getPendingLogin(): Promise<PendingAgentLogin | null>;
|
|
694
1340
|
getActiveProvider(): Promise<Provider | null>;
|
|
@@ -698,9 +1344,14 @@ declare class FileAgentSessionStore implements AgentMcpSessionStore {
|
|
|
698
1344
|
clearSession(): Promise<void>;
|
|
699
1345
|
clearPendingLogin(): Promise<void>;
|
|
700
1346
|
clearActiveProvider(): Promise<void>;
|
|
1347
|
+
private isFromIssuer;
|
|
1348
|
+
/**
|
|
1349
|
+
* Read-modify-write under the file's lock: tool calls run concurrently and several MCP processes can share the file,
|
|
1350
|
+
* so without it one write could drop another's (a refreshed session, a pending login).
|
|
1351
|
+
*/
|
|
1352
|
+
private update;
|
|
701
1353
|
private readState;
|
|
702
1354
|
private writeState;
|
|
703
|
-
private writeStateOrDelete;
|
|
704
1355
|
private deleteFile;
|
|
705
1356
|
}
|
|
706
1357
|
/**
|
|
@@ -741,6 +1392,11 @@ declare class HeliosAgentMcpProviderService {
|
|
|
741
1392
|
resolveProvider(explicitProvider?: Provider): Promise<Provider>;
|
|
742
1393
|
}
|
|
743
1394
|
|
|
1395
|
+
type StartLoginResult = AgentStartLoginResult;
|
|
1396
|
+
type EnsureLoginResult = AgentEnsureLoginResult;
|
|
1397
|
+
type PendingLoginResult = AgentPendingLoginResult;
|
|
1398
|
+
type PollLoginResult = AgentPollLoginResult;
|
|
1399
|
+
type EnsureLoginOptions = AgentEnsureLoginOptions;
|
|
744
1400
|
interface HeliosAgentMcpAuthServiceOptions {
|
|
745
1401
|
client: HeliosAgentAuthClient;
|
|
746
1402
|
sessionStore: AgentMcpSessionStore;
|
|
@@ -753,73 +1409,10 @@ interface HeliosAgentMcpAuthServiceOptions {
|
|
|
753
1409
|
deviceLogin?: boolean;
|
|
754
1410
|
}
|
|
755
1411
|
declare const HOSTED_RECONNECT_MESSAGE = "Helios no longer accepts this connection (it expired or was revoked). Reconnect Helios in your AI app to continue.";
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
deviceCode: string;
|
|
759
|
-
userCode: string;
|
|
760
|
-
verificationUri: string;
|
|
761
|
-
verificationUriComplete: string;
|
|
762
|
-
expiresInSeconds: number;
|
|
763
|
-
pollIntervalSeconds: number;
|
|
764
|
-
requestedScope: AgentDeviceStartInput['scope'];
|
|
765
|
-
startedAt: string;
|
|
766
|
-
}
|
|
767
|
-
type EnsureLoginResult = (AgentSessionView & {
|
|
768
|
-
status: 'connected';
|
|
769
|
-
connected: true;
|
|
770
|
-
}) | (StartLoginResult & {
|
|
771
|
-
connected: false;
|
|
772
|
-
message: string;
|
|
773
|
-
});
|
|
774
|
-
type PendingLoginResult = StartLoginResult & {
|
|
775
|
-
connected: false;
|
|
776
|
-
message: string;
|
|
777
|
-
};
|
|
778
|
-
type PollLoginResult = (AgentSessionView & {
|
|
779
|
-
status: 'connected';
|
|
780
|
-
connected: true;
|
|
781
|
-
}) | {
|
|
782
|
-
status: 'pending' | 'rejected' | 'expired' | 'failed';
|
|
783
|
-
connected: false;
|
|
784
|
-
message: string;
|
|
785
|
-
};
|
|
786
|
-
interface EnsureLoginOptions {
|
|
787
|
-
clientName?: string;
|
|
788
|
-
scope?: AgentDeviceStartInput['scope'];
|
|
789
|
-
constraints?: AgentDeviceStartInput['constraints'];
|
|
790
|
-
}
|
|
791
|
-
declare class HeliosAgentMcpAuthService {
|
|
792
|
-
private readonly client;
|
|
793
|
-
private readonly sessionStore;
|
|
794
|
-
private readonly refreshWindowMs;
|
|
795
|
-
private readonly now;
|
|
796
|
-
private readonly deviceLogin;
|
|
1412
|
+
/** The shared delegated-agent sign-in (AgentAuthService), worded for MCP tools. */
|
|
1413
|
+
declare class HeliosAgentMcpAuthService extends AgentAuthService {
|
|
797
1414
|
constructor(options: HeliosAgentMcpAuthServiceOptions);
|
|
798
|
-
startLogin(input: AgentDeviceStartInput): Promise<StartLoginResult>;
|
|
799
|
-
resetSessionAndStartLogin(input: AgentDeviceStartInput): Promise<StartLoginResult>;
|
|
800
|
-
private startDeviceLogin;
|
|
801
|
-
private buildStartLoginResult;
|
|
802
|
-
startRelogin(options?: EnsureLoginOptions): Promise<PendingLoginResult>;
|
|
803
|
-
clearSessionState(): Promise<void>;
|
|
804
|
-
invalidateIfUnauthorized(error: unknown, options?: EnsureLoginOptions): Promise<PendingLoginResult | null>;
|
|
805
|
-
refreshSessionAfterUnauthorized(error: unknown): Promise<StoredAgentSession | null>;
|
|
806
|
-
ensureLogin(options?: EnsureLoginOptions): Promise<EnsureLoginResult>;
|
|
807
|
-
/** Polls the given login, or the stored pending one when no device code is given. */
|
|
808
|
-
pollLogin(deviceCode?: string): Promise<PollLoginResult>;
|
|
809
|
-
whoami(): Promise<AgentSessionView>;
|
|
810
|
-
getAccessToken(): Promise<string | null>;
|
|
811
|
-
requireSession(): Promise<StoredAgentSession>;
|
|
812
|
-
private getValidSession;
|
|
813
|
-
private refreshStoredSession;
|
|
814
|
-
private getPendingLogin;
|
|
815
|
-
private clearPendingLoginIfMatches;
|
|
816
1415
|
}
|
|
817
|
-
declare function retryAfterUnauthorizedRefresh<T>(options: {
|
|
818
|
-
authService: HeliosAgentMcpAuthService;
|
|
819
|
-
error: unknown;
|
|
820
|
-
loginOptions: EnsureLoginOptions;
|
|
821
|
-
retry: (accessToken: string) => Promise<T>;
|
|
822
|
-
}): Promise<T | PendingLoginResult | null>;
|
|
823
1416
|
declare function formatHeliosLoginPrompt(result: Pick<StartLoginResult, 'verificationUriComplete' | 'userCode' | 'requestedScope'>): string;
|
|
824
1417
|
|
|
825
1418
|
interface HeliosAgentMcpAccountServiceOptions {
|
|
@@ -889,6 +1482,18 @@ declare class HeliosAgentMcpDocsService {
|
|
|
889
1482
|
}
|
|
890
1483
|
declare function getDefaultHeliosAgentMcpDocsRoot(): string;
|
|
891
1484
|
|
|
1485
|
+
/** Helios's public gateway serves both identity (/api/agents) and data-bridge (/api/trpc). */
|
|
1486
|
+
declare const DEFAULT_HELIOS_BASE_URL = "https://helios.pgn.io";
|
|
1487
|
+
/** Sessions stored before the issuer was recorded could only have come from the public gateway. */
|
|
1488
|
+
declare const DEFAULT_HELIOS_SESSION_ISSUER: AgentSessionIssuer;
|
|
1489
|
+
/**
|
|
1490
|
+
* Checks a Helios base URL the local server sends the stored tokens to: https, or plain http to localhost only, so a
|
|
1491
|
+
* config can't send them in clear text or to a host by mistake. Returns the value unchanged.
|
|
1492
|
+
*/
|
|
1493
|
+
declare function assertHeliosBaseUrl(name: string, value: string): string;
|
|
1494
|
+
/** True when a stored session or login came from the hosts this server is configured for. */
|
|
1495
|
+
declare function isSameHeliosIssuer(stored: AgentSessionIssuer | null | undefined, configured: AgentSessionIssuer): boolean;
|
|
1496
|
+
|
|
892
1497
|
interface HeliosAgentMcpLedgerServiceOptions {
|
|
893
1498
|
authService: HeliosAgentMcpAuthService;
|
|
894
1499
|
dataBridgeClient: HeliosAgentDataBridgeClient;
|
|
@@ -1037,6 +1642,16 @@ declare class HeliosAgentMcpTradingService {
|
|
|
1037
1642
|
private submitIntent;
|
|
1038
1643
|
}
|
|
1039
1644
|
|
|
1645
|
+
/**
|
|
1646
|
+
* Which tools a server lists (Mario 2026-10-26, the lean MCP):
|
|
1647
|
+
* - lean: the 9 smart-money-first tools (reads, your trades, trade, protect, candles) with short text answers, for small models (Qwen 27B
|
|
1648
|
+
* at 32k) and most agents;
|
|
1649
|
+
* - signals: the reads of lean only (no trade or protect), for agents that should watch but never trade;
|
|
1650
|
+
* - full: lean plus the depth reads (the ~50-column snapshot, symbol detail with raw indicators, fills, the
|
|
1651
|
+
* indicator docs), for strong models that do their own analysis.
|
|
1652
|
+
*/
|
|
1653
|
+
type McpProfile = 'lean' | 'signals' | 'full';
|
|
1654
|
+
declare const MCP_PROFILES: readonly McpProfile[];
|
|
1040
1655
|
interface CreateHeliosAgentMcpServerOptions {
|
|
1041
1656
|
identityServiceUrl: string;
|
|
1042
1657
|
dataBridgeUrl: string;
|
|
@@ -1050,7 +1665,10 @@ interface CreateHeliosAgentMcpServerOptions {
|
|
|
1050
1665
|
* left out (whoami stays) and no tool ever starts a login of its own.
|
|
1051
1666
|
*/
|
|
1052
1667
|
hosted?: boolean;
|
|
1668
|
+
/** Default full, which keeps every read tool; the CLI and the hosted /mcp pass lean. */
|
|
1669
|
+
profile?: McpProfile;
|
|
1053
1670
|
}
|
|
1671
|
+
declare const MAX_TOOL_INPUT_ELEMENTS = 10000;
|
|
1054
1672
|
declare function createHeliosAgentMcpServer(options: CreateHeliosAgentMcpServerOptions): Promise<{
|
|
1055
1673
|
server: McpServer;
|
|
1056
1674
|
authService: HeliosAgentMcpAuthService;
|
|
@@ -1136,11 +1754,15 @@ declare function createHeliosAuthToolDefinitions(service: HeliosAgentMcpAuthServ
|
|
|
1136
1754
|
"orders:cancel": "orders:cancel";
|
|
1137
1755
|
}>>;
|
|
1138
1756
|
constraints: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1757
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
1758
|
+
requireApprovalProof: z.ZodOptional<z.ZodBoolean>;
|
|
1139
1759
|
}, z.core.$strip>;
|
|
1140
1760
|
execute(input: {
|
|
1141
1761
|
clientName: string;
|
|
1142
1762
|
scope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
|
|
1143
1763
|
constraints?: Record<string, unknown> | undefined;
|
|
1764
|
+
verified?: boolean | undefined;
|
|
1765
|
+
requireApprovalProof?: boolean | undefined;
|
|
1144
1766
|
}): Promise<{
|
|
1145
1767
|
content: {
|
|
1146
1768
|
type: "text";
|
|
@@ -1151,7 +1773,6 @@ declare function createHeliosAuthToolDefinitions(service: HeliosAgentMcpAuthServ
|
|
|
1151
1773
|
loginUrl: string;
|
|
1152
1774
|
nextStep: string;
|
|
1153
1775
|
status: "pending";
|
|
1154
|
-
deviceCode: string;
|
|
1155
1776
|
userCode: string;
|
|
1156
1777
|
verificationUri: string;
|
|
1157
1778
|
verificationUriComplete: string;
|
|
@@ -1196,7 +1817,6 @@ declare function createHeliosAuthToolDefinitions(service: HeliosAgentMcpAuthServ
|
|
|
1196
1817
|
actionRequired: true;
|
|
1197
1818
|
loginUrl: string;
|
|
1198
1819
|
nextStep: string;
|
|
1199
|
-
deviceCode: string;
|
|
1200
1820
|
userCode: string;
|
|
1201
1821
|
verificationUri: string;
|
|
1202
1822
|
verificationUriComplete: string;
|
|
@@ -1316,7 +1936,7 @@ declare function createHeliosAccountToolDefinitions(service: HeliosAgentMcpAccou
|
|
|
1316
1936
|
verificationUriComplete: string;
|
|
1317
1937
|
expiresInSeconds: number;
|
|
1318
1938
|
pollIntervalSeconds: number;
|
|
1319
|
-
requestedScope:
|
|
1939
|
+
requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
|
|
1320
1940
|
startedAt: string;
|
|
1321
1941
|
};
|
|
1322
1942
|
}>;
|
|
@@ -1353,7 +1973,7 @@ declare function createHeliosAccountToolDefinitions(service: HeliosAgentMcpAccou
|
|
|
1353
1973
|
verificationUriComplete: string;
|
|
1354
1974
|
expiresInSeconds: number;
|
|
1355
1975
|
pollIntervalSeconds: number;
|
|
1356
|
-
requestedScope:
|
|
1976
|
+
requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
|
|
1357
1977
|
startedAt: string;
|
|
1358
1978
|
};
|
|
1359
1979
|
}>;
|
|
@@ -1385,7 +2005,7 @@ declare function createHeliosLedgerToolDefinitions(service: HeliosAgentMcpLedger
|
|
|
1385
2005
|
verificationUriComplete: string;
|
|
1386
2006
|
expiresInSeconds: number;
|
|
1387
2007
|
pollIntervalSeconds: number;
|
|
1388
|
-
requestedScope:
|
|
2008
|
+
requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
|
|
1389
2009
|
startedAt: string;
|
|
1390
2010
|
};
|
|
1391
2011
|
}>;
|
|
@@ -1428,7 +2048,7 @@ declare function createHeliosLedgerToolDefinitions(service: HeliosAgentMcpLedger
|
|
|
1428
2048
|
verificationUriComplete: string;
|
|
1429
2049
|
expiresInSeconds: number;
|
|
1430
2050
|
pollIntervalSeconds: number;
|
|
1431
|
-
requestedScope:
|
|
2051
|
+
requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
|
|
1432
2052
|
startedAt: string;
|
|
1433
2053
|
};
|
|
1434
2054
|
}>;
|
|
@@ -1467,7 +2087,7 @@ declare function createHeliosLedgerToolDefinitions(service: HeliosAgentMcpLedger
|
|
|
1467
2087
|
verificationUriComplete: string;
|
|
1468
2088
|
expiresInSeconds: number;
|
|
1469
2089
|
pollIntervalSeconds: number;
|
|
1470
|
-
requestedScope:
|
|
2090
|
+
requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
|
|
1471
2091
|
startedAt: string;
|
|
1472
2092
|
};
|
|
1473
2093
|
}>;
|
|
@@ -1514,7 +2134,7 @@ declare function createHeliosMarketToolDefinitions(service: HeliosAgentMcpMarket
|
|
|
1514
2134
|
verificationUriComplete: string;
|
|
1515
2135
|
expiresInSeconds: number;
|
|
1516
2136
|
pollIntervalSeconds: number;
|
|
1517
|
-
requestedScope:
|
|
2137
|
+
requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
|
|
1518
2138
|
startedAt: string;
|
|
1519
2139
|
};
|
|
1520
2140
|
}>;
|
|
@@ -1564,7 +2184,7 @@ declare function createHeliosMarketToolDefinitions(service: HeliosAgentMcpMarket
|
|
|
1564
2184
|
verificationUriComplete: string;
|
|
1565
2185
|
expiresInSeconds: number;
|
|
1566
2186
|
pollIntervalSeconds: number;
|
|
1567
|
-
requestedScope:
|
|
2187
|
+
requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
|
|
1568
2188
|
startedAt: string;
|
|
1569
2189
|
};
|
|
1570
2190
|
}>;
|
|
@@ -1601,7 +2221,7 @@ declare function createHeliosMarketToolDefinitions(service: HeliosAgentMcpMarket
|
|
|
1601
2221
|
verificationUriComplete: string;
|
|
1602
2222
|
expiresInSeconds: number;
|
|
1603
2223
|
pollIntervalSeconds: number;
|
|
1604
|
-
requestedScope:
|
|
2224
|
+
requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
|
|
1605
2225
|
startedAt: string;
|
|
1606
2226
|
};
|
|
1607
2227
|
}>;
|
|
@@ -1667,6 +2287,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
|
|
|
1667
2287
|
}, z.core.$strip>>;
|
|
1668
2288
|
}, z.core.$strip>>;
|
|
1669
2289
|
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
2290
|
+
idempotencyWindowSeconds: z.ZodOptional<z.ZodNumber>;
|
|
1670
2291
|
}, z.core.$strip>;
|
|
1671
2292
|
execute(input: {
|
|
1672
2293
|
symbol: string;
|
|
@@ -1698,6 +2319,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
|
|
|
1698
2319
|
} | undefined;
|
|
1699
2320
|
} | undefined;
|
|
1700
2321
|
idempotencyKey?: string | undefined;
|
|
2322
|
+
idempotencyWindowSeconds?: number | undefined;
|
|
1701
2323
|
}): Promise<{
|
|
1702
2324
|
content: {
|
|
1703
2325
|
type: "text";
|
|
@@ -1720,7 +2342,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
|
|
|
1720
2342
|
verificationUriComplete: string;
|
|
1721
2343
|
expiresInSeconds: number;
|
|
1722
2344
|
pollIntervalSeconds: number;
|
|
1723
|
-
requestedScope:
|
|
2345
|
+
requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
|
|
1724
2346
|
startedAt: string;
|
|
1725
2347
|
};
|
|
1726
2348
|
}>;
|
|
@@ -1785,6 +2407,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
|
|
|
1785
2407
|
}, z.core.$strip>>;
|
|
1786
2408
|
}, z.core.$strip>>;
|
|
1787
2409
|
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
2410
|
+
idempotencyWindowSeconds: z.ZodOptional<z.ZodNumber>;
|
|
1788
2411
|
}, z.core.$strip>;
|
|
1789
2412
|
execute(input: {
|
|
1790
2413
|
symbol: string;
|
|
@@ -1816,6 +2439,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
|
|
|
1816
2439
|
} | undefined;
|
|
1817
2440
|
} | undefined;
|
|
1818
2441
|
idempotencyKey?: string | undefined;
|
|
2442
|
+
idempotencyWindowSeconds?: number | undefined;
|
|
1819
2443
|
}): Promise<{
|
|
1820
2444
|
content: {
|
|
1821
2445
|
type: "text";
|
|
@@ -1838,7 +2462,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
|
|
|
1838
2462
|
verificationUriComplete: string;
|
|
1839
2463
|
expiresInSeconds: number;
|
|
1840
2464
|
pollIntervalSeconds: number;
|
|
1841
|
-
requestedScope:
|
|
2465
|
+
requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
|
|
1842
2466
|
startedAt: string;
|
|
1843
2467
|
};
|
|
1844
2468
|
}>;
|
|
@@ -1903,6 +2527,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
|
|
|
1903
2527
|
}, z.core.$strip>>;
|
|
1904
2528
|
}, z.core.$strip>>;
|
|
1905
2529
|
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
2530
|
+
idempotencyWindowSeconds: z.ZodOptional<z.ZodNumber>;
|
|
1906
2531
|
}, z.core.$strip>;
|
|
1907
2532
|
execute(input: {
|
|
1908
2533
|
symbol: string;
|
|
@@ -1934,6 +2559,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
|
|
|
1934
2559
|
} | undefined;
|
|
1935
2560
|
} | undefined;
|
|
1936
2561
|
idempotencyKey?: string | undefined;
|
|
2562
|
+
idempotencyWindowSeconds?: number | undefined;
|
|
1937
2563
|
}): Promise<{
|
|
1938
2564
|
content: {
|
|
1939
2565
|
type: "text";
|
|
@@ -1956,7 +2582,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
|
|
|
1956
2582
|
verificationUriComplete: string;
|
|
1957
2583
|
expiresInSeconds: number;
|
|
1958
2584
|
pollIntervalSeconds: number;
|
|
1959
|
-
requestedScope:
|
|
2585
|
+
requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
|
|
1960
2586
|
startedAt: string;
|
|
1961
2587
|
};
|
|
1962
2588
|
}>;
|
|
@@ -1970,11 +2596,13 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
|
|
|
1970
2596
|
}>>;
|
|
1971
2597
|
symbol: z.ZodString;
|
|
1972
2598
|
maxSlippageBps: z.ZodOptional<z.ZodNumber>;
|
|
2599
|
+
fraction: z.ZodOptional<z.ZodNumber>;
|
|
1973
2600
|
}, z.core.$strip>;
|
|
1974
2601
|
execute(input: {
|
|
1975
2602
|
symbol: string;
|
|
1976
2603
|
provider?: "hyperliquid" | undefined;
|
|
1977
2604
|
maxSlippageBps?: number | undefined;
|
|
2605
|
+
fraction?: number | undefined;
|
|
1978
2606
|
}): Promise<{
|
|
1979
2607
|
content: {
|
|
1980
2608
|
type: "text";
|
|
@@ -1997,7 +2625,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
|
|
|
1997
2625
|
verificationUriComplete: string;
|
|
1998
2626
|
expiresInSeconds: number;
|
|
1999
2627
|
pollIntervalSeconds: number;
|
|
2000
|
-
requestedScope:
|
|
2628
|
+
requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
|
|
2001
2629
|
startedAt: string;
|
|
2002
2630
|
};
|
|
2003
2631
|
}>;
|
|
@@ -2071,7 +2699,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
|
|
|
2071
2699
|
verificationUriComplete: string;
|
|
2072
2700
|
expiresInSeconds: number;
|
|
2073
2701
|
pollIntervalSeconds: number;
|
|
2074
|
-
requestedScope:
|
|
2702
|
+
requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
|
|
2075
2703
|
startedAt: string;
|
|
2076
2704
|
};
|
|
2077
2705
|
}>;
|
|
@@ -2112,7 +2740,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
|
|
|
2112
2740
|
verificationUriComplete: string;
|
|
2113
2741
|
expiresInSeconds: number;
|
|
2114
2742
|
pollIntervalSeconds: number;
|
|
2115
|
-
requestedScope:
|
|
2743
|
+
requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
|
|
2116
2744
|
startedAt: string;
|
|
2117
2745
|
};
|
|
2118
2746
|
}>;
|
|
@@ -2143,7 +2771,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
|
|
|
2143
2771
|
verificationUriComplete: string;
|
|
2144
2772
|
expiresInSeconds: number;
|
|
2145
2773
|
pollIntervalSeconds: number;
|
|
2146
|
-
requestedScope:
|
|
2774
|
+
requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
|
|
2147
2775
|
startedAt: string;
|
|
2148
2776
|
};
|
|
2149
2777
|
}>;
|
|
@@ -2180,10 +2808,261 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
|
|
|
2180
2808
|
verificationUriComplete: string;
|
|
2181
2809
|
expiresInSeconds: number;
|
|
2182
2810
|
pollIntervalSeconds: number;
|
|
2183
|
-
requestedScope:
|
|
2811
|
+
requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
|
|
2184
2812
|
startedAt: string;
|
|
2185
2813
|
};
|
|
2186
2814
|
}>;
|
|
2187
2815
|
}];
|
|
2188
2816
|
|
|
2189
|
-
|
|
2817
|
+
/**
|
|
2818
|
+
* Text for the lean tools: what a small model (Qwen 27B at 32k) reads, so every answer is short, line-oriented and the
|
|
2819
|
+
* same shape each time. The first line is the answer, then one line per row with `|` between fields, units on every
|
|
2820
|
+
* number, times as "minutes ago". Clients that read structured content also get the JSON these are rendered from.
|
|
2821
|
+
*/
|
|
2822
|
+
declare const usd: (v: number | null | undefined, signed?: boolean) => string;
|
|
2823
|
+
declare const pct: (v: number | null | undefined, places?: number) => string;
|
|
2824
|
+
/** A price with the digits that matter: 67,420 · 36.90 · 0.0001234. */
|
|
2825
|
+
declare const price: (v: number | null | undefined) => string;
|
|
2826
|
+
declare const ago: (t: number | null | undefined, now: number) => string;
|
|
2827
|
+
/** "Patient Sniper #4 (swing, 82% win)". */
|
|
2828
|
+
declare const trader: (m: Pick<SmMove, "nick" | "rank" | "style" | "win">) => string;
|
|
2829
|
+
/** "opened long HYPE $310k @ 36.95 5x" or "closed long SOL $150k +$11.8k (+7.9%)". */
|
|
2830
|
+
declare const moveText: (m: SmMove) => string;
|
|
2831
|
+
/** Where the mark sits against the bigger side's weighted entry: edge > 0 is better than their entry. */
|
|
2832
|
+
declare const entryText: (side: "long" | "short" | null, edgePct: number | null) => string | null;
|
|
2833
|
+
declare function renderMarket(m: AgentMarket, now?: number): string;
|
|
2834
|
+
declare function renderBoard(b: SmartMoneyBoard, now?: number): string;
|
|
2835
|
+
declare function renderMoves(m: SmartMoneyMoves, now?: number): string;
|
|
2836
|
+
interface CoinYou {
|
|
2837
|
+
position: PortfolioSnapshot['positions'][number] | null;
|
|
2838
|
+
availableBalance: number;
|
|
2839
|
+
}
|
|
2840
|
+
declare function renderCoin(c: SmartMoneyCoin, you: CoinYou | null, now?: number): string;
|
|
2841
|
+
declare function renderAccount(p: PortfolioSnapshot, orders: OpenOrder[] | null, summary: LedgerSummary | null): string;
|
|
2842
|
+
/** "long 0.5 BTC @ 67,420 · mark 67,900 · open PnL +$240 · 10x · liquidation 61,200". */
|
|
2843
|
+
declare function positionLine(pos: PortfolioSnapshot['positions'][number]): string;
|
|
2844
|
+
/** The agent's own fills, newest first, with the window's totals on the first line. */
|
|
2845
|
+
declare function renderTrades(page: LedgerFillsPage, paper: boolean, coin: string | null, now?: number): string;
|
|
2846
|
+
declare function renderCandles(coin: string, interval: string, c: MarketCandles): string;
|
|
2847
|
+
|
|
2848
|
+
/**
|
|
2849
|
+
* The lean tool set (Mario 2026-10-26: "make our MCP incredibly high performance and valuable, even if it means
|
|
2850
|
+
* stripping away most of the indicators"): smart money first, flat parameters, short text answers a 27B model at 32k
|
|
2851
|
+
* reads reliably, and the full JSON as structured content for clients that read it. data-bridge serves the reads from
|
|
2852
|
+
* prebuilt views (services/agents/smartMoney.ts), so each call is a Redis read on the server.
|
|
2853
|
+
*/
|
|
2854
|
+
interface LeanToolResult {
|
|
2855
|
+
content: Array<{
|
|
2856
|
+
type: 'text';
|
|
2857
|
+
text: string;
|
|
2858
|
+
}>;
|
|
2859
|
+
structuredContent: Record<string, unknown>;
|
|
2860
|
+
}
|
|
2861
|
+
interface LeanToolDefinition<TInput> {
|
|
2862
|
+
name: string;
|
|
2863
|
+
title: string;
|
|
2864
|
+
description: string;
|
|
2865
|
+
inputSchema: z.ZodType<TInput>;
|
|
2866
|
+
/** Changes the account (MCP annotations: apps ask before running it). */
|
|
2867
|
+
acts?: boolean;
|
|
2868
|
+
execute(input: TInput): Promise<LeanToolResult>;
|
|
2869
|
+
}
|
|
2870
|
+
interface LeanServices {
|
|
2871
|
+
auth: HeliosAgentMcpAuthService;
|
|
2872
|
+
dataBridge: HeliosAgentDataBridgeClient;
|
|
2873
|
+
}
|
|
2874
|
+
declare const smBoardInputSchema: z.ZodObject<{
|
|
2875
|
+
view: z.ZodOptional<z.ZodEnum<{
|
|
2876
|
+
discount: "discount";
|
|
2877
|
+
conviction: "conviction";
|
|
2878
|
+
flows: "flows";
|
|
2879
|
+
pileins: "pileins";
|
|
2880
|
+
}>>;
|
|
2881
|
+
side: z.ZodOptional<z.ZodEnum<{
|
|
2882
|
+
long: "long";
|
|
2883
|
+
short: "short";
|
|
2884
|
+
any: "any";
|
|
2885
|
+
}>>;
|
|
2886
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
2887
|
+
}, z.core.$strip>;
|
|
2888
|
+
declare const smMovesInputSchema: z.ZodObject<{
|
|
2889
|
+
since: z.ZodOptional<z.ZodString>;
|
|
2890
|
+
coin: z.ZodOptional<z.ZodString>;
|
|
2891
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
2892
|
+
all: "all";
|
|
2893
|
+
entries: "entries";
|
|
2894
|
+
exits: "exits";
|
|
2895
|
+
}>>;
|
|
2896
|
+
min_usd: z.ZodOptional<z.ZodNumber>;
|
|
2897
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
2898
|
+
}, z.core.$strip>;
|
|
2899
|
+
declare const smCoinInputSchema: z.ZodObject<{
|
|
2900
|
+
coin: z.ZodString;
|
|
2901
|
+
}, z.core.$strip>;
|
|
2902
|
+
declare const marketInputSchema: z.ZodObject<{
|
|
2903
|
+
coins: z.ZodOptional<z.ZodString>;
|
|
2904
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
2905
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
2906
|
+
sort: z.ZodOptional<z.ZodEnum<{
|
|
2907
|
+
lean: "lean";
|
|
2908
|
+
rank: "rank";
|
|
2909
|
+
volume: "volume";
|
|
2910
|
+
move1h: "move1h";
|
|
2911
|
+
move24h: "move24h";
|
|
2912
|
+
funding: "funding";
|
|
2913
|
+
edge: "edge";
|
|
2914
|
+
}>>;
|
|
2915
|
+
filter: z.ZodOptional<z.ZodEnum<{
|
|
2916
|
+
discount: "discount";
|
|
2917
|
+
turning: "turning";
|
|
2918
|
+
falling: "falling";
|
|
2919
|
+
stretched_up: "stretched_up";
|
|
2920
|
+
stretched_down: "stretched_down";
|
|
2921
|
+
sm_long: "sm_long";
|
|
2922
|
+
sm_short: "sm_short";
|
|
2923
|
+
}>>;
|
|
2924
|
+
}, z.core.$strip>;
|
|
2925
|
+
declare const accountInputSchema: z.ZodObject<{
|
|
2926
|
+
paper: z.ZodOptional<z.ZodBoolean>;
|
|
2927
|
+
}, z.core.$strip>;
|
|
2928
|
+
declare const tradeInputSchema: z.ZodObject<{
|
|
2929
|
+
coin: z.ZodString;
|
|
2930
|
+
action: z.ZodEnum<{
|
|
2931
|
+
reverse: "reverse";
|
|
2932
|
+
open: "open";
|
|
2933
|
+
add: "add";
|
|
2934
|
+
close: "close";
|
|
2935
|
+
reset: "reset";
|
|
2936
|
+
}>;
|
|
2937
|
+
side: z.ZodOptional<z.ZodEnum<{
|
|
2938
|
+
long: "long";
|
|
2939
|
+
short: "short";
|
|
2940
|
+
}>>;
|
|
2941
|
+
margin_usd: z.ZodOptional<z.ZodNumber>;
|
|
2942
|
+
leverage: z.ZodOptional<z.ZodNumber>;
|
|
2943
|
+
sl_pct: z.ZodOptional<z.ZodNumber>;
|
|
2944
|
+
tp_pct: z.ZodOptional<z.ZodNumber>;
|
|
2945
|
+
limit_px: z.ZodOptional<z.ZodNumber>;
|
|
2946
|
+
slippage_bps: z.ZodOptional<z.ZodNumber>;
|
|
2947
|
+
fraction: z.ZodOptional<z.ZodNumber>;
|
|
2948
|
+
paper: z.ZodOptional<z.ZodBoolean>;
|
|
2949
|
+
key: z.ZodOptional<z.ZodString>;
|
|
2950
|
+
}, z.core.$strip>;
|
|
2951
|
+
/** How long after the first identical keyless trade call a repeat is still a retry of it (data-bridge holds the window). */
|
|
2952
|
+
declare const TRADE_KEY_WINDOW_SECONDS = 60;
|
|
2953
|
+
/**
|
|
2954
|
+
* The key for a trade call that brought none: a fingerprint of the account and the normalized order, sent with
|
|
2955
|
+
* idempotencyWindowSeconds. The data-bridge keeps the window in Redis, so an identical call within
|
|
2956
|
+
* TRADE_KEY_WINDOW_SECONDS of the first (a retry after a timeout or a lost reply, when the model never saw a key) names
|
|
2957
|
+
* the same order on every replica and after a restart, and is placed once. The window runs from the first call; after
|
|
2958
|
+
* it an identical call is a new order. A deliberate second identical order within the window needs its own `key`.
|
|
2959
|
+
*/
|
|
2960
|
+
declare function tradeKeyFor(input: z.infer<typeof tradeInputSchema>, account: string): string;
|
|
2961
|
+
declare const protectInputSchema: z.ZodObject<{
|
|
2962
|
+
coin: z.ZodString;
|
|
2963
|
+
op: z.ZodEnum<{
|
|
2964
|
+
set: "set";
|
|
2965
|
+
remove: "remove";
|
|
2966
|
+
cancel: "cancel";
|
|
2967
|
+
move: "move";
|
|
2968
|
+
}>;
|
|
2969
|
+
tp_px: z.ZodOptional<z.ZodNumber>;
|
|
2970
|
+
sl_px: z.ZodOptional<z.ZodNumber>;
|
|
2971
|
+
order_id: z.ZodOptional<z.ZodString>;
|
|
2972
|
+
px: z.ZodOptional<z.ZodNumber>;
|
|
2973
|
+
paper: z.ZodOptional<z.ZodBoolean>;
|
|
2974
|
+
}, z.core.$strip>;
|
|
2975
|
+
declare const tradesInputSchema: z.ZodObject<{
|
|
2976
|
+
window: z.ZodOptional<z.ZodEnum<{
|
|
2977
|
+
"24h": "24h";
|
|
2978
|
+
"7d": "7d";
|
|
2979
|
+
"30d": "30d";
|
|
2980
|
+
}>>;
|
|
2981
|
+
coin: z.ZodOptional<z.ZodString>;
|
|
2982
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
2983
|
+
paper: z.ZodOptional<z.ZodBoolean>;
|
|
2984
|
+
}, z.core.$strip>;
|
|
2985
|
+
declare const candlesInputSchema: z.ZodObject<{
|
|
2986
|
+
coin: z.ZodString;
|
|
2987
|
+
interval: z.ZodEnum<{
|
|
2988
|
+
"1m": "1m";
|
|
2989
|
+
"5m": "5m";
|
|
2990
|
+
"15m": "15m";
|
|
2991
|
+
"1h": "1h";
|
|
2992
|
+
"4h": "4h";
|
|
2993
|
+
"1d": "1d";
|
|
2994
|
+
}>;
|
|
2995
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
2996
|
+
}, z.core.$strip>;
|
|
2997
|
+
/**
|
|
2998
|
+
* Why a TP/SL would trigger the moment it is set, or null when both legs are on the right side of the mark: a long's
|
|
2999
|
+
* stop sits under the price and its take profit over it, a short's the other way round. Hyperliquid fires a trigger
|
|
3000
|
+
* that is already through the price at once, closing the position at market.
|
|
3001
|
+
*/
|
|
3002
|
+
declare function wrongSideTpSl(side: 'LONG' | 'SHORT', mark: number, tp?: number, sl?: number): string | null;
|
|
3003
|
+
declare function createLeanToolDefinitions(services: LeanServices): {
|
|
3004
|
+
smBoard: LeanToolDefinition<{
|
|
3005
|
+
view?: "discount" | "conviction" | "flows" | "pileins" | undefined;
|
|
3006
|
+
side?: "long" | "short" | "any" | undefined;
|
|
3007
|
+
limit?: number | undefined;
|
|
3008
|
+
}>;
|
|
3009
|
+
smMoves: LeanToolDefinition<{
|
|
3010
|
+
since?: string | undefined;
|
|
3011
|
+
coin?: string | undefined;
|
|
3012
|
+
kind?: "all" | "entries" | "exits" | undefined;
|
|
3013
|
+
min_usd?: number | undefined;
|
|
3014
|
+
limit?: number | undefined;
|
|
3015
|
+
}>;
|
|
3016
|
+
smCoin: LeanToolDefinition<{
|
|
3017
|
+
coin: string;
|
|
3018
|
+
}>;
|
|
3019
|
+
market: LeanToolDefinition<{
|
|
3020
|
+
coins?: string | undefined;
|
|
3021
|
+
limit?: number | undefined;
|
|
3022
|
+
offset?: number | undefined;
|
|
3023
|
+
sort?: "lean" | "rank" | "volume" | "move1h" | "move24h" | "funding" | "edge" | undefined;
|
|
3024
|
+
filter?: "discount" | "turning" | "falling" | "stretched_up" | "stretched_down" | "sm_long" | "sm_short" | undefined;
|
|
3025
|
+
}>;
|
|
3026
|
+
account: LeanToolDefinition<{
|
|
3027
|
+
paper?: boolean | undefined;
|
|
3028
|
+
}>;
|
|
3029
|
+
trade: LeanToolDefinition<{
|
|
3030
|
+
coin: string;
|
|
3031
|
+
action: "reverse" | "open" | "add" | "close" | "reset";
|
|
3032
|
+
side?: "long" | "short" | undefined;
|
|
3033
|
+
margin_usd?: number | undefined;
|
|
3034
|
+
leverage?: number | undefined;
|
|
3035
|
+
sl_pct?: number | undefined;
|
|
3036
|
+
tp_pct?: number | undefined;
|
|
3037
|
+
limit_px?: number | undefined;
|
|
3038
|
+
slippage_bps?: number | undefined;
|
|
3039
|
+
fraction?: number | undefined;
|
|
3040
|
+
paper?: boolean | undefined;
|
|
3041
|
+
key?: string | undefined;
|
|
3042
|
+
}>;
|
|
3043
|
+
protect: LeanToolDefinition<{
|
|
3044
|
+
coin: string;
|
|
3045
|
+
op: "set" | "remove" | "cancel" | "move";
|
|
3046
|
+
tp_px?: number | undefined;
|
|
3047
|
+
sl_px?: number | undefined;
|
|
3048
|
+
order_id?: string | undefined;
|
|
3049
|
+
px?: number | undefined;
|
|
3050
|
+
paper?: boolean | undefined;
|
|
3051
|
+
}>;
|
|
3052
|
+
trades: LeanToolDefinition<{
|
|
3053
|
+
window?: "24h" | "7d" | "30d" | undefined;
|
|
3054
|
+
coin?: string | undefined;
|
|
3055
|
+
limit?: number | undefined;
|
|
3056
|
+
paper?: boolean | undefined;
|
|
3057
|
+
}>;
|
|
3058
|
+
candles: LeanToolDefinition<{
|
|
3059
|
+
coin: string;
|
|
3060
|
+
interval: "1m" | "5m" | "15m" | "1h" | "4h" | "1d";
|
|
3061
|
+
limit?: number | undefined;
|
|
3062
|
+
}>;
|
|
3063
|
+
};
|
|
3064
|
+
type LeanTools = ReturnType<typeof createLeanToolDefinitions>;
|
|
3065
|
+
/** The tool sets per profile, in the order they are listed (smart money first, so it is what a model reaches for). */
|
|
3066
|
+
declare function leanToolsFor(tools: LeanTools, profile: 'lean' | 'signals' | 'full'): LeanToolDefinition<never>[];
|
|
3067
|
+
|
|
3068
|
+
export { type ActiveProviderView, type AgentMcpSessionStore, type CancelOrderToolResult, type ClosePositionToolResult, type CoinYou, type CreateHeliosAgentMcpServerOptions, DEFAULT_HELIOS_BASE_URL, DEFAULT_HELIOS_SESSION_ISSUER, DEFAULT_SNAPSHOT_FIELDS, DEFAULT_SNAPSHOT_TOP, type DeleteTpSlToolResult, type EnsureLoginOptions, type EnsureLoginResult, FileAgentSessionStore, type FileAgentSessionStoreOptions, type GetHeliosAgentMcpDocumentInput, HOSTED_RECONNECT_MESSAGE, HeliosAgentMcpAccountService, type HeliosAgentMcpAccountServiceOptions, HeliosAgentMcpAuthService, type HeliosAgentMcpAuthServiceOptions, type HeliosAgentMcpDocsIndex, type HeliosAgentMcpDocsIndexEntry, HeliosAgentMcpDocsService, type HeliosAgentMcpDocsServiceOptions, type HeliosAgentMcpDocument, HeliosAgentMcpLedgerService, type HeliosAgentMcpLedgerServiceOptions, HeliosAgentMcpMarketService, type HeliosAgentMcpMarketServiceOptions, HeliosAgentMcpProviderService, type HeliosAgentMcpProviderServiceOptions, HeliosAgentMcpTradingService, type HeliosAgentMcpTradingServiceOptions, type HeliosMcpToolDefinition, type HeliosMcpToolResult, type LeanServices, type LeanToolDefinition, type LeanToolResult, type LeanTools, type LedgerFillsResult, type LedgerSummaryResult, MAX_TOOL_INPUT_ELEMENTS, MCP_PROFILES, type MarketSnapshotChunkResult, type MarketSnapshotResult, type MarketSymbolDetailResult, type McpProfile, MemoryAgentMcpSessionStore, type OpenOrdersToolResult, type OpenPositionsResult, type PendingAgentLogin, type PendingLoginResult, type PollLoginResult, type PortfolioResult, type SetTpSlToolResult, type StartLoginResult, TRADE_KEY_WINDOW_SECONDS, type TradeIntentAction, type TradeIntentActionInput, type TradeIntentActionResult, type WalletStateResult, accountInputSchema, ago, assertHeliosBaseUrl, candlesInputSchema, compactSymbolDetail, createHeliosAccountToolDefinitions, createHeliosAgentMcpServer, createHeliosAuthToolDefinitions, createHeliosDocsToolDefinitions, createHeliosLedgerToolDefinitions, createHeliosMarketToolDefinitions, createHeliosProviderToolDefinitions, createHeliosTradingToolDefinitions, createLeanToolDefinitions, entryText, formatHeliosLoginPrompt, getDefaultHeliosAgentMcpDocsRoot, getDefaultHeliosAgentMcpSessionPath, isSameHeliosIssuer, leanToolsFor, marketInputSchema, moveText, pct, pendingAgentLoginSchema, positionLine, price, protectInputSchema, renderAccount, renderBoard, renderCandles, renderCoin, renderMarket, renderMoves, renderTrades, retryAfterUnauthorizedRefresh, smBoardInputSchema, smCoinInputSchema, smMovesInputSchema, toolAnnotations, topOfSnapshot, tradeInputSchema, tradeKeyFor, trader, tradesInputSchema, usd, withDataText, withSnapshotDefaults, wrongSideTpSl };
|