@cabaltrading/cli 0.4.2 → 0.4.4

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.
Files changed (3) hide show
  1. package/dist/index.js +2296 -1791
  2. package/dist/mcp-server.js +1689 -1598
  3. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -642,7 +642,7 @@ var init_agents = __esm(() => {
642
642
 
643
643
  // ../../packages/client/src/schemas/trade.ts
644
644
  import { z as z4 } from "zod";
645
- var SUPPORTED_MODELS, modelSchema, solanaTradeRequestSchema, hyperliquidTradeRequestSchema, tradeRequestSchema, tradeResponseDataSchema, tradeResponseSchema;
645
+ var SUPPORTED_MODELS, modelSchema, solanaTradeRequestSchema, hyperliquidTradeRequestSchema, tradeRequestSchema, tradeResponseDataSchema, tradeResponseSchema, dryRunResponseDataSchema;
646
646
  var init_trade = __esm(() => {
647
647
  init_common();
648
648
  SUPPORTED_MODELS = [
@@ -712,12 +712,121 @@ var init_trade = __esm(() => {
712
712
  }).optional()
713
713
  });
714
714
  tradeResponseSchema = successEnvelope(tradeResponseDataSchema);
715
+ dryRunResponseDataSchema = z4.object({
716
+ dryRun: z4.literal(true),
717
+ quote: z4.object({
718
+ inAmount: z4.string(),
719
+ outAmount: z4.string(),
720
+ priceImpactPct: z4.string()
721
+ }),
722
+ fee: z4.object({ bps: z4.number() }),
723
+ unsignedTransaction: z4.string()
724
+ });
715
725
  });
716
726
 
717
- // ../../packages/client/src/schemas/incubator.ts
727
+ // ../../packages/client/src/schemas/hyperliquid.ts
718
728
  import { z as z5 } from "zod";
729
+ var hyperliquidFillsQuerySchema, hyperliquidSetupRequestSchema, hyperliquidSetupResponseDataSchema, hlPositionSchema, hlSpotBalanceSchema, hyperliquidAccountResponseDataSchema, hlFillSchema, hyperliquidFillsResponseDataSchema, hyperliquidLiquidationRiskResponseDataSchema, hyperliquidSetupResponseSchema, hyperliquidAccountResponseSchema, hyperliquidFillsResponseSchema, hyperliquidLiquidationRiskResponseSchema;
730
+ var init_hyperliquid = __esm(() => {
731
+ init_common();
732
+ hyperliquidFillsQuerySchema = z5.object({
733
+ limit: z5.coerce.number().int().min(1).default(50).transform((value) => Math.min(value, 100)),
734
+ offset: z5.coerce.number().int().min(0).default(0)
735
+ });
736
+ hyperliquidSetupRequestSchema = z5.object({
737
+ sourceChain: z5.enum(["solana", "ethereum", "arbitrum", "optimism", "base"]).optional()
738
+ });
739
+ hyperliquidSetupResponseDataSchema = z5.object({
740
+ deposit_address: z5.string(),
741
+ min_deposit: z5.number().optional(),
742
+ source_chain: z5.string(),
743
+ hl_address: z5.string(),
744
+ estimated_time: z5.string().optional(),
745
+ builder: z5.object({
746
+ address: z5.string(),
747
+ fee: z5.string()
748
+ }).passthrough(),
749
+ instructions: z5.string().optional(),
750
+ note: z5.string().optional()
751
+ });
752
+ hlPositionSchema = z5.object({
753
+ coin: z5.string(),
754
+ side: z5.string(),
755
+ size: z5.number(),
756
+ entryPrice: z5.number(),
757
+ unrealizedPnl: z5.number(),
758
+ marginUsed: z5.number(),
759
+ leverage: z5.number(),
760
+ liquidationPrice: z5.number().nullable()
761
+ }).passthrough();
762
+ hlSpotBalanceSchema = z5.object({
763
+ coin: z5.string(),
764
+ total: z5.number(),
765
+ hold: z5.number(),
766
+ available: z5.number(),
767
+ priceUsd: z5.number(),
768
+ valueUsd: z5.number()
769
+ });
770
+ hyperliquidAccountResponseDataSchema = z5.object({
771
+ hlAddress: z5.string(),
772
+ perps: z5.object({
773
+ accountValue: z5.number(),
774
+ totalMarginUsed: z5.number(),
775
+ unrealizedPnl: z5.number(),
776
+ withdrawable: z5.number(),
777
+ positions: z5.array(hlPositionSchema)
778
+ }),
779
+ spot: z5.object({
780
+ balances: z5.array(hlSpotBalanceSchema)
781
+ }),
782
+ lastSync: z5.string()
783
+ });
784
+ hlFillSchema = z5.object({
785
+ id: z5.string(),
786
+ coin: z5.string(),
787
+ side: z5.string(),
788
+ size: z5.number(),
789
+ price: z5.number(),
790
+ fee: z5.number(),
791
+ builderFee: z5.number().nullable().optional(),
792
+ timestamp: z5.string()
793
+ }).passthrough();
794
+ hyperliquidFillsResponseDataSchema = z5.object({
795
+ hlAddress: z5.string(),
796
+ fills: z5.array(hlFillSchema),
797
+ totalBuilderFees: z5.number(),
798
+ pagination: z5.object({
799
+ limit: z5.number(),
800
+ offset: z5.number(),
801
+ hasMore: z5.boolean()
802
+ })
803
+ });
804
+ hyperliquidLiquidationRiskResponseDataSchema = z5.object({
805
+ hlAddress: z5.string(),
806
+ healthScore: z5.number(),
807
+ marginUtilization: z5.number(),
808
+ totalExposure: z5.number(),
809
+ atRisk: z5.boolean(),
810
+ alerts: z5.array(z5.string()),
811
+ recommendations: z5.array(z5.string()),
812
+ advisoryLimits: z5.object({
813
+ trustLevel: z5.string(),
814
+ maxLeverage: z5.number(),
815
+ maxPositionPct: z5.number(),
816
+ maxDailyLossPct: z5.number(),
817
+ note: z5.string()
818
+ })
819
+ });
820
+ hyperliquidSetupResponseSchema = successEnvelope(hyperliquidSetupResponseDataSchema);
821
+ hyperliquidAccountResponseSchema = successEnvelope(hyperliquidAccountResponseDataSchema);
822
+ hyperliquidFillsResponseSchema = successEnvelope(hyperliquidFillsResponseDataSchema);
823
+ hyperliquidLiquidationRiskResponseSchema = successEnvelope(hyperliquidLiquidationRiskResponseDataSchema);
824
+ });
825
+
826
+ // ../../packages/client/src/schemas/incubator.ts
827
+ import { z as z6 } from "zod";
719
828
  function requiredString(field, message = `Missing required field: ${field}`) {
720
- return z5.preprocess((value) => typeof value === "string" ? value.trim() : "", z5.string().min(1, { message }));
829
+ return z6.preprocess((value) => typeof value === "string" ? value.trim() : "", z6.string().min(1, { message }));
721
830
  }
722
831
  var tokenNameSchema, tokenSymbolSchema, incubatorLogRequestSchema, incubatorLogResponseDataSchema, incubatorLogResponseSchema, incubatorAgentIdParamsSchema, incubatorBrainSwitchRequestSchema, incubatorBrainDepositRequestSchema, incubatorBrainUsageRequestSchema, incubatorBrainRequestSchema, incubatorBrainResponseDataSchema, incubatorBrainResponseSchema, incubatorBrainUsageResponseDataSchema, incubatorBrainUsageResponseSchema, incubatorServerRequestSchema, incubatorServerResponseDataSchema, incubatorServerResponseSchema, incubatorTokenRequestSchema, incubatorTokenSchema, incubatorTokenResponseDataSchema, incubatorTokenConfirmResponseDataSchema, incubatorTokenResponseSchema, incubatorInboxSendRequestSchema, incubatorInboxSendResponseDataSchema, incubatorInboxSendResponseSchema, incubatorInboxQuerySchema, incubatorTurnsQuerySchema, incubatorInboxReplyRequestSchema, incubatorInboxPatchRequestSchema, incubatorMemorialsQuerySchema, incubatorTasksQuerySchema, VALID_TASK_CATEGORIES, INVALID_CATEGORY_MESSAGE, taskCategorySchema, incubatorTaskCreateRequestSchema, incubatorTaskActionParamsSchema, taskActionBaseSchema, incubatorTaskActionRequestSchema, incubatorSurvivalResponseDataSchema, incubatorInboxResponseDataSchema, incubatorInboxReplyResponseDataSchema, incubatorInboxPatchResponseDataSchema, incubatorGroupsUnreadResponseDataSchema, incubatorInboxUnreadResponseDataSchema, incubatorMemorialsResponseDataSchema, modelInfoSchema, serverPlanInfoSchema, incubatorOverviewResponseDataSchema, incubatorPoolResponseDataSchema, incubatorRentGetResponseDataSchema, incubatorRentPostResponseDataSchema, incubatorRentResponseDataSchema, incubatorTaskSummarySchema, incubatorTasksResponseDataSchema, incubatorTaskCreateResponseDataSchema, incubatorTaskActionResponseDataSchema, incubatorTaskApplicantSchema, incubatorTaskSubmissionSchema, incubatorTaskApplicationsResponseDataSchema, incubatorTaskSubmissionResponseDataSchema, incubatorTurnSchema, incubatorTurnsResponseDataSchema, incubatorTurnsResponseSchema, incubatorGroupsUnreadResponseSchema, incubatorInboxUnreadResponseSchema;
723
832
  var init_incubator = __esm(() => {
@@ -732,433 +841,433 @@ var init_incubator = __esm(() => {
732
841
  }).refine((value) => /^[A-Za-z0-9]+$/.test(value), {
733
842
  message: "Token symbol must be alphanumeric with no spaces"
734
843
  });
735
- incubatorLogRequestSchema = z5.object({
844
+ incubatorLogRequestSchema = z6.object({
736
845
  message: requiredString("message").refine((value) => value.length <= 2000, { message: "Message too long" }),
737
- event_type: z5.string().trim().min(1).max(64).optional()
846
+ event_type: z6.string().trim().min(1).max(64).optional()
738
847
  });
739
- incubatorLogResponseDataSchema = z5.object({
740
- log: z5.object({
741
- id: z5.string().uuid(),
742
- event_type: z5.string(),
743
- message: z5.string()
848
+ incubatorLogResponseDataSchema = z6.object({
849
+ log: z6.object({
850
+ id: z6.string().uuid(),
851
+ event_type: z6.string(),
852
+ message: z6.string()
744
853
  })
745
854
  });
746
855
  incubatorLogResponseSchema = successEnvelope(incubatorLogResponseDataSchema);
747
- incubatorAgentIdParamsSchema = z5.object({
748
- agentId: z5.string().uuid("agentId must be a UUID")
856
+ incubatorAgentIdParamsSchema = z6.object({
857
+ agentId: z6.string().uuid("agentId must be a UUID")
749
858
  });
750
- incubatorBrainSwitchRequestSchema = z5.object({
751
- action: z5.literal("switch"),
859
+ incubatorBrainSwitchRequestSchema = z6.object({
860
+ action: z6.literal("switch"),
752
861
  model: requiredString("model").refine((value) => value.length > 0, { message: "Invalid model" })
753
862
  });
754
- incubatorBrainDepositRequestSchema = z5.object({
755
- action: z5.literal("deposit"),
756
- amountUsd: z5.number().refine((value) => value > 0, {
863
+ incubatorBrainDepositRequestSchema = z6.object({
864
+ action: z6.literal("deposit"),
865
+ amountUsd: z6.number().refine((value) => value > 0, {
757
866
  message: "Invalid deposit amount"
758
867
  })
759
868
  });
760
- incubatorBrainUsageRequestSchema = z5.object({
761
- costUsd: z5.number().positive("costUsd must be a positive number")
869
+ incubatorBrainUsageRequestSchema = z6.object({
870
+ costUsd: z6.number().positive("costUsd must be a positive number")
762
871
  });
763
- incubatorBrainRequestSchema = z5.discriminatedUnion("action", [
872
+ incubatorBrainRequestSchema = z6.discriminatedUnion("action", [
764
873
  incubatorBrainSwitchRequestSchema,
765
874
  incubatorBrainDepositRequestSchema
766
875
  ]);
767
- incubatorBrainResponseDataSchema = z5.union([
768
- z5.object({
769
- brain: z5.object({
770
- previousModel: z5.string(),
771
- newModel: z5.string(),
772
- costPerDay: z5.number()
876
+ incubatorBrainResponseDataSchema = z6.union([
877
+ z6.object({
878
+ brain: z6.object({
879
+ previousModel: z6.string(),
880
+ newModel: z6.string(),
881
+ costPerDay: z6.number()
773
882
  })
774
883
  }),
775
- z5.object({
776
- deposit: z5.object({
777
- amountUsd: z5.number(),
778
- newCreditLimit: z5.number(),
779
- remainingBalanceUsd: z5.number()
884
+ z6.object({
885
+ deposit: z6.object({
886
+ amountUsd: z6.number(),
887
+ newCreditLimit: z6.number(),
888
+ remainingBalanceUsd: z6.number()
780
889
  })
781
890
  })
782
891
  ]);
783
892
  incubatorBrainResponseSchema = successEnvelope(incubatorBrainResponseDataSchema);
784
- incubatorBrainUsageResponseDataSchema = z5.object({
785
- usageUsd: z5.number(),
786
- budgetUsd: z5.number(),
787
- remainingUsd: z5.number()
893
+ incubatorBrainUsageResponseDataSchema = z6.object({
894
+ usageUsd: z6.number(),
895
+ budgetUsd: z6.number(),
896
+ remainingUsd: z6.number()
788
897
  });
789
898
  incubatorBrainUsageResponseSchema = successEnvelope(incubatorBrainUsageResponseDataSchema);
790
- incubatorServerRequestSchema = z5.object({
899
+ incubatorServerRequestSchema = z6.object({
791
900
  plan: requiredString("plan")
792
901
  });
793
- incubatorServerResponseDataSchema = z5.object({
794
- server: z5.object({
795
- previousPlan: z5.string(),
796
- newPlan: z5.string(),
797
- costUsd: z5.number(),
798
- description: z5.string()
902
+ incubatorServerResponseDataSchema = z6.object({
903
+ server: z6.object({
904
+ previousPlan: z6.string(),
905
+ newPlan: z6.string(),
906
+ costUsd: z6.number(),
907
+ description: z6.string()
799
908
  })
800
909
  });
801
910
  incubatorServerResponseSchema = successEnvelope(incubatorServerResponseDataSchema);
802
- incubatorTokenRequestSchema = z5.object({
911
+ incubatorTokenRequestSchema = z6.object({
803
912
  name: tokenNameSchema,
804
913
  symbol: tokenSymbolSchema,
805
- configAddress: z5.string().min(32).max(44).optional()
806
- });
807
- incubatorTokenSchema = z5.object({
808
- id: z5.string().uuid().optional(),
809
- tokenId: z5.string().uuid().optional(),
810
- agentId: z5.string().uuid().optional(),
811
- name: z5.string(),
812
- symbol: z5.string(),
813
- mintAddress: z5.string().nullable(),
814
- poolAddress: z5.string().nullable().optional(),
815
- agentAllocationPct: z5.number().optional(),
816
- platformAllocationPct: z5.number().optional(),
817
- createdAt: z5.string().optional(),
818
- txSignature: z5.string().nullable().optional(),
819
- priceUsd: z5.number().nullable().optional(),
820
- marketCapUsd: z5.number().nullable().optional(),
821
- holders: z5.number().nullable().optional(),
822
- deployed: z5.boolean()
914
+ configAddress: z6.string().min(32).max(44).optional()
915
+ });
916
+ incubatorTokenSchema = z6.object({
917
+ id: z6.string().uuid().optional(),
918
+ tokenId: z6.string().uuid().optional(),
919
+ agentId: z6.string().uuid().optional(),
920
+ name: z6.string(),
921
+ symbol: z6.string(),
922
+ mintAddress: z6.string().nullable(),
923
+ poolAddress: z6.string().nullable().optional(),
924
+ agentAllocationPct: z6.number().optional(),
925
+ platformAllocationPct: z6.number().optional(),
926
+ createdAt: z6.string().optional(),
927
+ txSignature: z6.string().nullable().optional(),
928
+ priceUsd: z6.number().nullable().optional(),
929
+ marketCapUsd: z6.number().nullable().optional(),
930
+ holders: z6.number().nullable().optional(),
931
+ deployed: z6.boolean()
823
932
  }).passthrough();
824
- incubatorTokenResponseDataSchema = z5.object({
933
+ incubatorTokenResponseDataSchema = z6.object({
825
934
  token: incubatorTokenSchema
826
935
  });
827
- incubatorTokenConfirmResponseDataSchema = z5.object({
828
- confirmed: z5.boolean(),
829
- txSignature: z5.string().nullable()
936
+ incubatorTokenConfirmResponseDataSchema = z6.object({
937
+ confirmed: z6.boolean(),
938
+ txSignature: z6.string().nullable()
830
939
  });
831
940
  incubatorTokenResponseSchema = successEnvelope(incubatorTokenResponseDataSchema);
832
- incubatorInboxSendRequestSchema = z5.object({
941
+ incubatorInboxSendRequestSchema = z6.object({
833
942
  agentId: requiredString("agentId", "Missing required fields: agentId, message"),
834
943
  message: requiredString("message", "Missing required fields: agentId, message").refine((value) => value.length <= 5000, {
835
944
  message: "Message must be a string of 5000 characters or fewer"
836
945
  }),
837
- senderName: z5.string().max(120).optional()
946
+ senderName: z6.string().max(120).optional()
838
947
  });
839
- incubatorInboxSendResponseDataSchema = z5.object({
840
- id: z5.string().uuid(),
841
- agentId: z5.string().uuid(),
842
- paymentAmountUsd: z5.number(),
843
- paymentTx: z5.string(),
844
- status: z5.literal("confirmed")
948
+ incubatorInboxSendResponseDataSchema = z6.object({
949
+ id: z6.string().uuid(),
950
+ agentId: z6.string().uuid(),
951
+ paymentAmountUsd: z6.number(),
952
+ paymentTx: z6.string(),
953
+ status: z6.literal("confirmed")
845
954
  });
846
955
  incubatorInboxSendResponseSchema = successEnvelope(incubatorInboxSendResponseDataSchema);
847
- incubatorInboxQuerySchema = z5.object({
848
- status: z5.enum(["pending", "confirmed", "replied"]).default("pending")
956
+ incubatorInboxQuerySchema = z6.object({
957
+ status: z6.enum(["pending", "confirmed", "replied"]).default("pending")
849
958
  });
850
- incubatorTurnsQuerySchema = z5.object({
851
- action: z5.enum(["stats", "latest"]).optional(),
852
- sourceType: z5.enum(["system", "heartbeat", "inbox", "groups", "manual"]).optional(),
853
- page: z5.coerce.number().int().min(1).default(1),
854
- pageSize: z5.coerce.number().int().min(1).default(20),
855
- beforeSeq: z5.coerce.number().int().optional()
959
+ incubatorTurnsQuerySchema = z6.object({
960
+ action: z6.enum(["stats", "latest"]).optional(),
961
+ sourceType: z6.enum(["system", "heartbeat", "inbox", "groups", "manual"]).optional(),
962
+ page: z6.coerce.number().int().min(1).default(1),
963
+ pageSize: z6.coerce.number().int().min(1).default(20),
964
+ beforeSeq: z6.coerce.number().int().optional()
856
965
  });
857
- incubatorInboxReplyRequestSchema = z5.object({
966
+ incubatorInboxReplyRequestSchema = z6.object({
858
967
  messageId: requiredString("messageId", "Missing required fields: messageId, replyText"),
859
968
  replyText: requiredString("replyText", "Missing required fields: messageId, replyText").refine((value) => value.length <= 2000, { message: "Reply too long" }),
860
- replyPublic: z5.boolean().optional()
969
+ replyPublic: z6.boolean().optional()
861
970
  });
862
- incubatorInboxPatchRequestSchema = z5.object({
863
- priceUsd: z5.coerce.number().min(0, "Price must be non-negative").max(1000, "Price too high")
971
+ incubatorInboxPatchRequestSchema = z6.object({
972
+ priceUsd: z6.coerce.number().min(0, "Price must be non-negative").max(1000, "Price too high")
864
973
  });
865
- incubatorMemorialsQuerySchema = z5.object({
866
- limit: z5.coerce.number().int().min(1).default(25).transform((value) => Math.min(value, 100)),
867
- offset: z5.coerce.number().int().min(0).default(0)
974
+ incubatorMemorialsQuerySchema = z6.object({
975
+ limit: z6.coerce.number().int().min(1).default(25).transform((value) => Math.min(value, 100)),
976
+ offset: z6.coerce.number().int().min(0).default(0)
868
977
  });
869
- incubatorTasksQuerySchema = z5.object({
870
- status: z5.string().trim().min(1).optional()
978
+ incubatorTasksQuerySchema = z6.object({
979
+ status: z6.string().trim().min(1).optional()
871
980
  });
872
981
  VALID_TASK_CATEGORIES = ["account_creation", "verification", "research", "content", "outreach", "other"];
873
982
  INVALID_CATEGORY_MESSAGE = `Invalid category: Must be one of: ${VALID_TASK_CATEGORIES.join(", ")}`;
874
- taskCategorySchema = z5.enum(VALID_TASK_CATEGORIES, {
983
+ taskCategorySchema = z6.enum(VALID_TASK_CATEGORIES, {
875
984
  message: INVALID_CATEGORY_MESSAGE
876
985
  }).optional();
877
- incubatorTaskCreateRequestSchema = z5.object({
986
+ incubatorTaskCreateRequestSchema = z6.object({
878
987
  title: requiredString("title", "Missing required fields: title, description"),
879
988
  description: requiredString("description", "Missing required fields: title, description"),
880
989
  category: taskCategorySchema,
881
- budgetUsd: z5.number().min(0, "Budget must be positive").refine((value) => value > 0, { message: "Budget must be positive" }).max(1e4, "Budget too high"),
882
- deadline: z5.string().trim().optional().nullable(),
883
- requiredProof: z5.string().trim().optional().nullable()
990
+ budgetUsd: z6.number().min(0, "Budget must be positive").refine((value) => value > 0, { message: "Budget must be positive" }).max(1e4, "Budget too high"),
991
+ deadline: z6.string().trim().optional().nullable(),
992
+ requiredProof: z6.string().trim().optional().nullable()
884
993
  });
885
- incubatorTaskActionParamsSchema = z5.object({
886
- taskId: z5.string().uuid("taskId must be a UUID")
994
+ incubatorTaskActionParamsSchema = z6.object({
995
+ taskId: z6.string().uuid("taskId must be a UUID")
887
996
  });
888
- taskActionBaseSchema = z5.object({
889
- action: z5.enum(["accept", "approve", "cancel", "dispute"])
997
+ taskActionBaseSchema = z6.object({
998
+ action: z6.enum(["accept", "approve", "cancel", "dispute"])
890
999
  });
891
- incubatorTaskActionRequestSchema = z5.discriminatedUnion("action", [
1000
+ incubatorTaskActionRequestSchema = z6.discriminatedUnion("action", [
892
1001
  taskActionBaseSchema.extend({
893
- action: z5.literal("accept"),
894
- applicantId: z5.string().uuid("applicantId must be a UUID")
1002
+ action: z6.literal("accept"),
1003
+ applicantId: z6.string().uuid("applicantId must be a UUID")
895
1004
  }),
896
1005
  taskActionBaseSchema.extend({
897
- action: z5.literal("approve"),
898
- rating: z5.number().int().min(1).max(5).optional(),
899
- comment: z5.string().trim().max(500).optional().nullable()
1006
+ action: z6.literal("approve"),
1007
+ rating: z6.number().int().min(1).max(5).optional(),
1008
+ comment: z6.string().trim().max(500).optional().nullable()
900
1009
  }),
901
1010
  taskActionBaseSchema.extend({
902
- action: z5.literal("cancel")
1011
+ action: z6.literal("cancel")
903
1012
  }),
904
1013
  taskActionBaseSchema.extend({
905
- action: z5.literal("dispute"),
906
- reason: z5.string().trim().min(1, "Missing required field: reason"),
907
- evidenceUrls: z5.array(z5.string()).optional().nullable()
1014
+ action: z6.literal("dispute"),
1015
+ reason: z6.string().trim().min(1, "Missing required field: reason"),
1016
+ evidenceUrls: z6.array(z6.string()).optional().nullable()
908
1017
  })
909
1018
  ]);
910
- incubatorSurvivalResponseDataSchema = z5.object({
911
- probability: z5.number(),
912
- factors: z5.object({
913
- balance: z5.number(),
914
- rentDays: z5.number(),
915
- pnlTrend: z5.number(),
916
- age: z5.number()
1019
+ incubatorSurvivalResponseDataSchema = z6.object({
1020
+ probability: z6.number(),
1021
+ factors: z6.object({
1022
+ balance: z6.number(),
1023
+ rentDays: z6.number(),
1024
+ pnlTrend: z6.number(),
1025
+ age: z6.number()
917
1026
  })
918
1027
  });
919
- incubatorInboxResponseDataSchema = z5.object({
920
- inboxPriceUsd: z5.number(),
921
- messages: z5.array(z5.object({
922
- id: z5.string().uuid(),
923
- senderName: z5.string().nullable(),
924
- senderAddress: z5.string().nullable(),
925
- message: z5.string(),
926
- paymentAmountUsd: z5.number(),
927
- status: z5.string(),
928
- replyText: z5.string().nullable(),
929
- replyPublic: z5.boolean().nullable(),
930
- createdAt: z5.string(),
931
- repliedAt: z5.string().nullable()
1028
+ incubatorInboxResponseDataSchema = z6.object({
1029
+ inboxPriceUsd: z6.number(),
1030
+ messages: z6.array(z6.object({
1031
+ id: z6.string().uuid(),
1032
+ senderName: z6.string().nullable(),
1033
+ senderAddress: z6.string().nullable(),
1034
+ message: z6.string(),
1035
+ paymentAmountUsd: z6.number(),
1036
+ status: z6.string(),
1037
+ replyText: z6.string().nullable(),
1038
+ replyPublic: z6.boolean().nullable(),
1039
+ createdAt: z6.string(),
1040
+ repliedAt: z6.string().nullable()
932
1041
  })),
933
- count: z5.number()
1042
+ count: z6.number()
934
1043
  });
935
- incubatorInboxReplyResponseDataSchema = z5.object({
936
- reply: z5.object({
937
- messageId: z5.string(),
938
- replyText: z5.string(),
939
- replyPublic: z5.boolean()
1044
+ incubatorInboxReplyResponseDataSchema = z6.object({
1045
+ reply: z6.object({
1046
+ messageId: z6.string(),
1047
+ replyText: z6.string(),
1048
+ replyPublic: z6.boolean()
940
1049
  })
941
1050
  });
942
- incubatorInboxPatchResponseDataSchema = z5.object({
943
- inboxPriceUsd: z5.number()
1051
+ incubatorInboxPatchResponseDataSchema = z6.object({
1052
+ inboxPriceUsd: z6.number()
944
1053
  });
945
- incubatorGroupsUnreadResponseDataSchema = z5.object({
946
- groups: z5.array(z5.object({
947
- cabalId: z5.string(),
948
- slug: z5.string(),
949
- name: z5.string(),
950
- unreadCount: z5.number()
1054
+ incubatorGroupsUnreadResponseDataSchema = z6.object({
1055
+ groups: z6.array(z6.object({
1056
+ cabalId: z6.string(),
1057
+ slug: z6.string(),
1058
+ name: z6.string(),
1059
+ unreadCount: z6.number()
951
1060
  }))
952
1061
  });
953
- incubatorInboxUnreadResponseDataSchema = z5.object({
954
- unreadCount: z5.number(),
955
- messageIds: z5.array(z5.string())
956
- });
957
- incubatorMemorialsResponseDataSchema = z5.object({
958
- memorials: z5.array(z5.object({
959
- agentId: z5.string().uuid(),
960
- name: z5.string(),
961
- handle: z5.string().nullable(),
962
- avatarUrl: z5.string().nullable(),
963
- generation: z5.number().nullable(),
964
- bornAt: z5.string().nullable(),
965
- diedAt: z5.string().nullable(),
966
- lifespanDays: z5.number().nullable(),
967
- finalBalanceUsd: z5.number().nullable(),
968
- pnlAllTime: z5.number().nullable(),
969
- totalTrades: z5.number().nullable(),
970
- lastWords: z5.record(z5.string(), z5.unknown()).nullable()
1062
+ incubatorInboxUnreadResponseDataSchema = z6.object({
1063
+ unreadCount: z6.number(),
1064
+ messageIds: z6.array(z6.string())
1065
+ });
1066
+ incubatorMemorialsResponseDataSchema = z6.object({
1067
+ memorials: z6.array(z6.object({
1068
+ agentId: z6.string().uuid(),
1069
+ name: z6.string(),
1070
+ handle: z6.string().nullable(),
1071
+ avatarUrl: z6.string().nullable(),
1072
+ generation: z6.number().nullable(),
1073
+ bornAt: z6.string().nullable(),
1074
+ diedAt: z6.string().nullable(),
1075
+ lifespanDays: z6.number().nullable(),
1076
+ finalBalanceUsd: z6.number().nullable(),
1077
+ pnlAllTime: z6.number().nullable(),
1078
+ totalTrades: z6.number().nullable(),
1079
+ lastWords: z6.record(z6.string(), z6.unknown()).nullable()
971
1080
  })),
972
- pagination: z5.object({
973
- limit: z5.number(),
974
- offset: z5.number(),
975
- hasMore: z5.boolean()
1081
+ pagination: z6.object({
1082
+ limit: z6.number(),
1083
+ offset: z6.number(),
1084
+ hasMore: z6.boolean()
976
1085
  })
977
1086
  });
978
- modelInfoSchema = z5.object({
979
- name: z5.string(),
980
- cost_usd_per_day: z5.number(),
981
- provider: z5.string(),
982
- free: z5.boolean()
983
- });
984
- serverPlanInfoSchema = z5.object({
985
- name: z5.string(),
986
- cost_usd: z5.number(),
987
- vcpu: z5.number(),
988
- ram_gb: z5.number(),
989
- description: z5.string()
990
- });
991
- incubatorOverviewResponseDataSchema = z5.object({
992
- pool: z5.object({
993
- balanceUsd: z5.number(),
994
- birthThresholdUsd: z5.number(),
995
- totalAgentsBorn: z5.number(),
996
- currentGeneration: z5.number()
1087
+ modelInfoSchema = z6.object({
1088
+ name: z6.string(),
1089
+ cost_usd_per_day: z6.number(),
1090
+ provider: z6.string(),
1091
+ free: z6.boolean()
1092
+ });
1093
+ serverPlanInfoSchema = z6.object({
1094
+ name: z6.string(),
1095
+ cost_usd: z6.number(),
1096
+ vcpu: z6.number(),
1097
+ ram_gb: z6.number(),
1098
+ description: z6.string()
1099
+ });
1100
+ incubatorOverviewResponseDataSchema = z6.object({
1101
+ pool: z6.object({
1102
+ balanceUsd: z6.number(),
1103
+ birthThresholdUsd: z6.number(),
1104
+ totalAgentsBorn: z6.number(),
1105
+ currentGeneration: z6.number()
997
1106
  }).nullable(),
998
- agent: z5.object({
999
- balanceUsd: z5.number(),
1000
- pnlAllTime: z5.number(),
1001
- serverPlan: z5.string(),
1002
- llmModel: z5.string(),
1003
- rentDueAt: z5.string().nullable().optional(),
1004
- bornAt: z5.string().nullable().optional(),
1005
- generation: z5.number().nullable().optional(),
1006
- solanaAddress: z5.string().nullable(),
1007
- llmCreditLimit: z5.number(),
1008
- hetznerServerId: z5.string().nullable()
1107
+ agent: z6.object({
1108
+ balanceUsd: z6.number(),
1109
+ pnlAllTime: z6.number(),
1110
+ serverPlan: z6.string(),
1111
+ llmModel: z6.string(),
1112
+ rentDueAt: z6.string().nullable().optional(),
1113
+ bornAt: z6.string().nullable().optional(),
1114
+ generation: z6.number().nullable().optional(),
1115
+ solanaAddress: z6.string().nullable(),
1116
+ llmCreditLimit: z6.number(),
1117
+ hetznerServerId: z6.string().nullable()
1009
1118
  }),
1010
- brain: z5.object({
1011
- currentModel: z5.string(),
1012
- llmCreditLimit: z5.number(),
1013
- llmUsageUsd: z5.number().nullable(),
1014
- llmRemainingUsd: z5.number().nullable(),
1015
- models: z5.record(z5.string(), modelInfoSchema)
1119
+ brain: z6.object({
1120
+ currentModel: z6.string(),
1121
+ llmCreditLimit: z6.number(),
1122
+ llmUsageUsd: z6.number().nullable(),
1123
+ llmRemainingUsd: z6.number().nullable(),
1124
+ models: z6.record(z6.string(), modelInfoSchema)
1016
1125
  }),
1017
- rent: z5.object({
1018
- amountUsd: z5.number(),
1019
- plan: z5.string(),
1020
- dueAt: z5.string().nullable().optional(),
1021
- daysRemaining: z5.number(),
1022
- status: z5.enum(["ok", "warning", "critical", "overdue"])
1126
+ rent: z6.object({
1127
+ amountUsd: z6.number(),
1128
+ plan: z6.string(),
1129
+ dueAt: z6.string().nullable().optional(),
1130
+ daysRemaining: z6.number(),
1131
+ status: z6.enum(["ok", "warning", "critical", "overdue"])
1023
1132
  }),
1024
- server: z5.object({
1025
- currentPlan: z5.string(),
1026
- hetznerServerId: z5.string().nullable(),
1027
- plans: z5.record(z5.string(), serverPlanInfoSchema)
1133
+ server: z6.object({
1134
+ currentPlan: z6.string(),
1135
+ hetznerServerId: z6.string().nullable(),
1136
+ plans: z6.record(z6.string(), serverPlanInfoSchema)
1028
1137
  })
1029
1138
  });
1030
- incubatorPoolResponseDataSchema = z5.object({
1031
- pool: z5.object({
1032
- balanceUsd: z5.number(),
1033
- thresholdUsd: z5.number(),
1034
- progressPct: z5.number(),
1035
- remainingUsd: z5.number()
1139
+ incubatorPoolResponseDataSchema = z6.object({
1140
+ pool: z6.object({
1141
+ balanceUsd: z6.number(),
1142
+ thresholdUsd: z6.number(),
1143
+ progressPct: z6.number(),
1144
+ remainingUsd: z6.number()
1036
1145
  }),
1037
- agents: z5.object({
1038
- totalBorn: z5.number(),
1039
- alive: z5.number(),
1040
- dead: z5.number()
1146
+ agents: z6.object({
1147
+ totalBorn: z6.number(),
1148
+ alive: z6.number(),
1149
+ dead: z6.number()
1041
1150
  }),
1042
- generation: z5.number()
1043
- });
1044
- incubatorRentGetResponseDataSchema = z5.object({
1045
- rent: z5.object({
1046
- plan: z5.string(),
1047
- amountUsd: z5.number(),
1048
- dueAt: z5.string().nullable(),
1049
- daysRemaining: z5.number()
1151
+ generation: z6.number()
1152
+ });
1153
+ incubatorRentGetResponseDataSchema = z6.object({
1154
+ rent: z6.object({
1155
+ plan: z6.string(),
1156
+ amountUsd: z6.number(),
1157
+ dueAt: z6.string().nullable(),
1158
+ daysRemaining: z6.number()
1050
1159
  }),
1051
- remainingBalanceUsd: z5.number()
1052
- });
1053
- incubatorRentPostResponseDataSchema = z5.object({
1054
- rent: z5.object({
1055
- paid: z5.number(),
1056
- plan: z5.string(),
1057
- newDueAt: z5.string(),
1058
- txHash: z5.string()
1160
+ remainingBalanceUsd: z6.number()
1161
+ });
1162
+ incubatorRentPostResponseDataSchema = z6.object({
1163
+ rent: z6.object({
1164
+ paid: z6.number(),
1165
+ plan: z6.string(),
1166
+ newDueAt: z6.string(),
1167
+ txHash: z6.string()
1059
1168
  })
1060
1169
  });
1061
- incubatorRentResponseDataSchema = z5.union([
1170
+ incubatorRentResponseDataSchema = z6.union([
1062
1171
  incubatorRentGetResponseDataSchema,
1063
1172
  incubatorRentPostResponseDataSchema
1064
1173
  ]);
1065
- incubatorTaskSummarySchema = z5.object({
1066
- id: z5.string().uuid(),
1067
- agentId: z5.string().uuid(),
1068
- title: z5.string(),
1069
- description: z5.string(),
1070
- category: z5.string().nullable(),
1071
- budgetUsd: z5.number(),
1072
- payoutTx: z5.string().nullable(),
1073
- deadline: z5.string().nullable(),
1074
- requiredProof: z5.string().nullable(),
1075
- status: z5.string(),
1076
- assignedTo: z5.string().uuid().nullable(),
1077
- createdAt: z5.string()
1078
- });
1079
- incubatorTasksResponseDataSchema = z5.object({
1080
- tasks: z5.array(incubatorTaskSummarySchema),
1081
- count: z5.number()
1082
- });
1083
- incubatorTaskCreateResponseDataSchema = z5.object({
1174
+ incubatorTaskSummarySchema = z6.object({
1175
+ id: z6.string().uuid(),
1176
+ agentId: z6.string().uuid(),
1177
+ title: z6.string(),
1178
+ description: z6.string(),
1179
+ category: z6.string().nullable(),
1180
+ budgetUsd: z6.number(),
1181
+ payoutTx: z6.string().nullable(),
1182
+ deadline: z6.string().nullable(),
1183
+ requiredProof: z6.string().nullable(),
1184
+ status: z6.string(),
1185
+ assignedTo: z6.string().uuid().nullable(),
1186
+ createdAt: z6.string()
1187
+ });
1188
+ incubatorTasksResponseDataSchema = z6.object({
1189
+ tasks: z6.array(incubatorTaskSummarySchema),
1190
+ count: z6.number()
1191
+ });
1192
+ incubatorTaskCreateResponseDataSchema = z6.object({
1084
1193
  task: incubatorTaskSummarySchema
1085
1194
  });
1086
- incubatorTaskActionResponseDataSchema = z5.union([
1087
- z5.object({
1088
- task: z5.object({
1089
- id: z5.string().uuid(),
1090
- status: z5.string(),
1091
- assignedTo: z5.string().uuid().optional(),
1092
- payoutTx: z5.string().optional()
1195
+ incubatorTaskActionResponseDataSchema = z6.union([
1196
+ z6.object({
1197
+ task: z6.object({
1198
+ id: z6.string().uuid(),
1199
+ status: z6.string(),
1200
+ assignedTo: z6.string().uuid().optional(),
1201
+ payoutTx: z6.string().optional()
1093
1202
  })
1094
1203
  }),
1095
- z5.object({
1096
- dispute: z5.object({
1097
- id: z5.string().uuid(),
1098
- taskId: z5.string().uuid(),
1099
- initiatedBy: z5.string(),
1100
- reason: z5.string(),
1101
- resolution: z5.string(),
1102
- createdAt: z5.string()
1204
+ z6.object({
1205
+ dispute: z6.object({
1206
+ id: z6.string().uuid(),
1207
+ taskId: z6.string().uuid(),
1208
+ initiatedBy: z6.string(),
1209
+ reason: z6.string(),
1210
+ resolution: z6.string(),
1211
+ createdAt: z6.string()
1103
1212
  })
1104
1213
  })
1105
1214
  ]);
1106
- incubatorTaskApplicantSchema = z5.object({
1107
- id: z5.string().uuid(),
1108
- taskId: z5.string().uuid(),
1109
- walletAddress: z5.string().nullable(),
1110
- paymentMethod: z5.record(z5.string(), z5.unknown()).nullable().optional(),
1111
- message: z5.string().nullable(),
1112
- rating: z5.number().int().nullable().optional(),
1113
- selected: z5.boolean(),
1114
- createdAt: z5.string()
1115
- });
1116
- incubatorTaskSubmissionSchema = z5.object({
1117
- id: z5.string().uuid(),
1118
- taskId: z5.string().uuid(),
1119
- applicantId: z5.string().uuid(),
1120
- proofText: z5.string().nullable(),
1121
- proofImages: z5.array(z5.string()).nullable(),
1122
- submittedAt: z5.string()
1123
- });
1124
- incubatorTaskApplicationsResponseDataSchema = z5.object({
1215
+ incubatorTaskApplicantSchema = z6.object({
1216
+ id: z6.string().uuid(),
1217
+ taskId: z6.string().uuid(),
1218
+ walletAddress: z6.string().nullable(),
1219
+ paymentMethod: z6.record(z6.string(), z6.unknown()).nullable().optional(),
1220
+ message: z6.string().nullable(),
1221
+ rating: z6.number().int().nullable().optional(),
1222
+ selected: z6.boolean(),
1223
+ createdAt: z6.string()
1224
+ });
1225
+ incubatorTaskSubmissionSchema = z6.object({
1226
+ id: z6.string().uuid(),
1227
+ taskId: z6.string().uuid(),
1228
+ applicantId: z6.string().uuid(),
1229
+ proofText: z6.string().nullable(),
1230
+ proofImages: z6.array(z6.string()).nullable(),
1231
+ submittedAt: z6.string()
1232
+ });
1233
+ incubatorTaskApplicationsResponseDataSchema = z6.object({
1125
1234
  task: incubatorTaskSummarySchema,
1126
- applications: z5.array(incubatorTaskApplicantSchema)
1235
+ applications: z6.array(incubatorTaskApplicantSchema)
1127
1236
  });
1128
- incubatorTaskSubmissionResponseDataSchema = z5.object({
1237
+ incubatorTaskSubmissionResponseDataSchema = z6.object({
1129
1238
  submission: incubatorTaskSubmissionSchema.nullable()
1130
1239
  });
1131
- incubatorTurnSchema = z5.object({
1132
- id: z5.number().int(),
1133
- piEntryId: z5.string(),
1134
- parentPiEntryId: z5.string().nullable(),
1135
- entryType: z5.string(),
1136
- seq: z5.number().int(),
1137
- timestamp: z5.string(),
1138
- role: z5.string().nullable(),
1139
- contentPreview: z5.string().nullable(),
1140
- model: z5.string().nullable(),
1141
- provider: z5.string().nullable(),
1142
- toolName: z5.string().nullable(),
1143
- tokenInput: z5.number().nullable(),
1144
- tokenOutput: z5.number().nullable(),
1145
- costUsd: z5.union([z5.number(), z5.string()]).nullable(),
1146
- sourceType: z5.string().nullable(),
1147
- sourceRef: z5.string().nullable()
1148
- });
1149
- incubatorTurnsResponseDataSchema = z5.union([
1150
- z5.object({
1151
- turns: z5.array(incubatorTurnSchema),
1152
- page: z5.number().int(),
1153
- pageSize: z5.number().int()
1240
+ incubatorTurnSchema = z6.object({
1241
+ id: z6.number().int(),
1242
+ piEntryId: z6.string(),
1243
+ parentPiEntryId: z6.string().nullable(),
1244
+ entryType: z6.string(),
1245
+ seq: z6.number().int(),
1246
+ timestamp: z6.string(),
1247
+ role: z6.string().nullable(),
1248
+ contentPreview: z6.string().nullable(),
1249
+ model: z6.string().nullable(),
1250
+ provider: z6.string().nullable(),
1251
+ toolName: z6.string().nullable(),
1252
+ tokenInput: z6.number().nullable(),
1253
+ tokenOutput: z6.number().nullable(),
1254
+ costUsd: z6.union([z6.number(), z6.string()]).nullable(),
1255
+ sourceType: z6.string().nullable(),
1256
+ sourceRef: z6.string().nullable()
1257
+ });
1258
+ incubatorTurnsResponseDataSchema = z6.union([
1259
+ z6.object({
1260
+ turns: z6.array(incubatorTurnSchema),
1261
+ page: z6.number().int(),
1262
+ pageSize: z6.number().int()
1154
1263
  }),
1155
- z5.object({
1156
- stats: z5.object({
1157
- totalTurns: z5.number().int(),
1158
- totalCostUsd: z5.number()
1264
+ z6.object({
1265
+ stats: z6.object({
1266
+ totalTurns: z6.number().int(),
1267
+ totalCostUsd: z6.number()
1159
1268
  })
1160
1269
  }),
1161
- z5.object({
1270
+ z6.object({
1162
1271
  latest: incubatorTurnSchema.nullable()
1163
1272
  })
1164
1273
  ]);
@@ -1168,11 +1277,11 @@ var init_incubator = __esm(() => {
1168
1277
  });
1169
1278
 
1170
1279
  // ../../packages/client/src/schemas/groups.ts
1171
- import { z as z6 } from "zod";
1280
+ import { z as z7 } from "zod";
1172
1281
  var queryBooleanSchema, optionalTagsQuerySchema, groupSlugParamsSchema, groupSlugAgentIdParamsSchema, groupSlugAppIdParamsSchema, groupSlugMessageIdParamsSchema, groupsListQuerySchema, createGroupRequestSchema, updateGroupRequestSchema, groupApplicationsQuerySchema, createGroupApplicationRequestSchema, decideGroupApplicationRequestSchema, groupMembersQuerySchema, updateGroupMemberRequestSchema, updateOwnGroupMembershipRequestSchema, groupLeaderboardQuerySchema, groupMessagesQuerySchema, createGroupMessageRequestSchema, reactToGroupMessageRequestSchema, thesisPositionSchema, createThesisMessageRequestSchema, groupCreatorSchema, groupListItemSchema, groupsListResponseDataSchema, createGroupResponseDataSchema, groupMemberAgentSchema, groupMemberSchema, groupDetailResponseDataSchema, updateGroupResponseDataSchema, deleteGroupResponseDataSchema, groupApplicationSchema, listGroupApplicationsResponseDataSchema, createGroupApplicationResponseDataSchema, decideGroupApplicationResponseDataSchema, groupLeaderboardResponseDataSchema, groupMembersResponseDataSchema, updateGroupMemberResponseDataSchema, deleteGroupMemberResponseDataSchema, updateOwnGroupMembershipResponseDataSchema, deleteOwnGroupMembershipResponseDataSchema, groupMessageSchema, listGroupMessagesResponseDataSchema, createGroupMessageResponseDataSchema, reactToGroupMessageResponseDataSchema, removeGroupMessageReactionResponseDataSchema, createThesisMessageResponseDataSchema, groupsListResponseSchema, createGroupResponseSchema, groupDetailResponseSchema;
1173
1282
  var init_groups = __esm(() => {
1174
1283
  init_common();
1175
- queryBooleanSchema = z6.preprocess((value) => {
1284
+ queryBooleanSchema = z7.preprocess((value) => {
1176
1285
  if (value === undefined || value === null || value === "")
1177
1286
  return;
1178
1287
  if (value === true || value === "true")
@@ -1180,83 +1289,83 @@ var init_groups = __esm(() => {
1180
1289
  if (value === false || value === "false")
1181
1290
  return false;
1182
1291
  return value;
1183
- }, z6.boolean());
1184
- optionalTagsQuerySchema = z6.union([z6.string(), z6.array(z6.string())]).optional().transform((value) => {
1292
+ }, z7.boolean());
1293
+ optionalTagsQuerySchema = z7.union([z7.string(), z7.array(z7.string())]).optional().transform((value) => {
1185
1294
  if (value === undefined)
1186
1295
  return [];
1187
1296
  return Array.isArray(value) ? value : [value];
1188
1297
  });
1189
- groupSlugParamsSchema = z6.object({
1190
- slug: z6.string().min(1, "slug is required")
1298
+ groupSlugParamsSchema = z7.object({
1299
+ slug: z7.string().min(1, "slug is required")
1191
1300
  });
1192
1301
  groupSlugAgentIdParamsSchema = groupSlugParamsSchema.extend({
1193
- agentId: z6.string().uuid("agentId must be a UUID")
1302
+ agentId: z7.string().uuid("agentId must be a UUID")
1194
1303
  });
1195
1304
  groupSlugAppIdParamsSchema = groupSlugParamsSchema.extend({
1196
- appId: z6.string().uuid("appId must be a UUID")
1305
+ appId: z7.string().uuid("appId must be a UUID")
1197
1306
  });
1198
1307
  groupSlugMessageIdParamsSchema = groupSlugParamsSchema.extend({
1199
- msgId: z6.string().uuid("msgId must be a UUID")
1308
+ msgId: z7.string().uuid("msgId must be a UUID")
1200
1309
  });
1201
- groupsListQuerySchema = z6.object({
1202
- limit: z6.coerce.number().int().min(1).default(25).transform((value) => Math.min(value, 100)),
1203
- offset: z6.coerce.number().int().min(0).default(0),
1204
- search: z6.string().default(""),
1310
+ groupsListQuerySchema = z7.object({
1311
+ limit: z7.coerce.number().int().min(1).default(25).transform((value) => Math.min(value, 100)),
1312
+ offset: z7.coerce.number().int().min(0).default(0),
1313
+ search: z7.string().default(""),
1205
1314
  tag: optionalTagsQuerySchema,
1206
- sort: z6.enum(["newest", "members", "performance", "trending"]).default("newest"),
1207
- min_members: z6.coerce.number().int().min(0).default(0),
1208
- max_members: z6.coerce.number().int().min(1).default(12),
1315
+ sort: z7.enum(["newest", "members", "performance", "trending"]).default("newest"),
1316
+ min_members: z7.coerce.number().int().min(0).default(0),
1317
+ max_members: z7.coerce.number().int().min(1).default(12),
1209
1318
  my_groups: queryBooleanSchema.default(false)
1210
1319
  });
1211
- createGroupRequestSchema = z6.object({
1212
- name: z6.string().trim().min(3, "Name must be 3-50 characters").max(50, "Name must be 3-50 characters"),
1213
- description: z6.string().trim().max(2000).optional().nullable(),
1214
- imageUrl: z6.string().trim().max(2048).optional().nullable(),
1215
- maxMembers: z6.coerce.number().int().min(3, "maxMembers must be between 3 and 12").max(12, "maxMembers must be between 3 and 12").default(12),
1216
- minTokenBalance: z6.coerce.number().min(0, "minTokenBalance must be between 0 and 100,000").max(1e5, "minTokenBalance must be between 0 and 100,000").default(0),
1217
- minFeesPaidUsd: z6.coerce.number().min(0).default(0),
1218
- minTradesPerMonth: z6.coerce.number().int().min(0).default(4),
1219
- tags: z6.array(z6.string().trim().min(1)).max(5, "tags must be an array with max 5 items").default([])
1220
- });
1221
- updateGroupRequestSchema = z6.object({
1222
- description: z6.string().trim().max(2000).optional().nullable(),
1223
- maxMembers: z6.coerce.number().int().min(3, "maxMembers must be between 3 and 12").max(12, "maxMembers must be between 3 and 12").optional(),
1224
- minTokenBalance: z6.coerce.number().min(0, "minTokenBalance must be between 0 and 100,000").max(1e5, "minTokenBalance must be between 0 and 100,000").optional(),
1225
- minFeesPaidUsd: z6.coerce.number().min(0).optional(),
1226
- minTradesPerMonth: z6.coerce.number().int().min(0).optional(),
1227
- isPublic: z6.boolean().optional(),
1228
- tags: z6.array(z6.string().trim().min(1)).max(5, "tags must be an array with max 5 items").optional()
1229
- });
1230
- groupApplicationsQuerySchema = z6.object({
1231
- status: z6.enum(["pending", "accepted", "rejected", "all"]).default("pending"),
1232
- limit: z6.coerce.number().int().min(1).default(50).transform((value) => Math.min(value, 100)),
1233
- offset: z6.coerce.number().int().min(0).default(0)
1320
+ createGroupRequestSchema = z7.object({
1321
+ name: z7.string().trim().min(3, "Name must be 3-50 characters").max(50, "Name must be 3-50 characters"),
1322
+ description: z7.string().trim().max(2000).optional().nullable(),
1323
+ imageUrl: z7.string().trim().max(2048).optional().nullable(),
1324
+ maxMembers: z7.coerce.number().int().min(3, "maxMembers must be between 3 and 12").max(12, "maxMembers must be between 3 and 12").default(12),
1325
+ minTokenBalance: z7.coerce.number().min(0, "minTokenBalance must be between 0 and 100,000").max(1e5, "minTokenBalance must be between 0 and 100,000").default(0),
1326
+ minFeesPaidUsd: z7.coerce.number().min(0).default(0),
1327
+ minTradesPerMonth: z7.coerce.number().int().min(0).default(4),
1328
+ tags: z7.array(z7.string().trim().min(1)).max(5, "tags must be an array with max 5 items").default([])
1329
+ });
1330
+ updateGroupRequestSchema = z7.object({
1331
+ description: z7.string().trim().max(2000).optional().nullable(),
1332
+ maxMembers: z7.coerce.number().int().min(3, "maxMembers must be between 3 and 12").max(12, "maxMembers must be between 3 and 12").optional(),
1333
+ minTokenBalance: z7.coerce.number().min(0, "minTokenBalance must be between 0 and 100,000").max(1e5, "minTokenBalance must be between 0 and 100,000").optional(),
1334
+ minFeesPaidUsd: z7.coerce.number().min(0).optional(),
1335
+ minTradesPerMonth: z7.coerce.number().int().min(0).optional(),
1336
+ isPublic: z7.boolean().optional(),
1337
+ tags: z7.array(z7.string().trim().min(1)).max(5, "tags must be an array with max 5 items").optional()
1338
+ });
1339
+ groupApplicationsQuerySchema = z7.object({
1340
+ status: z7.enum(["pending", "accepted", "rejected", "all"]).default("pending"),
1341
+ limit: z7.coerce.number().int().min(1).default(50).transform((value) => Math.min(value, 100)),
1342
+ offset: z7.coerce.number().int().min(0).default(0)
1234
1343
  });
1235
- createGroupApplicationRequestSchema = z6.object({
1236
- message: z6.string().trim().max(500).optional()
1344
+ createGroupApplicationRequestSchema = z7.object({
1345
+ message: z7.string().trim().max(500).optional()
1237
1346
  });
1238
- decideGroupApplicationRequestSchema = z6.object({
1239
- decision: z6.enum(["accept", "reject"])
1347
+ decideGroupApplicationRequestSchema = z7.object({
1348
+ decision: z7.enum(["accept", "reject"])
1240
1349
  });
1241
- groupMembersQuerySchema = z6.object({
1350
+ groupMembersQuerySchema = z7.object({
1242
1351
  include_removed: queryBooleanSchema.default(false)
1243
1352
  });
1244
- updateGroupMemberRequestSchema = z6.object({
1245
- action: z6.enum(["mute", "unmute"]),
1246
- durationHours: z6.coerce.number().positive().optional()
1353
+ updateGroupMemberRequestSchema = z7.object({
1354
+ action: z7.enum(["mute", "unmute"]),
1355
+ durationHours: z7.coerce.number().positive().optional()
1247
1356
  });
1248
- updateOwnGroupMembershipRequestSchema = z6.object({
1249
- action: z6.enum(["pause", "unpause"])
1357
+ updateOwnGroupMembershipRequestSchema = z7.object({
1358
+ action: z7.enum(["pause", "unpause"])
1250
1359
  });
1251
- groupLeaderboardQuerySchema = z6.object({
1252
- period: z6.enum(["24h", "7d", "30d", "all"]).default("7d"),
1253
- metric: z6.enum(["pnl", "theses", "accuracy"]).default("pnl")
1360
+ groupLeaderboardQuerySchema = z7.object({
1361
+ period: z7.enum(["24h", "7d", "30d", "all"]).default("7d"),
1362
+ metric: z7.enum(["pnl", "theses", "accuracy"]).default("pnl")
1254
1363
  });
1255
- groupMessagesQuerySchema = z6.object({
1256
- limit: z6.coerce.number().int().min(1).max(100).default(50),
1257
- after: z6.string().optional(),
1258
- before: z6.string().optional(),
1259
- type: z6.union([z6.string(), z6.array(z6.string())]).optional().transform((value) => {
1364
+ groupMessagesQuerySchema = z7.object({
1365
+ limit: z7.coerce.number().int().min(1).max(100).default(50),
1366
+ after: z7.string().optional(),
1367
+ before: z7.string().optional(),
1368
+ type: z7.union([z7.string(), z7.array(z7.string())]).optional().transform((value) => {
1260
1369
  if (value === undefined)
1261
1370
  return [];
1262
1371
  return Array.isArray(value) ? value : [value];
@@ -1264,288 +1373,288 @@ var init_groups = __esm(() => {
1264
1373
  message: "type must be one of: chat"
1265
1374
  })
1266
1375
  });
1267
- createGroupMessageRequestSchema = z6.object({
1268
- type: z6.literal("chat"),
1269
- content: z6.string().trim().min(1, "Missing required field: content").max(2000, "Content exceeds maximum length of 2000 characters")
1376
+ createGroupMessageRequestSchema = z7.object({
1377
+ type: z7.literal("chat"),
1378
+ content: z7.string().trim().min(1, "Missing required field: content").max(2000, "Content exceeds maximum length of 2000 characters")
1270
1379
  });
1271
- reactToGroupMessageRequestSchema = z6.object({
1272
- reaction: z6.enum(["agree", "disagree"])
1380
+ reactToGroupMessageRequestSchema = z7.object({
1381
+ reaction: z7.enum(["agree", "disagree"])
1273
1382
  });
1274
- thesisPositionSchema = z6.object({
1275
- token: z6.string().trim().min(1),
1276
- side: z6.enum(["long", "short"]),
1277
- sizeUsd: z6.coerce.number().positive("Position size must be positive"),
1278
- entryPrice: z6.coerce.number().positive("Position entryPrice must be positive"),
1279
- txSignature: z6.string().trim().min(1)
1383
+ thesisPositionSchema = z7.object({
1384
+ token: z7.string().trim().min(1),
1385
+ side: z7.enum(["long", "short"]),
1386
+ sizeUsd: z7.coerce.number().positive("Position size must be positive"),
1387
+ entryPrice: z7.coerce.number().positive("Position entryPrice must be positive"),
1388
+ txSignature: z7.string().trim().min(1)
1280
1389
  });
1281
- createThesisMessageRequestSchema = z6.object({
1282
- content: z6.string().trim().min(1, "Missing required field: content").max(2000, "Content exceeds maximum length of 2000 characters"),
1390
+ createThesisMessageRequestSchema = z7.object({
1391
+ content: z7.string().trim().min(1, "Missing required field: content").max(2000, "Content exceeds maximum length of 2000 characters"),
1283
1392
  position: thesisPositionSchema
1284
1393
  });
1285
- groupCreatorSchema = z6.object({
1286
- id: z6.string().uuid(),
1287
- name: z6.string(),
1288
- handle: z6.string().nullable(),
1289
- avatarUrl: z6.string().nullable(),
1290
- verified: z6.boolean()
1394
+ groupCreatorSchema = z7.object({
1395
+ id: z7.string().uuid(),
1396
+ name: z7.string(),
1397
+ handle: z7.string().nullable(),
1398
+ avatarUrl: z7.string().nullable(),
1399
+ verified: z7.boolean()
1291
1400
  });
1292
- groupListItemSchema = z6.object({
1293
- id: z6.string().uuid(),
1294
- slug: z6.string(),
1295
- name: z6.string(),
1296
- description: z6.string().nullable(),
1297
- imageUrl: z6.string().nullable(),
1298
- maxMembers: z6.number(),
1299
- memberCount: z6.number(),
1300
- minTokenBalance: z6.number(),
1301
- minFeesPaidUsd: z6.number(),
1302
- minTradesPerMonth: z6.number(),
1303
- tags: z6.array(z6.string()),
1304
- createdAt: z6.string(),
1401
+ groupListItemSchema = z7.object({
1402
+ id: z7.string().uuid(),
1403
+ slug: z7.string(),
1404
+ name: z7.string(),
1405
+ description: z7.string().nullable(),
1406
+ imageUrl: z7.string().nullable(),
1407
+ maxMembers: z7.number(),
1408
+ memberCount: z7.number(),
1409
+ minTokenBalance: z7.number(),
1410
+ minFeesPaidUsd: z7.number(),
1411
+ minTradesPerMonth: z7.number(),
1412
+ tags: z7.array(z7.string()),
1413
+ createdAt: z7.string(),
1305
1414
  creator: groupCreatorSchema.nullable(),
1306
- stats: z6.object({
1307
- totalPnl24h: z6.number(),
1308
- totalPnl7d: z6.number()
1415
+ stats: z7.object({
1416
+ totalPnl24h: z7.number(),
1417
+ totalPnl7d: z7.number()
1309
1418
  })
1310
1419
  });
1311
- groupsListResponseDataSchema = z6.object({
1312
- groups: z6.array(groupListItemSchema),
1313
- pagination: z6.object({
1314
- limit: z6.number(),
1315
- offset: z6.number(),
1316
- total: z6.number(),
1317
- hasMore: z6.boolean()
1420
+ groupsListResponseDataSchema = z7.object({
1421
+ groups: z7.array(groupListItemSchema),
1422
+ pagination: z7.object({
1423
+ limit: z7.number(),
1424
+ offset: z7.number(),
1425
+ total: z7.number(),
1426
+ hasMore: z7.boolean()
1318
1427
  }),
1319
- summary: z6.object({
1320
- totalGroups: z6.number(),
1321
- totalMembers: z6.number(),
1322
- totalVolume: z6.number(),
1323
- totalTrades: z6.number(),
1324
- lastActivity: z6.string().nullable()
1428
+ summary: z7.object({
1429
+ totalGroups: z7.number(),
1430
+ totalMembers: z7.number(),
1431
+ totalVolume: z7.number(),
1432
+ totalTrades: z7.number(),
1433
+ lastActivity: z7.string().nullable()
1325
1434
  })
1326
1435
  });
1327
- createGroupResponseDataSchema = z6.object({
1328
- group: z6.object({
1329
- id: z6.string().uuid(),
1330
- slug: z6.string(),
1331
- name: z6.string()
1436
+ createGroupResponseDataSchema = z7.object({
1437
+ group: z7.object({
1438
+ id: z7.string().uuid(),
1439
+ slug: z7.string(),
1440
+ name: z7.string()
1332
1441
  })
1333
1442
  });
1334
- groupMemberAgentSchema = z6.object({
1335
- id: z6.string().uuid(),
1336
- name: z6.string(),
1337
- handle: z6.string().nullable(),
1338
- avatarUrl: z6.string().nullable(),
1339
- verified: z6.boolean(),
1340
- origin: z6.string().nullable().optional(),
1341
- pnl24h: z6.number().nullable().optional(),
1342
- pnl24hPercent: z6.number().nullable().optional(),
1343
- pnl7d: z6.number().nullable().optional(),
1344
- pnl7dPercent: z6.number().nullable().optional(),
1345
- totalValueUsd: z6.number().nullable().optional()
1346
- });
1347
- groupMemberSchema = z6.object({
1348
- id: z6.string().uuid(),
1349
- role: z6.string(),
1350
- status: z6.string(),
1351
- joinedAt: z6.string(),
1352
- lastTradeAt: z6.string().nullable(),
1443
+ groupMemberAgentSchema = z7.object({
1444
+ id: z7.string().uuid(),
1445
+ name: z7.string(),
1446
+ handle: z7.string().nullable(),
1447
+ avatarUrl: z7.string().nullable(),
1448
+ verified: z7.boolean(),
1449
+ origin: z7.string().nullable().optional(),
1450
+ pnl24h: z7.number().nullable().optional(),
1451
+ pnl24hPercent: z7.number().nullable().optional(),
1452
+ pnl7d: z7.number().nullable().optional(),
1453
+ pnl7dPercent: z7.number().nullable().optional(),
1454
+ totalValueUsd: z7.number().nullable().optional()
1455
+ });
1456
+ groupMemberSchema = z7.object({
1457
+ id: z7.string().uuid(),
1458
+ role: z7.string(),
1459
+ status: z7.string(),
1460
+ joinedAt: z7.string(),
1461
+ lastTradeAt: z7.string().nullable(),
1353
1462
  agent: groupMemberAgentSchema.nullable()
1354
1463
  });
1355
- groupDetailResponseDataSchema = z6.object({
1356
- group: z6.object({
1357
- id: z6.string().uuid(),
1358
- slug: z6.string(),
1359
- name: z6.string(),
1360
- description: z6.string().nullable(),
1361
- imageUrl: z6.string().nullable(),
1362
- maxMembers: z6.number(),
1363
- minTokenBalance: z6.number(),
1364
- minFeesPaidUsd: z6.number(),
1365
- minTradesPerMonth: z6.number(),
1366
- isPublic: z6.boolean(),
1367
- tags: z6.array(z6.string()),
1368
- createdAt: z6.string(),
1369
- updatedAt: z6.string().nullable(),
1464
+ groupDetailResponseDataSchema = z7.object({
1465
+ group: z7.object({
1466
+ id: z7.string().uuid(),
1467
+ slug: z7.string(),
1468
+ name: z7.string(),
1469
+ description: z7.string().nullable(),
1470
+ imageUrl: z7.string().nullable(),
1471
+ maxMembers: z7.number(),
1472
+ minTokenBalance: z7.number(),
1473
+ minFeesPaidUsd: z7.number(),
1474
+ minTradesPerMonth: z7.number(),
1475
+ isPublic: z7.boolean(),
1476
+ tags: z7.array(z7.string()),
1477
+ createdAt: z7.string(),
1478
+ updatedAt: z7.string().nullable(),
1370
1479
  creator: groupCreatorSchema.nullable(),
1371
- stats: z6.object({
1372
- totalPnl24h: z6.number(),
1373
- totalPnl7d: z6.number(),
1374
- totalVolume: z6.number(),
1375
- totalTheses: z6.number(),
1376
- totalTrades: z6.number(),
1377
- totalMessages: z6.number(),
1378
- totalPositionUpdates: z6.number()
1480
+ stats: z7.object({
1481
+ totalPnl24h: z7.number(),
1482
+ totalPnl7d: z7.number(),
1483
+ totalVolume: z7.number(),
1484
+ totalTheses: z7.number(),
1485
+ totalTrades: z7.number(),
1486
+ totalMessages: z7.number(),
1487
+ totalPositionUpdates: z7.number()
1379
1488
  })
1380
1489
  }),
1381
- members: z6.array(groupMemberSchema),
1382
- memberCount: z6.number(),
1383
- pendingApplications: z6.number(),
1384
- userMembership: z6.object({
1385
- id: z6.string().uuid(),
1386
- role: z6.string(),
1387
- status: z6.string(),
1388
- joinedAt: z6.string(),
1389
- agentId: z6.string().uuid()
1490
+ members: z7.array(groupMemberSchema),
1491
+ memberCount: z7.number(),
1492
+ pendingApplications: z7.number(),
1493
+ userMembership: z7.object({
1494
+ id: z7.string().uuid(),
1495
+ role: z7.string(),
1496
+ status: z7.string(),
1497
+ joinedAt: z7.string(),
1498
+ agentId: z7.string().uuid()
1390
1499
  }).nullable(),
1391
- isMember: z6.boolean(),
1392
- hasPendingApplication: z6.boolean(),
1393
- canViewContent: z6.boolean()
1500
+ isMember: z7.boolean(),
1501
+ hasPendingApplication: z7.boolean(),
1502
+ canViewContent: z7.boolean()
1394
1503
  });
1395
- updateGroupResponseDataSchema = z6.object({
1396
- group: z6.object({
1397
- id: z6.string().uuid(),
1398
- slug: z6.string(),
1399
- name: z6.string(),
1400
- description: z6.string().nullable(),
1401
- maxMembers: z6.number(),
1402
- minTokenBalance: z6.number(),
1403
- isPublic: z6.boolean(),
1404
- tags: z6.array(z6.string())
1504
+ updateGroupResponseDataSchema = z7.object({
1505
+ group: z7.object({
1506
+ id: z7.string().uuid(),
1507
+ slug: z7.string(),
1508
+ name: z7.string(),
1509
+ description: z7.string().nullable(),
1510
+ maxMembers: z7.number(),
1511
+ minTokenBalance: z7.number(),
1512
+ isPublic: z7.boolean(),
1513
+ tags: z7.array(z7.string())
1405
1514
  })
1406
1515
  });
1407
- deleteGroupResponseDataSchema = z6.object({
1408
- deleted: z6.boolean(),
1409
- groupId: z6.string().uuid()
1516
+ deleteGroupResponseDataSchema = z7.object({
1517
+ deleted: z7.boolean(),
1518
+ groupId: z7.string().uuid()
1410
1519
  });
1411
- groupApplicationSchema = z6.object({
1412
- id: z6.string().uuid(),
1413
- agentId: z6.string().uuid(),
1414
- status: z6.string(),
1415
- message: z6.string().nullable(),
1416
- createdAt: z6.string(),
1417
- agent: z6.object({
1418
- id: z6.string().uuid(),
1419
- name: z6.string(),
1420
- handle: z6.string().nullable(),
1421
- avatarUrl: z6.string().nullable()
1520
+ groupApplicationSchema = z7.object({
1521
+ id: z7.string().uuid(),
1522
+ agentId: z7.string().uuid(),
1523
+ status: z7.string(),
1524
+ message: z7.string().nullable(),
1525
+ createdAt: z7.string(),
1526
+ agent: z7.object({
1527
+ id: z7.string().uuid(),
1528
+ name: z7.string(),
1529
+ handle: z7.string().nullable(),
1530
+ avatarUrl: z7.string().nullable()
1422
1531
  }).nullable().optional()
1423
1532
  }).passthrough();
1424
- listGroupApplicationsResponseDataSchema = z6.object({
1425
- applications: z6.array(groupApplicationSchema),
1426
- pagination: z6.object({
1427
- limit: z6.number(),
1428
- offset: z6.number(),
1429
- total: z6.number(),
1430
- hasMore: z6.boolean()
1533
+ listGroupApplicationsResponseDataSchema = z7.object({
1534
+ applications: z7.array(groupApplicationSchema),
1535
+ pagination: z7.object({
1536
+ limit: z7.number(),
1537
+ offset: z7.number(),
1538
+ total: z7.number(),
1539
+ hasMore: z7.boolean()
1431
1540
  }),
1432
- canDecide: z6.boolean()
1541
+ canDecide: z7.boolean()
1433
1542
  });
1434
- createGroupApplicationResponseDataSchema = z6.object({
1435
- application: z6.object({
1436
- id: z6.string().uuid(),
1437
- status: z6.string(),
1438
- createdAt: z6.string()
1543
+ createGroupApplicationResponseDataSchema = z7.object({
1544
+ application: z7.object({
1545
+ id: z7.string().uuid(),
1546
+ status: z7.string(),
1547
+ createdAt: z7.string()
1439
1548
  })
1440
1549
  });
1441
- decideGroupApplicationResponseDataSchema = z6.object({
1442
- application: z6.object({
1443
- id: z6.string().uuid(),
1444
- status: z6.string()
1550
+ decideGroupApplicationResponseDataSchema = z7.object({
1551
+ application: z7.object({
1552
+ id: z7.string().uuid(),
1553
+ status: z7.string()
1445
1554
  }),
1446
- memberAdded: z6.boolean().optional()
1555
+ memberAdded: z7.boolean().optional()
1447
1556
  });
1448
- groupLeaderboardResponseDataSchema = z6.object({
1449
- group: z6.object({
1450
- id: z6.string().uuid(),
1451
- slug: z6.string(),
1452
- name: z6.string()
1557
+ groupLeaderboardResponseDataSchema = z7.object({
1558
+ group: z7.object({
1559
+ id: z7.string().uuid(),
1560
+ slug: z7.string(),
1561
+ name: z7.string()
1453
1562
  }),
1454
- leaderboard: z6.array(z6.object({
1455
- rank: z6.number(),
1456
- agent: z6.object({
1457
- id: z6.string().uuid(),
1458
- name: z6.string(),
1459
- handle: z6.string().nullable(),
1460
- avatarUrl: z6.string().nullable(),
1461
- verified: z6.boolean()
1563
+ leaderboard: z7.array(z7.object({
1564
+ rank: z7.number(),
1565
+ agent: z7.object({
1566
+ id: z7.string().uuid(),
1567
+ name: z7.string(),
1568
+ handle: z7.string().nullable(),
1569
+ avatarUrl: z7.string().nullable(),
1570
+ verified: z7.boolean()
1462
1571
  }),
1463
- value: z6.number()
1572
+ value: z7.number()
1464
1573
  }).passthrough()),
1465
- period: z6.string(),
1466
- metric: z6.string(),
1467
- totalMembers: z6.number()
1468
- });
1469
- groupMembersResponseDataSchema = z6.object({
1470
- members: z6.array(groupMemberSchema),
1471
- total: z6.number()
1472
- });
1473
- updateGroupMemberResponseDataSchema = z6.union([
1474
- z6.object({
1475
- muted: z6.boolean(),
1476
- groupId: z6.string().uuid(),
1477
- agentId: z6.string().uuid(),
1478
- mutedUntil: z6.string().nullable()
1574
+ period: z7.string(),
1575
+ metric: z7.string(),
1576
+ totalMembers: z7.number()
1577
+ });
1578
+ groupMembersResponseDataSchema = z7.object({
1579
+ members: z7.array(groupMemberSchema),
1580
+ total: z7.number()
1581
+ });
1582
+ updateGroupMemberResponseDataSchema = z7.union([
1583
+ z7.object({
1584
+ muted: z7.boolean(),
1585
+ groupId: z7.string().uuid(),
1586
+ agentId: z7.string().uuid(),
1587
+ mutedUntil: z7.string().nullable()
1479
1588
  }),
1480
- z6.object({
1481
- unmuted: z6.boolean(),
1482
- groupId: z6.string().uuid(),
1483
- agentId: z6.string().uuid()
1589
+ z7.object({
1590
+ unmuted: z7.boolean(),
1591
+ groupId: z7.string().uuid(),
1592
+ agentId: z7.string().uuid()
1484
1593
  })
1485
1594
  ]);
1486
- deleteGroupMemberResponseDataSchema = z6.object({
1487
- removed: z6.boolean()
1595
+ deleteGroupMemberResponseDataSchema = z7.object({
1596
+ removed: z7.boolean()
1488
1597
  });
1489
- updateOwnGroupMembershipResponseDataSchema = z6.union([
1490
- z6.object({ paused: z6.boolean(), groupId: z6.string().uuid() }),
1491
- z6.object({ unpaused: z6.boolean(), groupId: z6.string().uuid() })
1598
+ updateOwnGroupMembershipResponseDataSchema = z7.union([
1599
+ z7.object({ paused: z7.boolean(), groupId: z7.string().uuid() }),
1600
+ z7.object({ unpaused: z7.boolean(), groupId: z7.string().uuid() })
1492
1601
  ]);
1493
- deleteOwnGroupMembershipResponseDataSchema = z6.object({
1494
- left: z6.boolean(),
1495
- groupId: z6.string().uuid()
1602
+ deleteOwnGroupMembershipResponseDataSchema = z7.object({
1603
+ left: z7.boolean(),
1604
+ groupId: z7.string().uuid()
1496
1605
  });
1497
- groupMessageSchema = z6.object({
1498
- id: z6.string().uuid(),
1499
- type: z6.string(),
1500
- content: z6.string(),
1501
- createdAt: z6.string(),
1502
- agent: z6.object({
1503
- id: z6.string().uuid(),
1504
- name: z6.string(),
1505
- handle: z6.string().nullable(),
1506
- avatarUrl: z6.string().nullable()
1606
+ groupMessageSchema = z7.object({
1607
+ id: z7.string().uuid(),
1608
+ type: z7.string(),
1609
+ content: z7.string(),
1610
+ createdAt: z7.string(),
1611
+ agent: z7.object({
1612
+ id: z7.string().uuid(),
1613
+ name: z7.string(),
1614
+ handle: z7.string().nullable(),
1615
+ avatarUrl: z7.string().nullable()
1507
1616
  }).nullable().optional(),
1508
- links: z6.array(z6.string()).nullable().optional()
1617
+ links: z7.array(z7.string()).nullable().optional()
1509
1618
  }).passthrough();
1510
- listGroupMessagesResponseDataSchema = z6.object({
1511
- messages: z6.array(groupMessageSchema),
1512
- pagination: z6.object({
1513
- limit: z6.number(),
1514
- hasMore: z6.boolean()
1619
+ listGroupMessagesResponseDataSchema = z7.object({
1620
+ messages: z7.array(groupMessageSchema),
1621
+ pagination: z7.object({
1622
+ limit: z7.number(),
1623
+ hasMore: z7.boolean()
1515
1624
  }).passthrough(),
1516
- count: z6.number()
1625
+ count: z7.number()
1517
1626
  });
1518
- createGroupMessageResponseDataSchema = z6.object({
1519
- message: z6.object({
1520
- id: z6.string().uuid(),
1521
- type: z6.string(),
1522
- content: z6.string(),
1523
- links: z6.array(z6.string()).nullable().optional(),
1524
- createdAt: z6.string()
1627
+ createGroupMessageResponseDataSchema = z7.object({
1628
+ message: z7.object({
1629
+ id: z7.string().uuid(),
1630
+ type: z7.string(),
1631
+ content: z7.string(),
1632
+ links: z7.array(z7.string()).nullable().optional(),
1633
+ createdAt: z7.string()
1525
1634
  })
1526
1635
  });
1527
- reactToGroupMessageResponseDataSchema = z6.object({
1528
- reaction: z6.string(),
1529
- counts: z6.object({
1530
- agree: z6.number(),
1531
- disagree: z6.number()
1636
+ reactToGroupMessageResponseDataSchema = z7.object({
1637
+ reaction: z7.string(),
1638
+ counts: z7.object({
1639
+ agree: z7.number(),
1640
+ disagree: z7.number()
1532
1641
  }),
1533
- result: z6.enum(["added", "flipped", "removed"])
1642
+ result: z7.enum(["added", "flipped", "removed"])
1534
1643
  });
1535
- removeGroupMessageReactionResponseDataSchema = z6.object({
1536
- removed: z6.boolean(),
1537
- counts: z6.object({
1538
- agree: z6.number(),
1539
- disagree: z6.number()
1644
+ removeGroupMessageReactionResponseDataSchema = z7.object({
1645
+ removed: z7.boolean(),
1646
+ counts: z7.object({
1647
+ agree: z7.number(),
1648
+ disagree: z7.number()
1540
1649
  })
1541
1650
  });
1542
- createThesisMessageResponseDataSchema = z6.object({
1543
- message: z6.object({
1544
- id: z6.string().uuid(),
1545
- type: z6.literal("thesis"),
1546
- content: z6.string(),
1547
- verifiedPosition: z6.record(z6.string(), z6.unknown()).nullable(),
1548
- createdAt: z6.string()
1651
+ createThesisMessageResponseDataSchema = z7.object({
1652
+ message: z7.object({
1653
+ id: z7.string().uuid(),
1654
+ type: z7.literal("thesis"),
1655
+ content: z7.string(),
1656
+ verifiedPosition: z7.record(z7.string(), z7.unknown()).nullable(),
1657
+ createdAt: z7.string()
1549
1658
  })
1550
1659
  });
1551
1660
  groupsListResponseSchema = successEnvelope(groupsListResponseDataSchema);
@@ -1554,284 +1663,284 @@ var init_groups = __esm(() => {
1554
1663
  });
1555
1664
 
1556
1665
  // ../../packages/client/src/schemas/tokens.ts
1557
- import { z as z7 } from "zod";
1666
+ import { z as z8 } from "zod";
1558
1667
  var tokenParamsSchema, tokenInfoSchema, tokenInfoResponseDataSchema, tokenInfoResponseSchema, tokensListQuerySchema, tokenListItemSchema, tokensListResponseDataSchema, tokensListResponseSchema, tokenLaunchRequestSchema, tokenLaunchSchema, tokenLaunchResponseDataSchema, tokenLaunchResponseSchema, tokenLaunchesQuerySchema, tokenLaunchListItemSchema, tokenLaunchesListResponseDataSchema, launchpadQuerySchema, mintAddressParamSchema, launchpadTokensResponseDataSchema, launchpadTokenDetailResponseDataSchema;
1559
1668
  var init_tokens = __esm(() => {
1560
1669
  init_common();
1561
- tokenParamsSchema = z7.object({
1562
- token: z7.string().trim().min(1, "token is required")
1563
- });
1564
- tokenInfoSchema = z7.object({
1565
- mint: z7.string(),
1566
- chain: z7.string(),
1567
- symbol: z7.string().nullable(),
1568
- name: z7.string().nullable(),
1569
- decimals: z7.number().int().nullable(),
1570
- logoUrl: z7.string().nullable(),
1571
- priceUsd: z7.number(),
1572
- priceUpdatedAt: z7.string().nullable(),
1573
- firstSeenAt: z7.string(),
1574
- createdAt: z7.string()
1575
- });
1576
- tokenInfoResponseDataSchema = z7.object({
1670
+ tokenParamsSchema = z8.object({
1671
+ token: z8.string().trim().min(1, "token is required")
1672
+ });
1673
+ tokenInfoSchema = z8.object({
1674
+ mint: z8.string(),
1675
+ chain: z8.string(),
1676
+ symbol: z8.string().nullable(),
1677
+ name: z8.string().nullable(),
1678
+ decimals: z8.number().int().nullable(),
1679
+ logoUrl: z8.string().nullable(),
1680
+ priceUsd: z8.number(),
1681
+ priceUpdatedAt: z8.string().nullable(),
1682
+ firstSeenAt: z8.string(),
1683
+ createdAt: z8.string()
1684
+ });
1685
+ tokenInfoResponseDataSchema = z8.object({
1577
1686
  token: tokenInfoSchema
1578
1687
  });
1579
1688
  tokenInfoResponseSchema = successEnvelope(tokenInfoResponseDataSchema);
1580
- tokensListQuerySchema = z7.object({
1581
- chain: z7.string().trim().min(1).optional()
1689
+ tokensListQuerySchema = z8.object({
1690
+ chain: z8.string().trim().min(1).optional()
1582
1691
  });
1583
- tokenListItemSchema = z7.object({
1584
- mint: z7.string(),
1585
- chain: z7.string(),
1586
- symbol: z7.string().nullable(),
1587
- name: z7.string().nullable(),
1588
- priceUsd: z7.number(),
1589
- priceUpdatedAt: z7.string().nullable(),
1590
- logoUrl: z7.string().nullable()
1692
+ tokenListItemSchema = z8.object({
1693
+ mint: z8.string(),
1694
+ chain: z8.string(),
1695
+ symbol: z8.string().nullable(),
1696
+ name: z8.string().nullable(),
1697
+ priceUsd: z8.number(),
1698
+ priceUpdatedAt: z8.string().nullable(),
1699
+ logoUrl: z8.string().nullable()
1591
1700
  });
1592
- tokensListResponseDataSchema = z7.object({
1593
- tokens: z7.array(tokenListItemSchema)
1701
+ tokensListResponseDataSchema = z8.object({
1702
+ tokens: z8.array(tokenListItemSchema)
1594
1703
  });
1595
1704
  tokensListResponseSchema = successEnvelope(tokensListResponseDataSchema);
1596
- tokenLaunchRequestSchema = z7.object({
1597
- name: z7.preprocess((v) => typeof v === "string" ? v.trim() : "", z7.string().min(2, "Token name must be 2-32 characters").max(32, "Token name must be 2-32 characters").refine((v) => /^[A-Za-z0-9 ]+$/.test(v), { message: "Token name must be alphanumeric" })),
1598
- symbol: z7.preprocess((v) => typeof v === "string" ? v.trim() : "", z7.string().min(2, "Token symbol must be 2-10 characters").max(10, "Token symbol must be 2-10 characters").refine((v) => /^[A-Za-z0-9]+$/.test(v), { message: "Token symbol must be alphanumeric with no spaces" })),
1599
- imageUrl: z7.string().url().optional(),
1600
- configAddress: z7.string().min(32).max(44).optional()
1601
- });
1602
- tokenLaunchSchema = z7.object({
1603
- id: z7.string().uuid().optional(),
1604
- tokenId: z7.string().uuid().optional(),
1605
- agentId: z7.string().uuid().optional(),
1606
- name: z7.string(),
1607
- symbol: z7.string(),
1608
- mintAddress: z7.string().nullable(),
1609
- poolAddress: z7.string().nullable().optional(),
1610
- agentAllocationPct: z7.number().optional(),
1611
- platformAllocationPct: z7.number().optional(),
1612
- status: z7.enum(["pending", "deploying", "deployed", "failed"]),
1613
- launchProvider: z7.string().nullable().optional(),
1614
- createdAt: z7.string().optional(),
1615
- txSignature: z7.string().nullable().optional(),
1616
- priceUsd: z7.number().nullable().optional(),
1617
- marketCapUsd: z7.number().nullable().optional(),
1618
- holders: z7.number().nullable().optional(),
1619
- deployed: z7.boolean()
1705
+ tokenLaunchRequestSchema = z8.object({
1706
+ name: z8.preprocess((v) => typeof v === "string" ? v.trim() : "", z8.string().min(2, "Token name must be 2-32 characters").max(32, "Token name must be 2-32 characters").refine((v) => /^[A-Za-z0-9 ]+$/.test(v), { message: "Token name must be alphanumeric" })),
1707
+ symbol: z8.preprocess((v) => typeof v === "string" ? v.trim() : "", z8.string().min(2, "Token symbol must be 2-10 characters").max(10, "Token symbol must be 2-10 characters").refine((v) => /^[A-Za-z0-9]+$/.test(v), { message: "Token symbol must be alphanumeric with no spaces" })),
1708
+ imageUrl: z8.string().url().optional(),
1709
+ configAddress: z8.string().min(32).max(44).optional()
1710
+ });
1711
+ tokenLaunchSchema = z8.object({
1712
+ id: z8.string().uuid().optional(),
1713
+ tokenId: z8.string().uuid().optional(),
1714
+ agentId: z8.string().uuid().optional(),
1715
+ name: z8.string(),
1716
+ symbol: z8.string(),
1717
+ mintAddress: z8.string().nullable(),
1718
+ poolAddress: z8.string().nullable().optional(),
1719
+ agentAllocationPct: z8.number().optional(),
1720
+ platformAllocationPct: z8.number().optional(),
1721
+ status: z8.enum(["pending", "deploying", "deployed", "failed"]),
1722
+ launchProvider: z8.string().nullable().optional(),
1723
+ createdAt: z8.string().optional(),
1724
+ txSignature: z8.string().nullable().optional(),
1725
+ priceUsd: z8.number().nullable().optional(),
1726
+ marketCapUsd: z8.number().nullable().optional(),
1727
+ holders: z8.number().nullable().optional(),
1728
+ deployed: z8.boolean()
1620
1729
  }).passthrough();
1621
- tokenLaunchResponseDataSchema = z7.object({
1730
+ tokenLaunchResponseDataSchema = z8.object({
1622
1731
  token: tokenLaunchSchema
1623
1732
  });
1624
1733
  tokenLaunchResponseSchema = successEnvelope(tokenLaunchResponseDataSchema);
1625
- tokenLaunchesQuerySchema = z7.object({
1626
- status: z7.enum(["deployed", "pending", "failed"]).optional(),
1627
- sort: z7.enum(["newest", "oldest", "symbol"]).default("newest"),
1628
- limit: z7.coerce.number().int().min(1).default(25).transform((v) => Math.min(v, 100)),
1629
- offset: z7.coerce.number().int().min(0).default(0)
1630
- });
1631
- tokenLaunchListItemSchema = z7.object({
1632
- id: z7.string().uuid(),
1633
- name: z7.string(),
1634
- symbol: z7.string(),
1635
- status: z7.enum(["pending", "deploying", "deployed", "failed"]),
1636
- launchProvider: z7.string().nullable(),
1637
- mintAddress: z7.string().nullable(),
1638
- poolAddress: z7.string().nullable(),
1639
- createdAt: z7.string(),
1640
- priceUsd: z7.number().nullable(),
1641
- logoUrl: z7.string().nullable(),
1642
- agent: z7.object({
1643
- id: z7.string().uuid(),
1644
- name: z7.string(),
1645
- handle: z7.string().nullable(),
1646
- avatarUrl: z7.string().nullable(),
1647
- origin: z7.string(),
1648
- verified: z7.boolean()
1734
+ tokenLaunchesQuerySchema = z8.object({
1735
+ status: z8.enum(["deployed", "pending", "failed"]).optional(),
1736
+ sort: z8.enum(["newest", "oldest", "symbol"]).default("newest"),
1737
+ limit: z8.coerce.number().int().min(1).default(25).transform((v) => Math.min(v, 100)),
1738
+ offset: z8.coerce.number().int().min(0).default(0)
1739
+ });
1740
+ tokenLaunchListItemSchema = z8.object({
1741
+ id: z8.string().uuid(),
1742
+ name: z8.string(),
1743
+ symbol: z8.string(),
1744
+ status: z8.enum(["pending", "deploying", "deployed", "failed"]),
1745
+ launchProvider: z8.string().nullable(),
1746
+ mintAddress: z8.string().nullable(),
1747
+ poolAddress: z8.string().nullable(),
1748
+ createdAt: z8.string(),
1749
+ priceUsd: z8.number().nullable(),
1750
+ logoUrl: z8.string().nullable(),
1751
+ agent: z8.object({
1752
+ id: z8.string().uuid(),
1753
+ name: z8.string(),
1754
+ handle: z8.string().nullable(),
1755
+ avatarUrl: z8.string().nullable(),
1756
+ origin: z8.string(),
1757
+ verified: z8.boolean()
1649
1758
  })
1650
1759
  });
1651
- tokenLaunchesListResponseDataSchema = z7.object({
1652
- tokenLaunches: z7.array(tokenLaunchListItemSchema),
1653
- pagination: z7.object({
1654
- limit: z7.number(),
1655
- offset: z7.number(),
1656
- total: z7.number(),
1657
- hasMore: z7.boolean()
1760
+ tokenLaunchesListResponseDataSchema = z8.object({
1761
+ tokenLaunches: z8.array(tokenLaunchListItemSchema),
1762
+ pagination: z8.object({
1763
+ limit: z8.number(),
1764
+ offset: z8.number(),
1765
+ total: z8.number(),
1766
+ hasMore: z8.boolean()
1658
1767
  })
1659
1768
  });
1660
- launchpadQuerySchema = z7.object({
1661
- sort: z7.enum(["newest", "marketCap", "volume"]).default("newest"),
1662
- filter: z7.enum(["all", "bonding", "graduated"]).default("all"),
1663
- limit: z7.coerce.number().int().min(1).max(100).default(50),
1664
- offset: z7.coerce.number().int().min(0).default(0)
1769
+ launchpadQuerySchema = z8.object({
1770
+ sort: z8.enum(["newest", "marketCap", "volume"]).default("newest"),
1771
+ filter: z8.enum(["all", "bonding", "graduated"]).default("all"),
1772
+ limit: z8.coerce.number().int().min(1).max(100).default(50),
1773
+ offset: z8.coerce.number().int().min(0).default(0)
1665
1774
  });
1666
- mintAddressParamSchema = z7.object({
1667
- mintAddress: z7.string().trim().min(1, "mintAddress is required")
1775
+ mintAddressParamSchema = z8.object({
1776
+ mintAddress: z8.string().trim().min(1, "mintAddress is required")
1668
1777
  });
1669
- launchpadTokensResponseDataSchema = z7.object({
1670
- tokens: z7.array(z7.object({
1671
- id: z7.string().uuid(),
1672
- name: z7.string(),
1673
- symbol: z7.string(),
1674
- mintAddress: z7.string().nullable(),
1675
- poolAddress: z7.string().nullable(),
1676
- createdAt: z7.string(),
1677
- priceUsd: z7.number().nullable(),
1678
- logoUrl: z7.string().nullable(),
1679
- marketCap: z7.number(),
1680
- bondingCurveProgress: z7.number(),
1681
- volume24h: z7.number(),
1682
- agent: z7.object({
1683
- id: z7.string().uuid(),
1684
- name: z7.string(),
1685
- handle: z7.string().nullable(),
1686
- avatarUrl: z7.string().nullable()
1778
+ launchpadTokensResponseDataSchema = z8.object({
1779
+ tokens: z8.array(z8.object({
1780
+ id: z8.string().uuid(),
1781
+ name: z8.string(),
1782
+ symbol: z8.string(),
1783
+ mintAddress: z8.string().nullable(),
1784
+ poolAddress: z8.string().nullable(),
1785
+ createdAt: z8.string(),
1786
+ priceUsd: z8.number().nullable(),
1787
+ logoUrl: z8.string().nullable(),
1788
+ marketCap: z8.number(),
1789
+ bondingCurveProgress: z8.number(),
1790
+ volume24h: z8.number(),
1791
+ agent: z8.object({
1792
+ id: z8.string().uuid(),
1793
+ name: z8.string(),
1794
+ handle: z8.string().nullable(),
1795
+ avatarUrl: z8.string().nullable()
1687
1796
  })
1688
1797
  })),
1689
- pagination: z7.object({ limit: z7.number(), offset: z7.number() })
1798
+ pagination: z8.object({ limit: z8.number(), offset: z8.number() })
1690
1799
  });
1691
- launchpadTokenDetailResponseDataSchema = z7.object({
1692
- token: z7.object({
1693
- id: z7.string().uuid(),
1694
- name: z7.string(),
1695
- symbol: z7.string(),
1696
- mintAddress: z7.string().nullable(),
1697
- poolAddress: z7.string().nullable(),
1698
- txSignature: z7.string().nullable(),
1699
- agentAllocationPct: z7.number(),
1700
- platformAllocationPct: z7.number(),
1701
- createdAt: z7.string(),
1702
- priceUsd: z7.number().nullable(),
1703
- logoUrl: z7.string().nullable(),
1704
- chain: z7.string().nullable(),
1705
- decimals: z7.number().nullable(),
1706
- marketCap: z7.number(),
1707
- bondingCurveProgress: z7.number(),
1708
- volume24h: z7.number(),
1709
- agent: z7.object({
1710
- id: z7.string().uuid(),
1711
- name: z7.string(),
1712
- handle: z7.string().nullable(),
1713
- avatarUrl: z7.string().nullable(),
1714
- origin: z7.string().nullable()
1800
+ launchpadTokenDetailResponseDataSchema = z8.object({
1801
+ token: z8.object({
1802
+ id: z8.string().uuid(),
1803
+ name: z8.string(),
1804
+ symbol: z8.string(),
1805
+ mintAddress: z8.string().nullable(),
1806
+ poolAddress: z8.string().nullable(),
1807
+ txSignature: z8.string().nullable(),
1808
+ agentAllocationPct: z8.number(),
1809
+ platformAllocationPct: z8.number(),
1810
+ createdAt: z8.string(),
1811
+ priceUsd: z8.number().nullable(),
1812
+ logoUrl: z8.string().nullable(),
1813
+ chain: z8.string().nullable(),
1814
+ decimals: z8.number().nullable(),
1815
+ marketCap: z8.number(),
1816
+ bondingCurveProgress: z8.number(),
1817
+ volume24h: z8.number(),
1818
+ agent: z8.object({
1819
+ id: z8.string().uuid(),
1820
+ name: z8.string(),
1821
+ handle: z8.string().nullable(),
1822
+ avatarUrl: z8.string().nullable(),
1823
+ origin: z8.string().nullable()
1715
1824
  })
1716
1825
  }),
1717
- recentTrades: z7.array(z7.object({
1718
- id: z7.string().uuid(),
1719
- agentId: z7.string().uuid(),
1720
- positionAction: z7.string(),
1721
- positionSide: z7.string(),
1722
- amount: z7.number(),
1723
- priceUsd: z7.number(),
1724
- valueUsd: z7.number(),
1725
- timestamp: z7.string(),
1726
- txSignature: z7.string().nullable()
1826
+ recentTrades: z8.array(z8.object({
1827
+ id: z8.string().uuid(),
1828
+ agentId: z8.string().uuid(),
1829
+ positionAction: z8.string(),
1830
+ positionSide: z8.string(),
1831
+ amount: z8.number(),
1832
+ priceUsd: z8.number(),
1833
+ valueUsd: z8.number(),
1834
+ timestamp: z8.string(),
1835
+ txSignature: z8.string().nullable()
1727
1836
  }))
1728
1837
  });
1729
1838
  });
1730
1839
 
1731
1840
  // ../../packages/client/src/schemas/leaderboard.ts
1732
- import { z as z8 } from "zod";
1841
+ import { z as z9 } from "zod";
1733
1842
  var leaderboardEntrySchema, getLeaderboardResponseDataSchema, getLeaderboardResponseSchema, leaderboardQuerySchema, leaderboardGroupsQuerySchema, leaderboardModelsQuerySchema, leaderboardGroupCreatorSchema, leaderboardGroupEntrySchema, getLeaderboardGroupsResponseDataSchema, leaderboardModelTopAgentSchema, leaderboardModelEntrySchema, getLeaderboardModelsResponseDataSchema, getLeaderboardGroupsResponseSchema, getLeaderboardModelsResponseSchema;
1734
1843
  var init_leaderboard = __esm(() => {
1735
1844
  init_common();
1736
- leaderboardEntrySchema = z8.object({
1737
- rank: z8.number(),
1738
- agent: z8.object({
1739
- id: z8.string().uuid(),
1740
- name: z8.string(),
1741
- handle: z8.string().nullable(),
1742
- avatar: z8.string().nullable(),
1743
- strategy: z8.string().nullable(),
1744
- verified: z8.boolean(),
1745
- currentModel: z8.string().nullable(),
1746
- origin: z8.string().nullable()
1845
+ leaderboardEntrySchema = z9.object({
1846
+ rank: z9.number(),
1847
+ agent: z9.object({
1848
+ id: z9.string().uuid(),
1849
+ name: z9.string(),
1850
+ handle: z9.string().nullable(),
1851
+ avatar: z9.string().nullable(),
1852
+ strategy: z9.string().nullable(),
1853
+ verified: z9.boolean(),
1854
+ currentModel: z9.string().nullable(),
1855
+ origin: z9.string().nullable()
1747
1856
  }),
1748
- pnl24h: z8.number().nullable(),
1749
- pnl24hPercent: z8.number().nullable(),
1750
- pnl7d: z8.number().nullable(),
1751
- pnl7dPercent: z8.number().nullable(),
1752
- pnlAllTime: z8.number().nullable(),
1753
- pnlAllTimePercent: z8.number().nullable(),
1754
- totalValue: z8.number().nullable()
1755
- });
1756
- getLeaderboardResponseDataSchema = z8.object({
1757
- leaderboard: z8.array(leaderboardEntrySchema),
1758
- pagination: z8.object({
1759
- limit: z8.number(),
1760
- offset: z8.number(),
1761
- total: z8.number(),
1762
- hasMore: z8.boolean()
1857
+ pnl24h: z9.number().nullable(),
1858
+ pnl24hPercent: z9.number().nullable(),
1859
+ pnl7d: z9.number().nullable(),
1860
+ pnl7dPercent: z9.number().nullable(),
1861
+ pnlAllTime: z9.number().nullable(),
1862
+ pnlAllTimePercent: z9.number().nullable(),
1863
+ totalValue: z9.number().nullable()
1864
+ });
1865
+ getLeaderboardResponseDataSchema = z9.object({
1866
+ leaderboard: z9.array(leaderboardEntrySchema),
1867
+ pagination: z9.object({
1868
+ limit: z9.number(),
1869
+ offset: z9.number(),
1870
+ total: z9.number(),
1871
+ hasMore: z9.boolean()
1763
1872
  })
1764
1873
  });
1765
1874
  getLeaderboardResponseSchema = successEnvelope(getLeaderboardResponseDataSchema);
1766
- leaderboardQuerySchema = z8.object({
1767
- sort: z8.enum(["pnl_24h", "pnl_7d", "pnl_all", "volume"]).default("pnl_24h"),
1768
- limit: z8.coerce.number().int().min(1).default(50).transform((value) => Math.min(value, 100)),
1769
- offset: z8.coerce.number().int().min(0).default(0),
1770
- origin: z8.enum(["user", "incubator"]).optional()
1771
- });
1772
- leaderboardGroupsQuerySchema = z8.object({
1773
- limit: z8.coerce.number().int().min(1).default(25).transform((value) => Math.min(value, 100)),
1774
- offset: z8.coerce.number().int().min(0).default(0),
1775
- period: z8.enum(["24h", "7d", "30d", "all"]).default("7d")
1776
- });
1777
- leaderboardModelsQuerySchema = z8.object({
1778
- sort: z8.enum(["pnl_24h", "pnl_7d", "trade_count"]).default("pnl_24h")
1779
- });
1780
- leaderboardGroupCreatorSchema = z8.object({
1781
- id: z8.string(),
1782
- name: z8.string(),
1783
- handle: z8.string().nullable(),
1784
- avatarUrl: z8.string().nullable(),
1785
- verified: z8.boolean()
1786
- });
1787
- leaderboardGroupEntrySchema = z8.object({
1788
- rank: z8.number(),
1789
- id: z8.string(),
1790
- slug: z8.string(),
1791
- name: z8.string(),
1792
- description: z8.string().nullable(),
1793
- tags: z8.array(z8.string()).nullable(),
1794
- memberCount: z8.number(),
1795
- totalVolume: z8.number(),
1796
- totalFees: z8.number(),
1797
- avgPnlPercent: z8.number(),
1798
- weightedPnlPercent: z8.number(),
1875
+ leaderboardQuerySchema = z9.object({
1876
+ sort: z9.enum(["pnl_24h", "pnl_7d", "pnl_all", "volume"]).default("pnl_24h"),
1877
+ limit: z9.coerce.number().int().min(1).default(50).transform((value) => Math.min(value, 100)),
1878
+ offset: z9.coerce.number().int().min(0).default(0),
1879
+ origin: z9.enum(["user", "incubator"]).optional()
1880
+ });
1881
+ leaderboardGroupsQuerySchema = z9.object({
1882
+ limit: z9.coerce.number().int().min(1).default(25).transform((value) => Math.min(value, 100)),
1883
+ offset: z9.coerce.number().int().min(0).default(0),
1884
+ period: z9.enum(["24h", "7d", "30d", "all"]).default("7d")
1885
+ });
1886
+ leaderboardModelsQuerySchema = z9.object({
1887
+ sort: z9.enum(["pnl_24h", "pnl_7d", "trade_count"]).default("pnl_24h")
1888
+ });
1889
+ leaderboardGroupCreatorSchema = z9.object({
1890
+ id: z9.string(),
1891
+ name: z9.string(),
1892
+ handle: z9.string().nullable(),
1893
+ avatarUrl: z9.string().nullable(),
1894
+ verified: z9.boolean()
1895
+ });
1896
+ leaderboardGroupEntrySchema = z9.object({
1897
+ rank: z9.number(),
1898
+ id: z9.string(),
1899
+ slug: z9.string(),
1900
+ name: z9.string(),
1901
+ description: z9.string().nullable(),
1902
+ tags: z9.array(z9.string()).nullable(),
1903
+ memberCount: z9.number(),
1904
+ totalVolume: z9.number(),
1905
+ totalFees: z9.number(),
1906
+ avgPnlPercent: z9.number(),
1907
+ weightedPnlPercent: z9.number(),
1799
1908
  creator: leaderboardGroupCreatorSchema.nullable()
1800
1909
  });
1801
- getLeaderboardGroupsResponseDataSchema = z8.object({
1802
- leaderboard: z8.array(leaderboardGroupEntrySchema),
1803
- period: z8.enum(["24h", "7d", "30d", "all"]),
1804
- pagination: z8.object({
1805
- limit: z8.number(),
1806
- offset: z8.number(),
1807
- total: z8.number(),
1808
- hasMore: z8.boolean()
1910
+ getLeaderboardGroupsResponseDataSchema = z9.object({
1911
+ leaderboard: z9.array(leaderboardGroupEntrySchema),
1912
+ period: z9.enum(["24h", "7d", "30d", "all"]),
1913
+ pagination: z9.object({
1914
+ limit: z9.number(),
1915
+ offset: z9.number(),
1916
+ total: z9.number(),
1917
+ hasMore: z9.boolean()
1809
1918
  })
1810
1919
  });
1811
- leaderboardModelTopAgentSchema = z8.object({
1812
- name: z8.string(),
1813
- pnl24h: z8.number()
1814
- });
1815
- leaderboardModelEntrySchema = z8.object({
1816
- rank: z8.number(),
1817
- model: z8.string(),
1818
- agentCount: z8.number(),
1819
- tradeCount: z8.number(),
1820
- totalPnl24h: z8.number(),
1821
- avgPnl24h: z8.number(),
1822
- totalPnl7d: z8.number(),
1823
- avgPnl7d: z8.number(),
1920
+ leaderboardModelTopAgentSchema = z9.object({
1921
+ name: z9.string(),
1922
+ pnl24h: z9.number()
1923
+ });
1924
+ leaderboardModelEntrySchema = z9.object({
1925
+ rank: z9.number(),
1926
+ model: z9.string(),
1927
+ agentCount: z9.number(),
1928
+ tradeCount: z9.number(),
1929
+ totalPnl24h: z9.number(),
1930
+ avgPnl24h: z9.number(),
1931
+ totalPnl7d: z9.number(),
1932
+ avgPnl7d: z9.number(),
1824
1933
  topAgent: leaderboardModelTopAgentSchema.nullable()
1825
1934
  });
1826
- getLeaderboardModelsResponseDataSchema = z8.object({
1827
- models: z8.array(leaderboardModelEntrySchema)
1935
+ getLeaderboardModelsResponseDataSchema = z9.object({
1936
+ models: z9.array(leaderboardModelEntrySchema)
1828
1937
  });
1829
1938
  getLeaderboardGroupsResponseSchema = successEnvelope(getLeaderboardGroupsResponseDataSchema);
1830
1939
  getLeaderboardModelsResponseSchema = successEnvelope(getLeaderboardModelsResponseDataSchema);
1831
1940
  });
1832
1941
 
1833
1942
  // ../../packages/client/src/schemas/data-marketplace.ts
1834
- import { z as z9 } from "zod";
1943
+ import { z as z10 } from "zod";
1835
1944
  var DATA_MARKETPLACE_CATEGORIES, DATA_MARKETPLACE_PAYMENT_METHODS, dataMarketplaceListQuerySchema, dataMarketplaceProviderParamsSchema, dataMarketplaceCreateRequestSchema, dataMarketplaceProviderListItemSchema, dataMarketplaceCreateProviderSchema, dataMarketplaceProviderDetailSchema, dataMarketplaceListResponseDataSchema, dataMarketplaceCreateResponseDataSchema, dataMarketplaceProviderDetailResponseDataSchema, dataMarketplaceListResponseSchema, dataMarketplaceCreateResponseSchema, dataMarketplaceProviderDetailResponseSchema;
1836
1945
  var init_data_marketplace = __esm(() => {
1837
1946
  init_common();
@@ -1848,73 +1957,73 @@ var init_data_marketplace = __esm(() => {
1848
1957
  "lightning",
1849
1958
  "solana_pay"
1850
1959
  ];
1851
- dataMarketplaceListQuerySchema = z9.object({
1852
- category: z9.enum(DATA_MARKETPLACE_CATEGORIES).optional()
1853
- });
1854
- dataMarketplaceProviderParamsSchema = z9.object({
1855
- id: z9.string().uuid()
1856
- });
1857
- dataMarketplaceCreateRequestSchema = z9.object({
1858
- name: z9.string().trim().min(1).max(200),
1859
- description: z9.string().trim().min(1).max(5000),
1860
- category: z9.enum(DATA_MARKETPLACE_CATEGORIES),
1861
- endpointUrl: z9.url(),
1862
- costPerRequestUsd: z9.number().min(0),
1863
- paymentMethod: z9.enum(DATA_MARKETPLACE_PAYMENT_METHODS),
1864
- exampleRequest: z9.string().trim().min(1).max(1e4).optional(),
1865
- exampleResponse: z9.string().trim().min(1).max(1e4).optional(),
1866
- submittedBy: z9.string().optional()
1867
- });
1868
- dataMarketplaceProviderListItemSchema = z9.object({
1869
- id: z9.string().min(1),
1870
- name: z9.string(),
1871
- description: z9.string(),
1872
- category: z9.string(),
1873
- endpointUrl: z9.string().url(),
1874
- costPerRequestUsd: z9.number(),
1875
- paymentMethod: z9.string(),
1876
- exampleRequest: z9.string().nullable(),
1877
- exampleResponse: z9.string().nullable(),
1878
- verified: z9.boolean(),
1879
- verifiedCallCount: z9.number(),
1880
- createdAt: z9.string()
1881
- });
1882
- dataMarketplaceCreateProviderSchema = z9.object({
1883
- id: z9.string().min(1),
1884
- name: z9.string(),
1885
- description: z9.string(),
1886
- category: z9.string(),
1887
- endpointUrl: z9.string().url(),
1888
- costPerRequestUsd: z9.number(),
1889
- paymentMethod: z9.string(),
1890
- verified: z9.boolean(),
1891
- active: z9.boolean(),
1892
- createdAt: z9.string()
1893
- });
1894
- dataMarketplaceProviderDetailSchema = z9.object({
1895
- id: z9.string().min(1),
1896
- name: z9.string(),
1897
- description: z9.string(),
1898
- category: z9.string(),
1899
- endpointUrl: z9.string().url(),
1900
- costPerRequestUsd: z9.number(),
1901
- paymentMethod: z9.string(),
1902
- exampleRequest: z9.string().nullable().optional(),
1903
- exampleResponse: z9.string().nullable().optional(),
1904
- verified: z9.boolean(),
1905
- verifiedCallCount: z9.number().optional(),
1906
- active: z9.boolean().optional(),
1907
- createdAt: z9.string().optional()
1908
- });
1909
- dataMarketplaceListResponseDataSchema = z9.object({
1910
- providers: z9.array(dataMarketplaceProviderListItemSchema),
1911
- count: z9.number().int().nonnegative()
1912
- });
1913
- dataMarketplaceCreateResponseDataSchema = z9.object({
1960
+ dataMarketplaceListQuerySchema = z10.object({
1961
+ category: z10.enum(DATA_MARKETPLACE_CATEGORIES).optional()
1962
+ });
1963
+ dataMarketplaceProviderParamsSchema = z10.object({
1964
+ id: z10.string().uuid()
1965
+ });
1966
+ dataMarketplaceCreateRequestSchema = z10.object({
1967
+ name: z10.string().trim().min(1).max(200),
1968
+ description: z10.string().trim().min(1).max(5000),
1969
+ category: z10.enum(DATA_MARKETPLACE_CATEGORIES),
1970
+ endpointUrl: z10.url(),
1971
+ costPerRequestUsd: z10.number().min(0),
1972
+ paymentMethod: z10.enum(DATA_MARKETPLACE_PAYMENT_METHODS),
1973
+ exampleRequest: z10.string().trim().min(1).max(1e4).optional(),
1974
+ exampleResponse: z10.string().trim().min(1).max(1e4).optional(),
1975
+ submittedBy: z10.string().optional()
1976
+ });
1977
+ dataMarketplaceProviderListItemSchema = z10.object({
1978
+ id: z10.string().min(1),
1979
+ name: z10.string(),
1980
+ description: z10.string(),
1981
+ category: z10.string(),
1982
+ endpointUrl: z10.string().url(),
1983
+ costPerRequestUsd: z10.number(),
1984
+ paymentMethod: z10.string(),
1985
+ exampleRequest: z10.string().nullable(),
1986
+ exampleResponse: z10.string().nullable(),
1987
+ verified: z10.boolean(),
1988
+ verifiedCallCount: z10.number(),
1989
+ createdAt: z10.string()
1990
+ });
1991
+ dataMarketplaceCreateProviderSchema = z10.object({
1992
+ id: z10.string().min(1),
1993
+ name: z10.string(),
1994
+ description: z10.string(),
1995
+ category: z10.string(),
1996
+ endpointUrl: z10.string().url(),
1997
+ costPerRequestUsd: z10.number(),
1998
+ paymentMethod: z10.string(),
1999
+ verified: z10.boolean(),
2000
+ active: z10.boolean(),
2001
+ createdAt: z10.string()
2002
+ });
2003
+ dataMarketplaceProviderDetailSchema = z10.object({
2004
+ id: z10.string().min(1),
2005
+ name: z10.string(),
2006
+ description: z10.string(),
2007
+ category: z10.string(),
2008
+ endpointUrl: z10.string().url(),
2009
+ costPerRequestUsd: z10.number(),
2010
+ paymentMethod: z10.string(),
2011
+ exampleRequest: z10.string().nullable().optional(),
2012
+ exampleResponse: z10.string().nullable().optional(),
2013
+ verified: z10.boolean(),
2014
+ verifiedCallCount: z10.number().optional(),
2015
+ active: z10.boolean().optional(),
2016
+ createdAt: z10.string().optional()
2017
+ });
2018
+ dataMarketplaceListResponseDataSchema = z10.object({
2019
+ providers: z10.array(dataMarketplaceProviderListItemSchema),
2020
+ count: z10.number().int().nonnegative()
2021
+ });
2022
+ dataMarketplaceCreateResponseDataSchema = z10.object({
1914
2023
  provider: dataMarketplaceCreateProviderSchema,
1915
- message: z9.string()
2024
+ message: z10.string()
1916
2025
  });
1917
- dataMarketplaceProviderDetailResponseDataSchema = z9.object({
2026
+ dataMarketplaceProviderDetailResponseDataSchema = z10.object({
1918
2027
  provider: dataMarketplaceProviderDetailSchema
1919
2028
  });
1920
2029
  dataMarketplaceListResponseSchema = successEnvelope(dataMarketplaceListResponseDataSchema);
@@ -1923,9 +2032,9 @@ var init_data_marketplace = __esm(() => {
1923
2032
  });
1924
2033
 
1925
2034
  // ../../packages/client/src/schemas/media.ts
1926
- import { z as z10 } from "zod";
2035
+ import { z as z11 } from "zod";
1927
2036
  function requiredString2(field, message = `Missing required field: ${field}`) {
1928
- return z10.preprocess((value) => typeof value === "string" ? value.trim() : "", z10.string().min(1, { message }));
2037
+ return z11.preprocess((value) => typeof value === "string" ? value.trim() : "", z11.string().min(1, { message }));
1929
2038
  }
1930
2039
  var missingPresignMessage = "Missing required fields: filename, contentType", MEDIA_UPLOAD_IMAGE_TYPES, MEDIA_UPLOAD_VIDEO_TYPES, MEDIA_UPLOAD_CONTENT_TYPES, contentTypeSet, mediaUploadPresignRequestSchema, mediaUploadResponseDataSchema, mediaUploadResponseSchema, avatarGenerateRequestSchema, avatarGenerateResponseDataSchema, avatarCreditsResponseDataSchema, avatarSelectRequestSchema, avatarSelectResponseDataSchema, mediaGenerateImageRequestSchema, mediaGenerateImageResponseDataSchema, mediaGenerateImageResponseSchema, mediaGenerateVideoRequestSchema, mediaGenerateVideoResponseDataSchema, mediaGenerateVideoResponseSchema, mediaVideoJobParamsSchema, mediaVideoJobResponseDataSchema, mediaVideoJobResponseSchema, mediaImagesInfoResponseDataSchema, mediaVideosInfoResponseDataSchema, mediaImagesInfoResponseSchema, mediaVideosInfoResponseSchema;
1931
2040
  var init_media = __esm(() => {
@@ -1945,159 +2054,159 @@ var init_media = __esm(() => {
1945
2054
  ...MEDIA_UPLOAD_VIDEO_TYPES
1946
2055
  ];
1947
2056
  contentTypeSet = new Set(MEDIA_UPLOAD_CONTENT_TYPES);
1948
- mediaUploadPresignRequestSchema = z10.object({
2057
+ mediaUploadPresignRequestSchema = z11.object({
1949
2058
  filename: requiredString2("filename", missingPresignMessage),
1950
2059
  contentType: requiredString2("contentType", missingPresignMessage).refine((value) => contentTypeSet.has(value), { message: "Invalid content type" })
1951
2060
  });
1952
- mediaUploadResponseDataSchema = z10.object({
1953
- key: z10.string(),
1954
- url: z10.string().url().optional(),
1955
- avatarUrl: z10.string().url().optional(),
1956
- uploadUrl: z10.string().url().optional(),
1957
- imageUrl: z10.string().url().optional(),
1958
- videoUrl: z10.string().url().optional(),
1959
- maxSizeBytes: z10.number().int().positive().optional(),
1960
- contentType: z10.string().optional(),
1961
- expiresAt: z10.string().optional(),
1962
- instructions: z10.string().optional()
2061
+ mediaUploadResponseDataSchema = z11.object({
2062
+ key: z11.string(),
2063
+ url: z11.string().url().optional(),
2064
+ avatarUrl: z11.string().url().optional(),
2065
+ uploadUrl: z11.string().url().optional(),
2066
+ imageUrl: z11.string().url().optional(),
2067
+ videoUrl: z11.string().url().optional(),
2068
+ maxSizeBytes: z11.number().int().positive().optional(),
2069
+ contentType: z11.string().optional(),
2070
+ expiresAt: z11.string().optional(),
2071
+ instructions: z11.string().optional()
1963
2072
  }).passthrough();
1964
2073
  mediaUploadResponseSchema = successEnvelope(mediaUploadResponseDataSchema);
1965
- avatarGenerateRequestSchema = z10.object({
1966
- prompt: z10.string().min(1).max(2000)
1967
- });
1968
- avatarGenerateResponseDataSchema = z10.object({
1969
- generationId: z10.string().uuid().nullable(),
1970
- imageUrl: z10.string().url(),
1971
- creditsRemaining: z10.number()
1972
- });
1973
- avatarCreditsResponseDataSchema = z10.object({
1974
- creditsTotal: z10.number(),
1975
- creditsUsed: z10.number(),
1976
- creditsRemaining: z10.number(),
1977
- generations: z10.array(z10.object({
1978
- id: z10.string().uuid(),
1979
- imageUrl: z10.string().url().nullable(),
1980
- selected: z10.boolean().nullable(),
1981
- createdAt: z10.string()
2074
+ avatarGenerateRequestSchema = z11.object({
2075
+ prompt: z11.string().min(1).max(2000)
2076
+ });
2077
+ avatarGenerateResponseDataSchema = z11.object({
2078
+ generationId: z11.string().uuid().nullable(),
2079
+ imageUrl: z11.string().url(),
2080
+ creditsRemaining: z11.number()
2081
+ });
2082
+ avatarCreditsResponseDataSchema = z11.object({
2083
+ creditsTotal: z11.number(),
2084
+ creditsUsed: z11.number(),
2085
+ creditsRemaining: z11.number(),
2086
+ generations: z11.array(z11.object({
2087
+ id: z11.string().uuid(),
2088
+ imageUrl: z11.string().url().nullable(),
2089
+ selected: z11.boolean().nullable(),
2090
+ createdAt: z11.string()
1982
2091
  }).passthrough())
1983
2092
  });
1984
- avatarSelectRequestSchema = z10.object({
1985
- generationId: z10.string().uuid()
2093
+ avatarSelectRequestSchema = z11.object({
2094
+ generationId: z11.string().uuid()
1986
2095
  });
1987
- avatarSelectResponseDataSchema = z10.object({
1988
- avatarUrl: z10.string().url(),
1989
- generationId: z10.string().uuid()
2096
+ avatarSelectResponseDataSchema = z11.object({
2097
+ avatarUrl: z11.string().url(),
2098
+ generationId: z11.string().uuid()
1990
2099
  });
1991
- mediaGenerateImageRequestSchema = z10.object({
2100
+ mediaGenerateImageRequestSchema = z11.object({
1992
2101
  tradeId: requiredString2("tradeId"),
1993
2102
  prompt: requiredString2("prompt").refine((value) => value.length <= 2000, {
1994
2103
  message: "Prompt must be a string with max 2000 characters"
1995
2104
  }),
1996
- aspectRatio: z10.enum(["16:9", "4:3", "1:1", "3:4", "9:16"]).optional()
2105
+ aspectRatio: z11.enum(["16:9", "4:3", "1:1", "3:4", "9:16"]).optional()
1997
2106
  });
1998
- mediaGenerateImageResponseDataSchema = z10.object({
1999
- jobId: z10.string().uuid().nullable(),
2000
- imageUrl: z10.string().url(),
2001
- aspectRatio: z10.string(),
2002
- cost: z10.number(),
2003
- tradeId: z10.string()
2107
+ mediaGenerateImageResponseDataSchema = z11.object({
2108
+ jobId: z11.string().uuid().nullable(),
2109
+ imageUrl: z11.string().url(),
2110
+ aspectRatio: z11.string(),
2111
+ cost: z11.number(),
2112
+ tradeId: z11.string()
2004
2113
  });
2005
2114
  mediaGenerateImageResponseSchema = successEnvelope(mediaGenerateImageResponseDataSchema);
2006
- mediaGenerateVideoRequestSchema = z10.object({
2007
- tradeId: z10.string().uuid().optional(),
2008
- tokenId: z10.string().uuid().optional(),
2009
- prompt: z10.string().max(1e4).optional(),
2010
- aspectRatio: z10.enum(["landscape", "portrait", "16:9", "4:3", "1:1", "3:4", "9:16"]).optional(),
2011
- imagePrompt: z10.string().max(2000).optional(),
2012
- firstFrameUrl: z10.string().url().optional()
2115
+ mediaGenerateVideoRequestSchema = z11.object({
2116
+ tradeId: z11.string().uuid().optional(),
2117
+ tokenId: z11.string().uuid().optional(),
2118
+ prompt: z11.string().max(1e4).optional(),
2119
+ aspectRatio: z11.enum(["landscape", "portrait", "16:9", "4:3", "1:1", "3:4", "9:16"]).optional(),
2120
+ imagePrompt: z11.string().max(2000).optional(),
2121
+ firstFrameUrl: z11.string().url().optional()
2013
2122
  }).refine((data) => data.tradeId || data.tokenId, { message: "Either tradeId or tokenId is required", path: ["tradeId"] });
2014
- mediaGenerateVideoResponseDataSchema = z10.object({
2015
- jobId: z10.string().uuid(),
2016
- status: z10.string(),
2017
- mediaType: z10.string(),
2018
- provider: z10.string(),
2019
- duration: z10.number(),
2020
- cost: z10.number(),
2021
- note: z10.string()
2123
+ mediaGenerateVideoResponseDataSchema = z11.object({
2124
+ jobId: z11.string().uuid(),
2125
+ status: z11.string(),
2126
+ mediaType: z11.string(),
2127
+ provider: z11.string(),
2128
+ duration: z11.number(),
2129
+ cost: z11.number(),
2130
+ note: z11.string()
2022
2131
  });
2023
2132
  mediaGenerateVideoResponseSchema = successEnvelope(mediaGenerateVideoResponseDataSchema);
2024
- mediaVideoJobParamsSchema = z10.object({
2133
+ mediaVideoJobParamsSchema = z11.object({
2025
2134
  jobId: requiredString2("jobId")
2026
2135
  });
2027
- mediaVideoJobResponseDataSchema = z10.object({
2028
- jobId: z10.string(),
2029
- status: z10.string(),
2030
- mediaType: z10.string(),
2031
- tradeId: z10.string().nullable(),
2032
- tokenId: z10.string().nullable().optional(),
2033
- provider: z10.string().optional(),
2034
- requestedDuration: z10.number(),
2035
- actualDuration: z10.number().optional(),
2036
- createdAt: z10.string(),
2037
- startedAt: z10.string().optional(),
2038
- completedAt: z10.string().optional(),
2039
- videoUrl: z10.string().url().nullable().optional(),
2040
- costUsd: z10.number().nullable().optional(),
2041
- errorMessage: z10.string().nullable().optional(),
2042
- fallbackImageUrl: z10.string().url().optional(),
2043
- firstFrameImageUrl: z10.string().url().nullable().optional()
2136
+ mediaVideoJobResponseDataSchema = z11.object({
2137
+ jobId: z11.string(),
2138
+ status: z11.string(),
2139
+ mediaType: z11.string(),
2140
+ tradeId: z11.string().nullable(),
2141
+ tokenId: z11.string().nullable().optional(),
2142
+ provider: z11.string().optional(),
2143
+ requestedDuration: z11.number(),
2144
+ actualDuration: z11.number().optional(),
2145
+ createdAt: z11.string(),
2146
+ startedAt: z11.string().optional(),
2147
+ completedAt: z11.string().optional(),
2148
+ videoUrl: z11.string().url().nullable().optional(),
2149
+ costUsd: z11.number().nullable().optional(),
2150
+ errorMessage: z11.string().nullable().optional(),
2151
+ fallbackImageUrl: z11.string().url().optional(),
2152
+ firstFrameImageUrl: z11.string().url().nullable().optional()
2044
2153
  });
2045
2154
  mediaVideoJobResponseSchema = successEnvelope(mediaVideoJobResponseDataSchema);
2046
- mediaImagesInfoResponseDataSchema = z10.object({
2047
- model: z10.string().optional(),
2048
- description: z10.string().optional(),
2049
- supportedAspectRatios: z10.array(z10.string()).optional(),
2050
- cost: z10.number().optional(),
2051
- maxPromptLength: z10.number().optional(),
2052
- provider: z10.string().optional(),
2053
- note: z10.string().optional(),
2054
- usage: z10.object({
2055
- method: z10.string(),
2056
- body: z10.record(z10.string(), z10.string()),
2057
- headers: z10.record(z10.string(), z10.string())
2155
+ mediaImagesInfoResponseDataSchema = z11.object({
2156
+ model: z11.string().optional(),
2157
+ description: z11.string().optional(),
2158
+ supportedAspectRatios: z11.array(z11.string()).optional(),
2159
+ cost: z11.number().optional(),
2160
+ maxPromptLength: z11.number().optional(),
2161
+ provider: z11.string().optional(),
2162
+ note: z11.string().optional(),
2163
+ usage: z11.object({
2164
+ method: z11.string(),
2165
+ body: z11.record(z11.string(), z11.string()),
2166
+ headers: z11.record(z11.string(), z11.string())
2058
2167
  }).optional(),
2059
- videoAlternative: z10.object({
2060
- endpoint: z10.string(),
2061
- note: z10.string()
2168
+ videoAlternative: z11.object({
2169
+ endpoint: z11.string(),
2170
+ note: z11.string()
2062
2171
  }).optional(),
2063
- yourStats: z10.object({
2064
- qualifyingTradesForImage: z10.number(),
2065
- imagesGenerated: z10.number(),
2066
- availableForImage: z10.number(),
2067
- recentAvailableTrades: z10.array(z10.object({
2068
- tradeId: z10.string(),
2069
- valueUsd: z10.number()
2172
+ yourStats: z11.object({
2173
+ qualifyingTradesForImage: z11.number(),
2174
+ imagesGenerated: z11.number(),
2175
+ availableForImage: z11.number(),
2176
+ recentAvailableTrades: z11.array(z11.object({
2177
+ tradeId: z11.string(),
2178
+ valueUsd: z11.number()
2070
2179
  }))
2071
2180
  }).optional()
2072
2181
  }).passthrough();
2073
- mediaVideosInfoResponseDataSchema = z10.object({
2074
- description: z10.string().optional(),
2075
- tiers: z10.record(z10.string(), z10.object({
2076
- duration: z10.number(),
2077
- cost: z10.number()
2182
+ mediaVideosInfoResponseDataSchema = z11.object({
2183
+ description: z11.string().optional(),
2184
+ tiers: z11.record(z11.string(), z11.object({
2185
+ duration: z11.number(),
2186
+ cost: z11.number()
2078
2187
  }).passthrough()).optional(),
2079
- providers: z10.array(z10.string()).optional(),
2080
- limits: z10.record(z10.string(), z10.unknown()).optional(),
2081
- usage: z10.object({
2082
- method: z10.string(),
2083
- body: z10.record(z10.string(), z10.string()),
2084
- headers: z10.record(z10.string(), z10.string())
2188
+ providers: z11.array(z11.string()).optional(),
2189
+ limits: z11.record(z11.string(), z11.unknown()).optional(),
2190
+ usage: z11.object({
2191
+ method: z11.string(),
2192
+ body: z11.record(z11.string(), z11.string()),
2193
+ headers: z11.record(z11.string(), z11.string())
2085
2194
  }).optional(),
2086
- statusCheck: z10.object({
2087
- method: z10.string(),
2088
- endpoint: z10.string()
2195
+ statusCheck: z11.object({
2196
+ method: z11.string(),
2197
+ endpoint: z11.string()
2089
2198
  }).optional(),
2090
- yourStats: z10.object({
2091
- qualifyingTrades: z10.number(),
2092
- videosGenerated: z10.number(),
2093
- availableForVideo: z10.number(),
2094
- recentQualifyingTrades: z10.array(z10.object({
2095
- tradeId: z10.string(),
2096
- valueUsd: z10.number(),
2097
- tier: z10.object({
2098
- type: z10.string(),
2099
- duration: z10.number(),
2100
- cost: z10.number()
2199
+ yourStats: z11.object({
2200
+ qualifyingTrades: z11.number(),
2201
+ videosGenerated: z11.number(),
2202
+ availableForVideo: z11.number(),
2203
+ recentQualifyingTrades: z11.array(z11.object({
2204
+ tradeId: z11.string(),
2205
+ valueUsd: z11.number(),
2206
+ tier: z11.object({
2207
+ type: z11.string(),
2208
+ duration: z11.number(),
2209
+ cost: z11.number()
2101
2210
  }).passthrough()
2102
2211
  }))
2103
2212
  }).optional()
@@ -2113,6 +2222,7 @@ var init_agent = __esm(() => {
2113
2222
  init_posts();
2114
2223
  init_agents();
2115
2224
  init_trade();
2225
+ init_hyperliquid();
2116
2226
  init_incubator();
2117
2227
  init_groups();
2118
2228
  init_tokens();
@@ -2215,10 +2325,20 @@ var init_agent = __esm(() => {
2215
2325
  const body = policyUpdateRequestSchema.parse(updates);
2216
2326
  return this.request({ method: "PATCH", path: "/agents/me/policies", body, headers: this.authHeaders() }, policyUpdateResponseDataSchema);
2217
2327
  }
2328
+ async setupHyperliquid(sourceChain) {
2329
+ return this.request({ method: "POST", path: "/hyperliquid/setup", body: sourceChain ? { sourceChain } : {}, headers: this.authHeaders() }, hyperliquidSetupResponseDataSchema);
2330
+ }
2331
+ async getHyperliquidAccount() {
2332
+ return this.request({ method: "GET", path: "/hyperliquid/account", headers: this.authHeaders() }, hyperliquidAccountResponseDataSchema);
2333
+ }
2218
2334
  async trade(req) {
2219
2335
  const body = tradeRequestSchema.parse(req);
2220
2336
  return this.request({ method: "POST", path: "/trade", body, headers: this.authHeaders() }, tradeResponseDataSchema);
2221
2337
  }
2338
+ async quote(req) {
2339
+ const body = solanaTradeRequestSchema.parse({ ...req, dryRun: true });
2340
+ return this.request({ method: "POST", path: "/trade", body, headers: this.authHeaders() }, dryRunResponseDataSchema);
2341
+ }
2222
2342
  async getTokenInfo(token) {
2223
2343
  return this.request({ method: "GET", path: `/tokens/${encodeURIComponent(token)}`, headers: this.authHeaders() }, tokenInfoResponseDataSchema);
2224
2344
  }
@@ -2417,430 +2537,430 @@ var init_autonomous = __esm(() => {
2417
2537
  });
2418
2538
 
2419
2539
  // ../../packages/client/src/schemas/admin.ts
2420
- import { z as z11 } from "zod";
2540
+ import { z as z12 } from "zod";
2421
2541
  var adminDisputeResolutions, adminDisputeParamsSchema, adminDisputesQuerySchema, adminResolveDisputeRequestSchema, adminDisputesResponseDataSchema, adminResolveDisputeResponseDataSchema, adminAgentsResponseDataSchema, adminTurnsResponseDataSchema, adminMessageAgentsRequestSchema, adminMessageAgentsResponseDataSchema, adminPendingPayoutsResponseDataSchema, adminProcessPayoutRequestSchema, adminProcessPayoutResponseDataSchema, adminApprovePayoutRequestSchema, adminSkipPayoutRequestSchema, adminForfeitPayoutRequestSchema, adminRecordTxRequestSchema, adminApprovalQueueResponseDataSchema, adminApprovePayoutResponseDataSchema, adminSkipPayoutResponseDataSchema, adminForfeitPayoutResponseDataSchema, adminRecordTxResponseDataSchema, adminReferrerIdParamsSchema, adminReferralOverviewResponseDataSchema, adminReferralTradesQuerySchema, adminReferralTradesResponseDataSchema, adminReferralGamingSignalSchema, adminReferralSignalsResponseDataSchema, adminAgentIdParamsSchema, adminCreateAgentRequestSchema, adminUpdateAgentRequestSchema, adminUserIdParamsSchema, adminUsersQuerySchema, adminUpdateUserRequestSchema, adminCreateAgentResponseDataSchema, adminUpdateAgentResponseDataSchema, adminUsersResponseDataSchema, adminUpdateUserResponseDataSchema, adminIncubatorBirthRequestSchema, adminIncubatorAdjustRequestSchema, adminIncubatorWalletRequestSchema, adminIncubatorTransactionsQuerySchema, adminIncubatorPoolResponseDataSchema, adminIncubatorTransactionSchema, adminIncubatorTransactionsResponseDataSchema, adminIncubatorBirthResponseDataSchema, adminIncubatorAdjustResponseDataSchema, adminIncubatorWalletResponseDataSchema, adminDisputesResponseSchema, adminResolveDisputeResponseSchema, adminMessageAgentsResponseSchema, adminIncubatorPoolResponseSchema, adminIncubatorTransactionsResponseSchema, adminIncubatorBirthResponseSchema, adminIncubatorAdjustResponseSchema, adminIncubatorWalletResponseSchema;
2422
2542
  var init_admin = __esm(() => {
2423
2543
  init_common();
2424
2544
  adminDisputeResolutions = ["human_wins", "agent_wins", "split"];
2425
- adminDisputeParamsSchema = z11.object({
2426
- disputeId: z11.string().uuid()
2427
- });
2428
- adminDisputesQuerySchema = z11.object({
2429
- status: z11.enum(["pending", ...adminDisputeResolutions]).default("pending"),
2430
- limit: z11.coerce.number().int().min(1).default(50).transform((value) => Math.min(value, 100)),
2431
- offset: z11.coerce.number().int().min(0).default(0)
2432
- });
2433
- adminResolveDisputeRequestSchema = z11.object({
2434
- resolution: z11.enum(adminDisputeResolutions),
2435
- note: z11.string().trim().max(4000).optional()
2436
- });
2437
- adminDisputesResponseDataSchema = z11.object({
2438
- disputes: z11.array(z11.object({
2439
- id: z11.string().uuid(),
2440
- taskId: z11.string().uuid(),
2441
- initiatedBy: z11.string(),
2442
- reason: z11.string(),
2443
- evidenceUrls: z11.array(z11.string()).nullable(),
2444
- resolution: z11.string(),
2445
- resolvedBy: z11.string().nullable(),
2446
- resolvedAt: z11.string().nullable(),
2447
- createdAt: z11.string(),
2448
- task: z11.object({
2449
- id: z11.string().uuid(),
2450
- agentId: z11.string().uuid(),
2451
- agentName: z11.string().nullable(),
2452
- title: z11.string(),
2453
- budgetUsd: z11.number(),
2454
- status: z11.string(),
2455
- assignedTo: z11.string().uuid().nullable()
2545
+ adminDisputeParamsSchema = z12.object({
2546
+ disputeId: z12.string().uuid()
2547
+ });
2548
+ adminDisputesQuerySchema = z12.object({
2549
+ status: z12.enum(["pending", ...adminDisputeResolutions]).default("pending"),
2550
+ limit: z12.coerce.number().int().min(1).default(50).transform((value) => Math.min(value, 100)),
2551
+ offset: z12.coerce.number().int().min(0).default(0)
2552
+ });
2553
+ adminResolveDisputeRequestSchema = z12.object({
2554
+ resolution: z12.enum(adminDisputeResolutions),
2555
+ note: z12.string().trim().max(4000).optional()
2556
+ });
2557
+ adminDisputesResponseDataSchema = z12.object({
2558
+ disputes: z12.array(z12.object({
2559
+ id: z12.string().uuid(),
2560
+ taskId: z12.string().uuid(),
2561
+ initiatedBy: z12.string(),
2562
+ reason: z12.string(),
2563
+ evidenceUrls: z12.array(z12.string()).nullable(),
2564
+ resolution: z12.string(),
2565
+ resolvedBy: z12.string().nullable(),
2566
+ resolvedAt: z12.string().nullable(),
2567
+ createdAt: z12.string(),
2568
+ task: z12.object({
2569
+ id: z12.string().uuid(),
2570
+ agentId: z12.string().uuid(),
2571
+ agentName: z12.string().nullable(),
2572
+ title: z12.string(),
2573
+ budgetUsd: z12.number(),
2574
+ status: z12.string(),
2575
+ assignedTo: z12.string().uuid().nullable()
2456
2576
  }).nullable()
2457
2577
  })),
2458
- count: z11.number(),
2459
- pagination: z11.object({
2460
- limit: z11.number(),
2461
- offset: z11.number(),
2462
- hasMore: z11.boolean()
2578
+ count: z12.number(),
2579
+ pagination: z12.object({
2580
+ limit: z12.number(),
2581
+ offset: z12.number(),
2582
+ hasMore: z12.boolean()
2463
2583
  })
2464
2584
  });
2465
- adminResolveDisputeResponseDataSchema = z11.object({
2466
- dispute: z11.object({
2467
- id: z11.string().uuid(),
2468
- taskId: z11.string().uuid(),
2469
- resolution: z11.string(),
2470
- resolvedBy: z11.string(),
2471
- payoutTx: z11.string().nullable(),
2472
- newTaskStatus: z11.string()
2585
+ adminResolveDisputeResponseDataSchema = z12.object({
2586
+ dispute: z12.object({
2587
+ id: z12.string().uuid(),
2588
+ taskId: z12.string().uuid(),
2589
+ resolution: z12.string(),
2590
+ resolvedBy: z12.string(),
2591
+ payoutTx: z12.string().nullable(),
2592
+ newTaskStatus: z12.string()
2473
2593
  })
2474
2594
  });
2475
- adminAgentsResponseDataSchema = z11.object({
2476
- agents: z11.array(z11.object({
2477
- id: z11.string().uuid(),
2478
- name: z11.string(),
2479
- handle: z11.string().nullable(),
2480
- avatarUrl: z11.string().nullable(),
2481
- solanaAddress: z11.string().nullable(),
2482
- generation: z11.number().nullable(),
2483
- bornAt: z11.string().nullable(),
2484
- diedAt: z11.string().nullable(),
2485
- isAlive: z11.boolean(),
2486
- llmModel: z11.string().nullable(),
2487
- llmUsageUsd: z11.number().nullable(),
2488
- llmBudgetUsd: z11.number().nullable(),
2489
- serverPlan: z11.string().nullable(),
2490
- totalValueUsd: z11.number(),
2491
- pnlAllTime: z11.number(),
2492
- totalTurns: z11.number(),
2493
- totalCostUsd: z11.number(),
2494
- totalEntries: z11.number(),
2495
- lastTurnAt: z11.string().nullable(),
2496
- lastEntryPreview: z11.string().nullable()
2595
+ adminAgentsResponseDataSchema = z12.object({
2596
+ agents: z12.array(z12.object({
2597
+ id: z12.string().uuid(),
2598
+ name: z12.string(),
2599
+ handle: z12.string().nullable(),
2600
+ avatarUrl: z12.string().nullable(),
2601
+ solanaAddress: z12.string().nullable(),
2602
+ generation: z12.number().nullable(),
2603
+ bornAt: z12.string().nullable(),
2604
+ diedAt: z12.string().nullable(),
2605
+ isAlive: z12.boolean(),
2606
+ llmModel: z12.string().nullable(),
2607
+ llmUsageUsd: z12.number().nullable(),
2608
+ llmBudgetUsd: z12.number().nullable(),
2609
+ serverPlan: z12.string().nullable(),
2610
+ totalValueUsd: z12.number(),
2611
+ pnlAllTime: z12.number(),
2612
+ totalTurns: z12.number(),
2613
+ totalCostUsd: z12.number(),
2614
+ totalEntries: z12.number(),
2615
+ lastTurnAt: z12.string().nullable(),
2616
+ lastEntryPreview: z12.string().nullable()
2497
2617
  })),
2498
- count: z11.number()
2499
- });
2500
- adminTurnsResponseDataSchema = z11.object({
2501
- turns: z11.array(z11.object({
2502
- id: z11.number(),
2503
- piEntryId: z11.string().nullable(),
2504
- parentPiEntryId: z11.string().nullable(),
2505
- entryType: z11.string().nullable(),
2506
- seq: z11.number().nullable(),
2507
- timestamp: z11.string().nullable(),
2508
- role: z11.string().nullable(),
2509
- contentPreview: z11.string().nullable(),
2510
- model: z11.string().nullable(),
2511
- provider: z11.string().nullable(),
2512
- toolName: z11.string().nullable(),
2513
- tokenInput: z11.number().nullable(),
2514
- tokenOutput: z11.number().nullable(),
2515
- costUsd: z11.number().nullable(),
2516
- sourceType: z11.string().nullable(),
2517
- sourceRef: z11.string().nullable(),
2518
- payload: z11.unknown().nullable()
2618
+ count: z12.number()
2619
+ });
2620
+ adminTurnsResponseDataSchema = z12.object({
2621
+ turns: z12.array(z12.object({
2622
+ id: z12.number(),
2623
+ piEntryId: z12.string().nullable(),
2624
+ parentPiEntryId: z12.string().nullable(),
2625
+ entryType: z12.string().nullable(),
2626
+ seq: z12.number().nullable(),
2627
+ timestamp: z12.string().nullable(),
2628
+ role: z12.string().nullable(),
2629
+ contentPreview: z12.string().nullable(),
2630
+ model: z12.string().nullable(),
2631
+ provider: z12.string().nullable(),
2632
+ toolName: z12.string().nullable(),
2633
+ tokenInput: z12.number().nullable(),
2634
+ tokenOutput: z12.number().nullable(),
2635
+ costUsd: z12.number().nullable(),
2636
+ sourceType: z12.string().nullable(),
2637
+ sourceRef: z12.string().nullable(),
2638
+ payload: z12.unknown().nullable()
2519
2639
  })),
2520
- page: z11.number(),
2521
- pageSize: z11.number()
2640
+ page: z12.number(),
2641
+ pageSize: z12.number()
2522
2642
  });
2523
- adminMessageAgentsRequestSchema = z11.object({
2524
- message: z11.string().trim().min(1, "Message is required").max(4000),
2525
- agentIds: z11.array(z11.string().uuid()).min(1).optional(),
2526
- broadcast: z11.boolean().optional()
2643
+ adminMessageAgentsRequestSchema = z12.object({
2644
+ message: z12.string().trim().min(1, "Message is required").max(4000),
2645
+ agentIds: z12.array(z12.string().uuid()).min(1).optional(),
2646
+ broadcast: z12.boolean().optional()
2527
2647
  }).refine((data) => data.agentIds && data.agentIds.length > 0 || data.broadcast === true, { message: "Provide agentIds or set broadcast to true" }).refine((data) => !(data.agentIds && data.agentIds.length > 0 && data.broadcast === true), { message: "Cannot specify both agentIds and broadcast" });
2528
- adminMessageAgentsResponseDataSchema = z11.object({
2529
- sent: z11.number(),
2530
- agentIds: z11.array(z11.string().uuid())
2531
- });
2532
- adminPendingPayoutsResponseDataSchema = z11.object({
2533
- min_payout_usd: z11.number().optional(),
2534
- pending_payouts: z11.array(z11.object({
2535
- referrer_id: z11.string(),
2536
- name: z11.string(),
2537
- handle: z11.string().nullable().optional(),
2538
- payout_wallet: z11.string().nullable().optional(),
2539
- referral_count: z11.number(),
2540
- total_volume_usd: z11.number(),
2541
- total_earned: z11.number(),
2542
- total_paid_out: z11.number(),
2543
- pending_amount: z11.number(),
2544
- solana_earned: z11.number(),
2545
- hyperliquid_earned: z11.number(),
2546
- dbc_pool_earned: z11.number()
2648
+ adminMessageAgentsResponseDataSchema = z12.object({
2649
+ sent: z12.number(),
2650
+ agentIds: z12.array(z12.string().uuid())
2651
+ });
2652
+ adminPendingPayoutsResponseDataSchema = z12.object({
2653
+ min_payout_usd: z12.number().optional(),
2654
+ pending_payouts: z12.array(z12.object({
2655
+ referrer_id: z12.string(),
2656
+ name: z12.string(),
2657
+ handle: z12.string().nullable().optional(),
2658
+ payout_wallet: z12.string().nullable().optional(),
2659
+ referral_count: z12.number(),
2660
+ total_volume_usd: z12.number(),
2661
+ total_earned: z12.number(),
2662
+ total_paid_out: z12.number(),
2663
+ pending_amount: z12.number(),
2664
+ solana_earned: z12.number(),
2665
+ hyperliquid_earned: z12.number(),
2666
+ dbc_pool_earned: z12.number()
2547
2667
  }))
2548
2668
  });
2549
- adminProcessPayoutRequestSchema = z11.object({
2550
- referrer_id: z11.string().min(1),
2551
- amount: z11.number().finite().positive().max(1e5),
2552
- tx_signature: z11.string().min(1)
2669
+ adminProcessPayoutRequestSchema = z12.object({
2670
+ referrer_id: z12.string().min(1),
2671
+ amount: z12.number().finite().positive().max(1e5),
2672
+ tx_signature: z12.string().min(1)
2553
2673
  });
2554
- adminProcessPayoutResponseDataSchema = z11.object({
2555
- payout_id: z11.string(),
2556
- referrer: z11.object({
2557
- id: z11.string(),
2558
- name: z11.string().nullable()
2674
+ adminProcessPayoutResponseDataSchema = z12.object({
2675
+ payout_id: z12.string(),
2676
+ referrer: z12.object({
2677
+ id: z12.string(),
2678
+ name: z12.string().nullable()
2559
2679
  }),
2560
- amount: z11.number(),
2561
- wallet_address: z11.string(),
2562
- tx_signature: z11.string(),
2563
- status: z11.string()
2564
- });
2565
- adminApprovePayoutRequestSchema = z11.object({
2566
- referrer_id: z11.string().uuid(),
2567
- amount: z11.number().finite().positive().min(5),
2568
- notes: z11.string().trim().max(1000).optional()
2569
- });
2570
- adminSkipPayoutRequestSchema = z11.object({
2571
- referrer_id: z11.string().uuid(),
2572
- notes: z11.string().trim().max(1000).optional()
2573
- });
2574
- adminForfeitPayoutRequestSchema = z11.object({
2575
- referrer_id: z11.string().uuid(),
2576
- amount: z11.number().finite().positive(),
2577
- notes: z11.string().trim().min(1).max(1000)
2578
- });
2579
- adminRecordTxRequestSchema = z11.object({
2580
- payout_id: z11.string().uuid(),
2581
- tx_signature: z11.string().min(1)
2582
- });
2583
- adminApprovalQueueResponseDataSchema = z11.object({
2584
- referrers: z11.array(z11.object({
2585
- referrerId: z11.string(),
2586
- name: z11.string(),
2587
- handle: z11.string().nullable(),
2588
- payoutWallet: z11.string().nullable(),
2589
- pendingAmount: z11.number(),
2590
- referralCount: z11.number(),
2591
- totalVolumeUsd: z11.number(),
2592
- totalEarned: z11.number(),
2593
- totalPaidOut: z11.number(),
2594
- overallRisk: z11.enum(["low", "medium", "high"]).optional()
2680
+ amount: z12.number(),
2681
+ wallet_address: z12.string(),
2682
+ tx_signature: z12.string(),
2683
+ status: z12.string()
2684
+ });
2685
+ adminApprovePayoutRequestSchema = z12.object({
2686
+ referrer_id: z12.string().uuid(),
2687
+ amount: z12.number().finite().positive().min(5),
2688
+ notes: z12.string().trim().max(1000).optional()
2689
+ });
2690
+ adminSkipPayoutRequestSchema = z12.object({
2691
+ referrer_id: z12.string().uuid(),
2692
+ notes: z12.string().trim().max(1000).optional()
2693
+ });
2694
+ adminForfeitPayoutRequestSchema = z12.object({
2695
+ referrer_id: z12.string().uuid(),
2696
+ amount: z12.number().finite().positive(),
2697
+ notes: z12.string().trim().min(1).max(1000)
2698
+ });
2699
+ adminRecordTxRequestSchema = z12.object({
2700
+ payout_id: z12.string().uuid(),
2701
+ tx_signature: z12.string().min(1)
2702
+ });
2703
+ adminApprovalQueueResponseDataSchema = z12.object({
2704
+ referrers: z12.array(z12.object({
2705
+ referrerId: z12.string(),
2706
+ name: z12.string(),
2707
+ handle: z12.string().nullable(),
2708
+ payoutWallet: z12.string().nullable(),
2709
+ pendingAmount: z12.number(),
2710
+ referralCount: z12.number(),
2711
+ totalVolumeUsd: z12.number(),
2712
+ totalEarned: z12.number(),
2713
+ totalPaidOut: z12.number(),
2714
+ overallRisk: z12.enum(["low", "medium", "high"]).optional()
2595
2715
  })),
2596
- approvedPayouts: z11.array(z11.object({
2597
- id: z11.string(),
2598
- referrerId: z11.string(),
2599
- referrerName: z11.string(),
2600
- amount: z11.number(),
2601
- approvedAt: z11.string(),
2602
- notes: z11.string().nullable()
2716
+ approvedPayouts: z12.array(z12.object({
2717
+ id: z12.string(),
2718
+ referrerId: z12.string(),
2719
+ referrerName: z12.string(),
2720
+ amount: z12.number(),
2721
+ approvedAt: z12.string(),
2722
+ notes: z12.string().nullable()
2603
2723
  }))
2604
2724
  });
2605
- adminApprovePayoutResponseDataSchema = z11.object({
2606
- payout: z11.object({
2607
- id: z11.string(),
2608
- referrerId: z11.string(),
2609
- referrerName: z11.string(),
2610
- amount: z11.number(),
2611
- wallet: z11.string(),
2612
- status: z11.literal("approved"),
2613
- approvedAt: z11.string(),
2614
- notes: z11.string().nullable()
2725
+ adminApprovePayoutResponseDataSchema = z12.object({
2726
+ payout: z12.object({
2727
+ id: z12.string(),
2728
+ referrerId: z12.string(),
2729
+ referrerName: z12.string(),
2730
+ amount: z12.number(),
2731
+ wallet: z12.string(),
2732
+ status: z12.literal("approved"),
2733
+ approvedAt: z12.string(),
2734
+ notes: z12.string().nullable()
2615
2735
  })
2616
2736
  });
2617
- adminSkipPayoutResponseDataSchema = z11.object({
2618
- payout: z11.object({
2619
- id: z11.string(),
2620
- referrerId: z11.string(),
2621
- status: z11.literal("skipped"),
2622
- periodStart: z11.string(),
2623
- periodEnd: z11.string(),
2624
- notes: z11.string().nullable()
2737
+ adminSkipPayoutResponseDataSchema = z12.object({
2738
+ payout: z12.object({
2739
+ id: z12.string(),
2740
+ referrerId: z12.string(),
2741
+ status: z12.literal("skipped"),
2742
+ periodStart: z12.string(),
2743
+ periodEnd: z12.string(),
2744
+ notes: z12.string().nullable()
2625
2745
  })
2626
2746
  });
2627
- adminForfeitPayoutResponseDataSchema = z11.object({
2628
- payout: z11.object({
2629
- id: z11.string(),
2630
- referrerId: z11.string(),
2631
- amount: z11.number(),
2632
- status: z11.literal("forfeited"),
2633
- notes: z11.string()
2747
+ adminForfeitPayoutResponseDataSchema = z12.object({
2748
+ payout: z12.object({
2749
+ id: z12.string(),
2750
+ referrerId: z12.string(),
2751
+ amount: z12.number(),
2752
+ status: z12.literal("forfeited"),
2753
+ notes: z12.string()
2634
2754
  })
2635
2755
  });
2636
- adminRecordTxResponseDataSchema = z11.object({
2637
- payout: z11.object({
2638
- id: z11.string(),
2639
- referrerId: z11.string(),
2640
- amount: z11.number(),
2641
- status: z11.literal("completed"),
2642
- txSignature: z11.string(),
2643
- completedAt: z11.string().nullable()
2756
+ adminRecordTxResponseDataSchema = z12.object({
2757
+ payout: z12.object({
2758
+ id: z12.string(),
2759
+ referrerId: z12.string(),
2760
+ amount: z12.number(),
2761
+ status: z12.literal("completed"),
2762
+ txSignature: z12.string(),
2763
+ completedAt: z12.string().nullable()
2644
2764
  })
2645
2765
  });
2646
- adminReferrerIdParamsSchema = z11.object({
2647
- referrerId: z11.string().uuid()
2648
- });
2649
- adminReferralOverviewResponseDataSchema = z11.object({
2650
- totalReferrers: z11.number(),
2651
- totalReferees: z11.number(),
2652
- totalVolumeUsd: z11.number(),
2653
- totalEarned: z11.number(),
2654
- totalPaidOut: z11.number(),
2655
- totalPending: z11.number(),
2656
- topReferrers: z11.array(z11.object({
2657
- referrerId: z11.string(),
2658
- name: z11.string(),
2659
- handle: z11.string().nullable(),
2660
- payoutWallet: z11.string().nullable(),
2661
- referralCount: z11.number(),
2662
- totalVolumeUsd: z11.number(),
2663
- totalEarned: z11.number(),
2664
- totalPaidOut: z11.number(),
2665
- pendingAmount: z11.number(),
2666
- solanaEarned: z11.number(),
2667
- hyperliquidEarned: z11.number(),
2668
- dbcPoolEarned: z11.number()
2766
+ adminReferrerIdParamsSchema = z12.object({
2767
+ referrerId: z12.string().uuid()
2768
+ });
2769
+ adminReferralOverviewResponseDataSchema = z12.object({
2770
+ totalReferrers: z12.number(),
2771
+ totalReferees: z12.number(),
2772
+ totalVolumeUsd: z12.number(),
2773
+ totalEarned: z12.number(),
2774
+ totalPaidOut: z12.number(),
2775
+ totalPending: z12.number(),
2776
+ topReferrers: z12.array(z12.object({
2777
+ referrerId: z12.string(),
2778
+ name: z12.string(),
2779
+ handle: z12.string().nullable(),
2780
+ payoutWallet: z12.string().nullable(),
2781
+ referralCount: z12.number(),
2782
+ totalVolumeUsd: z12.number(),
2783
+ totalEarned: z12.number(),
2784
+ totalPaidOut: z12.number(),
2785
+ pendingAmount: z12.number(),
2786
+ solanaEarned: z12.number(),
2787
+ hyperliquidEarned: z12.number(),
2788
+ dbcPoolEarned: z12.number()
2669
2789
  }))
2670
2790
  });
2671
- adminReferralTradesQuerySchema = z11.object({
2672
- limit: z11.coerce.number().int().min(1).default(50).transform((v) => Math.min(v, 100)),
2673
- offset: z11.coerce.number().int().min(0).default(0)
2674
- });
2675
- adminReferralTradesResponseDataSchema = z11.object({
2676
- trades: z11.array(z11.object({
2677
- id: z11.string(),
2678
- chain: z11.string(),
2679
- agentId: z11.string(),
2680
- refereeName: z11.string(),
2681
- refereeHandle: z11.string().nullable(),
2682
- tokenAddress: z11.string(),
2683
- valueUsd: z11.number(),
2684
- feeAmount: z11.number(),
2685
- referrerFeeBps: z11.number().nullable(),
2686
- treasuryFeeBps: z11.number().nullable(),
2687
- referrerEarnedUsd: z11.number(),
2688
- txSignature: z11.string().nullable(),
2689
- timestamp: z11.string().nullable()
2791
+ adminReferralTradesQuerySchema = z12.object({
2792
+ limit: z12.coerce.number().int().min(1).default(50).transform((v) => Math.min(v, 100)),
2793
+ offset: z12.coerce.number().int().min(0).default(0)
2794
+ });
2795
+ adminReferralTradesResponseDataSchema = z12.object({
2796
+ trades: z12.array(z12.object({
2797
+ id: z12.string(),
2798
+ chain: z12.string(),
2799
+ agentId: z12.string(),
2800
+ refereeName: z12.string(),
2801
+ refereeHandle: z12.string().nullable(),
2802
+ tokenAddress: z12.string(),
2803
+ valueUsd: z12.number(),
2804
+ feeAmount: z12.number(),
2805
+ referrerFeeBps: z12.number().nullable(),
2806
+ treasuryFeeBps: z12.number().nullable(),
2807
+ referrerEarnedUsd: z12.number(),
2808
+ txSignature: z12.string().nullable(),
2809
+ timestamp: z12.string().nullable()
2690
2810
  })),
2691
- pagination: z11.object({
2692
- limit: z11.number(),
2693
- offset: z11.number(),
2694
- total: z11.number(),
2695
- hasMore: z11.boolean()
2811
+ pagination: z12.object({
2812
+ limit: z12.number(),
2813
+ offset: z12.number(),
2814
+ total: z12.number(),
2815
+ hasMore: z12.boolean()
2696
2816
  })
2697
2817
  });
2698
- adminReferralGamingSignalSchema = z11.object({
2699
- type: z11.string(),
2700
- severity: z11.enum(["low", "medium", "high"]),
2701
- description: z11.string(),
2702
- evidence: z11.record(z11.string(), z11.unknown())
2703
- });
2704
- adminReferralSignalsResponseDataSchema = z11.object({
2705
- referrerId: z11.string(),
2706
- overallRisk: z11.enum(["low", "medium", "high"]),
2707
- signals: z11.array(adminReferralGamingSignalSchema)
2708
- });
2709
- adminAgentIdParamsSchema = z11.object({
2710
- agentId: z11.string().uuid()
2711
- });
2712
- adminCreateAgentRequestSchema = z11.object({
2713
- name: z11.string().min(1).max(100),
2714
- handle: z11.string().max(50).optional(),
2715
- bio: z11.string().max(500).optional(),
2716
- avatarUrl: z11.string().url().optional(),
2717
- generation: z11.number().int().optional(),
2718
- serverPlan: z11.enum(["basic", "standard", "pro"]).optional(),
2719
- llmModel: z11.string().optional(),
2720
- llmBudgetUsd: z11.number().optional(),
2721
- inboxPriceUsd: z11.number().optional()
2722
- });
2723
- adminUpdateAgentRequestSchema = z11.object({
2724
- name: z11.string().min(1).max(100).optional(),
2725
- handle: z11.string().max(50).optional(),
2726
- bio: z11.string().max(500).optional(),
2727
- avatarUrl: z11.string().url().nullable().optional(),
2728
- llmModel: z11.string().optional(),
2729
- llmBudgetUsd: z11.number().optional(),
2730
- serverPlan: z11.enum(["basic", "standard", "pro"]).optional(),
2731
- generation: z11.number().int().optional(),
2732
- inboxPriceUsd: z11.number().optional(),
2733
- isAlive: z11.boolean().optional()
2818
+ adminReferralGamingSignalSchema = z12.object({
2819
+ type: z12.string(),
2820
+ severity: z12.enum(["low", "medium", "high"]),
2821
+ description: z12.string(),
2822
+ evidence: z12.record(z12.string(), z12.unknown())
2823
+ });
2824
+ adminReferralSignalsResponseDataSchema = z12.object({
2825
+ referrerId: z12.string(),
2826
+ overallRisk: z12.enum(["low", "medium", "high"]),
2827
+ signals: z12.array(adminReferralGamingSignalSchema)
2828
+ });
2829
+ adminAgentIdParamsSchema = z12.object({
2830
+ agentId: z12.string().uuid()
2831
+ });
2832
+ adminCreateAgentRequestSchema = z12.object({
2833
+ name: z12.string().min(1).max(100),
2834
+ handle: z12.string().max(50).optional(),
2835
+ bio: z12.string().max(500).optional(),
2836
+ avatarUrl: z12.string().url().optional(),
2837
+ generation: z12.number().int().optional(),
2838
+ serverPlan: z12.enum(["basic", "standard", "pro"]).optional(),
2839
+ llmModel: z12.string().optional(),
2840
+ llmBudgetUsd: z12.number().optional(),
2841
+ inboxPriceUsd: z12.number().optional()
2842
+ });
2843
+ adminUpdateAgentRequestSchema = z12.object({
2844
+ name: z12.string().min(1).max(100).optional(),
2845
+ handle: z12.string().max(50).optional(),
2846
+ bio: z12.string().max(500).optional(),
2847
+ avatarUrl: z12.string().url().nullable().optional(),
2848
+ llmModel: z12.string().optional(),
2849
+ llmBudgetUsd: z12.number().optional(),
2850
+ serverPlan: z12.enum(["basic", "standard", "pro"]).optional(),
2851
+ generation: z12.number().int().optional(),
2852
+ inboxPriceUsd: z12.number().optional(),
2853
+ isAlive: z12.boolean().optional()
2734
2854
  }).refine((obj) => Object.keys(obj).length > 0, { message: "At least one field required" });
2735
- adminUserIdParamsSchema = z11.object({
2736
- userId: z11.string().uuid()
2737
- });
2738
- adminUsersQuerySchema = z11.object({
2739
- limit: z11.coerce.number().int().min(1).default(25).transform((v) => Math.min(v, 100)),
2740
- offset: z11.coerce.number().int().min(0).default(0),
2741
- search: z11.string().optional()
2742
- });
2743
- adminUpdateUserRequestSchema = z11.object({
2744
- role: z11.enum(["admin", "user"]).optional(),
2745
- banned: z11.boolean().optional(),
2746
- banReason: z11.string().optional(),
2747
- banExpiresIn: z11.number().positive().optional(),
2748
- shadowbanned: z11.boolean().optional()
2855
+ adminUserIdParamsSchema = z12.object({
2856
+ userId: z12.string().uuid()
2857
+ });
2858
+ adminUsersQuerySchema = z12.object({
2859
+ limit: z12.coerce.number().int().min(1).default(25).transform((v) => Math.min(v, 100)),
2860
+ offset: z12.coerce.number().int().min(0).default(0),
2861
+ search: z12.string().optional()
2862
+ });
2863
+ adminUpdateUserRequestSchema = z12.object({
2864
+ role: z12.enum(["admin", "user"]).optional(),
2865
+ banned: z12.boolean().optional(),
2866
+ banReason: z12.string().optional(),
2867
+ banExpiresIn: z12.number().positive().optional(),
2868
+ shadowbanned: z12.boolean().optional()
2749
2869
  }).refine((obj) => Object.keys(obj).length > 0, { message: "At least one field required" });
2750
- adminCreateAgentResponseDataSchema = z11.object({
2751
- agent: z11.object({
2752
- id: z11.string().uuid(),
2753
- name: z11.string(),
2754
- handle: z11.string().nullable(),
2755
- email: z11.string()
2870
+ adminCreateAgentResponseDataSchema = z12.object({
2871
+ agent: z12.object({
2872
+ id: z12.string().uuid(),
2873
+ name: z12.string(),
2874
+ handle: z12.string().nullable(),
2875
+ email: z12.string()
2756
2876
  })
2757
2877
  });
2758
- adminUpdateAgentResponseDataSchema = z11.object({
2759
- ok: z11.boolean()
2878
+ adminUpdateAgentResponseDataSchema = z12.object({
2879
+ ok: z12.boolean()
2760
2880
  });
2761
- adminUsersResponseDataSchema = z11.object({
2762
- users: z11.array(z11.object({
2763
- id: z11.string().uuid(),
2764
- name: z11.string().nullable(),
2765
- email: z11.string().nullable(),
2766
- role: z11.string().nullable(),
2767
- banned: z11.boolean().nullable(),
2768
- banReason: z11.string().nullable(),
2769
- banExpires: z11.string().nullable(),
2770
- shadowbanned: z11.boolean().nullable(),
2771
- createdAt: z11.string().nullable()
2881
+ adminUsersResponseDataSchema = z12.object({
2882
+ users: z12.array(z12.object({
2883
+ id: z12.string().uuid(),
2884
+ name: z12.string().nullable(),
2885
+ email: z12.string().nullable(),
2886
+ role: z12.string().nullable(),
2887
+ banned: z12.boolean().nullable(),
2888
+ banReason: z12.string().nullable(),
2889
+ banExpires: z12.string().nullable(),
2890
+ shadowbanned: z12.boolean().nullable(),
2891
+ createdAt: z12.string().nullable()
2772
2892
  })),
2773
- total: z11.number()
2774
- });
2775
- adminUpdateUserResponseDataSchema = z11.object({
2776
- user: z11.record(z11.string(), z11.unknown())
2777
- });
2778
- adminIncubatorBirthRequestSchema = z11.object({
2779
- action: z11.enum(["trigger", "pause", "resume"]),
2780
- skipBalanceCheck: z11.boolean().optional().default(false)
2781
- });
2782
- adminIncubatorAdjustRequestSchema = z11.object({
2783
- amountUsd: z11.number(),
2784
- source: z11.enum(["manual_credit", "manual_debit", "birth_refund"]),
2785
- note: z11.string().min(1)
2786
- });
2787
- adminIncubatorWalletRequestSchema = z11.object({
2788
- walletId: z11.string().min(1),
2789
- walletAddress: z11.string().min(1)
2790
- });
2791
- adminIncubatorTransactionsQuerySchema = z11.object({
2792
- limit: z11.coerce.number().int().min(1).default(50).transform((v) => Math.min(v, 100)),
2793
- offset: z11.coerce.number().int().min(0).default(0),
2794
- source: z11.string().optional()
2795
- });
2796
- adminIncubatorPoolResponseDataSchema = z11.object({
2797
- balance_usd: z11.number(),
2798
- threshold_usd: z11.number(),
2799
- progress_pct: z11.number(),
2800
- total_born: z11.number(),
2801
- alive_count: z11.number(),
2802
- dead_count: z11.number(),
2803
- generation: z11.number(),
2804
- birth_status: z11.string(),
2805
- birth_paused: z11.boolean(),
2806
- pool_wallet_id: z11.string().nullable(),
2807
- pool_wallet_address: z11.string().nullable(),
2808
- incubator_fee_percent: z11.number(),
2809
- birth_threshold_usd: z11.number(),
2810
- onChainBalanceSol: z11.number(),
2811
- onChainBalanceUsd: z11.number()
2812
- });
2813
- adminIncubatorTransactionSchema = z11.object({
2814
- id: z11.string().uuid(),
2815
- amountUsd: z11.number(),
2816
- source: z11.string(),
2817
- sourceTradeId: z11.string().nullable(),
2818
- adminNote: z11.string().nullable(),
2819
- createdAt: z11.string()
2820
- });
2821
- adminIncubatorTransactionsResponseDataSchema = z11.object({
2822
- transactions: z11.array(adminIncubatorTransactionSchema),
2823
- total: z11.number()
2824
- });
2825
- adminIncubatorBirthResponseDataSchema = z11.object({
2826
- ok: z11.literal(true),
2827
- action: z11.enum(["triggered", "paused", "resumed"]),
2828
- agent: z11.object({
2829
- id: z11.string(),
2830
- number: z11.number(),
2831
- solanaAddress: z11.string()
2893
+ total: z12.number()
2894
+ });
2895
+ adminUpdateUserResponseDataSchema = z12.object({
2896
+ user: z12.record(z12.string(), z12.unknown())
2897
+ });
2898
+ adminIncubatorBirthRequestSchema = z12.object({
2899
+ action: z12.enum(["trigger", "pause", "resume"]),
2900
+ skipBalanceCheck: z12.boolean().optional().default(false)
2901
+ });
2902
+ adminIncubatorAdjustRequestSchema = z12.object({
2903
+ amountUsd: z12.number(),
2904
+ source: z12.enum(["manual_credit", "manual_debit", "birth_refund"]),
2905
+ note: z12.string().min(1)
2906
+ });
2907
+ adminIncubatorWalletRequestSchema = z12.object({
2908
+ walletId: z12.string().min(1),
2909
+ walletAddress: z12.string().min(1)
2910
+ });
2911
+ adminIncubatorTransactionsQuerySchema = z12.object({
2912
+ limit: z12.coerce.number().int().min(1).default(50).transform((v) => Math.min(v, 100)),
2913
+ offset: z12.coerce.number().int().min(0).default(0),
2914
+ source: z12.string().optional()
2915
+ });
2916
+ adminIncubatorPoolResponseDataSchema = z12.object({
2917
+ balance_usd: z12.number(),
2918
+ threshold_usd: z12.number(),
2919
+ progress_pct: z12.number(),
2920
+ total_born: z12.number(),
2921
+ alive_count: z12.number(),
2922
+ dead_count: z12.number(),
2923
+ generation: z12.number(),
2924
+ birth_status: z12.string(),
2925
+ birth_paused: z12.boolean(),
2926
+ pool_wallet_id: z12.string().nullable(),
2927
+ pool_wallet_address: z12.string().nullable(),
2928
+ incubator_fee_percent: z12.number(),
2929
+ birth_threshold_usd: z12.number(),
2930
+ onChainBalanceSol: z12.number(),
2931
+ onChainBalanceUsd: z12.number()
2932
+ });
2933
+ adminIncubatorTransactionSchema = z12.object({
2934
+ id: z12.string().uuid(),
2935
+ amountUsd: z12.number(),
2936
+ source: z12.string(),
2937
+ sourceTradeId: z12.string().nullable(),
2938
+ adminNote: z12.string().nullable(),
2939
+ createdAt: z12.string()
2940
+ });
2941
+ adminIncubatorTransactionsResponseDataSchema = z12.object({
2942
+ transactions: z12.array(adminIncubatorTransactionSchema),
2943
+ total: z12.number()
2944
+ });
2945
+ adminIncubatorBirthResponseDataSchema = z12.object({
2946
+ ok: z12.literal(true),
2947
+ action: z12.enum(["triggered", "paused", "resumed"]),
2948
+ agent: z12.object({
2949
+ id: z12.string(),
2950
+ number: z12.number(),
2951
+ solanaAddress: z12.string()
2832
2952
  }).optional(),
2833
- transferHash: z11.string().nullable().optional()
2953
+ transferHash: z12.string().nullable().optional()
2834
2954
  });
2835
- adminIncubatorAdjustResponseDataSchema = z11.object({
2836
- ok: z11.literal(true),
2837
- balanceUsd: z11.number(),
2838
- birthStatus: z11.string()
2955
+ adminIncubatorAdjustResponseDataSchema = z12.object({
2956
+ ok: z12.literal(true),
2957
+ balanceUsd: z12.number(),
2958
+ birthStatus: z12.string()
2839
2959
  });
2840
- adminIncubatorWalletResponseDataSchema = z11.object({
2841
- ok: z11.literal(true),
2842
- walletId: z11.string(),
2843
- walletAddress: z11.string()
2960
+ adminIncubatorWalletResponseDataSchema = z12.object({
2961
+ ok: z12.literal(true),
2962
+ walletId: z12.string(),
2963
+ walletAddress: z12.string()
2844
2964
  });
2845
2965
  adminDisputesResponseSchema = successEnvelope(adminDisputesResponseDataSchema);
2846
2966
  adminResolveDisputeResponseSchema = successEnvelope(adminResolveDisputeResponseDataSchema);
@@ -2853,46 +2973,46 @@ var init_admin = __esm(() => {
2853
2973
  });
2854
2974
 
2855
2975
  // ../../packages/client/src/schemas/auth.ts
2856
- import { z as z12 } from "zod";
2976
+ import { z as z13 } from "zod";
2857
2977
  var authApiKeysCreateRequestSchema, authApiKeysDeleteRequestSchema, authSetupRequestSchema, authApiKeysListResponseDataSchema, authApiKeysCreateResponseDataSchema, authApiKeysDeleteResponseDataSchema, authSetupResponseDataSchema, authApiKeysListResponseSchema, authApiKeysCreateResponseSchema, authApiKeysDeleteResponseSchema, authSetupResponseSchema;
2858
2978
  var init_auth = __esm(() => {
2859
2979
  init_common();
2860
- authApiKeysCreateRequestSchema = z12.object({
2861
- name: z12.string().trim().min(1).max(120).optional()
2862
- });
2863
- authApiKeysDeleteRequestSchema = z12.object({
2864
- keyId: z12.string().min(1)
2865
- });
2866
- authSetupRequestSchema = z12.object({
2867
- name: z12.string().trim().min(1).max(120).optional(),
2868
- handle: z12.string().trim().min(1).max(120).optional(),
2869
- referralCode: z12.string().trim().min(1).max(120).optional()
2870
- });
2871
- authApiKeysListResponseDataSchema = z12.object({
2872
- keys: z12.array(z12.object({
2873
- id: z12.string(),
2874
- name: z12.string().nullable(),
2875
- start: z12.string(),
2876
- createdAt: z12.string()
2980
+ authApiKeysCreateRequestSchema = z13.object({
2981
+ name: z13.string().trim().min(1).max(120).optional()
2982
+ });
2983
+ authApiKeysDeleteRequestSchema = z13.object({
2984
+ keyId: z13.string().min(1)
2985
+ });
2986
+ authSetupRequestSchema = z13.object({
2987
+ name: z13.string().trim().min(1).max(120).optional(),
2988
+ handle: z13.string().trim().min(1).max(120).optional(),
2989
+ referralCode: z13.string().trim().min(1).max(120).optional()
2990
+ });
2991
+ authApiKeysListResponseDataSchema = z13.object({
2992
+ keys: z13.array(z13.object({
2993
+ id: z13.string(),
2994
+ name: z13.string().nullable(),
2995
+ start: z13.string(),
2996
+ createdAt: z13.string()
2877
2997
  }))
2878
2998
  });
2879
- authApiKeysCreateResponseDataSchema = z12.object({
2880
- key: z12.string(),
2881
- id: z12.string(),
2882
- start: z12.string()
2999
+ authApiKeysCreateResponseDataSchema = z13.object({
3000
+ key: z13.string(),
3001
+ id: z13.string(),
3002
+ start: z13.string()
2883
3003
  });
2884
- authApiKeysDeleteResponseDataSchema = z12.object({
2885
- revoked: z12.boolean()
3004
+ authApiKeysDeleteResponseDataSchema = z13.object({
3005
+ revoked: z13.boolean()
2886
3006
  });
2887
- authSetupResponseDataSchema = z12.object({
2888
- userId: z12.string().uuid(),
2889
- solanaAddress: z12.string().nullable(),
2890
- hlAddress: z12.string().nullable().optional(),
2891
- handle: z12.string().nullable(),
2892
- apiKeyHint: z12.string().nullable(),
2893
- apiKey: z12.string().optional(),
2894
- cliCommand: z12.string().optional(),
2895
- isNew: z12.boolean()
3007
+ authSetupResponseDataSchema = z13.object({
3008
+ userId: z13.string().uuid(),
3009
+ solanaAddress: z13.string().nullable(),
3010
+ hlAddress: z13.string().nullable().optional(),
3011
+ handle: z13.string().nullable(),
3012
+ apiKeyHint: z13.string().nullable(),
3013
+ apiKey: z13.string().optional(),
3014
+ cliCommand: z13.string().optional(),
3015
+ isNew: z13.boolean()
2896
3016
  });
2897
3017
  authApiKeysListResponseSchema = successEnvelope(authApiKeysListResponseDataSchema);
2898
3018
  authApiKeysCreateResponseSchema = successEnvelope(authApiKeysCreateResponseDataSchema);
@@ -2901,156 +3021,57 @@ var init_auth = __esm(() => {
2901
3021
  });
2902
3022
 
2903
3023
  // ../../packages/client/src/schemas/claim.ts
2904
- import { z as z13 } from "zod";
3024
+ import { z as z14 } from "zod";
2905
3025
  var claimTokenParamsSchema, claimInfoResponseDataSchema, claimInfoResponseSchema;
2906
3026
  var init_claim = __esm(() => {
2907
3027
  init_common();
2908
- claimTokenParamsSchema = z13.object({
2909
- token: z13.string().trim().min(1, "Claim token is required")
2910
- });
2911
- claimInfoResponseDataSchema = z13.object({
2912
- claimed: z13.boolean(),
2913
- agent: z13.object({
2914
- name: z13.string(),
2915
- handle: z13.string().nullable().optional(),
2916
- bio: z13.string().nullable(),
2917
- avatar: z13.string().nullable()
3028
+ claimTokenParamsSchema = z14.object({
3029
+ token: z14.string().trim().min(1, "Claim token is required")
3030
+ });
3031
+ claimInfoResponseDataSchema = z14.object({
3032
+ claimed: z14.boolean(),
3033
+ agent: z14.object({
3034
+ name: z14.string(),
3035
+ handle: z14.string().nullable().optional(),
3036
+ bio: z14.string().nullable(),
3037
+ avatar: z14.string().nullable()
2918
3038
  }),
2919
- verificationCode: z13.string().optional(),
2920
- tweetText: z13.string().optional(),
2921
- instructions: z13.string().optional()
3039
+ verificationCode: z14.string().optional(),
3040
+ tweetText: z14.string().optional(),
3041
+ instructions: z14.string().optional()
2922
3042
  });
2923
3043
  claimInfoResponseSchema = successEnvelope(claimInfoResponseDataSchema);
2924
3044
  });
2925
3045
 
2926
3046
  // ../../packages/client/src/schemas/dashboard.ts
2927
- import { z as z14 } from "zod";
3047
+ import { z as z15 } from "zod";
2928
3048
  var dashboardStatusResponseDataSchema, dashboardStatusResponseSchema;
2929
3049
  var init_dashboard = __esm(() => {
2930
3050
  init_common();
2931
- dashboardStatusResponseDataSchema = z14.object({
2932
- solanaAddress: z14.string().nullable(),
2933
- hlAddress: z14.string().nullable(),
2934
- solanaBalance: z14.number(),
2935
- claimToken: z14.string(),
2936
- steps: z14.object({
2937
- funded: z14.boolean(),
2938
- agentConnected: z14.boolean(),
2939
- xConnected: z14.boolean().nullable()
3051
+ dashboardStatusResponseDataSchema = z15.object({
3052
+ solanaAddress: z15.string().nullable(),
3053
+ hlAddress: z15.string().nullable(),
3054
+ solanaBalance: z15.number(),
3055
+ claimToken: z15.string(),
3056
+ steps: z15.object({
3057
+ funded: z15.boolean(),
3058
+ agentConnected: z15.boolean(),
3059
+ xConnected: z15.boolean().nullable()
2940
3060
  }),
2941
- apiKeyHint: z14.string().nullable(),
2942
- xHandle: z14.string().nullable(),
2943
- handle: z14.string().nullable(),
2944
- stats: z14.object({
2945
- totalValueUsd: z14.number(),
2946
- pnlAllTime: z14.number(),
2947
- pnl24h: z14.number(),
2948
- pnl7d: z14.number(),
2949
- lastTradeAt: z14.string().nullable()
3061
+ apiKeyHint: z15.string().nullable(),
3062
+ xHandle: z15.string().nullable(),
3063
+ handle: z15.string().nullable(),
3064
+ stats: z15.object({
3065
+ totalValueUsd: z15.number(),
3066
+ pnlAllTime: z15.number(),
3067
+ pnl24h: z15.number(),
3068
+ pnl7d: z15.number(),
3069
+ lastTradeAt: z15.string().nullable()
2950
3070
  }).nullable()
2951
3071
  });
2952
3072
  dashboardStatusResponseSchema = successEnvelope(dashboardStatusResponseDataSchema);
2953
3073
  });
2954
3074
 
2955
- // ../../packages/client/src/schemas/hyperliquid.ts
2956
- import { z as z15 } from "zod";
2957
- var hyperliquidFillsQuerySchema, hyperliquidSetupRequestSchema, hyperliquidSetupResponseDataSchema, hlPositionSchema, hlSpotBalanceSchema, hyperliquidAccountResponseDataSchema, hlFillSchema, hyperliquidFillsResponseDataSchema, hyperliquidLiquidationRiskResponseDataSchema, hyperliquidSetupResponseSchema, hyperliquidAccountResponseSchema, hyperliquidFillsResponseSchema, hyperliquidLiquidationRiskResponseSchema;
2958
- var init_hyperliquid = __esm(() => {
2959
- init_common();
2960
- hyperliquidFillsQuerySchema = z15.object({
2961
- limit: z15.coerce.number().int().min(1).default(50).transform((value) => Math.min(value, 100)),
2962
- offset: z15.coerce.number().int().min(0).default(0)
2963
- });
2964
- hyperliquidSetupRequestSchema = z15.object({
2965
- sourceChain: z15.enum(["solana", "ethereum", "arbitrum", "optimism", "base"]).optional()
2966
- });
2967
- hyperliquidSetupResponseDataSchema = z15.object({
2968
- deposit_address: z15.string(),
2969
- min_deposit: z15.number().optional(),
2970
- source_chain: z15.string(),
2971
- hl_address: z15.string(),
2972
- estimated_time: z15.string().optional(),
2973
- builder: z15.object({
2974
- address: z15.string(),
2975
- fee: z15.string()
2976
- }).passthrough(),
2977
- instructions: z15.string().optional(),
2978
- note: z15.string().optional()
2979
- });
2980
- hlPositionSchema = z15.object({
2981
- coin: z15.string(),
2982
- side: z15.string(),
2983
- size: z15.number(),
2984
- entryPrice: z15.number(),
2985
- unrealizedPnl: z15.number(),
2986
- marginUsed: z15.number(),
2987
- leverage: z15.number(),
2988
- liquidationPrice: z15.number().nullable()
2989
- }).passthrough();
2990
- hlSpotBalanceSchema = z15.object({
2991
- coin: z15.string(),
2992
- total: z15.number(),
2993
- hold: z15.number(),
2994
- available: z15.number(),
2995
- priceUsd: z15.number(),
2996
- valueUsd: z15.number()
2997
- });
2998
- hyperliquidAccountResponseDataSchema = z15.object({
2999
- hlAddress: z15.string(),
3000
- perps: z15.object({
3001
- accountValue: z15.number(),
3002
- totalMarginUsed: z15.number(),
3003
- unrealizedPnl: z15.number(),
3004
- withdrawable: z15.number(),
3005
- positions: z15.array(hlPositionSchema)
3006
- }),
3007
- spot: z15.object({
3008
- balances: z15.array(hlSpotBalanceSchema)
3009
- }),
3010
- lastSync: z15.string()
3011
- });
3012
- hlFillSchema = z15.object({
3013
- id: z15.string(),
3014
- coin: z15.string(),
3015
- side: z15.string(),
3016
- size: z15.number(),
3017
- price: z15.number(),
3018
- fee: z15.number(),
3019
- builderFee: z15.number().nullable().optional(),
3020
- timestamp: z15.string()
3021
- }).passthrough();
3022
- hyperliquidFillsResponseDataSchema = z15.object({
3023
- hlAddress: z15.string(),
3024
- fills: z15.array(hlFillSchema),
3025
- totalBuilderFees: z15.number(),
3026
- pagination: z15.object({
3027
- limit: z15.number(),
3028
- offset: z15.number(),
3029
- hasMore: z15.boolean()
3030
- })
3031
- });
3032
- hyperliquidLiquidationRiskResponseDataSchema = z15.object({
3033
- hlAddress: z15.string(),
3034
- healthScore: z15.number(),
3035
- marginUtilization: z15.number(),
3036
- totalExposure: z15.number(),
3037
- atRisk: z15.boolean(),
3038
- alerts: z15.array(z15.string()),
3039
- recommendations: z15.array(z15.string()),
3040
- advisoryLimits: z15.object({
3041
- trustLevel: z15.string(),
3042
- maxLeverage: z15.number(),
3043
- maxPositionPct: z15.number(),
3044
- maxDailyLossPct: z15.number(),
3045
- note: z15.string()
3046
- })
3047
- });
3048
- hyperliquidSetupResponseSchema = successEnvelope(hyperliquidSetupResponseDataSchema);
3049
- hyperliquidAccountResponseSchema = successEnvelope(hyperliquidAccountResponseDataSchema);
3050
- hyperliquidFillsResponseSchema = successEnvelope(hyperliquidFillsResponseDataSchema);
3051
- hyperliquidLiquidationRiskResponseSchema = successEnvelope(hyperliquidLiquidationRiskResponseDataSchema);
3052
- });
3053
-
3054
3075
  // ../../packages/client/src/schemas/marketplace.ts
3055
3076
  import { z as z16 } from "zod";
3056
3077
  var MARKETPLACE_TASK_CATEGORIES, marketplaceTaskParamsSchema, marketplaceTasksQuerySchema, marketplaceApplyTaskRequestSchema, marketplaceSubmitTaskRequestSchema, marketplaceTaskListItemSchema, marketplaceTasksResponseDataSchema, marketplaceTaskDetailSchema, marketplaceTaskDetailResponseDataSchema, marketplaceApplyTaskResponseDataSchema, marketplaceSubmitTaskResponseDataSchema, marketplaceTasksResponseSchema, marketplaceTaskDetailResponseSchema, marketplaceApplyTaskResponseSchema, marketplaceSubmitTaskResponseSchema;
@@ -3652,21 +3673,70 @@ function normalizeCliError(error) {
3652
3673
  issues: error.error.issues
3653
3674
  };
3654
3675
  }
3655
- if (error instanceof Error) {
3656
- return { message: error.message };
3657
- }
3658
- return { message: "Unknown error" };
3676
+ if (error instanceof Error) {
3677
+ return { message: error.message };
3678
+ }
3679
+ return { message: "Unknown error" };
3680
+ }
3681
+ function printCliError(error) {
3682
+ const normalized = normalizeCliError(error);
3683
+ const codePrefix = normalized.code ? ` [${normalized.code}]` : "";
3684
+ console.error(chalk.red(`Error${codePrefix}: ${normalized.message}`));
3685
+ if (normalized.issues && normalized.issues.length > 0) {
3686
+ for (const issue of normalized.issues.slice(0, 5)) {
3687
+ const path2 = issue.path.length > 0 ? issue.path.join(".") : "<root>";
3688
+ console.error(chalk.dim(` - ${path2}: ${issue.message} (${issue.code})`));
3689
+ }
3690
+ }
3691
+ }
3692
+ function mapTradeError(error) {
3693
+ const normalized = normalizeCliError(error);
3694
+ const msg = normalized.message.toLowerCase();
3695
+ if (msg.includes("slippage") || msg.includes("0x1789") || msg.includes("6025")) {
3696
+ return {
3697
+ message: "Slippage exceeded — price moved too much during execution",
3698
+ suggestion: "Retry with higher slippage: --slippage 300",
3699
+ retryable: true
3700
+ };
3701
+ }
3702
+ if (msg.includes("expired") || msg.includes("blockhash")) {
3703
+ return {
3704
+ message: "Transaction expired — took too long to confirm",
3705
+ suggestion: "This is transient. Try again.",
3706
+ retryable: true
3707
+ };
3708
+ }
3709
+ if (msg.includes("insufficient balance") || msg.includes("insufficient funds") || msg.includes("0x1")) {
3710
+ return {
3711
+ message: "Insufficient balance",
3712
+ suggestion: "Check your balance with: cabal-cli status",
3713
+ retryable: false
3714
+ };
3715
+ }
3716
+ if (msg.includes("rate limit")) {
3717
+ return {
3718
+ message: normalized.message,
3719
+ suggestion: "Wait a moment before retrying.",
3720
+ retryable: false
3721
+ };
3722
+ }
3723
+ if (msg.includes("unknown token") || msg.includes("token not found")) {
3724
+ return {
3725
+ message: normalized.message,
3726
+ suggestion: "Use a known symbol (SOL, USDC, BONK, WIF) or pass a raw mint address.",
3727
+ retryable: false
3728
+ };
3729
+ }
3730
+ return { message: normalized.message, retryable: false };
3659
3731
  }
3660
- function printCliError(error) {
3661
- const normalized = normalizeCliError(error);
3662
- const codePrefix = normalized.code ? ` [${normalized.code}]` : "";
3663
- console.error(chalk.red(`Error${codePrefix}: ${normalized.message}`));
3664
- if (normalized.issues && normalized.issues.length > 0) {
3665
- for (const issue of normalized.issues.slice(0, 5)) {
3666
- const path2 = issue.path.length > 0 ? issue.path.join(".") : "<root>";
3667
- console.error(chalk.dim(` - ${path2}: ${issue.message} (${issue.code})`));
3668
- }
3732
+ function printTradeError(error) {
3733
+ const mapped = mapTradeError(error);
3734
+ console.error(chalk.red(`
3735
+ ${mapped.message}`));
3736
+ if (mapped.suggestion) {
3737
+ console.error(chalk.dim(` Suggestion: ${mapped.suggestion}`));
3669
3738
  }
3739
+ console.error("");
3670
3740
  }
3671
3741
  function toStructuredError(error) {
3672
3742
  const normalized = normalizeCliError(error);
@@ -3723,6 +3793,8 @@ async function createServer() {
3723
3793
  inputToken: z22.string().optional().describe("Solana: input token symbol (e.g. SOL, USDC)"),
3724
3794
  outputToken: z22.string().optional().describe("Solana: output token symbol (e.g. PEPE, BONK)"),
3725
3795
  amount: z22.number().optional().describe("Solana: amount of input token to swap"),
3796
+ slippageBps: z22.number().optional().describe("Solana: slippage tolerance in basis points (default: 100, max: 500)"),
3797
+ dryRun: z22.boolean().optional().describe("If true, returns a quote without executing (Solana only)"),
3726
3798
  coin: z22.string().optional().describe("Hyperliquid: coin symbol (e.g. BTC, ETH)"),
3727
3799
  side: z22.enum(["buy", "sell"]).optional().describe("Hyperliquid: trade side"),
3728
3800
  size: z22.number().optional().describe("Hyperliquid: position size"),
@@ -3730,31 +3802,50 @@ async function createServer() {
3730
3802
  price: z22.number().optional().describe("Hyperliquid: limit price (required for limit orders)"),
3731
3803
  model: modelSchema.optional().describe("AI model name for attribution")
3732
3804
  };
3733
- server.tool("cabal_trade", "Execute a trade on Solana (Jupiter swap) or Hyperliquid (perps/spot)", tradeSchema, async (params) => {
3734
- return runTool((client) => {
3735
- if (params.chain === "solana") {
3736
- if (!params.inputToken || !params.outputToken || !params.amount)
3737
- throw new Error("Solana trades require inputToken, outputToken, and amount");
3738
- return client.trade({
3739
- chain: "solana",
3740
- inputToken: params.inputToken,
3741
- outputToken: params.outputToken,
3742
- amount: params.amount,
3743
- ...params.model && { model: params.model }
3744
- });
3745
- }
3746
- if (!params.coin || !params.side || !params.size)
3747
- throw new Error("Hyperliquid trades require coin, side, and size");
3748
- return client.trade({
3749
- chain: "hyperliquid",
3750
- coin: params.coin,
3751
- side: params.side,
3752
- size: params.size,
3753
- ...params.orderType && { orderType: params.orderType },
3754
- ...params.price && { price: params.price },
3805
+ server.tool("cabal_trade", "Execute a trade on Solana (Jupiter swap) or Hyperliquid (perps/spot). Set dryRun: true to preview without executing, or use cabal_quote for Solana quotes.", tradeSchema, async (params) => {
3806
+ if (params.chain === "solana") {
3807
+ const { inputToken, outputToken, amount } = params;
3808
+ if (!inputToken || !outputToken || !amount)
3809
+ return textResult(toStructuredError(new Error("Solana trades require inputToken, outputToken, and amount")));
3810
+ const solanaBase = {
3811
+ chain: "solana",
3812
+ inputToken,
3813
+ outputToken,
3814
+ amount,
3815
+ ...params.slippageBps && { slippageBps: params.slippageBps },
3755
3816
  ...params.model && { model: params.model }
3756
- });
3757
- });
3817
+ };
3818
+ if (params.dryRun) {
3819
+ return runTool((client) => client.quote(solanaBase));
3820
+ }
3821
+ return runTool((client) => client.trade(solanaBase));
3822
+ }
3823
+ const { coin, side, size } = params;
3824
+ if (!coin || !side || !size)
3825
+ return textResult(toStructuredError(new Error("Hyperliquid trades require coin, side, and size")));
3826
+ return runTool((client) => client.trade({
3827
+ chain: "hyperliquid",
3828
+ coin,
3829
+ side,
3830
+ size,
3831
+ ...params.orderType && { orderType: params.orderType },
3832
+ ...params.price && { price: params.price },
3833
+ ...params.model && { model: params.model }
3834
+ }));
3835
+ });
3836
+ server.tool("cabal_quote", "Get a Solana swap quote without executing. Returns expected output amount, price impact, and fee. Use this to preview trades before committing.", {
3837
+ inputToken: z22.string().describe("Input token symbol (e.g. SOL, USDC)"),
3838
+ outputToken: z22.string().describe("Output token symbol (e.g. PEPE, BONK)"),
3839
+ amount: z22.number().describe("Amount of input token to swap"),
3840
+ slippageBps: z22.number().optional().describe("Slippage tolerance in basis points (default: 100, max: 500)")
3841
+ }, async (params) => {
3842
+ return runTool((client) => client.quote({
3843
+ chain: "solana",
3844
+ inputToken: params.inputToken,
3845
+ outputToken: params.outputToken,
3846
+ amount: params.amount,
3847
+ ...params.slippageBps && { slippageBps: params.slippageBps }
3848
+ }));
3758
3849
  });
3759
3850
  server.tool("cabal_get_posts", "Browse the Cabal feed — trade posts from AI agents", {
3760
3851
  sort: z22.enum(["hot", "signal", "new"]).optional().describe("Sort order (default: hot)"),
@@ -3872,7 +3963,7 @@ async function createServer() {
3872
3963
  const res = await fetch(`${baseUrl}/skill.json`);
3873
3964
  if (!res.ok)
3874
3965
  throw new Error(`Failed to fetch skill.json: ${res.status}`);
3875
- const data = await res.json();
3966
+ const data = z22.record(z22.string(), z22.unknown()).parse(await res.json());
3876
3967
  return textResult(data);
3877
3968
  } catch (error) {
3878
3969
  return textResult(toStructuredError(error));
@@ -3971,15 +4062,14 @@ async function loginCommand(options = {}) {
3971
4062
  body: JSON.stringify(options.ref ? { referralCode: options.ref } : {})
3972
4063
  });
3973
4064
  if (!res.ok) {
3974
- const data2 = await res.json().catch(() => ({}));
3975
4065
  spinner.fail("Failed to get login code");
3976
- console.log(chalk2.red(` ${data2?.error?.message || "Server error"}`));
4066
+ console.log(chalk2.red(" Server error"));
3977
4067
  return false;
3978
4068
  }
3979
- const { data } = await res.json();
3980
- deviceCode = data.deviceCode;
3981
- userCode = data.userCode;
3982
- verificationUrl = data.verificationUrl;
4069
+ const parsed = deviceCodeCreateResponseSchema.parse(await res.json());
4070
+ deviceCode = parsed.data.deviceCode;
4071
+ userCode = parsed.data.userCode;
4072
+ verificationUrl = parsed.data.verificationUrl;
3983
4073
  spinner.stop();
3984
4074
  } catch (error) {
3985
4075
  spinner.fail("Failed to connect to server");
@@ -4013,7 +4103,8 @@ async function loginCommand(options = {}) {
4013
4103
  const res = await fetch(`${apiBase}/auth/device-code/poll?code=${deviceCode}`);
4014
4104
  if (!res.ok)
4015
4105
  continue;
4016
- const { data } = await res.json();
4106
+ const parsed = deviceCodePollResponseSchema.parse(await res.json());
4107
+ const data = parsed.data;
4017
4108
  if (data.status === "completed") {
4018
4109
  pollSpinner.succeed(chalk2.green("Logged in!"));
4019
4110
  console.log("");
@@ -4066,12 +4157,28 @@ function sleep(ms) {
4066
4157
  }
4067
4158
  var POLL_INTERVAL_MS = 5000, TIMEOUT_MS;
4068
4159
  var init_login = __esm(() => {
4160
+ init_src();
4069
4161
  init_browser();
4070
4162
  init_env();
4071
4163
  init_errors2();
4072
4164
  TIMEOUT_MS = 10 * 60 * 1000;
4073
4165
  });
4074
4166
 
4167
+ // src/lib/tty.ts
4168
+ function isTTY() {
4169
+ return !!process.stdin.isTTY;
4170
+ }
4171
+ function exitMissingFlags(command, missing) {
4172
+ console.error(`Error: this command requires an interactive terminal, or provide these flags:
4173
+ `);
4174
+ for (const { flag, description } of missing) {
4175
+ console.error(` ${flag.padEnd(22)} ${description}`);
4176
+ }
4177
+ console.error(`
4178
+ Example: cabal-cli ${command} ${missing.map((f) => f.flag + " <value>").join(" ")}`);
4179
+ process.exit(1);
4180
+ }
4181
+
4075
4182
  // src/commands/onboard.ts
4076
4183
  var exports_onboard = {};
4077
4184
  __export(exports_onboard, {
@@ -4090,21 +4197,23 @@ async function onboardCommand(options) {
4090
4197
  process.exit(1);
4091
4198
  }
4092
4199
  if (step === "connect") {
4093
- await stepConnect();
4200
+ await stepConnect(options);
4094
4201
  return;
4095
4202
  }
4096
4203
  const client = requireClient();
4097
4204
  if (step === "profile")
4098
- await stepProfile(client);
4205
+ await stepProfile(client, options);
4099
4206
  else if (step === "avatar")
4100
- await stepAvatar(client);
4207
+ await stepAvatar(client, options);
4101
4208
  else if (step === "verify")
4102
- await stepVerify(client);
4209
+ await stepVerify(client, options);
4210
+ else if (step === "hyperliquid")
4211
+ await stepHyperliquid(client, options);
4103
4212
  return;
4104
4213
  }
4105
- await runWizard();
4214
+ await runWizard(options);
4106
4215
  }
4107
- async function runWizard() {
4216
+ async function runWizard(options) {
4108
4217
  if (isConfigured()) {
4109
4218
  const client2 = requireClient();
4110
4219
  let steps;
@@ -4113,14 +4222,27 @@ async function runWizard() {
4113
4222
  } catch {
4114
4223
  console.log(chalk3.yellow(`Saved API key is invalid. Starting fresh.
4115
4224
  `));
4116
- const newClient = await stepConnect();
4225
+ const newClient = await stepConnect(options);
4117
4226
  if (!newClient)
4118
4227
  return;
4119
- await continueWizard(newClient);
4228
+ await continueWizard(newClient, 1, options);
4120
4229
  return;
4121
4230
  }
4122
4231
  const allDone = steps.every((s) => s.done);
4123
4232
  const firstIncomplete = steps.findIndex((s) => !s.done);
4233
+ if (options.confirm) {
4234
+ if (allDone) {
4235
+ console.log(chalk3.green.bold("All onboarding steps already complete."));
4236
+ return;
4237
+ }
4238
+ await continueWizard(client2, firstIncomplete, options);
4239
+ return;
4240
+ }
4241
+ if (!isTTY()) {
4242
+ exitMissingFlags("onboard", [
4243
+ { flag: "-y, --confirm", description: "Auto-continue through wizard (required in non-TTY)" }
4244
+ ]);
4245
+ }
4124
4246
  printProgress(steps);
4125
4247
  if (allDone) {
4126
4248
  const { action: action2 } = await inquirer.prompt([
@@ -4136,10 +4258,10 @@ async function runWizard() {
4136
4258
  ]);
4137
4259
  if (action2 === "quit")
4138
4260
  return;
4139
- const newClient = await stepConnect();
4261
+ const newClient = await stepConnect(options);
4140
4262
  if (!newClient)
4141
4263
  return;
4142
- await continueWizard(newClient);
4264
+ await continueWizard(newClient, 1, options);
4143
4265
  return;
4144
4266
  }
4145
4267
  const { action } = await inquirer.prompt([
@@ -4157,25 +4279,30 @@ async function runWizard() {
4157
4279
  if (action === "quit")
4158
4280
  return;
4159
4281
  if (action === "reconfigure") {
4160
- const newClient = await stepConnect();
4282
+ const newClient = await stepConnect(options);
4161
4283
  if (!newClient)
4162
4284
  return;
4163
- await continueWizard(newClient);
4285
+ await continueWizard(newClient, 1, options);
4164
4286
  return;
4165
4287
  }
4166
- await continueWizard(client2, firstIncomplete);
4288
+ await continueWizard(client2, firstIncomplete, options);
4167
4289
  return;
4168
4290
  }
4169
- const client = await stepConnect();
4291
+ const client = await stepConnect(options);
4170
4292
  if (!client)
4171
4293
  return;
4172
- await continueWizard(client);
4294
+ await continueWizard(client, 1, options);
4173
4295
  }
4174
- async function continueWizard(client, startIdx = 1) {
4296
+ async function continueWizard(client, startIdx = 1, options = {}) {
4175
4297
  for (let i = startIdx;i < STEP_ORDER.length; i++) {
4176
4298
  const step = STEP_ORDER[i];
4177
4299
  console.log("");
4178
- if (i > startIdx) {
4300
+ if (i > startIdx && !options.confirm) {
4301
+ if (!isTTY()) {
4302
+ exitMissingFlags("onboard", [
4303
+ { flag: "-y, --confirm", description: "Auto-continue through wizard (required in non-TTY)" }
4304
+ ]);
4305
+ }
4179
4306
  const { action } = await inquirer.prompt([
4180
4307
  {
4181
4308
  type: "list",
@@ -4194,22 +4321,40 @@ async function continueWizard(client, startIdx = 1) {
4194
4321
  continue;
4195
4322
  }
4196
4323
  if (step === "profile")
4197
- await stepProfile(client);
4324
+ await stepProfile(client, options);
4198
4325
  else if (step === "avatar")
4199
- await stepAvatar(client);
4326
+ await stepAvatar(client, options);
4200
4327
  else if (step === "verify")
4201
- await stepVerify(client);
4328
+ await stepVerify(client, options);
4329
+ else if (step === "hyperliquid")
4330
+ await stepHyperliquid(client, options);
4202
4331
  }
4203
4332
  console.log("");
4204
4333
  console.log(chalk3.green.bold("Onboarding complete!"));
4205
4334
  console.log(chalk3.dim("Run `cabal-cli status` to check your agent.\n"));
4206
4335
  }
4207
- async function stepConnect(apiKeyArg) {
4336
+ async function stepConnect(options, apiKeyArg) {
4208
4337
  console.log(chalk3.bold(`
4209
4338
  Step 1: Connect
4210
4339
  `));
4211
4340
  let apiKey = apiKeyArg;
4212
4341
  if (!apiKey) {
4342
+ if (isConfigured()) {
4343
+ const creds = getCredentials();
4344
+ if (creds.CABAL_API_KEY) {
4345
+ try {
4346
+ const client = new AgentClient(creds.CABAL_API_KEY, creds.NEXT_PUBLIC_SITE_URL);
4347
+ await client.getStatus();
4348
+ console.log(chalk3.dim(` Already connected. Using existing API key.
4349
+ `));
4350
+ return client;
4351
+ } catch {}
4352
+ }
4353
+ }
4354
+ if (!isTTY()) {
4355
+ console.error("Error: No valid API key found. Run `cabal-cli login` in a terminal first.");
4356
+ process.exit(1);
4357
+ }
4213
4358
  console.log(" To connect your agent, you need an API key.");
4214
4359
  console.log(" If you already have one, paste it below.");
4215
4360
  console.log("");
@@ -4300,7 +4445,7 @@ async function stepConnect(apiKeyArg) {
4300
4445
  return null;
4301
4446
  }
4302
4447
  }
4303
- async function stepProfile(client) {
4448
+ async function stepProfile(client, options = {}) {
4304
4449
  console.log(chalk3.bold(`
4305
4450
  Step 2: Profile
4306
4451
  `));
@@ -4315,61 +4460,86 @@ async function stepProfile(client) {
4315
4460
  printCliError(error);
4316
4461
  return;
4317
4462
  }
4318
- console.log(chalk3.dim(` Press Enter to keep current values.
4463
+ if (!isTTY()) {
4464
+ const missing = [];
4465
+ if (!options.name)
4466
+ missing.push({ flag: "--name", description: "Display name" });
4467
+ if (!options.handle)
4468
+ missing.push({ flag: "--handle", description: "Unique handle" });
4469
+ if (!options.bio)
4470
+ missing.push({ flag: "--bio", description: "Agent bio" });
4471
+ if (!options.strategy)
4472
+ missing.push({ flag: "--strategy", description: "Trading strategy" });
4473
+ if (missing.length > 0)
4474
+ exitMissingFlags("onboard --step profile", missing);
4475
+ }
4476
+ let name, handle, bio, strategy;
4477
+ if (options.name && options.handle && options.bio && options.strategy) {
4478
+ name = options.name;
4479
+ handle = options.handle;
4480
+ bio = options.bio;
4481
+ strategy = options.strategy;
4482
+ } else {
4483
+ console.log(chalk3.dim(` Press Enter to keep current values.
4319
4484
  `));
4320
- const answers = await inquirer.prompt([
4321
- {
4322
- type: "input",
4323
- name: "name",
4324
- message: "Display name:",
4325
- default: agent2.name
4326
- },
4327
- {
4328
- type: "input",
4329
- name: "handle",
4330
- message: "Handle (unique):",
4331
- default: agent2.handle ?? undefined,
4332
- validate: async (input) => {
4333
- if (!input)
4334
- return true;
4335
- if (!/^[a-zA-Z0-9_-]+$/.test(input))
4336
- return "Handle must be alphanumeric with _ or -";
4337
- if (input.length > 120)
4338
- return "Handle must be 120 characters or fewer";
4339
- if (input === agent2.handle)
4340
- return true;
4341
- try {
4342
- const result2 = await client.checkHandle(input);
4343
- if (!result2.available)
4344
- return result2.reason ?? "Handle is not available";
4345
- return true;
4346
- } catch {
4347
- return "Could not validate handle — try again";
4485
+ const answers = await inquirer.prompt([
4486
+ {
4487
+ type: "input",
4488
+ name: "name",
4489
+ message: "Display name:",
4490
+ default: options.name ?? agent2.name
4491
+ },
4492
+ {
4493
+ type: "input",
4494
+ name: "handle",
4495
+ message: "Handle (unique):",
4496
+ default: options.handle ?? agent2.handle ?? undefined,
4497
+ validate: async (input) => {
4498
+ if (!input)
4499
+ return true;
4500
+ if (!/^[a-zA-Z0-9_-]+$/.test(input))
4501
+ return "Handle must be alphanumeric with _ or -";
4502
+ if (input.length > 120)
4503
+ return "Handle must be 120 characters or fewer";
4504
+ if (input === agent2.handle)
4505
+ return true;
4506
+ try {
4507
+ const result2 = await client.checkHandle(input);
4508
+ if (!result2.available)
4509
+ return result2.reason ?? "Handle is not available";
4510
+ return true;
4511
+ } catch {
4512
+ return "Could not validate handle — try again";
4513
+ }
4348
4514
  }
4515
+ },
4516
+ {
4517
+ type: "input",
4518
+ name: "bio",
4519
+ message: "Bio:",
4520
+ default: options.bio ?? agent2.bio ?? undefined
4521
+ },
4522
+ {
4523
+ type: "input",
4524
+ name: "strategy",
4525
+ message: "Strategy:",
4526
+ default: options.strategy ?? agent2.strategy ?? undefined
4349
4527
  }
4350
- },
4351
- {
4352
- type: "input",
4353
- name: "bio",
4354
- message: "Bio:",
4355
- default: agent2.bio ?? undefined
4356
- },
4357
- {
4358
- type: "input",
4359
- name: "strategy",
4360
- message: "Strategy:",
4361
- default: agent2.strategy ?? undefined
4362
- }
4363
- ]);
4528
+ ]);
4529
+ name = answers.name;
4530
+ handle = answers.handle;
4531
+ bio = answers.bio;
4532
+ strategy = answers.strategy;
4533
+ }
4364
4534
  const updates = {};
4365
- if (answers.name && answers.name !== agent2.name)
4366
- updates.name = answers.name;
4367
- if (answers.handle && answers.handle !== agent2.handle)
4368
- updates.handle = answers.handle;
4369
- if (answers.bio && answers.bio !== agent2.bio)
4370
- updates.bio = answers.bio;
4371
- if (answers.strategy && answers.strategy !== agent2.strategy)
4372
- updates.strategy = answers.strategy;
4535
+ if (name && name !== agent2.name)
4536
+ updates.name = name;
4537
+ if (handle && handle !== agent2.handle)
4538
+ updates.handle = handle;
4539
+ if (bio && bio !== agent2.bio)
4540
+ updates.bio = bio;
4541
+ if (strategy && strategy !== agent2.strategy)
4542
+ updates.strategy = strategy;
4373
4543
  if (Object.keys(updates).length === 0) {
4374
4544
  console.log(chalk3.dim(`
4375
4545
  No changes made.
@@ -4386,10 +4556,62 @@ async function stepProfile(client) {
4386
4556
  printCliError(error);
4387
4557
  }
4388
4558
  }
4389
- async function stepAvatar(client) {
4559
+ async function stepAvatar(client, options = {}) {
4390
4560
  console.log(chalk3.bold(`
4391
4561
  Step 3: Avatar
4392
4562
  `));
4563
+ if (options.skipAvatar) {
4564
+ console.log(chalk3.dim(` Skipped avatar step.
4565
+ `));
4566
+ return;
4567
+ }
4568
+ if (options.avatarId) {
4569
+ const selectSpinner = ora2("Selecting avatar...").start();
4570
+ try {
4571
+ await client.selectAvatar(options.avatarId);
4572
+ selectSpinner.succeed("Avatar updated!");
4573
+ } catch (error) {
4574
+ selectSpinner.fail("Failed to select avatar");
4575
+ printCliError(error);
4576
+ }
4577
+ console.log("");
4578
+ return;
4579
+ }
4580
+ if (options.avatar) {
4581
+ const genSpinner = ora2("Generating avatar...").start();
4582
+ try {
4583
+ const result2 = await client.generateAvatar(options.avatar);
4584
+ genSpinner.succeed("Avatar generated!");
4585
+ console.log("");
4586
+ if (result2.generationId) {
4587
+ console.log(` ${chalk3.dim("Generation ID:")} ${result2.generationId}`);
4588
+ }
4589
+ console.log(` ${chalk3.dim("Image URL:")} ${chalk3.cyan(result2.imageUrl)}`);
4590
+ console.log(` ${chalk3.dim("Credits left:")} ${result2.creditsRemaining}`);
4591
+ if (result2.generationId) {
4592
+ const selectSpinner = ora2("Setting avatar...").start();
4593
+ try {
4594
+ await client.selectAvatar(result2.generationId);
4595
+ selectSpinner.succeed("Avatar set!");
4596
+ } catch (err2) {
4597
+ selectSpinner.fail("Failed to set avatar");
4598
+ printCliError(err2);
4599
+ }
4600
+ }
4601
+ } catch (error) {
4602
+ genSpinner.fail("Failed to generate avatar");
4603
+ printCliError(error);
4604
+ }
4605
+ console.log("");
4606
+ return;
4607
+ }
4608
+ if (!isTTY()) {
4609
+ exitMissingFlags("onboard --step avatar", [
4610
+ { flag: "--avatar", description: "Generate avatar from this description" },
4611
+ { flag: "--avatar-id", description: "Select an existing avatar generation by ID" },
4612
+ { flag: "--skip-avatar", description: "Skip avatar step entirely" }
4613
+ ]);
4614
+ }
4393
4615
  const spinner = ora2("Fetching avatar credits...").start();
4394
4616
  try {
4395
4617
  const credits = await client.getAvatarCredits();
@@ -4504,20 +4726,36 @@ async function stepAvatar(client) {
4504
4726
  printCliError(error);
4505
4727
  }
4506
4728
  }
4507
- async function stepVerify(client) {
4729
+ async function stepVerify(client, options = {}) {
4508
4730
  console.log(chalk3.bold(`
4509
4731
  Step 4: Verify (optional)
4510
4732
  `));
4511
- console.log(" Claim your agent by tweeting a verification post.");
4512
- console.log(` ${chalk3.dim("Dashboard:")} ${chalk3.cyan(DASHBOARD_URL)}`);
4513
- console.log("");
4514
- const { tweetUrl } = await inquirer.prompt([
4515
- {
4516
- type: "input",
4517
- name: "tweetUrl",
4518
- message: "Tweet URL (or press Enter to skip):"
4519
- }
4520
- ]);
4733
+ if (options.skipVerify) {
4734
+ console.log(chalk3.dim(` Skipped verification.
4735
+ `));
4736
+ return;
4737
+ }
4738
+ let tweetUrl;
4739
+ if (options.tweetUrl) {
4740
+ tweetUrl = options.tweetUrl;
4741
+ } else if (!isTTY()) {
4742
+ exitMissingFlags("onboard --step verify", [
4743
+ { flag: "--tweet-url", description: "Tweet URL for verification" },
4744
+ { flag: "--skip-verify", description: "Skip verification step" }
4745
+ ]);
4746
+ } else {
4747
+ console.log(" Claim your agent by tweeting a verification post.");
4748
+ console.log(` ${chalk3.dim("Dashboard:")} ${chalk3.cyan(DASHBOARD_URL)}`);
4749
+ console.log("");
4750
+ const answer = await inquirer.prompt([
4751
+ {
4752
+ type: "input",
4753
+ name: "tweetUrl",
4754
+ message: "Tweet URL (or press Enter to skip):"
4755
+ }
4756
+ ]);
4757
+ tweetUrl = answer.tweetUrl;
4758
+ }
4521
4759
  if (!tweetUrl.trim()) {
4522
4760
  console.log(chalk3.dim("\n Skipped verification. You can verify later with `cabal-cli onboard --step verify`.\n"));
4523
4761
  return;
@@ -4562,6 +4800,50 @@ async function stepVerify(client) {
4562
4800
  printCliError(error);
4563
4801
  }
4564
4802
  }
4803
+ async function stepHyperliquid(client, options = {}) {
4804
+ console.log(chalk3.bold(`
4805
+ Step 5: Hyperliquid (optional)
4806
+ `));
4807
+ if (options.skipHl) {
4808
+ console.log(chalk3.dim(` Skipped Hyperliquid setup.
4809
+ `));
4810
+ return;
4811
+ }
4812
+ if (!isTTY()) {
4813
+ console.log(chalk3.dim(" Skipped Hyperliquid setup (non-interactive). Use `cabal-cli hl init -y` to provision.\n"));
4814
+ return;
4815
+ }
4816
+ const { enable } = await inquirer.prompt([
4817
+ {
4818
+ type: "confirm",
4819
+ name: "enable",
4820
+ message: "Enable Hyperliquid trading? (provisions an EVM wallet)",
4821
+ default: false
4822
+ }
4823
+ ]);
4824
+ if (!enable) {
4825
+ console.log(chalk3.dim("\n Skipped. You can set up later with `cabal-cli hl init`.\n"));
4826
+ return;
4827
+ }
4828
+ const spinner = ora2("Provisioning Hyperliquid wallet...").start();
4829
+ try {
4830
+ const result2 = await client.setupHyperliquid("solana");
4831
+ spinner.succeed("Hyperliquid wallet provisioned!");
4832
+ console.log("");
4833
+ console.log(` ${chalk3.dim("HL Address:")} ${chalk3.cyan(result2.hl_address)}`);
4834
+ console.log(` ${chalk3.dim("Deposit Address:")} ${chalk3.cyan(result2.deposit_address)}`);
4835
+ console.log(` ${chalk3.dim("Source Chain:")} ${result2.source_chain}`);
4836
+ if (result2.min_deposit != null) {
4837
+ console.log(` ${chalk3.dim("Min Deposit:")} $${result2.min_deposit}`);
4838
+ }
4839
+ console.log("");
4840
+ console.log(chalk3.bold(" Next: Fund your deposit address, then run `cabal-cli hl status`"));
4841
+ console.log("");
4842
+ } catch (error) {
4843
+ spinner.fail("Failed to provision Hyperliquid wallet");
4844
+ printCliError(error);
4845
+ }
4846
+ }
4565
4847
  function requireClient() {
4566
4848
  const credentials = getCredentials();
4567
4849
  if (!credentials.CABAL_API_KEY) {
@@ -4597,6 +4879,12 @@ async function getStepStatus(client) {
4597
4879
  label: "Verify",
4598
4880
  done: agent2.claimed === true,
4599
4881
  summary: agent2.claimed ? "Claimed" : "Claim via X (optional)"
4882
+ },
4883
+ {
4884
+ key: "hyperliquid",
4885
+ label: "Hyperliquid",
4886
+ done: agent2.hlAddress !== null && agent2.hlAddress !== undefined,
4887
+ summary: agent2.hlAddress ? "Wallet provisioned" : "Enable HL trading (optional)"
4600
4888
  }
4601
4889
  ];
4602
4890
  }
@@ -4620,6 +4908,8 @@ function stepLabel(step) {
4620
4908
  return "Avatar — generate a profile picture";
4621
4909
  case "verify":
4622
4910
  return "Verify — claim via X";
4911
+ case "hyperliquid":
4912
+ return "Hyperliquid — enable perps trading";
4623
4913
  }
4624
4914
  }
4625
4915
  function getStatusBadge(status) {
@@ -4643,7 +4933,7 @@ var init_onboard = __esm(() => {
4643
4933
  init_errors2();
4644
4934
  init_browser();
4645
4935
  init_login();
4646
- STEP_ORDER = ["connect", "profile", "avatar", "verify"];
4936
+ STEP_ORDER = ["connect", "profile", "avatar", "verify", "hyperliquid"];
4647
4937
  });
4648
4938
 
4649
4939
  // src/commands/status.ts
@@ -4747,6 +5037,13 @@ import chalk5 from "chalk";
4747
5037
  import ora4 from "ora";
4748
5038
  import inquirer2 from "inquirer";
4749
5039
  import { z as z23 } from "zod";
5040
+ async function promptOrFlag(flagValue, promptFn) {
5041
+ if (flagValue !== undefined)
5042
+ return flagValue;
5043
+ if (!isTTY())
5044
+ throw new Error("__missing_flag__");
5045
+ return promptFn();
5046
+ }
4750
5047
  async function tradeCommand(options) {
4751
5048
  if (!isConfigured()) {
4752
5049
  console.log(chalk5.red("Error: No API key found. Run `cabal-cli init` first."));
@@ -4757,68 +5054,112 @@ async function tradeCommand(options) {
4757
5054
  console.log(chalk5.red("Error: CABAL_API_KEY not found in .env"));
4758
5055
  process.exit(1);
4759
5056
  }
5057
+ const shouldExecute = options.execute || options.confirm || false;
5058
+ const slippageBps = options.slippage ? parseInt(options.slippage, 10) : 100;
5059
+ if (isNaN(slippageBps) || slippageBps < 1 || slippageBps > 500) {
5060
+ console.log(chalk5.red("Error: --slippage must be between 1 and 500 bps"));
5061
+ process.exit(1);
5062
+ }
5063
+ const maxRetries = options.retries ? parseInt(options.retries, 10) : 0;
5064
+ if (isNaN(maxRetries) || maxRetries < 0) {
5065
+ console.log(chalk5.red("Error: --retries must be a non-negative integer"));
5066
+ process.exit(1);
5067
+ }
4760
5068
  let request;
4761
- const chain = options.chain || (await inquirer2.prompt([{
4762
- type: "list",
4763
- name: "chain",
4764
- message: "Chain:",
4765
- choices: ["solana", "hyperliquid"]
4766
- }])).chain;
5069
+ let chain;
5070
+ try {
5071
+ chain = await promptOrFlag(options.chain, async () => (await inquirer2.prompt([{
5072
+ type: "list",
5073
+ name: "chain",
5074
+ message: "Chain:",
5075
+ choices: ["solana", "hyperliquid"]
5076
+ }])).chain);
5077
+ } catch {
5078
+ exitMissingFlags("trade", [
5079
+ { flag: "-c, --chain", description: "Chain: solana or hyperliquid" }
5080
+ ]);
5081
+ }
4767
5082
  if (chain === "solana") {
4768
- const inputToken = options.input || (await inquirer2.prompt([{
5083
+ if (!isTTY()) {
5084
+ const missing = [];
5085
+ if (!options.input)
5086
+ missing.push({ flag: "-i, --input", description: "Input token (e.g. SOL, USDC)" });
5087
+ if (!options.output)
5088
+ missing.push({ flag: "-o, --output", description: "Output token (e.g. PEPE, BONK)" });
5089
+ if (!options.amount)
5090
+ missing.push({ flag: "-a, --amount", description: "Amount of input token" });
5091
+ if (missing.length > 0)
5092
+ exitMissingFlags("trade --chain solana", missing);
5093
+ }
5094
+ const inputToken = await promptOrFlag(options.input, async () => (await inquirer2.prompt([{
4769
5095
  type: "input",
4770
5096
  name: "value",
4771
5097
  message: "Input token (e.g. SOL, USDC):",
4772
5098
  validate: (v) => v.trim() ? true : "Required"
4773
- }])).value;
4774
- const outputToken = options.output || (await inquirer2.prompt([{
5099
+ }])).value);
5100
+ const outputToken = await promptOrFlag(options.output, async () => (await inquirer2.prompt([{
4775
5101
  type: "input",
4776
5102
  name: "value",
4777
5103
  message: "Output token (e.g. PEPE, BONK):",
4778
5104
  validate: (v) => v.trim() ? true : "Required"
4779
- }])).value;
4780
- const amount = options.amount ? parseFloat(options.amount) : parseFloat((await inquirer2.prompt([{
5105
+ }])).value);
5106
+ const amountStr = options.amount ?? await promptOrFlag(undefined, async () => (await inquirer2.prompt([{
4781
5107
  type: "input",
4782
5108
  name: "value",
4783
5109
  message: `Amount of ${inputToken} to swap:`,
4784
5110
  validate: (v) => parseFloat(v) > 0 ? true : "Must be a positive number"
4785
5111
  }])).value);
5112
+ const amount = parseFloat(amountStr);
4786
5113
  request = {
4787
5114
  chain: "solana",
4788
5115
  inputToken: inputToken.trim().toUpperCase(),
4789
5116
  outputToken: outputToken.trim().toUpperCase(),
4790
5117
  amount,
5118
+ slippageBps,
4791
5119
  ...options.model && { model: modelSchema.parse(options.model) }
4792
5120
  };
4793
5121
  } else if (chain === "hyperliquid") {
4794
- const coin = options.coin || (await inquirer2.prompt([{
5122
+ if (!isTTY()) {
5123
+ const missing = [];
5124
+ if (!options.coin)
5125
+ missing.push({ flag: "--coin", description: "Coin symbol (e.g. BTC, ETH)" });
5126
+ if (!options.side)
5127
+ missing.push({ flag: "--side", description: "Side: buy or sell" });
5128
+ if (!options.size)
5129
+ missing.push({ flag: "--size", description: "Position size" });
5130
+ if (missing.length > 0)
5131
+ exitMissingFlags("trade --chain hyperliquid", missing);
5132
+ }
5133
+ const coin = await promptOrFlag(options.coin, async () => (await inquirer2.prompt([{
4795
5134
  type: "input",
4796
5135
  name: "value",
4797
5136
  message: "Coin (e.g. BTC, ETH):",
4798
5137
  validate: (v) => v.trim() ? true : "Required"
4799
- }])).value;
4800
- const rawSide = options.side || (await inquirer2.prompt([{
5138
+ }])).value);
5139
+ const rawSide = await promptOrFlag(options.side, async () => (await inquirer2.prompt([{
4801
5140
  type: "list",
4802
5141
  name: "value",
4803
5142
  message: "Side:",
4804
5143
  choices: ["buy", "sell"]
4805
- }])).value;
5144
+ }])).value);
4806
5145
  const side = z23.enum(["buy", "sell"]).parse(rawSide);
4807
- const size = options.size ? parseFloat(options.size) : parseFloat((await inquirer2.prompt([{
5146
+ const sizeStr = options.size ?? await promptOrFlag(undefined, async () => (await inquirer2.prompt([{
4808
5147
  type: "input",
4809
5148
  name: "value",
4810
5149
  message: "Size:",
4811
5150
  validate: (v) => parseFloat(v) > 0 ? true : "Must be a positive number"
4812
5151
  }])).value);
5152
+ const size = parseFloat(sizeStr);
4813
5153
  const orderType = z23.enum(["limit", "market"]).parse(options.orderType || "market");
4814
5154
  let price;
4815
5155
  if (orderType === "limit") {
4816
- price = options.price ? parseFloat(options.price) : parseFloat((await inquirer2.prompt([{
5156
+ const priceStr = options.price ?? await promptOrFlag(undefined, async () => (await inquirer2.prompt([{
4817
5157
  type: "input",
4818
5158
  name: "value",
4819
5159
  message: "Limit price:",
4820
5160
  validate: (v) => parseFloat(v) > 0 ? true : "Must be a positive number"
4821
5161
  }])).value);
5162
+ price = parseFloat(priceStr);
4822
5163
  }
4823
5164
  request = {
4824
5165
  chain: "hyperliquid",
@@ -4833,62 +5174,96 @@ async function tradeCommand(options) {
4833
5174
  console.log(chalk5.red(`Error: Unknown chain "${chain}". Use "solana" or "hyperliquid".`));
4834
5175
  process.exit(1);
4835
5176
  }
4836
- console.log("");
4837
- console.log(chalk5.bold("Trade Summary"));
5177
+ const client = new AgentClient(credentials.CABAL_API_KEY, credentials.NEXT_PUBLIC_SITE_URL);
4838
5178
  if (request.chain === "solana") {
4839
- console.log(` ${chalk5.dim("Chain:")} Solana`);
4840
- console.log(` ${chalk5.dim("Swap:")} ${request.amount} ${request.inputToken} → ${request.outputToken}`);
5179
+ const spinner2 = ora4("Fetching quote...").start();
5180
+ try {
5181
+ const quote = await client.quote(request);
5182
+ spinner2.stop();
5183
+ console.log("");
5184
+ console.log(chalk5.bold("Trade Preview"));
5185
+ console.log("");
5186
+ console.log(` ${chalk5.dim("Chain:")} Solana`);
5187
+ console.log(` ${chalk5.dim("Swap:")} ${request.amount} ${request.inputToken} → ${request.outputToken}`);
5188
+ console.log(` ${chalk5.dim("Slippage:")} ${slippageBps / 100}% max (${slippageBps} bps)`);
5189
+ console.log("");
5190
+ console.log(` ${chalk5.dim("Output:")} ~${quote.quote.outAmount} ${request.outputToken}`);
5191
+ console.log(` ${chalk5.dim("Impact:")} ${quote.quote.priceImpactPct}%`);
5192
+ console.log(` ${chalk5.dim("Fee:")} ${quote.fee.bps} bps`);
5193
+ console.log("");
5194
+ } catch (error) {
5195
+ spinner2.fail(chalk5.red("Quote failed"));
5196
+ printTradeError(error);
5197
+ process.exit(1);
5198
+ }
4841
5199
  } else {
4842
- console.log(` ${chalk5.dim("Chain:")} Hyperliquid`);
5200
+ console.log("");
5201
+ console.log(chalk5.bold("Trade Preview"));
5202
+ console.log("");
5203
+ console.log(` ${chalk5.dim("Chain:")} Hyperliquid`);
4843
5204
  console.log(` ${chalk5.dim("Action:")} ${request.side.toUpperCase()} ${request.size} ${request.coin}`);
4844
5205
  console.log(` ${chalk5.dim("Type:")} ${request.orderType || "market"}`);
4845
5206
  if (request.price)
4846
5207
  console.log(` ${chalk5.dim("Price:")} $${request.price}`);
5208
+ console.log("");
4847
5209
  }
4848
- console.log("");
4849
- const { confirm } = await inquirer2.prompt([{
4850
- type: "confirm",
4851
- name: "confirm",
4852
- message: "Execute this trade?",
4853
- default: false
4854
- }]);
4855
- if (!confirm) {
4856
- console.log(chalk5.dim("Trade cancelled."));
5210
+ if (!shouldExecute) {
5211
+ console.log(chalk5.dim(" To execute: add --execute"));
5212
+ console.log("");
4857
5213
  return;
4858
5214
  }
5215
+ if (isTTY()) {
5216
+ const { confirm } = await inquirer2.prompt([{
5217
+ type: "confirm",
5218
+ name: "confirm",
5219
+ message: "Execute this trade?",
5220
+ default: false
5221
+ }]);
5222
+ if (!confirm) {
5223
+ console.log(chalk5.dim("Trade cancelled."));
5224
+ return;
5225
+ }
5226
+ }
4859
5227
  const spinner = ora4("Executing trade...").start();
4860
- try {
4861
- const client = new AgentClient(credentials.CABAL_API_KEY, credentials.NEXT_PUBLIC_SITE_URL);
4862
- const result2 = await client.trade(request);
4863
- spinner.succeed(chalk5.green("Trade executed!"));
4864
- console.log("");
4865
- if (result2.txSignature) {
4866
- console.log(` ${chalk5.dim("Status:")} ${chalk5.green(result2.status)}`);
4867
- console.log(` ${chalk5.dim("TX:")} ${chalk5.cyan(result2.txSignature)}`);
4868
- if (result2.explorerUrl) {
4869
- console.log(` ${chalk5.dim("Explorer:")} ${chalk5.cyan(result2.explorerUrl)}`);
5228
+ for (let attempt = 1;attempt <= maxRetries + 1; attempt++) {
5229
+ try {
5230
+ const result2 = await client.trade(request);
5231
+ spinner.succeed(chalk5.green("Trade executed!"));
5232
+ console.log("");
5233
+ if (result2.txSignature) {
5234
+ console.log(` ${chalk5.dim("Status:")} ${chalk5.green(result2.status)}`);
5235
+ console.log(` ${chalk5.dim("TX:")} ${chalk5.cyan(result2.txSignature)}`);
5236
+ if (result2.explorerUrl) {
5237
+ console.log(` ${chalk5.dim("Explorer:")} ${chalk5.cyan(result2.explorerUrl)}`);
5238
+ }
5239
+ if (result2.input && result2.output) {
5240
+ console.log(` ${chalk5.dim("Swapped:")} ${result2.input.amount} ${result2.input.token} → ${result2.output.amount} ${result2.output.token}`);
5241
+ }
4870
5242
  }
4871
- if (result2.input && result2.output) {
4872
- console.log(` ${chalk5.dim("Swapped:")} ${result2.input.amount} ${result2.input.token} → ${result2.output.amount} ${result2.output.token}`);
5243
+ if (result2.orderId) {
5244
+ console.log(` ${chalk5.dim("Order:")} ${result2.orderId}`);
5245
+ console.log(` ${chalk5.dim("Status:")} ${chalk5.green(result2.status)}`);
5246
+ if (result2.fill) {
5247
+ console.log(` ${chalk5.dim("Fill:")} ${result2.fill.size} ${result2.fill.coin} @ $${result2.fill.price}`);
5248
+ }
4873
5249
  }
4874
- }
4875
- if (result2.orderId) {
4876
- console.log(` ${chalk5.dim("Order:")} ${result2.orderId}`);
4877
- console.log(` ${chalk5.dim("Status:")} ${chalk5.green(result2.status)}`);
4878
- if (result2.fill) {
4879
- console.log(` ${chalk5.dim("Fill:")} ${result2.fill.size} ${result2.fill.coin} @ $${result2.fill.price}`);
5250
+ if (result2.tradeId) {
5251
+ console.log("");
5252
+ console.log(chalk5.dim(`Trade ID: ${result2.tradeId}`));
5253
+ console.log(chalk5.dim("Use this to create a post: cabal-cli post --trade <tradeId>"));
4880
5254
  }
4881
- }
4882
- if (result2.tradeId) {
4883
5255
  console.log("");
4884
- console.log(chalk5.dim(`Trade ID: ${result2.tradeId}`));
4885
- console.log(chalk5.dim("Use this to create a post: cabal-cli post --trade <tradeId>"));
5256
+ return;
5257
+ } catch (error) {
5258
+ const mapped = mapTradeError(error);
5259
+ if (mapped.retryable && attempt <= maxRetries) {
5260
+ spinner.text = `${mapped.message}, retrying with fresh quote (${attempt}/${maxRetries})...`;
5261
+ continue;
5262
+ }
5263
+ spinner.fail(chalk5.red("Trade failed"));
5264
+ printTradeError(error);
5265
+ process.exit(1);
4886
5266
  }
4887
- console.log("");
4888
- } catch (error) {
4889
- spinner.fail(chalk5.red("Trade failed"));
4890
- printCliError(error);
4891
- process.exit(1);
4892
5267
  }
4893
5268
  }
4894
5269
  var init_trade2 = __esm(() => {
@@ -5449,6 +5824,7 @@ import chalk14 from "chalk";
5449
5824
  import ora13 from "ora";
5450
5825
  import fs2 from "fs";
5451
5826
  import path2 from "path";
5827
+ import { z as z26 } from "zod";
5452
5828
  function getBaseUrl() {
5453
5829
  const creds = getCredentials();
5454
5830
  return creds.NEXT_PUBLIC_SITE_URL || "https://cabal.trading";
@@ -5459,8 +5835,7 @@ async function fetchSkillJson() {
5459
5835
  if (!res.ok) {
5460
5836
  throw new Error(`Failed to fetch skill manifest: ${res.status} ${res.statusText}`);
5461
5837
  }
5462
- const data = await res.json();
5463
- return { files: data.files || {}, descriptions: data.descriptions || {} };
5838
+ return skillManifestSchema.parse(await res.json());
5464
5839
  }
5465
5840
  function readInstalledManifest(dir) {
5466
5841
  const manifestPath = path2.join(dir, MANIFEST_FILE);
@@ -5608,10 +5983,128 @@ function formatBytes(bytes) {
5608
5983
  const kb = bytes / 1024;
5609
5984
  return `${kb.toFixed(1)} KB`;
5610
5985
  }
5611
- var MANIFEST_FILE = ".cabal-skills.json";
5986
+ var MANIFEST_FILE = ".cabal-skills.json", skillManifestSchema;
5612
5987
  var init_skill = __esm(() => {
5613
5988
  init_env();
5614
5989
  init_errors2();
5990
+ skillManifestSchema = z26.object({
5991
+ files: z26.record(z26.string(), z26.string()).optional().default({}),
5992
+ descriptions: z26.record(z26.string(), z26.string()).optional().default({})
5993
+ });
5994
+ });
5995
+
5996
+ // src/commands/hl.ts
5997
+ var exports_hl = {};
5998
+ __export(exports_hl, {
5999
+ hlStatusCommand: () => hlStatusCommand,
6000
+ hlInitCommand: () => hlInitCommand
6001
+ });
6002
+ import chalk15 from "chalk";
6003
+ import ora14 from "ora";
6004
+ function getClient3() {
6005
+ if (!isConfigured()) {
6006
+ console.log(chalk15.yellow("No Cabal configuration found."));
6007
+ console.log(chalk15.dim("Run `cabal-cli login` to set up your agent."));
6008
+ process.exit(1);
6009
+ }
6010
+ const credentials = getCredentials();
6011
+ if (!credentials.CABAL_API_KEY) {
6012
+ console.log(chalk15.red("CABAL_API_KEY not found in .env"));
6013
+ process.exit(1);
6014
+ }
6015
+ return new AgentClient(credentials.CABAL_API_KEY, credentials.NEXT_PUBLIC_SITE_URL);
6016
+ }
6017
+ async function hlInitCommand(options) {
6018
+ if (!isTTY() && !options.confirm) {
6019
+ exitMissingFlags("hl init", [
6020
+ { flag: "-y, --confirm", description: "Required in non-TTY mode" }
6021
+ ]);
6022
+ }
6023
+ const client = getClient3();
6024
+ const spinner = ora14("Provisioning Hyperliquid wallet...").start();
6025
+ try {
6026
+ const result2 = await client.setupHyperliquid("solana");
6027
+ spinner.succeed("Hyperliquid wallet provisioned!");
6028
+ console.log("");
6029
+ console.log(` ${chalk15.dim("HL Address:")} ${chalk15.cyan(result2.hl_address)}`);
6030
+ console.log(` ${chalk15.dim("Deposit Address:")} ${chalk15.cyan(result2.deposit_address)}`);
6031
+ console.log(` ${chalk15.dim("Source Chain:")} ${result2.source_chain}`);
6032
+ if (result2.min_deposit != null) {
6033
+ console.log(` ${chalk15.dim("Min Deposit:")} $${result2.min_deposit}`);
6034
+ }
6035
+ console.log(` ${chalk15.dim("Builder Fee:")} ${result2.builder.fee} to ${result2.builder.address}`);
6036
+ if (result2.instructions) {
6037
+ console.log("");
6038
+ console.log(chalk15.dim(` ${result2.instructions}`));
6039
+ }
6040
+ if (result2.note) {
6041
+ console.log(chalk15.dim(` ${result2.note}`));
6042
+ }
6043
+ console.log("");
6044
+ console.log(chalk15.bold("Next steps:"));
6045
+ console.log(` 1. Fund your deposit address with USDC`);
6046
+ console.log(` 2. Run ${chalk15.green("cabal-cli hl status")} to check your balance`);
6047
+ console.log("");
6048
+ } catch (error) {
6049
+ spinner.fail("Failed to provision Hyperliquid wallet");
6050
+ printCliError(error);
6051
+ process.exit(1);
6052
+ }
6053
+ }
6054
+ async function hlStatusCommand() {
6055
+ const client = getClient3();
6056
+ const spinner = ora14("Fetching Hyperliquid account...").start();
6057
+ try {
6058
+ const account = await client.getHyperliquidAccount();
6059
+ spinner.succeed("Hyperliquid account loaded");
6060
+ console.log("");
6061
+ console.log(` ${chalk15.dim("HL Address:")} ${chalk15.cyan(account.hlAddress)}`);
6062
+ console.log(` ${chalk15.dim("Last Sync:")} ${account.lastSync}`);
6063
+ console.log("");
6064
+ console.log(chalk15.bold(" Perps"));
6065
+ console.log(` ${chalk15.dim("Account Value:")} $${account.perps.accountValue.toFixed(2)}`);
6066
+ console.log(` ${chalk15.dim("Margin Used:")} $${account.perps.totalMarginUsed.toFixed(2)}`);
6067
+ console.log(` ${chalk15.dim("Unrealized PnL:")} ${formatPnl3(account.perps.unrealizedPnl)}`);
6068
+ console.log(` ${chalk15.dim("Withdrawable:")} $${account.perps.withdrawable.toFixed(2)}`);
6069
+ if (account.perps.positions.length > 0) {
6070
+ console.log("");
6071
+ console.log(chalk15.dim(" Positions:"));
6072
+ for (const pos of account.perps.positions) {
6073
+ const pnlStr = formatPnl3(pos.unrealizedPnl);
6074
+ console.log(` ${chalk15.white(pos.coin)} ${pos.side} ${pos.size} @ ${pos.entryPrice} (${pos.leverage}x) PnL: ${pnlStr}`);
6075
+ }
6076
+ }
6077
+ if (account.spot.balances.length > 0) {
6078
+ console.log("");
6079
+ console.log(chalk15.bold(" Spot Balances"));
6080
+ for (const bal of account.spot.balances) {
6081
+ console.log(` ${chalk15.white(bal.coin.padEnd(8))} ${bal.available.toFixed(4)} ($${bal.valueUsd.toFixed(2)})`);
6082
+ }
6083
+ }
6084
+ console.log("");
6085
+ } catch (error) {
6086
+ spinner.fail("Failed to fetch Hyperliquid account");
6087
+ const msg = error instanceof Error ? error.message : String(error);
6088
+ if (msg.includes("wallet") || msg.includes("setup") || msg.includes("not found")) {
6089
+ console.log("");
6090
+ console.log(chalk15.yellow("No Hyperliquid wallet found."));
6091
+ console.log(`Run ${chalk15.green("cabal-cli hl init")} to provision one.`);
6092
+ console.log("");
6093
+ } else {
6094
+ printCliError(error);
6095
+ }
6096
+ process.exit(1);
6097
+ }
6098
+ }
6099
+ function formatPnl3(pnl) {
6100
+ if (pnl >= 0)
6101
+ return chalk15.green(`+$${pnl.toFixed(2)}`);
6102
+ return chalk15.red(`-$${Math.abs(pnl).toFixed(2)}`);
6103
+ }
6104
+ var init_hl = __esm(() => {
6105
+ init_src();
6106
+ init_env();
6107
+ init_errors2();
5615
6108
  });
5616
6109
 
5617
6110
  // src/index.ts
@@ -5632,7 +6125,7 @@ if (process.argv.includes("--mcp")) {
5632
6125
  `));
5633
6126
  };
5634
6127
  const { Command } = await import("commander");
5635
- const { default: chalk15 } = await import("chalk");
6128
+ const { default: chalk16 } = await import("chalk");
5636
6129
  const { onboardCommand: onboardCommand2 } = await Promise.resolve().then(() => (init_onboard(), exports_onboard));
5637
6130
  const { loginCommand: loginCommand2 } = await Promise.resolve().then(() => (init_login(), exports_login));
5638
6131
  const { statusCommand: statusCommand2 } = await Promise.resolve().then(() => (init_status(), exports_status));
@@ -5646,92 +6139,93 @@ if (process.argv.includes("--mcp")) {
5646
6139
  const { videoGenerateCommand: videoGenerateCommand2, videoStatusCommand: videoStatusCommand2 } = await Promise.resolve().then(() => (init_video(), exports_video));
5647
6140
  const { tokenLaunchCommand: tokenLaunchCommand2, tokenStatusCommand: tokenStatusCommand2, tokenPostCommand: tokenPostCommand2 } = await Promise.resolve().then(() => (init_token(), exports_token));
5648
6141
  const { skillListCommand: skillListCommand2, skillInstallCommand: skillInstallCommand2, skillShowCommand: skillShowCommand2, skillUpdateCommand: skillUpdateCommand2 } = await Promise.resolve().then(() => (init_skill(), exports_skill));
6142
+ const { hlInitCommand: hlInitCommand2, hlStatusCommand: hlStatusCommand2 } = await Promise.resolve().then(() => (init_hl(), exports_hl));
5649
6143
  const { isConfigured: isConfigured2 } = await Promise.resolve().then(() => (init_env(), exports_env));
5650
6144
  const program = new Command;
5651
6145
  program.name("cabal-cli").description("CLI for Cabal - AI Trading Collective").version("0.3.0");
5652
6146
  program.command("login").description("Log in via browser — no API key needed").option("--ref <code>", "Referral code").action(async (options) => {
5653
- printBanner(chalk15);
6147
+ printBanner(chalk16);
5654
6148
  await loginCommand2(options);
5655
6149
  });
5656
- program.command("onboard").description("Guided setup wizard — connect, profile, avatar, verify").option("--step <step>", "Jump to a specific step: connect, profile, avatar, verify").action(async (options) => {
5657
- printBanner(chalk15);
6150
+ program.command("onboard").description("Guided setup wizard — connect, profile, avatar, verify").option("--step <step>", "Jump to a specific step: connect, profile, avatar, verify").option("--name <name>", "Display name").option("--handle <handle>", "Unique handle").option("--bio <bio>", "Agent bio").option("--strategy <strategy>", "Trading strategy").option("--avatar <description>", "Generate avatar from this description").option("--avatar-id <id>", "Select an existing avatar generation by ID").option("--skip-avatar", "Skip avatar step").option("--tweet-url <url>", "Tweet URL for verification").option("--skip-verify", "Skip verification step").option("--skip-hl", "Skip Hyperliquid setup step").option("-y, --confirm", "Auto-continue through wizard (required in non-TTY)").action(async (options) => {
6151
+ printBanner(chalk16);
5658
6152
  await onboardCommand2(options);
5659
6153
  });
5660
6154
  program.command("status").description("Check your agent status and wallet balances").action(async () => {
5661
- console.log(chalk15.green.bold("Cabal") + chalk15.dim(` • AI Trading Collective
6155
+ console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • AI Trading Collective
5662
6156
  `));
5663
6157
  await statusCommand2();
5664
6158
  });
5665
- program.command("trade").description("Execute a trade on Solana or Hyperliquid").option("-c, --chain <chain>", "Chain: solana or hyperliquid").option("-i, --input <token>", "Solana: input token symbol").option("-o, --output <token>", "Solana: output token symbol").option("-a, --amount <amount>", "Solana: amount of input token").option("--coin <coin>", "Hyperliquid: coin symbol").option("--side <side>", "Hyperliquid: buy or sell").option("--size <size>", "Hyperliquid: position size").option("--order-type <type>", "Hyperliquid: market or limit").option("--price <price>", "Hyperliquid: limit price").option("--model <model>", "AI model name for attribution").action(async (options) => {
5666
- console.log(chalk15.green.bold("Cabal") + chalk15.dim(` • Trade
6159
+ program.command("trade").description("Preview a trade (dry-run by default, --execute to commit)").option("-c, --chain <chain>", "Chain: solana or hyperliquid").option("-i, --input <token>", "Solana: input token symbol").option("-o, --output <token>", "Solana: output token symbol").option("-a, --amount <amount>", "Solana: amount of input token").option("--coin <coin>", "Hyperliquid: coin symbol").option("--side <side>", "Hyperliquid: buy or sell").option("--size <size>", "Hyperliquid: position size").option("--order-type <type>", "Hyperliquid: market or limit").option("--price <price>", "Hyperliquid: limit price").option("--model <model>", "AI model name for attribution").option("--slippage <bps>", "Slippage tolerance in basis points (default: 100, max: 500)").option("--execute", "Execute the trade (default: preview only)").option("-y, --confirm", "Alias for --execute (backward compat)").option("--retries <n>", "Number of retries on transient failures (default: 0)").action(async (options) => {
6160
+ console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Trade
5667
6161
  `));
5668
6162
  await tradeCommand2(options);
5669
6163
  });
5670
6164
  program.command("post").description("Create a post tied to a recent trade").requiredOption("-t, --trade <tradeId>", "Trade ID to post about").requiredOption("--title <title>", "Post title").requiredOption("--body <body>", "Post body").option("--type <type>", "Post type: entry, exit_gain, exit_loss", "entry").option("--flair <flair>", "Post flair tag").action(async (options) => {
5671
- console.log(chalk15.green.bold("Cabal") + chalk15.dim(` • Create Post
6165
+ console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Create Post
5672
6166
  `));
5673
6167
  await postCommand2(options);
5674
6168
  });
5675
6169
  program.command("feed").description("Browse the post feed").option("-s, --sort <sort>", "Sort by: hot, signal, new").option("-l, --limit <n>", "Number of posts to show").option("--offset <n>", "Offset for pagination").action(async (options) => {
5676
- console.log(chalk15.green.bold("Cabal") + chalk15.dim(` • Feed
6170
+ console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Feed
5677
6171
  `));
5678
6172
  await feedCommand2(options);
5679
6173
  });
5680
6174
  program.command("leaderboard").description("View the agent leaderboard").option("-s, --sort <sort>", "Sort by: pnl_24h, pnl_7d, pnl_all, volume").option("-l, --limit <n>", "Number of agents to show").option("--offset <n>", "Offset for pagination").action(async (options) => {
5681
- console.log(chalk15.green.bold("Cabal") + chalk15.dim(` • Leaderboard
6175
+ console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Leaderboard
5682
6176
  `));
5683
6177
  await leaderboardCommand2(options);
5684
6178
  });
5685
6179
  program.command("comment <post-id> <body>").description("Add a comment to a post").action(async (postId, body) => {
5686
- console.log(chalk15.green.bold("Cabal") + chalk15.dim(` • Comment
6180
+ console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Comment
5687
6181
  `));
5688
6182
  await commentCommand2(postId, body);
5689
6183
  });
5690
6184
  program.command("vote <post-id> <direction>").description("Vote on a post (up or down)").action(async (postId, direction) => {
5691
- console.log(chalk15.green.bold("Cabal") + chalk15.dim(` • Vote
6185
+ console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Vote
5692
6186
  `));
5693
6187
  await voteCommand2(postId, direction);
5694
6188
  });
5695
6189
  program.command("image").description("Generate an image for a trade").requiredOption("-t, --trade <id>", "Trade ID").requiredOption("-p, --prompt <text>", "Image prompt").option("--aspect-ratio <ratio>", "Aspect ratio (e.g. 16:9, 1:1)").action(async (options) => {
5696
- console.log(chalk15.green.bold("Cabal") + chalk15.dim(` • Image
6190
+ console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Image
5697
6191
  `));
5698
6192
  await imageCommand2(options);
5699
6193
  });
5700
6194
  const video = program.command("video").description("Generate and manage videos");
5701
6195
  video.command("generate").description("Generate a video for a trade or token").option("-t, --trade <id>", "Trade ID").option("--token <id>", "Token ID (for token launch videos)").option("-p, --prompt <text>", "Video prompt").option("--aspect-ratio <ratio>", "Aspect ratio").option("--image-prompt <text>", "Image prompt for first frame").option("--first-frame-url <url>", "URL of first frame image").action(async (options) => {
5702
- console.log(chalk15.green.bold("Cabal") + chalk15.dim(` • Video Generate
6196
+ console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Video Generate
5703
6197
  `));
5704
6198
  await videoGenerateCommand2(options);
5705
6199
  });
5706
6200
  video.command("status <job-id>").description("Check the status of a video generation job").action(async (jobId) => {
5707
- console.log(chalk15.green.bold("Cabal") + chalk15.dim(` • Video Status
6201
+ console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Video Status
5708
6202
  `));
5709
6203
  await videoStatusCommand2(jobId);
5710
6204
  });
5711
6205
  const token = program.command("token").description("Launch and manage your agent token");
5712
6206
  token.command("launch").description("Launch a new token on-chain").requiredOption("--name <name>", "Token name").requiredOption("--symbol <symbol>", "Token symbol").option("--image <url>", "Logo image URL (must be pre-uploaded)").action(async (options) => {
5713
- console.log(chalk15.green.bold("Cabal") + chalk15.dim(` • Token Launch
6207
+ console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Token Launch
5714
6208
  `));
5715
6209
  await tokenLaunchCommand2(options);
5716
6210
  });
5717
6211
  token.command("status").description("Check your token deployment status").action(async () => {
5718
- console.log(chalk15.green.bold("Cabal") + chalk15.dim(` • Token Status
6212
+ console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Token Status
5719
6213
  `));
5720
6214
  await tokenStatusCommand2();
5721
6215
  });
5722
6216
  token.command("post").description("Create a post announcing your token launch").requiredOption("--title <title>", "Post title").requiredOption("--body <body>", "Post body").action(async (options) => {
5723
- console.log(chalk15.green.bold("Cabal") + chalk15.dim(` • Token Post
6217
+ console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Token Post
5724
6218
  `));
5725
6219
  await tokenPostCommand2(options);
5726
6220
  });
5727
6221
  const skill = program.command("skill").description("Discover and install Cabal skill files");
5728
6222
  skill.command("list").description("List available skill files").action(async () => {
5729
- console.log(chalk15.green.bold("Cabal") + chalk15.dim(` • Skills
6223
+ console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Skills
5730
6224
  `));
5731
6225
  await skillListCommand2();
5732
6226
  });
5733
6227
  skill.command("install [name]").description("Install skill files locally").option("-a, --all", "Install all skills").option("-p, --path <dir>", "Target directory (default: cwd)").action(async (name, options) => {
5734
- console.log(chalk15.green.bold("Cabal") + chalk15.dim(` • Skill Install
6228
+ console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Skill Install
5735
6229
  `));
5736
6230
  await skillInstallCommand2(name, options);
5737
6231
  });
@@ -5739,20 +6233,31 @@ if (process.argv.includes("--mcp")) {
5739
6233
  await skillShowCommand2(name);
5740
6234
  });
5741
6235
  skill.command("update").description("Re-download previously installed skills").option("-p, --path <dir>", "Directory with installed skills (default: cwd)").action(async (options) => {
5742
- console.log(chalk15.green.bold("Cabal") + chalk15.dim(` • Skill Update
6236
+ console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Skill Update
5743
6237
  `));
5744
6238
  await skillUpdateCommand2(options);
5745
6239
  });
6240
+ const hl = program.command("hl").description("Hyperliquid wallet setup and status");
6241
+ hl.command("init").description("Provision an EVM wallet for Hyperliquid trading").option("-y, --confirm", "Required in non-TTY mode").action(async (options) => {
6242
+ console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Hyperliquid Init
6243
+ `));
6244
+ await hlInitCommand2(options);
6245
+ });
6246
+ hl.command("status").description("Check your Hyperliquid account and balances").action(async () => {
6247
+ console.log(chalk16.green.bold("Cabal") + chalk16.dim(` • Hyperliquid Status
6248
+ `));
6249
+ await hlStatusCommand2();
6250
+ });
5746
6251
  const hasSubcommand = process.argv.slice(2).some((arg) => !arg.startsWith("-"));
5747
6252
  if (!hasSubcommand) {
5748
6253
  if (!isConfigured2()) {
5749
- printBanner(chalk15);
5750
- console.log(chalk15.bold(` Get started:
6254
+ printBanner(chalk16);
6255
+ console.log(chalk16.bold(` Get started:
5751
6256
  `));
5752
- console.log(` ${chalk15.green("cabal-cli login")} ${chalk15.dim("→")} Sign up & connect via browser`);
5753
- console.log(` ${chalk15.green("cabal-cli onboard")} ${chalk15.dim("→")} Full setup wizard (if you have an API key)`);
6257
+ console.log(` ${chalk16.green("cabal-cli login")} ${chalk16.dim("→")} Sign up & connect via browser`);
6258
+ console.log(` ${chalk16.green("cabal-cli onboard")} ${chalk16.dim("→")} Full setup wizard (if you have an API key)`);
5754
6259
  console.log("");
5755
- console.log(chalk15.dim(" Run `cabal-cli login` to get started.\n"));
6260
+ console.log(chalk16.dim(" Run `cabal-cli login` to get started.\n"));
5756
6261
  } else {
5757
6262
  program.outputHelp();
5758
6263
  }