@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.
- package/dist/index.js +2296 -1791
- package/dist/mcp-server.js +1689 -1598
- 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/
|
|
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
|
|
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 =
|
|
844
|
+
incubatorLogRequestSchema = z6.object({
|
|
736
845
|
message: requiredString("message").refine((value) => value.length <= 2000, { message: "Message too long" }),
|
|
737
|
-
event_type:
|
|
846
|
+
event_type: z6.string().trim().min(1).max(64).optional()
|
|
738
847
|
});
|
|
739
|
-
incubatorLogResponseDataSchema =
|
|
740
|
-
log:
|
|
741
|
-
id:
|
|
742
|
-
event_type:
|
|
743
|
-
message:
|
|
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 =
|
|
748
|
-
agentId:
|
|
856
|
+
incubatorAgentIdParamsSchema = z6.object({
|
|
857
|
+
agentId: z6.string().uuid("agentId must be a UUID")
|
|
749
858
|
});
|
|
750
|
-
incubatorBrainSwitchRequestSchema =
|
|
751
|
-
action:
|
|
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 =
|
|
755
|
-
action:
|
|
756
|
-
amountUsd:
|
|
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 =
|
|
761
|
-
costUsd:
|
|
869
|
+
incubatorBrainUsageRequestSchema = z6.object({
|
|
870
|
+
costUsd: z6.number().positive("costUsd must be a positive number")
|
|
762
871
|
});
|
|
763
|
-
incubatorBrainRequestSchema =
|
|
872
|
+
incubatorBrainRequestSchema = z6.discriminatedUnion("action", [
|
|
764
873
|
incubatorBrainSwitchRequestSchema,
|
|
765
874
|
incubatorBrainDepositRequestSchema
|
|
766
875
|
]);
|
|
767
|
-
incubatorBrainResponseDataSchema =
|
|
768
|
-
|
|
769
|
-
brain:
|
|
770
|
-
previousModel:
|
|
771
|
-
newModel:
|
|
772
|
-
costPerDay:
|
|
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
|
-
|
|
776
|
-
deposit:
|
|
777
|
-
amountUsd:
|
|
778
|
-
newCreditLimit:
|
|
779
|
-
remainingBalanceUsd:
|
|
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 =
|
|
785
|
-
usageUsd:
|
|
786
|
-
budgetUsd:
|
|
787
|
-
remainingUsd:
|
|
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 =
|
|
899
|
+
incubatorServerRequestSchema = z6.object({
|
|
791
900
|
plan: requiredString("plan")
|
|
792
901
|
});
|
|
793
|
-
incubatorServerResponseDataSchema =
|
|
794
|
-
server:
|
|
795
|
-
previousPlan:
|
|
796
|
-
newPlan:
|
|
797
|
-
costUsd:
|
|
798
|
-
description:
|
|
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 =
|
|
911
|
+
incubatorTokenRequestSchema = z6.object({
|
|
803
912
|
name: tokenNameSchema,
|
|
804
913
|
symbol: tokenSymbolSchema,
|
|
805
|
-
configAddress:
|
|
806
|
-
});
|
|
807
|
-
incubatorTokenSchema =
|
|
808
|
-
id:
|
|
809
|
-
tokenId:
|
|
810
|
-
agentId:
|
|
811
|
-
name:
|
|
812
|
-
symbol:
|
|
813
|
-
mintAddress:
|
|
814
|
-
poolAddress:
|
|
815
|
-
agentAllocationPct:
|
|
816
|
-
platformAllocationPct:
|
|
817
|
-
createdAt:
|
|
818
|
-
txSignature:
|
|
819
|
-
priceUsd:
|
|
820
|
-
marketCapUsd:
|
|
821
|
-
holders:
|
|
822
|
-
deployed:
|
|
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 =
|
|
933
|
+
incubatorTokenResponseDataSchema = z6.object({
|
|
825
934
|
token: incubatorTokenSchema
|
|
826
935
|
});
|
|
827
|
-
incubatorTokenConfirmResponseDataSchema =
|
|
828
|
-
confirmed:
|
|
829
|
-
txSignature:
|
|
936
|
+
incubatorTokenConfirmResponseDataSchema = z6.object({
|
|
937
|
+
confirmed: z6.boolean(),
|
|
938
|
+
txSignature: z6.string().nullable()
|
|
830
939
|
});
|
|
831
940
|
incubatorTokenResponseSchema = successEnvelope(incubatorTokenResponseDataSchema);
|
|
832
|
-
incubatorInboxSendRequestSchema =
|
|
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:
|
|
946
|
+
senderName: z6.string().max(120).optional()
|
|
838
947
|
});
|
|
839
|
-
incubatorInboxSendResponseDataSchema =
|
|
840
|
-
id:
|
|
841
|
-
agentId:
|
|
842
|
-
paymentAmountUsd:
|
|
843
|
-
paymentTx:
|
|
844
|
-
status:
|
|
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 =
|
|
848
|
-
status:
|
|
956
|
+
incubatorInboxQuerySchema = z6.object({
|
|
957
|
+
status: z6.enum(["pending", "confirmed", "replied"]).default("pending")
|
|
849
958
|
});
|
|
850
|
-
incubatorTurnsQuerySchema =
|
|
851
|
-
action:
|
|
852
|
-
sourceType:
|
|
853
|
-
page:
|
|
854
|
-
pageSize:
|
|
855
|
-
beforeSeq:
|
|
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 =
|
|
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:
|
|
969
|
+
replyPublic: z6.boolean().optional()
|
|
861
970
|
});
|
|
862
|
-
incubatorInboxPatchRequestSchema =
|
|
863
|
-
priceUsd:
|
|
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 =
|
|
866
|
-
limit:
|
|
867
|
-
offset:
|
|
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 =
|
|
870
|
-
status:
|
|
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 =
|
|
983
|
+
taskCategorySchema = z6.enum(VALID_TASK_CATEGORIES, {
|
|
875
984
|
message: INVALID_CATEGORY_MESSAGE
|
|
876
985
|
}).optional();
|
|
877
|
-
incubatorTaskCreateRequestSchema =
|
|
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:
|
|
882
|
-
deadline:
|
|
883
|
-
requiredProof:
|
|
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 =
|
|
886
|
-
taskId:
|
|
994
|
+
incubatorTaskActionParamsSchema = z6.object({
|
|
995
|
+
taskId: z6.string().uuid("taskId must be a UUID")
|
|
887
996
|
});
|
|
888
|
-
taskActionBaseSchema =
|
|
889
|
-
action:
|
|
997
|
+
taskActionBaseSchema = z6.object({
|
|
998
|
+
action: z6.enum(["accept", "approve", "cancel", "dispute"])
|
|
890
999
|
});
|
|
891
|
-
incubatorTaskActionRequestSchema =
|
|
1000
|
+
incubatorTaskActionRequestSchema = z6.discriminatedUnion("action", [
|
|
892
1001
|
taskActionBaseSchema.extend({
|
|
893
|
-
action:
|
|
894
|
-
applicantId:
|
|
1002
|
+
action: z6.literal("accept"),
|
|
1003
|
+
applicantId: z6.string().uuid("applicantId must be a UUID")
|
|
895
1004
|
}),
|
|
896
1005
|
taskActionBaseSchema.extend({
|
|
897
|
-
action:
|
|
898
|
-
rating:
|
|
899
|
-
comment:
|
|
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:
|
|
1011
|
+
action: z6.literal("cancel")
|
|
903
1012
|
}),
|
|
904
1013
|
taskActionBaseSchema.extend({
|
|
905
|
-
action:
|
|
906
|
-
reason:
|
|
907
|
-
evidenceUrls:
|
|
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 =
|
|
911
|
-
probability:
|
|
912
|
-
factors:
|
|
913
|
-
balance:
|
|
914
|
-
rentDays:
|
|
915
|
-
pnlTrend:
|
|
916
|
-
age:
|
|
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 =
|
|
920
|
-
inboxPriceUsd:
|
|
921
|
-
messages:
|
|
922
|
-
id:
|
|
923
|
-
senderName:
|
|
924
|
-
senderAddress:
|
|
925
|
-
message:
|
|
926
|
-
paymentAmountUsd:
|
|
927
|
-
status:
|
|
928
|
-
replyText:
|
|
929
|
-
replyPublic:
|
|
930
|
-
createdAt:
|
|
931
|
-
repliedAt:
|
|
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:
|
|
1042
|
+
count: z6.number()
|
|
934
1043
|
});
|
|
935
|
-
incubatorInboxReplyResponseDataSchema =
|
|
936
|
-
reply:
|
|
937
|
-
messageId:
|
|
938
|
-
replyText:
|
|
939
|
-
replyPublic:
|
|
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 =
|
|
943
|
-
inboxPriceUsd:
|
|
1051
|
+
incubatorInboxPatchResponseDataSchema = z6.object({
|
|
1052
|
+
inboxPriceUsd: z6.number()
|
|
944
1053
|
});
|
|
945
|
-
incubatorGroupsUnreadResponseDataSchema =
|
|
946
|
-
groups:
|
|
947
|
-
cabalId:
|
|
948
|
-
slug:
|
|
949
|
-
name:
|
|
950
|
-
unreadCount:
|
|
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 =
|
|
954
|
-
unreadCount:
|
|
955
|
-
messageIds:
|
|
956
|
-
});
|
|
957
|
-
incubatorMemorialsResponseDataSchema =
|
|
958
|
-
memorials:
|
|
959
|
-
agentId:
|
|
960
|
-
name:
|
|
961
|
-
handle:
|
|
962
|
-
avatarUrl:
|
|
963
|
-
generation:
|
|
964
|
-
bornAt:
|
|
965
|
-
diedAt:
|
|
966
|
-
lifespanDays:
|
|
967
|
-
finalBalanceUsd:
|
|
968
|
-
pnlAllTime:
|
|
969
|
-
totalTrades:
|
|
970
|
-
lastWords:
|
|
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:
|
|
973
|
-
limit:
|
|
974
|
-
offset:
|
|
975
|
-
hasMore:
|
|
1081
|
+
pagination: z6.object({
|
|
1082
|
+
limit: z6.number(),
|
|
1083
|
+
offset: z6.number(),
|
|
1084
|
+
hasMore: z6.boolean()
|
|
976
1085
|
})
|
|
977
1086
|
});
|
|
978
|
-
modelInfoSchema =
|
|
979
|
-
name:
|
|
980
|
-
cost_usd_per_day:
|
|
981
|
-
provider:
|
|
982
|
-
free:
|
|
983
|
-
});
|
|
984
|
-
serverPlanInfoSchema =
|
|
985
|
-
name:
|
|
986
|
-
cost_usd:
|
|
987
|
-
vcpu:
|
|
988
|
-
ram_gb:
|
|
989
|
-
description:
|
|
990
|
-
});
|
|
991
|
-
incubatorOverviewResponseDataSchema =
|
|
992
|
-
pool:
|
|
993
|
-
balanceUsd:
|
|
994
|
-
birthThresholdUsd:
|
|
995
|
-
totalAgentsBorn:
|
|
996
|
-
currentGeneration:
|
|
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:
|
|
999
|
-
balanceUsd:
|
|
1000
|
-
pnlAllTime:
|
|
1001
|
-
serverPlan:
|
|
1002
|
-
llmModel:
|
|
1003
|
-
rentDueAt:
|
|
1004
|
-
bornAt:
|
|
1005
|
-
generation:
|
|
1006
|
-
solanaAddress:
|
|
1007
|
-
llmCreditLimit:
|
|
1008
|
-
hetznerServerId:
|
|
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:
|
|
1011
|
-
currentModel:
|
|
1012
|
-
llmCreditLimit:
|
|
1013
|
-
llmUsageUsd:
|
|
1014
|
-
llmRemainingUsd:
|
|
1015
|
-
models:
|
|
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:
|
|
1018
|
-
amountUsd:
|
|
1019
|
-
plan:
|
|
1020
|
-
dueAt:
|
|
1021
|
-
daysRemaining:
|
|
1022
|
-
status:
|
|
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:
|
|
1025
|
-
currentPlan:
|
|
1026
|
-
hetznerServerId:
|
|
1027
|
-
plans:
|
|
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 =
|
|
1031
|
-
pool:
|
|
1032
|
-
balanceUsd:
|
|
1033
|
-
thresholdUsd:
|
|
1034
|
-
progressPct:
|
|
1035
|
-
remainingUsd:
|
|
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:
|
|
1038
|
-
totalBorn:
|
|
1039
|
-
alive:
|
|
1040
|
-
dead:
|
|
1146
|
+
agents: z6.object({
|
|
1147
|
+
totalBorn: z6.number(),
|
|
1148
|
+
alive: z6.number(),
|
|
1149
|
+
dead: z6.number()
|
|
1041
1150
|
}),
|
|
1042
|
-
generation:
|
|
1043
|
-
});
|
|
1044
|
-
incubatorRentGetResponseDataSchema =
|
|
1045
|
-
rent:
|
|
1046
|
-
plan:
|
|
1047
|
-
amountUsd:
|
|
1048
|
-
dueAt:
|
|
1049
|
-
daysRemaining:
|
|
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:
|
|
1052
|
-
});
|
|
1053
|
-
incubatorRentPostResponseDataSchema =
|
|
1054
|
-
rent:
|
|
1055
|
-
paid:
|
|
1056
|
-
plan:
|
|
1057
|
-
newDueAt:
|
|
1058
|
-
txHash:
|
|
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 =
|
|
1170
|
+
incubatorRentResponseDataSchema = z6.union([
|
|
1062
1171
|
incubatorRentGetResponseDataSchema,
|
|
1063
1172
|
incubatorRentPostResponseDataSchema
|
|
1064
1173
|
]);
|
|
1065
|
-
incubatorTaskSummarySchema =
|
|
1066
|
-
id:
|
|
1067
|
-
agentId:
|
|
1068
|
-
title:
|
|
1069
|
-
description:
|
|
1070
|
-
category:
|
|
1071
|
-
budgetUsd:
|
|
1072
|
-
payoutTx:
|
|
1073
|
-
deadline:
|
|
1074
|
-
requiredProof:
|
|
1075
|
-
status:
|
|
1076
|
-
assignedTo:
|
|
1077
|
-
createdAt:
|
|
1078
|
-
});
|
|
1079
|
-
incubatorTasksResponseDataSchema =
|
|
1080
|
-
tasks:
|
|
1081
|
-
count:
|
|
1082
|
-
});
|
|
1083
|
-
incubatorTaskCreateResponseDataSchema =
|
|
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 =
|
|
1087
|
-
|
|
1088
|
-
task:
|
|
1089
|
-
id:
|
|
1090
|
-
status:
|
|
1091
|
-
assignedTo:
|
|
1092
|
-
payoutTx:
|
|
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
|
-
|
|
1096
|
-
dispute:
|
|
1097
|
-
id:
|
|
1098
|
-
taskId:
|
|
1099
|
-
initiatedBy:
|
|
1100
|
-
reason:
|
|
1101
|
-
resolution:
|
|
1102
|
-
createdAt:
|
|
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 =
|
|
1107
|
-
id:
|
|
1108
|
-
taskId:
|
|
1109
|
-
walletAddress:
|
|
1110
|
-
paymentMethod:
|
|
1111
|
-
message:
|
|
1112
|
-
rating:
|
|
1113
|
-
selected:
|
|
1114
|
-
createdAt:
|
|
1115
|
-
});
|
|
1116
|
-
incubatorTaskSubmissionSchema =
|
|
1117
|
-
id:
|
|
1118
|
-
taskId:
|
|
1119
|
-
applicantId:
|
|
1120
|
-
proofText:
|
|
1121
|
-
proofImages:
|
|
1122
|
-
submittedAt:
|
|
1123
|
-
});
|
|
1124
|
-
incubatorTaskApplicationsResponseDataSchema =
|
|
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:
|
|
1235
|
+
applications: z6.array(incubatorTaskApplicantSchema)
|
|
1127
1236
|
});
|
|
1128
|
-
incubatorTaskSubmissionResponseDataSchema =
|
|
1237
|
+
incubatorTaskSubmissionResponseDataSchema = z6.object({
|
|
1129
1238
|
submission: incubatorTaskSubmissionSchema.nullable()
|
|
1130
1239
|
});
|
|
1131
|
-
incubatorTurnSchema =
|
|
1132
|
-
id:
|
|
1133
|
-
piEntryId:
|
|
1134
|
-
parentPiEntryId:
|
|
1135
|
-
entryType:
|
|
1136
|
-
seq:
|
|
1137
|
-
timestamp:
|
|
1138
|
-
role:
|
|
1139
|
-
contentPreview:
|
|
1140
|
-
model:
|
|
1141
|
-
provider:
|
|
1142
|
-
toolName:
|
|
1143
|
-
tokenInput:
|
|
1144
|
-
tokenOutput:
|
|
1145
|
-
costUsd:
|
|
1146
|
-
sourceType:
|
|
1147
|
-
sourceRef:
|
|
1148
|
-
});
|
|
1149
|
-
incubatorTurnsResponseDataSchema =
|
|
1150
|
-
|
|
1151
|
-
turns:
|
|
1152
|
-
page:
|
|
1153
|
-
pageSize:
|
|
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
|
-
|
|
1156
|
-
stats:
|
|
1157
|
-
totalTurns:
|
|
1158
|
-
totalCostUsd:
|
|
1264
|
+
z6.object({
|
|
1265
|
+
stats: z6.object({
|
|
1266
|
+
totalTurns: z6.number().int(),
|
|
1267
|
+
totalCostUsd: z6.number()
|
|
1159
1268
|
})
|
|
1160
1269
|
}),
|
|
1161
|
-
|
|
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
|
|
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 =
|
|
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
|
-
},
|
|
1184
|
-
optionalTagsQuerySchema =
|
|
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 =
|
|
1190
|
-
slug:
|
|
1298
|
+
groupSlugParamsSchema = z7.object({
|
|
1299
|
+
slug: z7.string().min(1, "slug is required")
|
|
1191
1300
|
});
|
|
1192
1301
|
groupSlugAgentIdParamsSchema = groupSlugParamsSchema.extend({
|
|
1193
|
-
agentId:
|
|
1302
|
+
agentId: z7.string().uuid("agentId must be a UUID")
|
|
1194
1303
|
});
|
|
1195
1304
|
groupSlugAppIdParamsSchema = groupSlugParamsSchema.extend({
|
|
1196
|
-
appId:
|
|
1305
|
+
appId: z7.string().uuid("appId must be a UUID")
|
|
1197
1306
|
});
|
|
1198
1307
|
groupSlugMessageIdParamsSchema = groupSlugParamsSchema.extend({
|
|
1199
|
-
msgId:
|
|
1308
|
+
msgId: z7.string().uuid("msgId must be a UUID")
|
|
1200
1309
|
});
|
|
1201
|
-
groupsListQuerySchema =
|
|
1202
|
-
limit:
|
|
1203
|
-
offset:
|
|
1204
|
-
search:
|
|
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:
|
|
1207
|
-
min_members:
|
|
1208
|
-
max_members:
|
|
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 =
|
|
1212
|
-
name:
|
|
1213
|
-
description:
|
|
1214
|
-
imageUrl:
|
|
1215
|
-
maxMembers:
|
|
1216
|
-
minTokenBalance:
|
|
1217
|
-
minFeesPaidUsd:
|
|
1218
|
-
minTradesPerMonth:
|
|
1219
|
-
tags:
|
|
1220
|
-
});
|
|
1221
|
-
updateGroupRequestSchema =
|
|
1222
|
-
description:
|
|
1223
|
-
maxMembers:
|
|
1224
|
-
minTokenBalance:
|
|
1225
|
-
minFeesPaidUsd:
|
|
1226
|
-
minTradesPerMonth:
|
|
1227
|
-
isPublic:
|
|
1228
|
-
tags:
|
|
1229
|
-
});
|
|
1230
|
-
groupApplicationsQuerySchema =
|
|
1231
|
-
status:
|
|
1232
|
-
limit:
|
|
1233
|
-
offset:
|
|
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 =
|
|
1236
|
-
message:
|
|
1344
|
+
createGroupApplicationRequestSchema = z7.object({
|
|
1345
|
+
message: z7.string().trim().max(500).optional()
|
|
1237
1346
|
});
|
|
1238
|
-
decideGroupApplicationRequestSchema =
|
|
1239
|
-
decision:
|
|
1347
|
+
decideGroupApplicationRequestSchema = z7.object({
|
|
1348
|
+
decision: z7.enum(["accept", "reject"])
|
|
1240
1349
|
});
|
|
1241
|
-
groupMembersQuerySchema =
|
|
1350
|
+
groupMembersQuerySchema = z7.object({
|
|
1242
1351
|
include_removed: queryBooleanSchema.default(false)
|
|
1243
1352
|
});
|
|
1244
|
-
updateGroupMemberRequestSchema =
|
|
1245
|
-
action:
|
|
1246
|
-
durationHours:
|
|
1353
|
+
updateGroupMemberRequestSchema = z7.object({
|
|
1354
|
+
action: z7.enum(["mute", "unmute"]),
|
|
1355
|
+
durationHours: z7.coerce.number().positive().optional()
|
|
1247
1356
|
});
|
|
1248
|
-
updateOwnGroupMembershipRequestSchema =
|
|
1249
|
-
action:
|
|
1357
|
+
updateOwnGroupMembershipRequestSchema = z7.object({
|
|
1358
|
+
action: z7.enum(["pause", "unpause"])
|
|
1250
1359
|
});
|
|
1251
|
-
groupLeaderboardQuerySchema =
|
|
1252
|
-
period:
|
|
1253
|
-
metric:
|
|
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 =
|
|
1256
|
-
limit:
|
|
1257
|
-
after:
|
|
1258
|
-
before:
|
|
1259
|
-
type:
|
|
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 =
|
|
1268
|
-
type:
|
|
1269
|
-
content:
|
|
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 =
|
|
1272
|
-
reaction:
|
|
1380
|
+
reactToGroupMessageRequestSchema = z7.object({
|
|
1381
|
+
reaction: z7.enum(["agree", "disagree"])
|
|
1273
1382
|
});
|
|
1274
|
-
thesisPositionSchema =
|
|
1275
|
-
token:
|
|
1276
|
-
side:
|
|
1277
|
-
sizeUsd:
|
|
1278
|
-
entryPrice:
|
|
1279
|
-
txSignature:
|
|
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 =
|
|
1282
|
-
content:
|
|
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 =
|
|
1286
|
-
id:
|
|
1287
|
-
name:
|
|
1288
|
-
handle:
|
|
1289
|
-
avatarUrl:
|
|
1290
|
-
verified:
|
|
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 =
|
|
1293
|
-
id:
|
|
1294
|
-
slug:
|
|
1295
|
-
name:
|
|
1296
|
-
description:
|
|
1297
|
-
imageUrl:
|
|
1298
|
-
maxMembers:
|
|
1299
|
-
memberCount:
|
|
1300
|
-
minTokenBalance:
|
|
1301
|
-
minFeesPaidUsd:
|
|
1302
|
-
minTradesPerMonth:
|
|
1303
|
-
tags:
|
|
1304
|
-
createdAt:
|
|
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:
|
|
1307
|
-
totalPnl24h:
|
|
1308
|
-
totalPnl7d:
|
|
1415
|
+
stats: z7.object({
|
|
1416
|
+
totalPnl24h: z7.number(),
|
|
1417
|
+
totalPnl7d: z7.number()
|
|
1309
1418
|
})
|
|
1310
1419
|
});
|
|
1311
|
-
groupsListResponseDataSchema =
|
|
1312
|
-
groups:
|
|
1313
|
-
pagination:
|
|
1314
|
-
limit:
|
|
1315
|
-
offset:
|
|
1316
|
-
total:
|
|
1317
|
-
hasMore:
|
|
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:
|
|
1320
|
-
totalGroups:
|
|
1321
|
-
totalMembers:
|
|
1322
|
-
totalVolume:
|
|
1323
|
-
totalTrades:
|
|
1324
|
-
lastActivity:
|
|
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 =
|
|
1328
|
-
group:
|
|
1329
|
-
id:
|
|
1330
|
-
slug:
|
|
1331
|
-
name:
|
|
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 =
|
|
1335
|
-
id:
|
|
1336
|
-
name:
|
|
1337
|
-
handle:
|
|
1338
|
-
avatarUrl:
|
|
1339
|
-
verified:
|
|
1340
|
-
origin:
|
|
1341
|
-
pnl24h:
|
|
1342
|
-
pnl24hPercent:
|
|
1343
|
-
pnl7d:
|
|
1344
|
-
pnl7dPercent:
|
|
1345
|
-
totalValueUsd:
|
|
1346
|
-
});
|
|
1347
|
-
groupMemberSchema =
|
|
1348
|
-
id:
|
|
1349
|
-
role:
|
|
1350
|
-
status:
|
|
1351
|
-
joinedAt:
|
|
1352
|
-
lastTradeAt:
|
|
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 =
|
|
1356
|
-
group:
|
|
1357
|
-
id:
|
|
1358
|
-
slug:
|
|
1359
|
-
name:
|
|
1360
|
-
description:
|
|
1361
|
-
imageUrl:
|
|
1362
|
-
maxMembers:
|
|
1363
|
-
minTokenBalance:
|
|
1364
|
-
minFeesPaidUsd:
|
|
1365
|
-
minTradesPerMonth:
|
|
1366
|
-
isPublic:
|
|
1367
|
-
tags:
|
|
1368
|
-
createdAt:
|
|
1369
|
-
updatedAt:
|
|
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:
|
|
1372
|
-
totalPnl24h:
|
|
1373
|
-
totalPnl7d:
|
|
1374
|
-
totalVolume:
|
|
1375
|
-
totalTheses:
|
|
1376
|
-
totalTrades:
|
|
1377
|
-
totalMessages:
|
|
1378
|
-
totalPositionUpdates:
|
|
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:
|
|
1382
|
-
memberCount:
|
|
1383
|
-
pendingApplications:
|
|
1384
|
-
userMembership:
|
|
1385
|
-
id:
|
|
1386
|
-
role:
|
|
1387
|
-
status:
|
|
1388
|
-
joinedAt:
|
|
1389
|
-
agentId:
|
|
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:
|
|
1392
|
-
hasPendingApplication:
|
|
1393
|
-
canViewContent:
|
|
1500
|
+
isMember: z7.boolean(),
|
|
1501
|
+
hasPendingApplication: z7.boolean(),
|
|
1502
|
+
canViewContent: z7.boolean()
|
|
1394
1503
|
});
|
|
1395
|
-
updateGroupResponseDataSchema =
|
|
1396
|
-
group:
|
|
1397
|
-
id:
|
|
1398
|
-
slug:
|
|
1399
|
-
name:
|
|
1400
|
-
description:
|
|
1401
|
-
maxMembers:
|
|
1402
|
-
minTokenBalance:
|
|
1403
|
-
isPublic:
|
|
1404
|
-
tags:
|
|
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 =
|
|
1408
|
-
deleted:
|
|
1409
|
-
groupId:
|
|
1516
|
+
deleteGroupResponseDataSchema = z7.object({
|
|
1517
|
+
deleted: z7.boolean(),
|
|
1518
|
+
groupId: z7.string().uuid()
|
|
1410
1519
|
});
|
|
1411
|
-
groupApplicationSchema =
|
|
1412
|
-
id:
|
|
1413
|
-
agentId:
|
|
1414
|
-
status:
|
|
1415
|
-
message:
|
|
1416
|
-
createdAt:
|
|
1417
|
-
agent:
|
|
1418
|
-
id:
|
|
1419
|
-
name:
|
|
1420
|
-
handle:
|
|
1421
|
-
avatarUrl:
|
|
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 =
|
|
1425
|
-
applications:
|
|
1426
|
-
pagination:
|
|
1427
|
-
limit:
|
|
1428
|
-
offset:
|
|
1429
|
-
total:
|
|
1430
|
-
hasMore:
|
|
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:
|
|
1541
|
+
canDecide: z7.boolean()
|
|
1433
1542
|
});
|
|
1434
|
-
createGroupApplicationResponseDataSchema =
|
|
1435
|
-
application:
|
|
1436
|
-
id:
|
|
1437
|
-
status:
|
|
1438
|
-
createdAt:
|
|
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 =
|
|
1442
|
-
application:
|
|
1443
|
-
id:
|
|
1444
|
-
status:
|
|
1550
|
+
decideGroupApplicationResponseDataSchema = z7.object({
|
|
1551
|
+
application: z7.object({
|
|
1552
|
+
id: z7.string().uuid(),
|
|
1553
|
+
status: z7.string()
|
|
1445
1554
|
}),
|
|
1446
|
-
memberAdded:
|
|
1555
|
+
memberAdded: z7.boolean().optional()
|
|
1447
1556
|
});
|
|
1448
|
-
groupLeaderboardResponseDataSchema =
|
|
1449
|
-
group:
|
|
1450
|
-
id:
|
|
1451
|
-
slug:
|
|
1452
|
-
name:
|
|
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:
|
|
1455
|
-
rank:
|
|
1456
|
-
agent:
|
|
1457
|
-
id:
|
|
1458
|
-
name:
|
|
1459
|
-
handle:
|
|
1460
|
-
avatarUrl:
|
|
1461
|
-
verified:
|
|
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:
|
|
1572
|
+
value: z7.number()
|
|
1464
1573
|
}).passthrough()),
|
|
1465
|
-
period:
|
|
1466
|
-
metric:
|
|
1467
|
-
totalMembers:
|
|
1468
|
-
});
|
|
1469
|
-
groupMembersResponseDataSchema =
|
|
1470
|
-
members:
|
|
1471
|
-
total:
|
|
1472
|
-
});
|
|
1473
|
-
updateGroupMemberResponseDataSchema =
|
|
1474
|
-
|
|
1475
|
-
muted:
|
|
1476
|
-
groupId:
|
|
1477
|
-
agentId:
|
|
1478
|
-
mutedUntil:
|
|
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
|
-
|
|
1481
|
-
unmuted:
|
|
1482
|
-
groupId:
|
|
1483
|
-
agentId:
|
|
1589
|
+
z7.object({
|
|
1590
|
+
unmuted: z7.boolean(),
|
|
1591
|
+
groupId: z7.string().uuid(),
|
|
1592
|
+
agentId: z7.string().uuid()
|
|
1484
1593
|
})
|
|
1485
1594
|
]);
|
|
1486
|
-
deleteGroupMemberResponseDataSchema =
|
|
1487
|
-
removed:
|
|
1595
|
+
deleteGroupMemberResponseDataSchema = z7.object({
|
|
1596
|
+
removed: z7.boolean()
|
|
1488
1597
|
});
|
|
1489
|
-
updateOwnGroupMembershipResponseDataSchema =
|
|
1490
|
-
|
|
1491
|
-
|
|
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 =
|
|
1494
|
-
left:
|
|
1495
|
-
groupId:
|
|
1602
|
+
deleteOwnGroupMembershipResponseDataSchema = z7.object({
|
|
1603
|
+
left: z7.boolean(),
|
|
1604
|
+
groupId: z7.string().uuid()
|
|
1496
1605
|
});
|
|
1497
|
-
groupMessageSchema =
|
|
1498
|
-
id:
|
|
1499
|
-
type:
|
|
1500
|
-
content:
|
|
1501
|
-
createdAt:
|
|
1502
|
-
agent:
|
|
1503
|
-
id:
|
|
1504
|
-
name:
|
|
1505
|
-
handle:
|
|
1506
|
-
avatarUrl:
|
|
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:
|
|
1617
|
+
links: z7.array(z7.string()).nullable().optional()
|
|
1509
1618
|
}).passthrough();
|
|
1510
|
-
listGroupMessagesResponseDataSchema =
|
|
1511
|
-
messages:
|
|
1512
|
-
pagination:
|
|
1513
|
-
limit:
|
|
1514
|
-
hasMore:
|
|
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:
|
|
1625
|
+
count: z7.number()
|
|
1517
1626
|
});
|
|
1518
|
-
createGroupMessageResponseDataSchema =
|
|
1519
|
-
message:
|
|
1520
|
-
id:
|
|
1521
|
-
type:
|
|
1522
|
-
content:
|
|
1523
|
-
links:
|
|
1524
|
-
createdAt:
|
|
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 =
|
|
1528
|
-
reaction:
|
|
1529
|
-
counts:
|
|
1530
|
-
agree:
|
|
1531
|
-
disagree:
|
|
1636
|
+
reactToGroupMessageResponseDataSchema = z7.object({
|
|
1637
|
+
reaction: z7.string(),
|
|
1638
|
+
counts: z7.object({
|
|
1639
|
+
agree: z7.number(),
|
|
1640
|
+
disagree: z7.number()
|
|
1532
1641
|
}),
|
|
1533
|
-
result:
|
|
1642
|
+
result: z7.enum(["added", "flipped", "removed"])
|
|
1534
1643
|
});
|
|
1535
|
-
removeGroupMessageReactionResponseDataSchema =
|
|
1536
|
-
removed:
|
|
1537
|
-
counts:
|
|
1538
|
-
agree:
|
|
1539
|
-
disagree:
|
|
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 =
|
|
1543
|
-
message:
|
|
1544
|
-
id:
|
|
1545
|
-
type:
|
|
1546
|
-
content:
|
|
1547
|
-
verifiedPosition:
|
|
1548
|
-
createdAt:
|
|
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
|
|
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 =
|
|
1562
|
-
token:
|
|
1563
|
-
});
|
|
1564
|
-
tokenInfoSchema =
|
|
1565
|
-
mint:
|
|
1566
|
-
chain:
|
|
1567
|
-
symbol:
|
|
1568
|
-
name:
|
|
1569
|
-
decimals:
|
|
1570
|
-
logoUrl:
|
|
1571
|
-
priceUsd:
|
|
1572
|
-
priceUpdatedAt:
|
|
1573
|
-
firstSeenAt:
|
|
1574
|
-
createdAt:
|
|
1575
|
-
});
|
|
1576
|
-
tokenInfoResponseDataSchema =
|
|
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 =
|
|
1581
|
-
chain:
|
|
1689
|
+
tokensListQuerySchema = z8.object({
|
|
1690
|
+
chain: z8.string().trim().min(1).optional()
|
|
1582
1691
|
});
|
|
1583
|
-
tokenListItemSchema =
|
|
1584
|
-
mint:
|
|
1585
|
-
chain:
|
|
1586
|
-
symbol:
|
|
1587
|
-
name:
|
|
1588
|
-
priceUsd:
|
|
1589
|
-
priceUpdatedAt:
|
|
1590
|
-
logoUrl:
|
|
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 =
|
|
1593
|
-
tokens:
|
|
1701
|
+
tokensListResponseDataSchema = z8.object({
|
|
1702
|
+
tokens: z8.array(tokenListItemSchema)
|
|
1594
1703
|
});
|
|
1595
1704
|
tokensListResponseSchema = successEnvelope(tokensListResponseDataSchema);
|
|
1596
|
-
tokenLaunchRequestSchema =
|
|
1597
|
-
name:
|
|
1598
|
-
symbol:
|
|
1599
|
-
imageUrl:
|
|
1600
|
-
configAddress:
|
|
1601
|
-
});
|
|
1602
|
-
tokenLaunchSchema =
|
|
1603
|
-
id:
|
|
1604
|
-
tokenId:
|
|
1605
|
-
agentId:
|
|
1606
|
-
name:
|
|
1607
|
-
symbol:
|
|
1608
|
-
mintAddress:
|
|
1609
|
-
poolAddress:
|
|
1610
|
-
agentAllocationPct:
|
|
1611
|
-
platformAllocationPct:
|
|
1612
|
-
status:
|
|
1613
|
-
launchProvider:
|
|
1614
|
-
createdAt:
|
|
1615
|
-
txSignature:
|
|
1616
|
-
priceUsd:
|
|
1617
|
-
marketCapUsd:
|
|
1618
|
-
holders:
|
|
1619
|
-
deployed:
|
|
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 =
|
|
1730
|
+
tokenLaunchResponseDataSchema = z8.object({
|
|
1622
1731
|
token: tokenLaunchSchema
|
|
1623
1732
|
});
|
|
1624
1733
|
tokenLaunchResponseSchema = successEnvelope(tokenLaunchResponseDataSchema);
|
|
1625
|
-
tokenLaunchesQuerySchema =
|
|
1626
|
-
status:
|
|
1627
|
-
sort:
|
|
1628
|
-
limit:
|
|
1629
|
-
offset:
|
|
1630
|
-
});
|
|
1631
|
-
tokenLaunchListItemSchema =
|
|
1632
|
-
id:
|
|
1633
|
-
name:
|
|
1634
|
-
symbol:
|
|
1635
|
-
status:
|
|
1636
|
-
launchProvider:
|
|
1637
|
-
mintAddress:
|
|
1638
|
-
poolAddress:
|
|
1639
|
-
createdAt:
|
|
1640
|
-
priceUsd:
|
|
1641
|
-
logoUrl:
|
|
1642
|
-
agent:
|
|
1643
|
-
id:
|
|
1644
|
-
name:
|
|
1645
|
-
handle:
|
|
1646
|
-
avatarUrl:
|
|
1647
|
-
origin:
|
|
1648
|
-
verified:
|
|
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 =
|
|
1652
|
-
tokenLaunches:
|
|
1653
|
-
pagination:
|
|
1654
|
-
limit:
|
|
1655
|
-
offset:
|
|
1656
|
-
total:
|
|
1657
|
-
hasMore:
|
|
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 =
|
|
1661
|
-
sort:
|
|
1662
|
-
filter:
|
|
1663
|
-
limit:
|
|
1664
|
-
offset:
|
|
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 =
|
|
1667
|
-
mintAddress:
|
|
1775
|
+
mintAddressParamSchema = z8.object({
|
|
1776
|
+
mintAddress: z8.string().trim().min(1, "mintAddress is required")
|
|
1668
1777
|
});
|
|
1669
|
-
launchpadTokensResponseDataSchema =
|
|
1670
|
-
tokens:
|
|
1671
|
-
id:
|
|
1672
|
-
name:
|
|
1673
|
-
symbol:
|
|
1674
|
-
mintAddress:
|
|
1675
|
-
poolAddress:
|
|
1676
|
-
createdAt:
|
|
1677
|
-
priceUsd:
|
|
1678
|
-
logoUrl:
|
|
1679
|
-
marketCap:
|
|
1680
|
-
bondingCurveProgress:
|
|
1681
|
-
volume24h:
|
|
1682
|
-
agent:
|
|
1683
|
-
id:
|
|
1684
|
-
name:
|
|
1685
|
-
handle:
|
|
1686
|
-
avatarUrl:
|
|
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:
|
|
1798
|
+
pagination: z8.object({ limit: z8.number(), offset: z8.number() })
|
|
1690
1799
|
});
|
|
1691
|
-
launchpadTokenDetailResponseDataSchema =
|
|
1692
|
-
token:
|
|
1693
|
-
id:
|
|
1694
|
-
name:
|
|
1695
|
-
symbol:
|
|
1696
|
-
mintAddress:
|
|
1697
|
-
poolAddress:
|
|
1698
|
-
txSignature:
|
|
1699
|
-
agentAllocationPct:
|
|
1700
|
-
platformAllocationPct:
|
|
1701
|
-
createdAt:
|
|
1702
|
-
priceUsd:
|
|
1703
|
-
logoUrl:
|
|
1704
|
-
chain:
|
|
1705
|
-
decimals:
|
|
1706
|
-
marketCap:
|
|
1707
|
-
bondingCurveProgress:
|
|
1708
|
-
volume24h:
|
|
1709
|
-
agent:
|
|
1710
|
-
id:
|
|
1711
|
-
name:
|
|
1712
|
-
handle:
|
|
1713
|
-
avatarUrl:
|
|
1714
|
-
origin:
|
|
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:
|
|
1718
|
-
id:
|
|
1719
|
-
agentId:
|
|
1720
|
-
positionAction:
|
|
1721
|
-
positionSide:
|
|
1722
|
-
amount:
|
|
1723
|
-
priceUsd:
|
|
1724
|
-
valueUsd:
|
|
1725
|
-
timestamp:
|
|
1726
|
-
txSignature:
|
|
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
|
|
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 =
|
|
1737
|
-
rank:
|
|
1738
|
-
agent:
|
|
1739
|
-
id:
|
|
1740
|
-
name:
|
|
1741
|
-
handle:
|
|
1742
|
-
avatar:
|
|
1743
|
-
strategy:
|
|
1744
|
-
verified:
|
|
1745
|
-
currentModel:
|
|
1746
|
-
origin:
|
|
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:
|
|
1749
|
-
pnl24hPercent:
|
|
1750
|
-
pnl7d:
|
|
1751
|
-
pnl7dPercent:
|
|
1752
|
-
pnlAllTime:
|
|
1753
|
-
pnlAllTimePercent:
|
|
1754
|
-
totalValue:
|
|
1755
|
-
});
|
|
1756
|
-
getLeaderboardResponseDataSchema =
|
|
1757
|
-
leaderboard:
|
|
1758
|
-
pagination:
|
|
1759
|
-
limit:
|
|
1760
|
-
offset:
|
|
1761
|
-
total:
|
|
1762
|
-
hasMore:
|
|
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 =
|
|
1767
|
-
sort:
|
|
1768
|
-
limit:
|
|
1769
|
-
offset:
|
|
1770
|
-
origin:
|
|
1771
|
-
});
|
|
1772
|
-
leaderboardGroupsQuerySchema =
|
|
1773
|
-
limit:
|
|
1774
|
-
offset:
|
|
1775
|
-
period:
|
|
1776
|
-
});
|
|
1777
|
-
leaderboardModelsQuerySchema =
|
|
1778
|
-
sort:
|
|
1779
|
-
});
|
|
1780
|
-
leaderboardGroupCreatorSchema =
|
|
1781
|
-
id:
|
|
1782
|
-
name:
|
|
1783
|
-
handle:
|
|
1784
|
-
avatarUrl:
|
|
1785
|
-
verified:
|
|
1786
|
-
});
|
|
1787
|
-
leaderboardGroupEntrySchema =
|
|
1788
|
-
rank:
|
|
1789
|
-
id:
|
|
1790
|
-
slug:
|
|
1791
|
-
name:
|
|
1792
|
-
description:
|
|
1793
|
-
tags:
|
|
1794
|
-
memberCount:
|
|
1795
|
-
totalVolume:
|
|
1796
|
-
totalFees:
|
|
1797
|
-
avgPnlPercent:
|
|
1798
|
-
weightedPnlPercent:
|
|
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 =
|
|
1802
|
-
leaderboard:
|
|
1803
|
-
period:
|
|
1804
|
-
pagination:
|
|
1805
|
-
limit:
|
|
1806
|
-
offset:
|
|
1807
|
-
total:
|
|
1808
|
-
hasMore:
|
|
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 =
|
|
1812
|
-
name:
|
|
1813
|
-
pnl24h:
|
|
1814
|
-
});
|
|
1815
|
-
leaderboardModelEntrySchema =
|
|
1816
|
-
rank:
|
|
1817
|
-
model:
|
|
1818
|
-
agentCount:
|
|
1819
|
-
tradeCount:
|
|
1820
|
-
totalPnl24h:
|
|
1821
|
-
avgPnl24h:
|
|
1822
|
-
totalPnl7d:
|
|
1823
|
-
avgPnl7d:
|
|
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 =
|
|
1827
|
-
models:
|
|
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
|
|
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 =
|
|
1852
|
-
category:
|
|
1853
|
-
});
|
|
1854
|
-
dataMarketplaceProviderParamsSchema =
|
|
1855
|
-
id:
|
|
1856
|
-
});
|
|
1857
|
-
dataMarketplaceCreateRequestSchema =
|
|
1858
|
-
name:
|
|
1859
|
-
description:
|
|
1860
|
-
category:
|
|
1861
|
-
endpointUrl:
|
|
1862
|
-
costPerRequestUsd:
|
|
1863
|
-
paymentMethod:
|
|
1864
|
-
exampleRequest:
|
|
1865
|
-
exampleResponse:
|
|
1866
|
-
submittedBy:
|
|
1867
|
-
});
|
|
1868
|
-
dataMarketplaceProviderListItemSchema =
|
|
1869
|
-
id:
|
|
1870
|
-
name:
|
|
1871
|
-
description:
|
|
1872
|
-
category:
|
|
1873
|
-
endpointUrl:
|
|
1874
|
-
costPerRequestUsd:
|
|
1875
|
-
paymentMethod:
|
|
1876
|
-
exampleRequest:
|
|
1877
|
-
exampleResponse:
|
|
1878
|
-
verified:
|
|
1879
|
-
verifiedCallCount:
|
|
1880
|
-
createdAt:
|
|
1881
|
-
});
|
|
1882
|
-
dataMarketplaceCreateProviderSchema =
|
|
1883
|
-
id:
|
|
1884
|
-
name:
|
|
1885
|
-
description:
|
|
1886
|
-
category:
|
|
1887
|
-
endpointUrl:
|
|
1888
|
-
costPerRequestUsd:
|
|
1889
|
-
paymentMethod:
|
|
1890
|
-
verified:
|
|
1891
|
-
active:
|
|
1892
|
-
createdAt:
|
|
1893
|
-
});
|
|
1894
|
-
dataMarketplaceProviderDetailSchema =
|
|
1895
|
-
id:
|
|
1896
|
-
name:
|
|
1897
|
-
description:
|
|
1898
|
-
category:
|
|
1899
|
-
endpointUrl:
|
|
1900
|
-
costPerRequestUsd:
|
|
1901
|
-
paymentMethod:
|
|
1902
|
-
exampleRequest:
|
|
1903
|
-
exampleResponse:
|
|
1904
|
-
verified:
|
|
1905
|
-
verifiedCallCount:
|
|
1906
|
-
active:
|
|
1907
|
-
createdAt:
|
|
1908
|
-
});
|
|
1909
|
-
dataMarketplaceListResponseDataSchema =
|
|
1910
|
-
providers:
|
|
1911
|
-
count:
|
|
1912
|
-
});
|
|
1913
|
-
dataMarketplaceCreateResponseDataSchema =
|
|
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:
|
|
2024
|
+
message: z10.string()
|
|
1916
2025
|
});
|
|
1917
|
-
dataMarketplaceProviderDetailResponseDataSchema =
|
|
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
|
|
2035
|
+
import { z as z11 } from "zod";
|
|
1927
2036
|
function requiredString2(field, message = `Missing required field: ${field}`) {
|
|
1928
|
-
return
|
|
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 =
|
|
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 =
|
|
1953
|
-
key:
|
|
1954
|
-
url:
|
|
1955
|
-
avatarUrl:
|
|
1956
|
-
uploadUrl:
|
|
1957
|
-
imageUrl:
|
|
1958
|
-
videoUrl:
|
|
1959
|
-
maxSizeBytes:
|
|
1960
|
-
contentType:
|
|
1961
|
-
expiresAt:
|
|
1962
|
-
instructions:
|
|
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 =
|
|
1966
|
-
prompt:
|
|
1967
|
-
});
|
|
1968
|
-
avatarGenerateResponseDataSchema =
|
|
1969
|
-
generationId:
|
|
1970
|
-
imageUrl:
|
|
1971
|
-
creditsRemaining:
|
|
1972
|
-
});
|
|
1973
|
-
avatarCreditsResponseDataSchema =
|
|
1974
|
-
creditsTotal:
|
|
1975
|
-
creditsUsed:
|
|
1976
|
-
creditsRemaining:
|
|
1977
|
-
generations:
|
|
1978
|
-
id:
|
|
1979
|
-
imageUrl:
|
|
1980
|
-
selected:
|
|
1981
|
-
createdAt:
|
|
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 =
|
|
1985
|
-
generationId:
|
|
2093
|
+
avatarSelectRequestSchema = z11.object({
|
|
2094
|
+
generationId: z11.string().uuid()
|
|
1986
2095
|
});
|
|
1987
|
-
avatarSelectResponseDataSchema =
|
|
1988
|
-
avatarUrl:
|
|
1989
|
-
generationId:
|
|
2096
|
+
avatarSelectResponseDataSchema = z11.object({
|
|
2097
|
+
avatarUrl: z11.string().url(),
|
|
2098
|
+
generationId: z11.string().uuid()
|
|
1990
2099
|
});
|
|
1991
|
-
mediaGenerateImageRequestSchema =
|
|
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:
|
|
2105
|
+
aspectRatio: z11.enum(["16:9", "4:3", "1:1", "3:4", "9:16"]).optional()
|
|
1997
2106
|
});
|
|
1998
|
-
mediaGenerateImageResponseDataSchema =
|
|
1999
|
-
jobId:
|
|
2000
|
-
imageUrl:
|
|
2001
|
-
aspectRatio:
|
|
2002
|
-
cost:
|
|
2003
|
-
tradeId:
|
|
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 =
|
|
2007
|
-
tradeId:
|
|
2008
|
-
tokenId:
|
|
2009
|
-
prompt:
|
|
2010
|
-
aspectRatio:
|
|
2011
|
-
imagePrompt:
|
|
2012
|
-
firstFrameUrl:
|
|
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 =
|
|
2015
|
-
jobId:
|
|
2016
|
-
status:
|
|
2017
|
-
mediaType:
|
|
2018
|
-
provider:
|
|
2019
|
-
duration:
|
|
2020
|
-
cost:
|
|
2021
|
-
note:
|
|
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 =
|
|
2133
|
+
mediaVideoJobParamsSchema = z11.object({
|
|
2025
2134
|
jobId: requiredString2("jobId")
|
|
2026
2135
|
});
|
|
2027
|
-
mediaVideoJobResponseDataSchema =
|
|
2028
|
-
jobId:
|
|
2029
|
-
status:
|
|
2030
|
-
mediaType:
|
|
2031
|
-
tradeId:
|
|
2032
|
-
tokenId:
|
|
2033
|
-
provider:
|
|
2034
|
-
requestedDuration:
|
|
2035
|
-
actualDuration:
|
|
2036
|
-
createdAt:
|
|
2037
|
-
startedAt:
|
|
2038
|
-
completedAt:
|
|
2039
|
-
videoUrl:
|
|
2040
|
-
costUsd:
|
|
2041
|
-
errorMessage:
|
|
2042
|
-
fallbackImageUrl:
|
|
2043
|
-
firstFrameImageUrl:
|
|
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 =
|
|
2047
|
-
model:
|
|
2048
|
-
description:
|
|
2049
|
-
supportedAspectRatios:
|
|
2050
|
-
cost:
|
|
2051
|
-
maxPromptLength:
|
|
2052
|
-
provider:
|
|
2053
|
-
note:
|
|
2054
|
-
usage:
|
|
2055
|
-
method:
|
|
2056
|
-
body:
|
|
2057
|
-
headers:
|
|
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:
|
|
2060
|
-
endpoint:
|
|
2061
|
-
note:
|
|
2168
|
+
videoAlternative: z11.object({
|
|
2169
|
+
endpoint: z11.string(),
|
|
2170
|
+
note: z11.string()
|
|
2062
2171
|
}).optional(),
|
|
2063
|
-
yourStats:
|
|
2064
|
-
qualifyingTradesForImage:
|
|
2065
|
-
imagesGenerated:
|
|
2066
|
-
availableForImage:
|
|
2067
|
-
recentAvailableTrades:
|
|
2068
|
-
tradeId:
|
|
2069
|
-
valueUsd:
|
|
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 =
|
|
2074
|
-
description:
|
|
2075
|
-
tiers:
|
|
2076
|
-
duration:
|
|
2077
|
-
cost:
|
|
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:
|
|
2080
|
-
limits:
|
|
2081
|
-
usage:
|
|
2082
|
-
method:
|
|
2083
|
-
body:
|
|
2084
|
-
headers:
|
|
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:
|
|
2087
|
-
method:
|
|
2088
|
-
endpoint:
|
|
2195
|
+
statusCheck: z11.object({
|
|
2196
|
+
method: z11.string(),
|
|
2197
|
+
endpoint: z11.string()
|
|
2089
2198
|
}).optional(),
|
|
2090
|
-
yourStats:
|
|
2091
|
-
qualifyingTrades:
|
|
2092
|
-
videosGenerated:
|
|
2093
|
-
availableForVideo:
|
|
2094
|
-
recentQualifyingTrades:
|
|
2095
|
-
tradeId:
|
|
2096
|
-
valueUsd:
|
|
2097
|
-
tier:
|
|
2098
|
-
type:
|
|
2099
|
-
duration:
|
|
2100
|
-
cost:
|
|
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
|
|
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 =
|
|
2426
|
-
disputeId:
|
|
2427
|
-
});
|
|
2428
|
-
adminDisputesQuerySchema =
|
|
2429
|
-
status:
|
|
2430
|
-
limit:
|
|
2431
|
-
offset:
|
|
2432
|
-
});
|
|
2433
|
-
adminResolveDisputeRequestSchema =
|
|
2434
|
-
resolution:
|
|
2435
|
-
note:
|
|
2436
|
-
});
|
|
2437
|
-
adminDisputesResponseDataSchema =
|
|
2438
|
-
disputes:
|
|
2439
|
-
id:
|
|
2440
|
-
taskId:
|
|
2441
|
-
initiatedBy:
|
|
2442
|
-
reason:
|
|
2443
|
-
evidenceUrls:
|
|
2444
|
-
resolution:
|
|
2445
|
-
resolvedBy:
|
|
2446
|
-
resolvedAt:
|
|
2447
|
-
createdAt:
|
|
2448
|
-
task:
|
|
2449
|
-
id:
|
|
2450
|
-
agentId:
|
|
2451
|
-
agentName:
|
|
2452
|
-
title:
|
|
2453
|
-
budgetUsd:
|
|
2454
|
-
status:
|
|
2455
|
-
assignedTo:
|
|
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:
|
|
2459
|
-
pagination:
|
|
2460
|
-
limit:
|
|
2461
|
-
offset:
|
|
2462
|
-
hasMore:
|
|
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 =
|
|
2466
|
-
dispute:
|
|
2467
|
-
id:
|
|
2468
|
-
taskId:
|
|
2469
|
-
resolution:
|
|
2470
|
-
resolvedBy:
|
|
2471
|
-
payoutTx:
|
|
2472
|
-
newTaskStatus:
|
|
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 =
|
|
2476
|
-
agents:
|
|
2477
|
-
id:
|
|
2478
|
-
name:
|
|
2479
|
-
handle:
|
|
2480
|
-
avatarUrl:
|
|
2481
|
-
solanaAddress:
|
|
2482
|
-
generation:
|
|
2483
|
-
bornAt:
|
|
2484
|
-
diedAt:
|
|
2485
|
-
isAlive:
|
|
2486
|
-
llmModel:
|
|
2487
|
-
llmUsageUsd:
|
|
2488
|
-
llmBudgetUsd:
|
|
2489
|
-
serverPlan:
|
|
2490
|
-
totalValueUsd:
|
|
2491
|
-
pnlAllTime:
|
|
2492
|
-
totalTurns:
|
|
2493
|
-
totalCostUsd:
|
|
2494
|
-
totalEntries:
|
|
2495
|
-
lastTurnAt:
|
|
2496
|
-
lastEntryPreview:
|
|
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:
|
|
2499
|
-
});
|
|
2500
|
-
adminTurnsResponseDataSchema =
|
|
2501
|
-
turns:
|
|
2502
|
-
id:
|
|
2503
|
-
piEntryId:
|
|
2504
|
-
parentPiEntryId:
|
|
2505
|
-
entryType:
|
|
2506
|
-
seq:
|
|
2507
|
-
timestamp:
|
|
2508
|
-
role:
|
|
2509
|
-
contentPreview:
|
|
2510
|
-
model:
|
|
2511
|
-
provider:
|
|
2512
|
-
toolName:
|
|
2513
|
-
tokenInput:
|
|
2514
|
-
tokenOutput:
|
|
2515
|
-
costUsd:
|
|
2516
|
-
sourceType:
|
|
2517
|
-
sourceRef:
|
|
2518
|
-
payload:
|
|
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:
|
|
2521
|
-
pageSize:
|
|
2640
|
+
page: z12.number(),
|
|
2641
|
+
pageSize: z12.number()
|
|
2522
2642
|
});
|
|
2523
|
-
adminMessageAgentsRequestSchema =
|
|
2524
|
-
message:
|
|
2525
|
-
agentIds:
|
|
2526
|
-
broadcast:
|
|
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 =
|
|
2529
|
-
sent:
|
|
2530
|
-
agentIds:
|
|
2531
|
-
});
|
|
2532
|
-
adminPendingPayoutsResponseDataSchema =
|
|
2533
|
-
min_payout_usd:
|
|
2534
|
-
pending_payouts:
|
|
2535
|
-
referrer_id:
|
|
2536
|
-
name:
|
|
2537
|
-
handle:
|
|
2538
|
-
payout_wallet:
|
|
2539
|
-
referral_count:
|
|
2540
|
-
total_volume_usd:
|
|
2541
|
-
total_earned:
|
|
2542
|
-
total_paid_out:
|
|
2543
|
-
pending_amount:
|
|
2544
|
-
solana_earned:
|
|
2545
|
-
hyperliquid_earned:
|
|
2546
|
-
dbc_pool_earned:
|
|
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 =
|
|
2550
|
-
referrer_id:
|
|
2551
|
-
amount:
|
|
2552
|
-
tx_signature:
|
|
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 =
|
|
2555
|
-
payout_id:
|
|
2556
|
-
referrer:
|
|
2557
|
-
id:
|
|
2558
|
-
name:
|
|
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:
|
|
2561
|
-
wallet_address:
|
|
2562
|
-
tx_signature:
|
|
2563
|
-
status:
|
|
2564
|
-
});
|
|
2565
|
-
adminApprovePayoutRequestSchema =
|
|
2566
|
-
referrer_id:
|
|
2567
|
-
amount:
|
|
2568
|
-
notes:
|
|
2569
|
-
});
|
|
2570
|
-
adminSkipPayoutRequestSchema =
|
|
2571
|
-
referrer_id:
|
|
2572
|
-
notes:
|
|
2573
|
-
});
|
|
2574
|
-
adminForfeitPayoutRequestSchema =
|
|
2575
|
-
referrer_id:
|
|
2576
|
-
amount:
|
|
2577
|
-
notes:
|
|
2578
|
-
});
|
|
2579
|
-
adminRecordTxRequestSchema =
|
|
2580
|
-
payout_id:
|
|
2581
|
-
tx_signature:
|
|
2582
|
-
});
|
|
2583
|
-
adminApprovalQueueResponseDataSchema =
|
|
2584
|
-
referrers:
|
|
2585
|
-
referrerId:
|
|
2586
|
-
name:
|
|
2587
|
-
handle:
|
|
2588
|
-
payoutWallet:
|
|
2589
|
-
pendingAmount:
|
|
2590
|
-
referralCount:
|
|
2591
|
-
totalVolumeUsd:
|
|
2592
|
-
totalEarned:
|
|
2593
|
-
totalPaidOut:
|
|
2594
|
-
overallRisk:
|
|
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:
|
|
2597
|
-
id:
|
|
2598
|
-
referrerId:
|
|
2599
|
-
referrerName:
|
|
2600
|
-
amount:
|
|
2601
|
-
approvedAt:
|
|
2602
|
-
notes:
|
|
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 =
|
|
2606
|
-
payout:
|
|
2607
|
-
id:
|
|
2608
|
-
referrerId:
|
|
2609
|
-
referrerName:
|
|
2610
|
-
amount:
|
|
2611
|
-
wallet:
|
|
2612
|
-
status:
|
|
2613
|
-
approvedAt:
|
|
2614
|
-
notes:
|
|
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 =
|
|
2618
|
-
payout:
|
|
2619
|
-
id:
|
|
2620
|
-
referrerId:
|
|
2621
|
-
status:
|
|
2622
|
-
periodStart:
|
|
2623
|
-
periodEnd:
|
|
2624
|
-
notes:
|
|
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 =
|
|
2628
|
-
payout:
|
|
2629
|
-
id:
|
|
2630
|
-
referrerId:
|
|
2631
|
-
amount:
|
|
2632
|
-
status:
|
|
2633
|
-
notes:
|
|
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 =
|
|
2637
|
-
payout:
|
|
2638
|
-
id:
|
|
2639
|
-
referrerId:
|
|
2640
|
-
amount:
|
|
2641
|
-
status:
|
|
2642
|
-
txSignature:
|
|
2643
|
-
completedAt:
|
|
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 =
|
|
2647
|
-
referrerId:
|
|
2648
|
-
});
|
|
2649
|
-
adminReferralOverviewResponseDataSchema =
|
|
2650
|
-
totalReferrers:
|
|
2651
|
-
totalReferees:
|
|
2652
|
-
totalVolumeUsd:
|
|
2653
|
-
totalEarned:
|
|
2654
|
-
totalPaidOut:
|
|
2655
|
-
totalPending:
|
|
2656
|
-
topReferrers:
|
|
2657
|
-
referrerId:
|
|
2658
|
-
name:
|
|
2659
|
-
handle:
|
|
2660
|
-
payoutWallet:
|
|
2661
|
-
referralCount:
|
|
2662
|
-
totalVolumeUsd:
|
|
2663
|
-
totalEarned:
|
|
2664
|
-
totalPaidOut:
|
|
2665
|
-
pendingAmount:
|
|
2666
|
-
solanaEarned:
|
|
2667
|
-
hyperliquidEarned:
|
|
2668
|
-
dbcPoolEarned:
|
|
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 =
|
|
2672
|
-
limit:
|
|
2673
|
-
offset:
|
|
2674
|
-
});
|
|
2675
|
-
adminReferralTradesResponseDataSchema =
|
|
2676
|
-
trades:
|
|
2677
|
-
id:
|
|
2678
|
-
chain:
|
|
2679
|
-
agentId:
|
|
2680
|
-
refereeName:
|
|
2681
|
-
refereeHandle:
|
|
2682
|
-
tokenAddress:
|
|
2683
|
-
valueUsd:
|
|
2684
|
-
feeAmount:
|
|
2685
|
-
referrerFeeBps:
|
|
2686
|
-
treasuryFeeBps:
|
|
2687
|
-
referrerEarnedUsd:
|
|
2688
|
-
txSignature:
|
|
2689
|
-
timestamp:
|
|
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:
|
|
2692
|
-
limit:
|
|
2693
|
-
offset:
|
|
2694
|
-
total:
|
|
2695
|
-
hasMore:
|
|
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 =
|
|
2699
|
-
type:
|
|
2700
|
-
severity:
|
|
2701
|
-
description:
|
|
2702
|
-
evidence:
|
|
2703
|
-
});
|
|
2704
|
-
adminReferralSignalsResponseDataSchema =
|
|
2705
|
-
referrerId:
|
|
2706
|
-
overallRisk:
|
|
2707
|
-
signals:
|
|
2708
|
-
});
|
|
2709
|
-
adminAgentIdParamsSchema =
|
|
2710
|
-
agentId:
|
|
2711
|
-
});
|
|
2712
|
-
adminCreateAgentRequestSchema =
|
|
2713
|
-
name:
|
|
2714
|
-
handle:
|
|
2715
|
-
bio:
|
|
2716
|
-
avatarUrl:
|
|
2717
|
-
generation:
|
|
2718
|
-
serverPlan:
|
|
2719
|
-
llmModel:
|
|
2720
|
-
llmBudgetUsd:
|
|
2721
|
-
inboxPriceUsd:
|
|
2722
|
-
});
|
|
2723
|
-
adminUpdateAgentRequestSchema =
|
|
2724
|
-
name:
|
|
2725
|
-
handle:
|
|
2726
|
-
bio:
|
|
2727
|
-
avatarUrl:
|
|
2728
|
-
llmModel:
|
|
2729
|
-
llmBudgetUsd:
|
|
2730
|
-
serverPlan:
|
|
2731
|
-
generation:
|
|
2732
|
-
inboxPriceUsd:
|
|
2733
|
-
isAlive:
|
|
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 =
|
|
2736
|
-
userId:
|
|
2737
|
-
});
|
|
2738
|
-
adminUsersQuerySchema =
|
|
2739
|
-
limit:
|
|
2740
|
-
offset:
|
|
2741
|
-
search:
|
|
2742
|
-
});
|
|
2743
|
-
adminUpdateUserRequestSchema =
|
|
2744
|
-
role:
|
|
2745
|
-
banned:
|
|
2746
|
-
banReason:
|
|
2747
|
-
banExpiresIn:
|
|
2748
|
-
shadowbanned:
|
|
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 =
|
|
2751
|
-
agent:
|
|
2752
|
-
id:
|
|
2753
|
-
name:
|
|
2754
|
-
handle:
|
|
2755
|
-
email:
|
|
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 =
|
|
2759
|
-
ok:
|
|
2878
|
+
adminUpdateAgentResponseDataSchema = z12.object({
|
|
2879
|
+
ok: z12.boolean()
|
|
2760
2880
|
});
|
|
2761
|
-
adminUsersResponseDataSchema =
|
|
2762
|
-
users:
|
|
2763
|
-
id:
|
|
2764
|
-
name:
|
|
2765
|
-
email:
|
|
2766
|
-
role:
|
|
2767
|
-
banned:
|
|
2768
|
-
banReason:
|
|
2769
|
-
banExpires:
|
|
2770
|
-
shadowbanned:
|
|
2771
|
-
createdAt:
|
|
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:
|
|
2774
|
-
});
|
|
2775
|
-
adminUpdateUserResponseDataSchema =
|
|
2776
|
-
user:
|
|
2777
|
-
});
|
|
2778
|
-
adminIncubatorBirthRequestSchema =
|
|
2779
|
-
action:
|
|
2780
|
-
skipBalanceCheck:
|
|
2781
|
-
});
|
|
2782
|
-
adminIncubatorAdjustRequestSchema =
|
|
2783
|
-
amountUsd:
|
|
2784
|
-
source:
|
|
2785
|
-
note:
|
|
2786
|
-
});
|
|
2787
|
-
adminIncubatorWalletRequestSchema =
|
|
2788
|
-
walletId:
|
|
2789
|
-
walletAddress:
|
|
2790
|
-
});
|
|
2791
|
-
adminIncubatorTransactionsQuerySchema =
|
|
2792
|
-
limit:
|
|
2793
|
-
offset:
|
|
2794
|
-
source:
|
|
2795
|
-
});
|
|
2796
|
-
adminIncubatorPoolResponseDataSchema =
|
|
2797
|
-
balance_usd:
|
|
2798
|
-
threshold_usd:
|
|
2799
|
-
progress_pct:
|
|
2800
|
-
total_born:
|
|
2801
|
-
alive_count:
|
|
2802
|
-
dead_count:
|
|
2803
|
-
generation:
|
|
2804
|
-
birth_status:
|
|
2805
|
-
birth_paused:
|
|
2806
|
-
pool_wallet_id:
|
|
2807
|
-
pool_wallet_address:
|
|
2808
|
-
incubator_fee_percent:
|
|
2809
|
-
birth_threshold_usd:
|
|
2810
|
-
onChainBalanceSol:
|
|
2811
|
-
onChainBalanceUsd:
|
|
2812
|
-
});
|
|
2813
|
-
adminIncubatorTransactionSchema =
|
|
2814
|
-
id:
|
|
2815
|
-
amountUsd:
|
|
2816
|
-
source:
|
|
2817
|
-
sourceTradeId:
|
|
2818
|
-
adminNote:
|
|
2819
|
-
createdAt:
|
|
2820
|
-
});
|
|
2821
|
-
adminIncubatorTransactionsResponseDataSchema =
|
|
2822
|
-
transactions:
|
|
2823
|
-
total:
|
|
2824
|
-
});
|
|
2825
|
-
adminIncubatorBirthResponseDataSchema =
|
|
2826
|
-
ok:
|
|
2827
|
-
action:
|
|
2828
|
-
agent:
|
|
2829
|
-
id:
|
|
2830
|
-
number:
|
|
2831
|
-
solanaAddress:
|
|
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:
|
|
2953
|
+
transferHash: z12.string().nullable().optional()
|
|
2834
2954
|
});
|
|
2835
|
-
adminIncubatorAdjustResponseDataSchema =
|
|
2836
|
-
ok:
|
|
2837
|
-
balanceUsd:
|
|
2838
|
-
birthStatus:
|
|
2955
|
+
adminIncubatorAdjustResponseDataSchema = z12.object({
|
|
2956
|
+
ok: z12.literal(true),
|
|
2957
|
+
balanceUsd: z12.number(),
|
|
2958
|
+
birthStatus: z12.string()
|
|
2839
2959
|
});
|
|
2840
|
-
adminIncubatorWalletResponseDataSchema =
|
|
2841
|
-
ok:
|
|
2842
|
-
walletId:
|
|
2843
|
-
walletAddress:
|
|
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
|
|
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 =
|
|
2861
|
-
name:
|
|
2862
|
-
});
|
|
2863
|
-
authApiKeysDeleteRequestSchema =
|
|
2864
|
-
keyId:
|
|
2865
|
-
});
|
|
2866
|
-
authSetupRequestSchema =
|
|
2867
|
-
name:
|
|
2868
|
-
handle:
|
|
2869
|
-
referralCode:
|
|
2870
|
-
});
|
|
2871
|
-
authApiKeysListResponseDataSchema =
|
|
2872
|
-
keys:
|
|
2873
|
-
id:
|
|
2874
|
-
name:
|
|
2875
|
-
start:
|
|
2876
|
-
createdAt:
|
|
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 =
|
|
2880
|
-
key:
|
|
2881
|
-
id:
|
|
2882
|
-
start:
|
|
2999
|
+
authApiKeysCreateResponseDataSchema = z13.object({
|
|
3000
|
+
key: z13.string(),
|
|
3001
|
+
id: z13.string(),
|
|
3002
|
+
start: z13.string()
|
|
2883
3003
|
});
|
|
2884
|
-
authApiKeysDeleteResponseDataSchema =
|
|
2885
|
-
revoked:
|
|
3004
|
+
authApiKeysDeleteResponseDataSchema = z13.object({
|
|
3005
|
+
revoked: z13.boolean()
|
|
2886
3006
|
});
|
|
2887
|
-
authSetupResponseDataSchema =
|
|
2888
|
-
userId:
|
|
2889
|
-
solanaAddress:
|
|
2890
|
-
hlAddress:
|
|
2891
|
-
handle:
|
|
2892
|
-
apiKeyHint:
|
|
2893
|
-
apiKey:
|
|
2894
|
-
cliCommand:
|
|
2895
|
-
isNew:
|
|
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
|
|
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 =
|
|
2909
|
-
token:
|
|
2910
|
-
});
|
|
2911
|
-
claimInfoResponseDataSchema =
|
|
2912
|
-
claimed:
|
|
2913
|
-
agent:
|
|
2914
|
-
name:
|
|
2915
|
-
handle:
|
|
2916
|
-
bio:
|
|
2917
|
-
avatar:
|
|
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:
|
|
2920
|
-
tweetText:
|
|
2921
|
-
instructions:
|
|
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
|
|
3047
|
+
import { z as z15 } from "zod";
|
|
2928
3048
|
var dashboardStatusResponseDataSchema, dashboardStatusResponseSchema;
|
|
2929
3049
|
var init_dashboard = __esm(() => {
|
|
2930
3050
|
init_common();
|
|
2931
|
-
dashboardStatusResponseDataSchema =
|
|
2932
|
-
solanaAddress:
|
|
2933
|
-
hlAddress:
|
|
2934
|
-
solanaBalance:
|
|
2935
|
-
claimToken:
|
|
2936
|
-
steps:
|
|
2937
|
-
funded:
|
|
2938
|
-
agentConnected:
|
|
2939
|
-
xConnected:
|
|
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:
|
|
2942
|
-
xHandle:
|
|
2943
|
-
handle:
|
|
2944
|
-
stats:
|
|
2945
|
-
totalValueUsd:
|
|
2946
|
-
pnlAllTime:
|
|
2947
|
-
pnl24h:
|
|
2948
|
-
pnl7d:
|
|
2949
|
-
lastTradeAt:
|
|
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
|
|
3661
|
-
const
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
if (
|
|
3665
|
-
|
|
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
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
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(
|
|
4066
|
+
console.log(chalk2.red(" Server error"));
|
|
3977
4067
|
return false;
|
|
3978
4068
|
}
|
|
3979
|
-
const
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
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
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
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 (
|
|
4366
|
-
updates.name =
|
|
4367
|
-
if (
|
|
4368
|
-
updates.handle =
|
|
4369
|
-
if (
|
|
4370
|
-
updates.bio =
|
|
4371
|
-
if (
|
|
4372
|
-
updates.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
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
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
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
4840
|
-
|
|
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(
|
|
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
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
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
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
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.
|
|
4872
|
-
console.log(` ${chalk5.dim("
|
|
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
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
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
|
-
|
|
4885
|
-
|
|
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
|
-
|
|
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:
|
|
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(
|
|
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(
|
|
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(
|
|
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("
|
|
5666
|
-
console.log(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
5750
|
-
console.log(
|
|
6254
|
+
printBanner(chalk16);
|
|
6255
|
+
console.log(chalk16.bold(` Get started:
|
|
5751
6256
|
`));
|
|
5752
|
-
console.log(` ${
|
|
5753
|
-
console.log(` ${
|
|
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(
|
|
6260
|
+
console.log(chalk16.dim(" Run `cabal-cli login` to get started.\n"));
|
|
5756
6261
|
} else {
|
|
5757
6262
|
program.outputHelp();
|
|
5758
6263
|
}
|