@pgnio/helios-mcp 0.2.9 → 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/dist/index.d.mts 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;
@@ -118,6 +115,11 @@ declare const portfolioSnapshotSchema: z.ZodObject<{
118
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,6 +440,7 @@ 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">;
@@ -448,7 +452,11 @@ declare const closePositionResultSchema: z.ZodObject<{
448
452
  hyperliquid: "hyperliquid";
449
453
  }>>;
450
454
  symbol: z.ZodString;
451
- mode: z.ZodLiteral<"FULL">;
455
+ mode: z.ZodEnum<{
456
+ FULL: "FULL";
457
+ PARTIAL: "PARTIAL";
458
+ }>;
459
+ fraction: z.ZodOptional<z.ZodNumber>;
452
460
  maxSlippageBps: z.ZodOptional<z.ZodNumber>;
453
461
  }, z.core.$strip>;
454
462
  declare const setTpSlInputSchema: z.ZodObject<{
@@ -537,6 +545,423 @@ declare const cancelOrderResultSchema: z.ZodObject<{
537
545
  symbol: z.ZodString;
538
546
  oid: z.ZodNumber;
539
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>;
540
965
  type AgentDeviceStartInput = z.infer<typeof agentDeviceStartInputSchema>;
541
966
  type AgentDeviceStartOutput = z.infer<typeof agentDeviceStartOutputSchema>;
542
967
  type AgentTokenResponse = z.infer<typeof agentTokenResponseSchema>;
@@ -566,61 +991,63 @@ type DeleteTpSlResult = z.infer<typeof deleteTpSlResultSchema>;
566
991
  type OpenOrder = z.infer<typeof openOrderSchema>;
567
992
  type CancelOrderInput = z.infer<typeof cancelOrderInputSchema>;
568
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>;
569
1008
 
570
1009
  type FetchLike = typeof fetch;
571
1010
  interface HeliosAgentAuthClientOptions {
572
1011
  baseUrl: string;
573
1012
  fetch?: FetchLike;
574
- headers?: HeadersInit;
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;
575
1030
  }
576
1031
  declare class HeliosAgentAuthClient {
577
1032
  private readonly baseUrl;
578
1033
  private readonly fetchImpl;
579
1034
  private readonly headers;
1035
+ private readonly startSecret;
580
1036
  constructor(options: HeliosAgentAuthClientOptions);
581
- startLogin(input: AgentDeviceStartInput): Promise<AgentDeviceStartOutput>;
582
- exchangeDeviceCode(deviceCode: string): Promise<AgentTokenResponse>;
1037
+ startLogin(input: AgentDeviceStartInput, options?: StartLoginOptions): Promise<AgentDeviceStartOutput>;
1038
+ exchangeDeviceCode(deviceCode: string, options?: ExchangeDeviceCodeOptions): Promise<AgentTokenResponse>;
583
1039
  refreshSession(refreshToken: string): Promise<AgentTokenResponse>;
584
1040
  private post;
585
1041
  private parseJson;
586
1042
  }
587
-
588
- interface HeliosAgentDataBridgeClientOptions {
589
- baseUrl: string;
590
- fetch?: FetchLike;
591
- }
592
- declare class HeliosAgentDataBridgeClient {
593
- private readonly baseUrl;
594
- private readonly fetchImpl;
595
- constructor(options: HeliosAgentDataBridgeClientOptions);
596
- getWalletState(accessToken: string): Promise<WalletState>;
597
- getOpenPositions(accessToken: string): Promise<OpenPositionsSnapshot>;
598
- getPortfolio(accessToken: string, input: PortfolioInput): Promise<PortfolioSnapshot>;
599
- getLedgerFills(accessToken: string, input?: LedgerFillsInput): Promise<LedgerFillsPage>;
600
- getLedgerSummary(accessToken: string, input?: LedgerSummaryInput): Promise<LedgerSummary>;
601
- getMarketSnapshot(accessToken: string, input?: MarketSnapshotInput): Promise<MarketSnapshot>;
602
- getMarketSnapshotChunk(accessToken: string, input?: MarketSnapshotChunkInput): Promise<MarketSnapshotChunk>;
603
- getMarketSymbolDetail(accessToken: string, input: MarketSymbolDetailInput): Promise<MarketSymbolDetail>;
604
- submitTradeIntent(accessToken: string, input: SubmitTradeIntentInput): Promise<SubmitTradeIntentResult>;
605
- closePosition(accessToken: string, input: ClosePositionInput): Promise<ClosePositionResult>;
606
- setTpSl(accessToken: string, input: SetTpSlInput): Promise<SetTpSlResult>;
607
- deleteTpSl(accessToken: string, input: DeleteTpSlInput): Promise<DeleteTpSlResult>;
608
- getOpenOrders(accessToken: string): Promise<OpenOrder[]>;
609
- cancelOrder(accessToken: string, input: CancelOrderInput): Promise<CancelOrderResult>;
610
- private request;
611
- private buildProcedureUrl;
612
- private parseJson;
613
- /** The result of a mutation older data-bridges answer with nothing; null when there is none. */
614
- private tryUnwrapResult;
615
- private unwrapResult;
616
- private extractErrorCode;
617
- private extractErrorMessage;
618
- /**
619
- * Unwrap a tRPC error envelope, handling the superjson `{ json: ... }` wrapper
620
- * that the data-bridge applies via its transformer configuration.
621
- */
622
- private unwrapTrpcError;
623
- }
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>;
624
1051
  declare const storedAgentSessionSchema: z.ZodObject<{
625
1052
  accessToken: z.ZodString;
626
1053
  refreshToken: z.ZodString;
@@ -636,6 +1063,10 @@ declare const storedAgentSessionSchema: z.ZodObject<{
636
1063
  accessTokenExpiresAt: z.ZodString;
637
1064
  createdAt: z.ZodString;
638
1065
  lastRefreshedAt: z.ZodString;
1066
+ issuer: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1067
+ identityServiceUrl: z.ZodString;
1068
+ dataBridgeUrl: z.ZodString;
1069
+ }, z.core.$strip>>>;
639
1070
  }, z.core.$strip>;
640
1071
  declare const agentSessionViewSchema: z.ZodObject<{
641
1072
  connected: z.ZodBoolean;
@@ -658,6 +1089,7 @@ declare const agentSessionViewSchema: z.ZodObject<{
658
1089
  accessTokenExpiresAt: z.ZodOptional<z.ZodString>;
659
1090
  lastRefreshedAt: z.ZodOptional<z.ZodString>;
660
1091
  }, z.core.$strip>;
1092
+ type AgentSessionIssuer = z.infer<typeof agentSessionIssuerSchema>;
661
1093
  type StoredAgentSession = z.infer<typeof storedAgentSessionSchema>;
662
1094
  type AgentSessionView = z.infer<typeof agentSessionViewSchema>;
663
1095
  interface AgentSessionStore {
@@ -666,6 +1098,203 @@ interface AgentSessionStore {
666
1098
  clearSession(): Promise<void>;
667
1099
  }
668
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
+
669
1298
  declare function getDefaultHeliosAgentMcpSessionPath(): string;
670
1299
  declare const pendingAgentLoginSchema: z.ZodObject<{
671
1300
  status: z.ZodLiteral<"pending">;
@@ -682,19 +1311,30 @@ declare const pendingAgentLoginSchema: z.ZodObject<{
682
1311
  "orders:cancel": "orders:cancel";
683
1312
  }>>;
684
1313
  startedAt: z.ZodString;
1314
+ issuer: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1315
+ identityServiceUrl: z.ZodString;
1316
+ dataBridgeUrl: z.ZodString;
1317
+ }, z.core.$strip>>>;
685
1318
  }, z.core.$strip>;
686
1319
  type PendingAgentLogin = z.infer<typeof pendingAgentLoginSchema>;
687
- interface AgentMcpSessionStore extends AgentSessionStore {
1320
+ interface AgentMcpSessionStore extends AgentLoginStore {
688
1321
  getActiveProvider(): Promise<Provider | null>;
689
1322
  setActiveProvider(provider: Provider): Promise<void>;
690
1323
  clearActiveProvider(): Promise<void>;
691
1324
  getPendingLogin(): Promise<PendingAgentLogin | null>;
692
1325
  setPendingLogin(pendingLogin: PendingAgentLogin): Promise<void>;
693
- clearPendingLogin(): Promise<void>;
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;
694
1333
  }
695
1334
  declare class FileAgentSessionStore implements AgentMcpSessionStore {
696
1335
  private readonly filePath;
697
- constructor(filePath?: string);
1336
+ private readonly issuer;
1337
+ constructor(filePath?: string, options?: FileAgentSessionStoreOptions);
698
1338
  getSession(): Promise<StoredAgentSession | null>;
699
1339
  getPendingLogin(): Promise<PendingAgentLogin | null>;
700
1340
  getActiveProvider(): Promise<Provider | null>;
@@ -704,9 +1344,14 @@ declare class FileAgentSessionStore implements AgentMcpSessionStore {
704
1344
  clearSession(): Promise<void>;
705
1345
  clearPendingLogin(): Promise<void>;
706
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;
707
1353
  private readState;
708
1354
  private writeState;
709
- private writeStateOrDelete;
710
1355
  private deleteFile;
711
1356
  }
712
1357
  /**
@@ -747,6 +1392,11 @@ declare class HeliosAgentMcpProviderService {
747
1392
  resolveProvider(explicitProvider?: Provider): Promise<Provider>;
748
1393
  }
749
1394
 
1395
+ type StartLoginResult = AgentStartLoginResult;
1396
+ type EnsureLoginResult = AgentEnsureLoginResult;
1397
+ type PendingLoginResult = AgentPendingLoginResult;
1398
+ type PollLoginResult = AgentPollLoginResult;
1399
+ type EnsureLoginOptions = AgentEnsureLoginOptions;
750
1400
  interface HeliosAgentMcpAuthServiceOptions {
751
1401
  client: HeliosAgentAuthClient;
752
1402
  sessionStore: AgentMcpSessionStore;
@@ -759,73 +1409,10 @@ interface HeliosAgentMcpAuthServiceOptions {
759
1409
  deviceLogin?: boolean;
760
1410
  }
761
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.";
762
- interface StartLoginResult {
763
- status: 'pending';
764
- deviceCode: string;
765
- userCode: string;
766
- verificationUri: string;
767
- verificationUriComplete: string;
768
- expiresInSeconds: number;
769
- pollIntervalSeconds: number;
770
- requestedScope: AgentDeviceStartInput['scope'];
771
- startedAt: string;
772
- }
773
- type EnsureLoginResult = (AgentSessionView & {
774
- status: 'connected';
775
- connected: true;
776
- }) | (StartLoginResult & {
777
- connected: false;
778
- message: string;
779
- });
780
- type PendingLoginResult = StartLoginResult & {
781
- connected: false;
782
- message: string;
783
- };
784
- type PollLoginResult = (AgentSessionView & {
785
- status: 'connected';
786
- connected: true;
787
- }) | {
788
- status: 'pending' | 'rejected' | 'expired' | 'failed';
789
- connected: false;
790
- message: string;
791
- };
792
- interface EnsureLoginOptions {
793
- clientName?: string;
794
- scope?: AgentDeviceStartInput['scope'];
795
- constraints?: AgentDeviceStartInput['constraints'];
796
- }
797
- declare class HeliosAgentMcpAuthService {
798
- private readonly client;
799
- private readonly sessionStore;
800
- private readonly refreshWindowMs;
801
- private readonly now;
802
- private readonly deviceLogin;
1412
+ /** The shared delegated-agent sign-in (AgentAuthService), worded for MCP tools. */
1413
+ declare class HeliosAgentMcpAuthService extends AgentAuthService {
803
1414
  constructor(options: HeliosAgentMcpAuthServiceOptions);
804
- startLogin(input: AgentDeviceStartInput): Promise<StartLoginResult>;
805
- resetSessionAndStartLogin(input: AgentDeviceStartInput): Promise<StartLoginResult>;
806
- private startDeviceLogin;
807
- private buildStartLoginResult;
808
- startRelogin(options?: EnsureLoginOptions): Promise<PendingLoginResult>;
809
- clearSessionState(): Promise<void>;
810
- invalidateIfUnauthorized(error: unknown, options?: EnsureLoginOptions): Promise<PendingLoginResult | null>;
811
- refreshSessionAfterUnauthorized(error: unknown): Promise<StoredAgentSession | null>;
812
- ensureLogin(options?: EnsureLoginOptions): Promise<EnsureLoginResult>;
813
- /** Polls the given login, or the stored pending one when no device code is given. */
814
- pollLogin(deviceCode?: string): Promise<PollLoginResult>;
815
- whoami(): Promise<AgentSessionView>;
816
- getAccessToken(): Promise<string | null>;
817
- requireSession(): Promise<StoredAgentSession>;
818
- private getValidSession;
819
- private refreshStoredSession;
820
- private getPendingLogin;
821
- private clearPendingLoginIfMatches;
822
1415
  }
823
- declare function retryAfterUnauthorizedRefresh<T>(options: {
824
- authService: HeliosAgentMcpAuthService;
825
- error: unknown;
826
- loginOptions: EnsureLoginOptions;
827
- retry: (accessToken: string) => Promise<T>;
828
- }): Promise<T | PendingLoginResult | null>;
829
1416
  declare function formatHeliosLoginPrompt(result: Pick<StartLoginResult, 'verificationUriComplete' | 'userCode' | 'requestedScope'>): string;
830
1417
 
831
1418
  interface HeliosAgentMcpAccountServiceOptions {
@@ -895,6 +1482,18 @@ declare class HeliosAgentMcpDocsService {
895
1482
  }
896
1483
  declare function getDefaultHeliosAgentMcpDocsRoot(): string;
897
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
+
898
1497
  interface HeliosAgentMcpLedgerServiceOptions {
899
1498
  authService: HeliosAgentMcpAuthService;
900
1499
  dataBridgeClient: HeliosAgentDataBridgeClient;
@@ -1043,6 +1642,16 @@ declare class HeliosAgentMcpTradingService {
1043
1642
  private submitIntent;
1044
1643
  }
1045
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[];
1046
1655
  interface CreateHeliosAgentMcpServerOptions {
1047
1656
  identityServiceUrl: string;
1048
1657
  dataBridgeUrl: string;
@@ -1056,7 +1665,10 @@ interface CreateHeliosAgentMcpServerOptions {
1056
1665
  * left out (whoami stays) and no tool ever starts a login of its own.
1057
1666
  */
1058
1667
  hosted?: boolean;
1668
+ /** Default full, which keeps every read tool; the CLI and the hosted /mcp pass lean. */
1669
+ profile?: McpProfile;
1059
1670
  }
1671
+ declare const MAX_TOOL_INPUT_ELEMENTS = 10000;
1060
1672
  declare function createHeliosAgentMcpServer(options: CreateHeliosAgentMcpServerOptions): Promise<{
1061
1673
  server: McpServer;
1062
1674
  authService: HeliosAgentMcpAuthService;
@@ -1142,11 +1754,15 @@ declare function createHeliosAuthToolDefinitions(service: HeliosAgentMcpAuthServ
1142
1754
  "orders:cancel": "orders:cancel";
1143
1755
  }>>;
1144
1756
  constraints: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1757
+ verified: z.ZodOptional<z.ZodBoolean>;
1758
+ requireApprovalProof: z.ZodOptional<z.ZodBoolean>;
1145
1759
  }, z.core.$strip>;
1146
1760
  execute(input: {
1147
1761
  clientName: string;
1148
1762
  scope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
1149
1763
  constraints?: Record<string, unknown> | undefined;
1764
+ verified?: boolean | undefined;
1765
+ requireApprovalProof?: boolean | undefined;
1150
1766
  }): Promise<{
1151
1767
  content: {
1152
1768
  type: "text";
@@ -1157,7 +1773,6 @@ declare function createHeliosAuthToolDefinitions(service: HeliosAgentMcpAuthServ
1157
1773
  loginUrl: string;
1158
1774
  nextStep: string;
1159
1775
  status: "pending";
1160
- deviceCode: string;
1161
1776
  userCode: string;
1162
1777
  verificationUri: string;
1163
1778
  verificationUriComplete: string;
@@ -1202,7 +1817,6 @@ declare function createHeliosAuthToolDefinitions(service: HeliosAgentMcpAuthServ
1202
1817
  actionRequired: true;
1203
1818
  loginUrl: string;
1204
1819
  nextStep: string;
1205
- deviceCode: string;
1206
1820
  userCode: string;
1207
1821
  verificationUri: string;
1208
1822
  verificationUriComplete: string;
@@ -1322,7 +1936,7 @@ declare function createHeliosAccountToolDefinitions(service: HeliosAgentMcpAccou
1322
1936
  verificationUriComplete: string;
1323
1937
  expiresInSeconds: number;
1324
1938
  pollIntervalSeconds: number;
1325
- requestedScope: AgentDeviceStartInput["scope"];
1939
+ requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
1326
1940
  startedAt: string;
1327
1941
  };
1328
1942
  }>;
@@ -1359,7 +1973,7 @@ declare function createHeliosAccountToolDefinitions(service: HeliosAgentMcpAccou
1359
1973
  verificationUriComplete: string;
1360
1974
  expiresInSeconds: number;
1361
1975
  pollIntervalSeconds: number;
1362
- requestedScope: AgentDeviceStartInput["scope"];
1976
+ requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
1363
1977
  startedAt: string;
1364
1978
  };
1365
1979
  }>;
@@ -1391,7 +2005,7 @@ declare function createHeliosLedgerToolDefinitions(service: HeliosAgentMcpLedger
1391
2005
  verificationUriComplete: string;
1392
2006
  expiresInSeconds: number;
1393
2007
  pollIntervalSeconds: number;
1394
- requestedScope: AgentDeviceStartInput["scope"];
2008
+ requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
1395
2009
  startedAt: string;
1396
2010
  };
1397
2011
  }>;
@@ -1434,7 +2048,7 @@ declare function createHeliosLedgerToolDefinitions(service: HeliosAgentMcpLedger
1434
2048
  verificationUriComplete: string;
1435
2049
  expiresInSeconds: number;
1436
2050
  pollIntervalSeconds: number;
1437
- requestedScope: AgentDeviceStartInput["scope"];
2051
+ requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
1438
2052
  startedAt: string;
1439
2053
  };
1440
2054
  }>;
@@ -1473,7 +2087,7 @@ declare function createHeliosLedgerToolDefinitions(service: HeliosAgentMcpLedger
1473
2087
  verificationUriComplete: string;
1474
2088
  expiresInSeconds: number;
1475
2089
  pollIntervalSeconds: number;
1476
- requestedScope: AgentDeviceStartInput["scope"];
2090
+ requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
1477
2091
  startedAt: string;
1478
2092
  };
1479
2093
  }>;
@@ -1520,7 +2134,7 @@ declare function createHeliosMarketToolDefinitions(service: HeliosAgentMcpMarket
1520
2134
  verificationUriComplete: string;
1521
2135
  expiresInSeconds: number;
1522
2136
  pollIntervalSeconds: number;
1523
- requestedScope: AgentDeviceStartInput["scope"];
2137
+ requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
1524
2138
  startedAt: string;
1525
2139
  };
1526
2140
  }>;
@@ -1570,7 +2184,7 @@ declare function createHeliosMarketToolDefinitions(service: HeliosAgentMcpMarket
1570
2184
  verificationUriComplete: string;
1571
2185
  expiresInSeconds: number;
1572
2186
  pollIntervalSeconds: number;
1573
- requestedScope: AgentDeviceStartInput["scope"];
2187
+ requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
1574
2188
  startedAt: string;
1575
2189
  };
1576
2190
  }>;
@@ -1607,7 +2221,7 @@ declare function createHeliosMarketToolDefinitions(service: HeliosAgentMcpMarket
1607
2221
  verificationUriComplete: string;
1608
2222
  expiresInSeconds: number;
1609
2223
  pollIntervalSeconds: number;
1610
- requestedScope: AgentDeviceStartInput["scope"];
2224
+ requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
1611
2225
  startedAt: string;
1612
2226
  };
1613
2227
  }>;
@@ -1673,6 +2287,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
1673
2287
  }, z.core.$strip>>;
1674
2288
  }, z.core.$strip>>;
1675
2289
  idempotencyKey: z.ZodOptional<z.ZodString>;
2290
+ idempotencyWindowSeconds: z.ZodOptional<z.ZodNumber>;
1676
2291
  }, z.core.$strip>;
1677
2292
  execute(input: {
1678
2293
  symbol: string;
@@ -1704,6 +2319,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
1704
2319
  } | undefined;
1705
2320
  } | undefined;
1706
2321
  idempotencyKey?: string | undefined;
2322
+ idempotencyWindowSeconds?: number | undefined;
1707
2323
  }): Promise<{
1708
2324
  content: {
1709
2325
  type: "text";
@@ -1726,7 +2342,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
1726
2342
  verificationUriComplete: string;
1727
2343
  expiresInSeconds: number;
1728
2344
  pollIntervalSeconds: number;
1729
- requestedScope: AgentDeviceStartInput["scope"];
2345
+ requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
1730
2346
  startedAt: string;
1731
2347
  };
1732
2348
  }>;
@@ -1791,6 +2407,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
1791
2407
  }, z.core.$strip>>;
1792
2408
  }, z.core.$strip>>;
1793
2409
  idempotencyKey: z.ZodOptional<z.ZodString>;
2410
+ idempotencyWindowSeconds: z.ZodOptional<z.ZodNumber>;
1794
2411
  }, z.core.$strip>;
1795
2412
  execute(input: {
1796
2413
  symbol: string;
@@ -1822,6 +2439,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
1822
2439
  } | undefined;
1823
2440
  } | undefined;
1824
2441
  idempotencyKey?: string | undefined;
2442
+ idempotencyWindowSeconds?: number | undefined;
1825
2443
  }): Promise<{
1826
2444
  content: {
1827
2445
  type: "text";
@@ -1844,7 +2462,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
1844
2462
  verificationUriComplete: string;
1845
2463
  expiresInSeconds: number;
1846
2464
  pollIntervalSeconds: number;
1847
- requestedScope: AgentDeviceStartInput["scope"];
2465
+ requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
1848
2466
  startedAt: string;
1849
2467
  };
1850
2468
  }>;
@@ -1909,6 +2527,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
1909
2527
  }, z.core.$strip>>;
1910
2528
  }, z.core.$strip>>;
1911
2529
  idempotencyKey: z.ZodOptional<z.ZodString>;
2530
+ idempotencyWindowSeconds: z.ZodOptional<z.ZodNumber>;
1912
2531
  }, z.core.$strip>;
1913
2532
  execute(input: {
1914
2533
  symbol: string;
@@ -1940,6 +2559,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
1940
2559
  } | undefined;
1941
2560
  } | undefined;
1942
2561
  idempotencyKey?: string | undefined;
2562
+ idempotencyWindowSeconds?: number | undefined;
1943
2563
  }): Promise<{
1944
2564
  content: {
1945
2565
  type: "text";
@@ -1962,7 +2582,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
1962
2582
  verificationUriComplete: string;
1963
2583
  expiresInSeconds: number;
1964
2584
  pollIntervalSeconds: number;
1965
- requestedScope: AgentDeviceStartInput["scope"];
2585
+ requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
1966
2586
  startedAt: string;
1967
2587
  };
1968
2588
  }>;
@@ -1976,11 +2596,13 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
1976
2596
  }>>;
1977
2597
  symbol: z.ZodString;
1978
2598
  maxSlippageBps: z.ZodOptional<z.ZodNumber>;
2599
+ fraction: z.ZodOptional<z.ZodNumber>;
1979
2600
  }, z.core.$strip>;
1980
2601
  execute(input: {
1981
2602
  symbol: string;
1982
2603
  provider?: "hyperliquid" | undefined;
1983
2604
  maxSlippageBps?: number | undefined;
2605
+ fraction?: number | undefined;
1984
2606
  }): Promise<{
1985
2607
  content: {
1986
2608
  type: "text";
@@ -2003,7 +2625,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
2003
2625
  verificationUriComplete: string;
2004
2626
  expiresInSeconds: number;
2005
2627
  pollIntervalSeconds: number;
2006
- requestedScope: AgentDeviceStartInput["scope"];
2628
+ requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
2007
2629
  startedAt: string;
2008
2630
  };
2009
2631
  }>;
@@ -2077,7 +2699,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
2077
2699
  verificationUriComplete: string;
2078
2700
  expiresInSeconds: number;
2079
2701
  pollIntervalSeconds: number;
2080
- requestedScope: AgentDeviceStartInput["scope"];
2702
+ requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
2081
2703
  startedAt: string;
2082
2704
  };
2083
2705
  }>;
@@ -2118,7 +2740,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
2118
2740
  verificationUriComplete: string;
2119
2741
  expiresInSeconds: number;
2120
2742
  pollIntervalSeconds: number;
2121
- requestedScope: AgentDeviceStartInput["scope"];
2743
+ requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
2122
2744
  startedAt: string;
2123
2745
  };
2124
2746
  }>;
@@ -2149,7 +2771,7 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
2149
2771
  verificationUriComplete: string;
2150
2772
  expiresInSeconds: number;
2151
2773
  pollIntervalSeconds: number;
2152
- requestedScope: AgentDeviceStartInput["scope"];
2774
+ requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
2153
2775
  startedAt: string;
2154
2776
  };
2155
2777
  }>;
@@ -2186,10 +2808,261 @@ declare function createHeliosTradingToolDefinitions(service: HeliosAgentMcpTradi
2186
2808
  verificationUriComplete: string;
2187
2809
  expiresInSeconds: number;
2188
2810
  pollIntervalSeconds: number;
2189
- requestedScope: AgentDeviceStartInput["scope"];
2811
+ requestedScope: ("account:read" | "market:read" | "orders:write" | "orders:cancel")[];
2190
2812
  startedAt: string;
2191
2813
  };
2192
2814
  }>;
2193
2815
  }];
2194
2816
 
2195
- export { type ActiveProviderView, type AgentMcpSessionStore, type CancelOrderToolResult, type ClosePositionToolResult, type CreateHeliosAgentMcpServerOptions, DEFAULT_SNAPSHOT_FIELDS, DEFAULT_SNAPSHOT_TOP, type DeleteTpSlToolResult, type EnsureLoginOptions, type EnsureLoginResult, FileAgentSessionStore, 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 LedgerFillsResult, type LedgerSummaryResult, type MarketSnapshotChunkResult, type MarketSnapshotResult, type MarketSymbolDetailResult, MemoryAgentMcpSessionStore, type OpenOrdersToolResult, type OpenPositionsResult, type PendingAgentLogin, type PendingLoginResult, type PollLoginResult, type PortfolioResult, type SetTpSlToolResult, type StartLoginResult, type TradeIntentAction, type TradeIntentActionInput, type TradeIntentActionResult, type WalletStateResult, compactSymbolDetail, createHeliosAccountToolDefinitions, createHeliosAgentMcpServer, createHeliosAuthToolDefinitions, createHeliosDocsToolDefinitions, createHeliosLedgerToolDefinitions, createHeliosMarketToolDefinitions, createHeliosProviderToolDefinitions, createHeliosTradingToolDefinitions, formatHeliosLoginPrompt, getDefaultHeliosAgentMcpDocsRoot, getDefaultHeliosAgentMcpSessionPath, pendingAgentLoginSchema, retryAfterUnauthorizedRefresh, toolAnnotations, topOfSnapshot, withDataText, withSnapshotDefaults };
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 };