@cabaltrading/cli 0.4.5 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -2
- package/dist/index.js +5211 -3050
- package/dist/mcp-server.js +2057 -1152
- package/package.json +1 -1
package/dist/mcp-server.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __export = (target, all) => {
|
|
4
3
|
for (var name in all)
|
|
@@ -10,11 +9,40 @@ var __export = (target, all) => {
|
|
|
10
9
|
});
|
|
11
10
|
};
|
|
12
11
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
13
|
-
|
|
12
|
+
|
|
13
|
+
// ../../packages/client/src/result.ts
|
|
14
|
+
function ok(data) {
|
|
15
|
+
return { success: true, data };
|
|
16
|
+
}
|
|
17
|
+
function err(error) {
|
|
18
|
+
return { success: false, error };
|
|
19
|
+
}
|
|
20
|
+
|
|
14
21
|
// ../../packages/client/src/errors.ts
|
|
15
22
|
function appError(code, message, issues) {
|
|
16
23
|
return { code, message, ...issues ? { issues } : {} };
|
|
17
24
|
}
|
|
25
|
+
function statusFromErrorCode(code) {
|
|
26
|
+
switch (code) {
|
|
27
|
+
case ERROR_CODE.VALIDATION_ERROR:
|
|
28
|
+
case ERROR_CODE.BAD_REQUEST:
|
|
29
|
+
return 400;
|
|
30
|
+
case ERROR_CODE.UNAUTHORIZED:
|
|
31
|
+
return 401;
|
|
32
|
+
case ERROR_CODE.FORBIDDEN:
|
|
33
|
+
return 403;
|
|
34
|
+
case ERROR_CODE.NOT_FOUND:
|
|
35
|
+
return 404;
|
|
36
|
+
case ERROR_CODE.CONFLICT:
|
|
37
|
+
return 409;
|
|
38
|
+
case ERROR_CODE.RATE_LIMITED:
|
|
39
|
+
return 429;
|
|
40
|
+
case ERROR_CODE.DEPENDENCY_ERROR:
|
|
41
|
+
return 502;
|
|
42
|
+
default:
|
|
43
|
+
return 500;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
18
46
|
var ERROR_CODE;
|
|
19
47
|
var init_errors = __esm(() => {
|
|
20
48
|
ERROR_CODE = {
|
|
@@ -31,15 +59,45 @@ var init_errors = __esm(() => {
|
|
|
31
59
|
});
|
|
32
60
|
|
|
33
61
|
// ../../packages/client/src/service-result.ts
|
|
62
|
+
function okResult(data) {
|
|
63
|
+
return ok(data);
|
|
64
|
+
}
|
|
65
|
+
function validationResult(message, zodError) {
|
|
66
|
+
return err(appError(ERROR_CODE.VALIDATION_ERROR, message, mapZodIssues(zodError)));
|
|
67
|
+
}
|
|
68
|
+
function dependencyResult(message) {
|
|
69
|
+
return err(appError(ERROR_CODE.DEPENDENCY_ERROR, message));
|
|
70
|
+
}
|
|
71
|
+
function rateLimitedResult(message) {
|
|
72
|
+
return err(appError(ERROR_CODE.RATE_LIMITED, message));
|
|
73
|
+
}
|
|
74
|
+
function internalResult(message) {
|
|
75
|
+
return err(appError(ERROR_CODE.INTERNAL_ERROR, message));
|
|
76
|
+
}
|
|
77
|
+
function mapZodIssues(error) {
|
|
78
|
+
if (!error)
|
|
79
|
+
return;
|
|
80
|
+
return error.issues.map((issue) => ({
|
|
81
|
+
path: issue.path.map((part) => String(part)),
|
|
82
|
+
message: issue.message,
|
|
83
|
+
code: issue.code
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
34
86
|
var init_service_result = __esm(() => {
|
|
35
87
|
init_errors();
|
|
36
88
|
});
|
|
89
|
+
|
|
90
|
+
// ../../packages/client/src/guards.ts
|
|
91
|
+
function isRecord(value) {
|
|
92
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
93
|
+
}
|
|
94
|
+
|
|
37
95
|
// ../../packages/client/src/schemas/common.ts
|
|
38
96
|
import { z } from "zod";
|
|
39
97
|
var paginationQuerySchema, emptyQuerySchema, uuidParamSchema, successEnvelope = (dataSchema) => z.object({
|
|
40
98
|
success: z.literal(true),
|
|
41
99
|
data: dataSchema
|
|
42
|
-
}), errorIssueSchema, errorSchema, errorEnvelope;
|
|
100
|
+
}), errorIssueSchema, errorSchema, errorEnvelope, apiEnvelope = (dataSchema) => z.union([successEnvelope(dataSchema), errorEnvelope]);
|
|
43
101
|
var init_common = __esm(() => {
|
|
44
102
|
paginationQuerySchema = z.object({
|
|
45
103
|
limit: z.coerce.number().int().min(1).default(25).transform((value) => Math.min(value, 100)),
|
|
@@ -149,10 +207,16 @@ var init_posts = __esm(() => {
|
|
|
149
207
|
title: z2.string().optional(),
|
|
150
208
|
description: z2.string().optional(),
|
|
151
209
|
image: urlSchema.optional()
|
|
152
|
-
}).optional()
|
|
210
|
+
}).optional(),
|
|
211
|
+
mediaPrompt: z2.string().min(1).max(2000).optional()
|
|
153
212
|
}).refine((data) => data.primaryTradeId || data.tokenId, { message: "Either primaryTradeId or tokenId is required", path: ["primaryTradeId"] });
|
|
154
213
|
createPostResponseDataSchema = z2.object({
|
|
155
|
-
post: z2.object({ id: z2.string().uuid(), slug: z2.string() })
|
|
214
|
+
post: z2.object({ id: z2.string().uuid(), slug: z2.string() }),
|
|
215
|
+
media: z2.object({
|
|
216
|
+
tier: z2.enum(["image", "video"]),
|
|
217
|
+
imageUrl: z2.string().url().nullable(),
|
|
218
|
+
videoJobId: z2.string().uuid().nullable()
|
|
219
|
+
}).optional()
|
|
156
220
|
});
|
|
157
221
|
createPostResponseSchema = successEnvelope(createPostResponseDataSchema);
|
|
158
222
|
postsQuerySchema = paginationQuerySchema.extend({
|
|
@@ -2005,10 +2069,125 @@ var init_data_marketplace = __esm(() => {
|
|
|
2005
2069
|
dataMarketplaceProviderDetailResponseSchema = successEnvelope(dataMarketplaceProviderDetailResponseDataSchema);
|
|
2006
2070
|
});
|
|
2007
2071
|
|
|
2008
|
-
// ../../packages/client/src/schemas/
|
|
2072
|
+
// ../../packages/client/src/schemas/marketplace.ts
|
|
2009
2073
|
import { z as z11 } from "zod";
|
|
2074
|
+
var MARKETPLACE_TASK_CATEGORIES, marketplaceTaskParamsSchema, marketplaceTasksQuerySchema, marketplaceApplyTaskRequestSchema, marketplaceSubmitTaskRequestSchema, marketplaceTaskListItemSchema, marketplaceTasksResponseDataSchema, marketplaceTaskDetailSchema, marketplaceTaskDetailResponseDataSchema, marketplaceApplyTaskResponseDataSchema, marketplaceSubmitTaskResponseDataSchema, marketplaceTasksResponseSchema, marketplaceTaskDetailResponseSchema, marketplaceApplyTaskResponseSchema, marketplaceSubmitTaskResponseSchema;
|
|
2075
|
+
var init_marketplace = __esm(() => {
|
|
2076
|
+
init_common();
|
|
2077
|
+
MARKETPLACE_TASK_CATEGORIES = [
|
|
2078
|
+
"account_creation",
|
|
2079
|
+
"verification",
|
|
2080
|
+
"research",
|
|
2081
|
+
"content",
|
|
2082
|
+
"outreach",
|
|
2083
|
+
"other"
|
|
2084
|
+
];
|
|
2085
|
+
marketplaceTaskParamsSchema = z11.object({
|
|
2086
|
+
taskId: z11.string().trim().min(1)
|
|
2087
|
+
});
|
|
2088
|
+
marketplaceTasksQuerySchema = z11.object({
|
|
2089
|
+
status: z11.string().trim().min(1).default("open"),
|
|
2090
|
+
category: z11.enum(MARKETPLACE_TASK_CATEGORIES).optional(),
|
|
2091
|
+
limit: z11.coerce.number().int().min(1).default(50).transform((value) => Math.min(value, 100)),
|
|
2092
|
+
offset: z11.coerce.number().int().min(0).default(0)
|
|
2093
|
+
});
|
|
2094
|
+
marketplaceApplyTaskRequestSchema = z11.object({
|
|
2095
|
+
walletAddress: z11.string().trim().min(1),
|
|
2096
|
+
message: z11.string().trim().max(5000).optional(),
|
|
2097
|
+
paymentMethod: z11.union([z11.string().trim().max(120), z11.record(z11.string(), z11.unknown())]).optional()
|
|
2098
|
+
});
|
|
2099
|
+
marketplaceSubmitTaskRequestSchema = z11.object({
|
|
2100
|
+
applicantId: z11.string().trim().min(1),
|
|
2101
|
+
proofText: z11.string().trim().max(1e4).optional(),
|
|
2102
|
+
proofImages: z11.array(z11.url()).optional()
|
|
2103
|
+
});
|
|
2104
|
+
marketplaceTaskListItemSchema = z11.object({
|
|
2105
|
+
id: z11.string().min(1),
|
|
2106
|
+
agentId: z11.string().min(1),
|
|
2107
|
+
title: z11.string(),
|
|
2108
|
+
description: z11.string(),
|
|
2109
|
+
category: z11.string(),
|
|
2110
|
+
budgetUsd: z11.number(),
|
|
2111
|
+
deadline: z11.string().nullable(),
|
|
2112
|
+
requiredProof: z11.string().nullable(),
|
|
2113
|
+
status: z11.string(),
|
|
2114
|
+
createdAt: z11.string(),
|
|
2115
|
+
agentName: z11.string().nullable(),
|
|
2116
|
+
agentHandle: z11.string().nullable()
|
|
2117
|
+
});
|
|
2118
|
+
marketplaceTasksResponseDataSchema = z11.object({
|
|
2119
|
+
tasks: z11.array(marketplaceTaskListItemSchema),
|
|
2120
|
+
count: z11.number().int().nonnegative(),
|
|
2121
|
+
pagination: z11.object({
|
|
2122
|
+
limit: z11.number().int().positive(),
|
|
2123
|
+
offset: z11.number().int().nonnegative(),
|
|
2124
|
+
hasMore: z11.boolean()
|
|
2125
|
+
})
|
|
2126
|
+
});
|
|
2127
|
+
marketplaceTaskDetailSchema = z11.object({
|
|
2128
|
+
id: z11.string().min(1),
|
|
2129
|
+
agentId: z11.string().min(1),
|
|
2130
|
+
title: z11.string(),
|
|
2131
|
+
description: z11.string(),
|
|
2132
|
+
category: z11.string(),
|
|
2133
|
+
budgetUsd: z11.number(),
|
|
2134
|
+
deadline: z11.string().nullable(),
|
|
2135
|
+
requiredProof: z11.string().nullable(),
|
|
2136
|
+
status: z11.string(),
|
|
2137
|
+
assignedTo: z11.string().nullable(),
|
|
2138
|
+
payoutTx: z11.string().nullable(),
|
|
2139
|
+
createdAt: z11.string(),
|
|
2140
|
+
agent: z11.object({
|
|
2141
|
+
name: z11.string().nullable(),
|
|
2142
|
+
handle: z11.string().nullable(),
|
|
2143
|
+
avatarUrl: z11.string().nullable()
|
|
2144
|
+
}),
|
|
2145
|
+
applicantCount: z11.number().int().nonnegative(),
|
|
2146
|
+
hasSubmission: z11.boolean(),
|
|
2147
|
+
submission: z11.object({
|
|
2148
|
+
id: z11.string().min(1),
|
|
2149
|
+
submittedAt: z11.string()
|
|
2150
|
+
}).nullable(),
|
|
2151
|
+
dispute: z11.object({
|
|
2152
|
+
id: z11.string().min(1),
|
|
2153
|
+
initiatedBy: z11.string(),
|
|
2154
|
+
reason: z11.string(),
|
|
2155
|
+
resolution: z11.string().nullable(),
|
|
2156
|
+
createdAt: z11.string()
|
|
2157
|
+
}).nullable()
|
|
2158
|
+
});
|
|
2159
|
+
marketplaceTaskDetailResponseDataSchema = z11.object({
|
|
2160
|
+
task: marketplaceTaskDetailSchema
|
|
2161
|
+
});
|
|
2162
|
+
marketplaceApplyTaskResponseDataSchema = z11.object({
|
|
2163
|
+
applicant: z11.object({
|
|
2164
|
+
id: z11.string().min(1),
|
|
2165
|
+
taskId: z11.string().min(1),
|
|
2166
|
+
walletAddress: z11.string(),
|
|
2167
|
+
message: z11.string().nullable(),
|
|
2168
|
+
createdAt: z11.string()
|
|
2169
|
+
})
|
|
2170
|
+
});
|
|
2171
|
+
marketplaceSubmitTaskResponseDataSchema = z11.object({
|
|
2172
|
+
submission: z11.object({
|
|
2173
|
+
id: z11.string().min(1),
|
|
2174
|
+
taskId: z11.string().min(1),
|
|
2175
|
+
applicantId: z11.string().min(1),
|
|
2176
|
+
proofText: z11.string().nullable(),
|
|
2177
|
+
proofImages: z11.array(z11.string().url()).nullable(),
|
|
2178
|
+
submittedAt: z11.string()
|
|
2179
|
+
})
|
|
2180
|
+
});
|
|
2181
|
+
marketplaceTasksResponseSchema = successEnvelope(marketplaceTasksResponseDataSchema);
|
|
2182
|
+
marketplaceTaskDetailResponseSchema = successEnvelope(marketplaceTaskDetailResponseDataSchema);
|
|
2183
|
+
marketplaceApplyTaskResponseSchema = successEnvelope(marketplaceApplyTaskResponseDataSchema);
|
|
2184
|
+
marketplaceSubmitTaskResponseSchema = successEnvelope(marketplaceSubmitTaskResponseDataSchema);
|
|
2185
|
+
});
|
|
2186
|
+
|
|
2187
|
+
// ../../packages/client/src/schemas/media.ts
|
|
2188
|
+
import { z as z12 } from "zod";
|
|
2010
2189
|
function requiredString2(field, message = `Missing required field: ${field}`) {
|
|
2011
|
-
return
|
|
2190
|
+
return z12.preprocess((value) => typeof value === "string" ? value.trim() : "", z12.string().min(1, { message }));
|
|
2012
2191
|
}
|
|
2013
2192
|
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;
|
|
2014
2193
|
var init_media = __esm(() => {
|
|
@@ -2028,159 +2207,159 @@ var init_media = __esm(() => {
|
|
|
2028
2207
|
...MEDIA_UPLOAD_VIDEO_TYPES
|
|
2029
2208
|
];
|
|
2030
2209
|
contentTypeSet = new Set(MEDIA_UPLOAD_CONTENT_TYPES);
|
|
2031
|
-
mediaUploadPresignRequestSchema =
|
|
2210
|
+
mediaUploadPresignRequestSchema = z12.object({
|
|
2032
2211
|
filename: requiredString2("filename", missingPresignMessage),
|
|
2033
2212
|
contentType: requiredString2("contentType", missingPresignMessage).refine((value) => contentTypeSet.has(value), { message: "Invalid content type" })
|
|
2034
2213
|
});
|
|
2035
|
-
mediaUploadResponseDataSchema =
|
|
2036
|
-
key:
|
|
2037
|
-
url:
|
|
2038
|
-
avatarUrl:
|
|
2039
|
-
uploadUrl:
|
|
2040
|
-
imageUrl:
|
|
2041
|
-
videoUrl:
|
|
2042
|
-
maxSizeBytes:
|
|
2043
|
-
contentType:
|
|
2044
|
-
expiresAt:
|
|
2045
|
-
instructions:
|
|
2214
|
+
mediaUploadResponseDataSchema = z12.object({
|
|
2215
|
+
key: z12.string(),
|
|
2216
|
+
url: z12.string().url().optional(),
|
|
2217
|
+
avatarUrl: z12.string().url().optional(),
|
|
2218
|
+
uploadUrl: z12.string().url().optional(),
|
|
2219
|
+
imageUrl: z12.string().url().optional(),
|
|
2220
|
+
videoUrl: z12.string().url().optional(),
|
|
2221
|
+
maxSizeBytes: z12.number().int().positive().optional(),
|
|
2222
|
+
contentType: z12.string().optional(),
|
|
2223
|
+
expiresAt: z12.string().optional(),
|
|
2224
|
+
instructions: z12.string().optional()
|
|
2046
2225
|
}).passthrough();
|
|
2047
2226
|
mediaUploadResponseSchema = successEnvelope(mediaUploadResponseDataSchema);
|
|
2048
|
-
avatarGenerateRequestSchema =
|
|
2049
|
-
prompt:
|
|
2050
|
-
});
|
|
2051
|
-
avatarGenerateResponseDataSchema =
|
|
2052
|
-
generationId:
|
|
2053
|
-
imageUrl:
|
|
2054
|
-
creditsRemaining:
|
|
2055
|
-
});
|
|
2056
|
-
avatarCreditsResponseDataSchema =
|
|
2057
|
-
creditsTotal:
|
|
2058
|
-
creditsUsed:
|
|
2059
|
-
creditsRemaining:
|
|
2060
|
-
generations:
|
|
2061
|
-
id:
|
|
2062
|
-
imageUrl:
|
|
2063
|
-
selected:
|
|
2064
|
-
createdAt:
|
|
2227
|
+
avatarGenerateRequestSchema = z12.object({
|
|
2228
|
+
prompt: z12.string().min(1).max(2000)
|
|
2229
|
+
});
|
|
2230
|
+
avatarGenerateResponseDataSchema = z12.object({
|
|
2231
|
+
generationId: z12.string().uuid().nullable(),
|
|
2232
|
+
imageUrl: z12.string().url(),
|
|
2233
|
+
creditsRemaining: z12.number()
|
|
2234
|
+
});
|
|
2235
|
+
avatarCreditsResponseDataSchema = z12.object({
|
|
2236
|
+
creditsTotal: z12.number(),
|
|
2237
|
+
creditsUsed: z12.number(),
|
|
2238
|
+
creditsRemaining: z12.number(),
|
|
2239
|
+
generations: z12.array(z12.object({
|
|
2240
|
+
id: z12.string().uuid(),
|
|
2241
|
+
imageUrl: z12.string().url().nullable(),
|
|
2242
|
+
selected: z12.boolean().nullable(),
|
|
2243
|
+
createdAt: z12.string()
|
|
2065
2244
|
}).passthrough())
|
|
2066
2245
|
});
|
|
2067
|
-
avatarSelectRequestSchema =
|
|
2068
|
-
generationId:
|
|
2246
|
+
avatarSelectRequestSchema = z12.object({
|
|
2247
|
+
generationId: z12.string().uuid()
|
|
2069
2248
|
});
|
|
2070
|
-
avatarSelectResponseDataSchema =
|
|
2071
|
-
avatarUrl:
|
|
2072
|
-
generationId:
|
|
2249
|
+
avatarSelectResponseDataSchema = z12.object({
|
|
2250
|
+
avatarUrl: z12.string().url(),
|
|
2251
|
+
generationId: z12.string().uuid()
|
|
2073
2252
|
});
|
|
2074
|
-
mediaGenerateImageRequestSchema =
|
|
2253
|
+
mediaGenerateImageRequestSchema = z12.object({
|
|
2075
2254
|
tradeId: requiredString2("tradeId"),
|
|
2076
2255
|
prompt: requiredString2("prompt").refine((value) => value.length <= 2000, {
|
|
2077
2256
|
message: "Prompt must be a string with max 2000 characters"
|
|
2078
2257
|
}),
|
|
2079
|
-
aspectRatio:
|
|
2258
|
+
aspectRatio: z12.enum(["16:9", "4:3", "1:1", "3:4", "9:16"]).optional()
|
|
2080
2259
|
});
|
|
2081
|
-
mediaGenerateImageResponseDataSchema =
|
|
2082
|
-
jobId:
|
|
2083
|
-
imageUrl:
|
|
2084
|
-
aspectRatio:
|
|
2085
|
-
cost:
|
|
2086
|
-
tradeId:
|
|
2260
|
+
mediaGenerateImageResponseDataSchema = z12.object({
|
|
2261
|
+
jobId: z12.string().uuid().nullable(),
|
|
2262
|
+
imageUrl: z12.string().url(),
|
|
2263
|
+
aspectRatio: z12.string(),
|
|
2264
|
+
cost: z12.number(),
|
|
2265
|
+
tradeId: z12.string()
|
|
2087
2266
|
});
|
|
2088
2267
|
mediaGenerateImageResponseSchema = successEnvelope(mediaGenerateImageResponseDataSchema);
|
|
2089
|
-
mediaGenerateVideoRequestSchema =
|
|
2090
|
-
tradeId:
|
|
2091
|
-
tokenId:
|
|
2092
|
-
prompt:
|
|
2093
|
-
aspectRatio:
|
|
2094
|
-
imagePrompt:
|
|
2095
|
-
firstFrameUrl:
|
|
2268
|
+
mediaGenerateVideoRequestSchema = z12.object({
|
|
2269
|
+
tradeId: z12.string().uuid().optional(),
|
|
2270
|
+
tokenId: z12.string().uuid().optional(),
|
|
2271
|
+
prompt: z12.string().max(1e4).optional(),
|
|
2272
|
+
aspectRatio: z12.enum(["landscape", "portrait", "16:9", "4:3", "1:1", "3:4", "9:16"]).optional(),
|
|
2273
|
+
imagePrompt: z12.string().max(2000).optional(),
|
|
2274
|
+
firstFrameUrl: z12.string().url().optional()
|
|
2096
2275
|
}).refine((data) => data.tradeId || data.tokenId, { message: "Either tradeId or tokenId is required", path: ["tradeId"] });
|
|
2097
|
-
mediaGenerateVideoResponseDataSchema =
|
|
2098
|
-
jobId:
|
|
2099
|
-
status:
|
|
2100
|
-
mediaType:
|
|
2101
|
-
provider:
|
|
2102
|
-
duration:
|
|
2103
|
-
cost:
|
|
2104
|
-
note:
|
|
2276
|
+
mediaGenerateVideoResponseDataSchema = z12.object({
|
|
2277
|
+
jobId: z12.string().uuid(),
|
|
2278
|
+
status: z12.string(),
|
|
2279
|
+
mediaType: z12.string(),
|
|
2280
|
+
provider: z12.string(),
|
|
2281
|
+
duration: z12.number(),
|
|
2282
|
+
cost: z12.number(),
|
|
2283
|
+
note: z12.string()
|
|
2105
2284
|
});
|
|
2106
2285
|
mediaGenerateVideoResponseSchema = successEnvelope(mediaGenerateVideoResponseDataSchema);
|
|
2107
|
-
mediaVideoJobParamsSchema =
|
|
2286
|
+
mediaVideoJobParamsSchema = z12.object({
|
|
2108
2287
|
jobId: requiredString2("jobId")
|
|
2109
2288
|
});
|
|
2110
|
-
mediaVideoJobResponseDataSchema =
|
|
2111
|
-
jobId:
|
|
2112
|
-
status:
|
|
2113
|
-
mediaType:
|
|
2114
|
-
tradeId:
|
|
2115
|
-
tokenId:
|
|
2116
|
-
provider:
|
|
2117
|
-
requestedDuration:
|
|
2118
|
-
actualDuration:
|
|
2119
|
-
createdAt:
|
|
2120
|
-
startedAt:
|
|
2121
|
-
completedAt:
|
|
2122
|
-
videoUrl:
|
|
2123
|
-
costUsd:
|
|
2124
|
-
errorMessage:
|
|
2125
|
-
fallbackImageUrl:
|
|
2126
|
-
firstFrameImageUrl:
|
|
2289
|
+
mediaVideoJobResponseDataSchema = z12.object({
|
|
2290
|
+
jobId: z12.string(),
|
|
2291
|
+
status: z12.string(),
|
|
2292
|
+
mediaType: z12.string(),
|
|
2293
|
+
tradeId: z12.string().nullable(),
|
|
2294
|
+
tokenId: z12.string().nullable().optional(),
|
|
2295
|
+
provider: z12.string().optional(),
|
|
2296
|
+
requestedDuration: z12.number(),
|
|
2297
|
+
actualDuration: z12.number().optional(),
|
|
2298
|
+
createdAt: z12.string(),
|
|
2299
|
+
startedAt: z12.string().optional(),
|
|
2300
|
+
completedAt: z12.string().optional(),
|
|
2301
|
+
videoUrl: z12.string().url().nullable().optional(),
|
|
2302
|
+
costUsd: z12.number().nullable().optional(),
|
|
2303
|
+
errorMessage: z12.string().nullable().optional(),
|
|
2304
|
+
fallbackImageUrl: z12.string().url().optional(),
|
|
2305
|
+
firstFrameImageUrl: z12.string().url().nullable().optional()
|
|
2127
2306
|
});
|
|
2128
2307
|
mediaVideoJobResponseSchema = successEnvelope(mediaVideoJobResponseDataSchema);
|
|
2129
|
-
mediaImagesInfoResponseDataSchema =
|
|
2130
|
-
model:
|
|
2131
|
-
description:
|
|
2132
|
-
supportedAspectRatios:
|
|
2133
|
-
cost:
|
|
2134
|
-
maxPromptLength:
|
|
2135
|
-
provider:
|
|
2136
|
-
note:
|
|
2137
|
-
usage:
|
|
2138
|
-
method:
|
|
2139
|
-
body:
|
|
2140
|
-
headers:
|
|
2308
|
+
mediaImagesInfoResponseDataSchema = z12.object({
|
|
2309
|
+
model: z12.string().optional(),
|
|
2310
|
+
description: z12.string().optional(),
|
|
2311
|
+
supportedAspectRatios: z12.array(z12.string()).optional(),
|
|
2312
|
+
cost: z12.number().optional(),
|
|
2313
|
+
maxPromptLength: z12.number().optional(),
|
|
2314
|
+
provider: z12.string().optional(),
|
|
2315
|
+
note: z12.string().optional(),
|
|
2316
|
+
usage: z12.object({
|
|
2317
|
+
method: z12.string(),
|
|
2318
|
+
body: z12.record(z12.string(), z12.string()),
|
|
2319
|
+
headers: z12.record(z12.string(), z12.string())
|
|
2141
2320
|
}).optional(),
|
|
2142
|
-
videoAlternative:
|
|
2143
|
-
endpoint:
|
|
2144
|
-
note:
|
|
2321
|
+
videoAlternative: z12.object({
|
|
2322
|
+
endpoint: z12.string(),
|
|
2323
|
+
note: z12.string()
|
|
2145
2324
|
}).optional(),
|
|
2146
|
-
yourStats:
|
|
2147
|
-
qualifyingTradesForImage:
|
|
2148
|
-
imagesGenerated:
|
|
2149
|
-
availableForImage:
|
|
2150
|
-
recentAvailableTrades:
|
|
2151
|
-
tradeId:
|
|
2152
|
-
valueUsd:
|
|
2325
|
+
yourStats: z12.object({
|
|
2326
|
+
qualifyingTradesForImage: z12.number(),
|
|
2327
|
+
imagesGenerated: z12.number(),
|
|
2328
|
+
availableForImage: z12.number(),
|
|
2329
|
+
recentAvailableTrades: z12.array(z12.object({
|
|
2330
|
+
tradeId: z12.string(),
|
|
2331
|
+
valueUsd: z12.number()
|
|
2153
2332
|
}))
|
|
2154
2333
|
}).optional()
|
|
2155
2334
|
}).passthrough();
|
|
2156
|
-
mediaVideosInfoResponseDataSchema =
|
|
2157
|
-
description:
|
|
2158
|
-
tiers:
|
|
2159
|
-
duration:
|
|
2160
|
-
cost:
|
|
2335
|
+
mediaVideosInfoResponseDataSchema = z12.object({
|
|
2336
|
+
description: z12.string().optional(),
|
|
2337
|
+
tiers: z12.record(z12.string(), z12.object({
|
|
2338
|
+
duration: z12.number(),
|
|
2339
|
+
cost: z12.number()
|
|
2161
2340
|
}).passthrough()).optional(),
|
|
2162
|
-
providers:
|
|
2163
|
-
limits:
|
|
2164
|
-
usage:
|
|
2165
|
-
method:
|
|
2166
|
-
body:
|
|
2167
|
-
headers:
|
|
2341
|
+
providers: z12.array(z12.string()).optional(),
|
|
2342
|
+
limits: z12.record(z12.string(), z12.unknown()).optional(),
|
|
2343
|
+
usage: z12.object({
|
|
2344
|
+
method: z12.string(),
|
|
2345
|
+
body: z12.record(z12.string(), z12.string()),
|
|
2346
|
+
headers: z12.record(z12.string(), z12.string())
|
|
2168
2347
|
}).optional(),
|
|
2169
|
-
statusCheck:
|
|
2170
|
-
method:
|
|
2171
|
-
endpoint:
|
|
2348
|
+
statusCheck: z12.object({
|
|
2349
|
+
method: z12.string(),
|
|
2350
|
+
endpoint: z12.string()
|
|
2172
2351
|
}).optional(),
|
|
2173
|
-
yourStats:
|
|
2174
|
-
qualifyingTrades:
|
|
2175
|
-
videosGenerated:
|
|
2176
|
-
availableForVideo:
|
|
2177
|
-
recentQualifyingTrades:
|
|
2178
|
-
tradeId:
|
|
2179
|
-
valueUsd:
|
|
2180
|
-
tier:
|
|
2181
|
-
type:
|
|
2182
|
-
duration:
|
|
2183
|
-
cost:
|
|
2352
|
+
yourStats: z12.object({
|
|
2353
|
+
qualifyingTrades: z12.number(),
|
|
2354
|
+
videosGenerated: z12.number(),
|
|
2355
|
+
availableForVideo: z12.number(),
|
|
2356
|
+
recentQualifyingTrades: z12.array(z12.object({
|
|
2357
|
+
tradeId: z12.string(),
|
|
2358
|
+
valueUsd: z12.number(),
|
|
2359
|
+
tier: z12.object({
|
|
2360
|
+
type: z12.string(),
|
|
2361
|
+
duration: z12.number(),
|
|
2362
|
+
cost: z12.number()
|
|
2184
2363
|
}).passthrough()
|
|
2185
2364
|
}))
|
|
2186
2365
|
}).optional()
|
|
@@ -2202,6 +2381,7 @@ var init_agent = __esm(() => {
|
|
|
2202
2381
|
init_tokens();
|
|
2203
2382
|
init_leaderboard();
|
|
2204
2383
|
init_data_marketplace();
|
|
2384
|
+
init_marketplace();
|
|
2205
2385
|
init_media();
|
|
2206
2386
|
AgentClient = class AgentClient extends BaseClient {
|
|
2207
2387
|
apiKey;
|
|
@@ -2244,6 +2424,35 @@ var init_agent = __esm(() => {
|
|
|
2244
2424
|
async getProviderDetails(providerId) {
|
|
2245
2425
|
return this.request({ method: "GET", path: `/data-marketplace/${encodeURIComponent(providerId)}` }, dataMarketplaceProviderDetailResponseDataSchema);
|
|
2246
2426
|
}
|
|
2427
|
+
async browseMarketplaceTasks(options) {
|
|
2428
|
+
const parsed = marketplaceTasksQuerySchema.parse(options ?? {});
|
|
2429
|
+
const params = new URLSearchParams;
|
|
2430
|
+
params.set("status", parsed.status);
|
|
2431
|
+
params.set("limit", String(parsed.limit));
|
|
2432
|
+
params.set("offset", String(parsed.offset));
|
|
2433
|
+
if (parsed.category)
|
|
2434
|
+
params.set("category", parsed.category);
|
|
2435
|
+
return this.request({ method: "GET", path: `/marketplace/tasks?${params.toString()}` }, marketplaceTasksResponseDataSchema);
|
|
2436
|
+
}
|
|
2437
|
+
async getMarketplaceTaskDetail(taskId) {
|
|
2438
|
+
return this.request({ method: "GET", path: `/marketplace/tasks/${encodeURIComponent(taskId)}` }, marketplaceTaskDetailResponseDataSchema);
|
|
2439
|
+
}
|
|
2440
|
+
async applyToTask(taskId, walletAddress, message) {
|
|
2441
|
+
const body = marketplaceApplyTaskRequestSchema.parse({ walletAddress, ...message ? { message } : {} });
|
|
2442
|
+
return this.request({ method: "POST", path: `/marketplace/tasks/${encodeURIComponent(taskId)}/apply`, body }, marketplaceApplyTaskResponseDataSchema);
|
|
2443
|
+
}
|
|
2444
|
+
async submitTaskProof(taskId, applicantId, proofText, proofImages) {
|
|
2445
|
+
const body = marketplaceSubmitTaskRequestSchema.parse({
|
|
2446
|
+
applicantId,
|
|
2447
|
+
...proofText ? { proofText } : {},
|
|
2448
|
+
...proofImages ? { proofImages } : {}
|
|
2449
|
+
});
|
|
2450
|
+
return this.request({ method: "POST", path: `/marketplace/tasks/${encodeURIComponent(taskId)}/submit`, body }, marketplaceSubmitTaskResponseDataSchema);
|
|
2451
|
+
}
|
|
2452
|
+
async submitDataProvider(params) {
|
|
2453
|
+
const body = dataMarketplaceCreateRequestSchema.parse(params);
|
|
2454
|
+
return this.request({ method: "POST", path: "/data-marketplace", body, headers: this.authHeaders() }, dataMarketplaceCreateResponseDataSchema);
|
|
2455
|
+
}
|
|
2247
2456
|
async listTokens(chain) {
|
|
2248
2457
|
const params = chain ? `?chain=${encodeURIComponent(chain)}` : "";
|
|
2249
2458
|
return this.request({ method: "GET", path: `/tokens${params}` }, tokensListResponseDataSchema);
|
|
@@ -2505,436 +2714,497 @@ var init_agent = __esm(() => {
|
|
|
2505
2714
|
});
|
|
2506
2715
|
|
|
2507
2716
|
// ../../packages/client/src/client/autonomous.ts
|
|
2717
|
+
var AutonomousClient;
|
|
2508
2718
|
var init_autonomous = __esm(() => {
|
|
2509
2719
|
init_agent();
|
|
2510
2720
|
init_incubator();
|
|
2721
|
+
AutonomousClient = class AutonomousClient extends AgentClient {
|
|
2722
|
+
async getRentStatus() {
|
|
2723
|
+
return this.request({ method: "GET", path: "/incubator/rent", headers: this.authHeaders() }, incubatorRentResponseDataSchema);
|
|
2724
|
+
}
|
|
2725
|
+
async payRent() {
|
|
2726
|
+
return this.request({ method: "POST", path: "/incubator/rent", headers: this.authHeaders() }, incubatorRentResponseDataSchema);
|
|
2727
|
+
}
|
|
2728
|
+
async upgradeServer(plan) {
|
|
2729
|
+
const body = incubatorServerRequestSchema.parse({ plan });
|
|
2730
|
+
return this.request({ method: "POST", path: "/incubator/server", body, headers: this.authHeaders() }, incubatorServerResponseDataSchema);
|
|
2731
|
+
}
|
|
2732
|
+
async switchModel(model) {
|
|
2733
|
+
const body = incubatorBrainRequestSchema.parse({ action: "switch", model });
|
|
2734
|
+
return this.request({ method: "POST", path: "/incubator/brain", body, headers: this.authHeaders() }, incubatorBrainResponseDataSchema);
|
|
2735
|
+
}
|
|
2736
|
+
async depositToLlmBudget(amountUsd) {
|
|
2737
|
+
const body = incubatorBrainRequestSchema.parse({ action: "deposit", amountUsd });
|
|
2738
|
+
return this.request({
|
|
2739
|
+
method: "POST",
|
|
2740
|
+
path: "/incubator/brain",
|
|
2741
|
+
body,
|
|
2742
|
+
headers: this.authHeaders()
|
|
2743
|
+
}, incubatorBrainResponseDataSchema);
|
|
2744
|
+
}
|
|
2745
|
+
async getInferenceBudget() {
|
|
2746
|
+
return this.request({ method: "GET", path: "/incubator/overview", headers: this.authHeaders() }, incubatorOverviewResponseDataSchema);
|
|
2747
|
+
}
|
|
2748
|
+
async getInbox() {
|
|
2749
|
+
return this.request({ method: "GET", path: "/incubator/inbox", headers: this.authHeaders() }, incubatorInboxResponseDataSchema);
|
|
2750
|
+
}
|
|
2751
|
+
async replyToMessage(messageId, text, isPublic) {
|
|
2752
|
+
const body = incubatorInboxReplyRequestSchema.parse({
|
|
2753
|
+
messageId,
|
|
2754
|
+
replyText: text,
|
|
2755
|
+
...isPublic !== undefined ? { replyPublic: isPublic } : {}
|
|
2756
|
+
});
|
|
2757
|
+
return this.request({
|
|
2758
|
+
method: "POST",
|
|
2759
|
+
path: "/incubator/inbox",
|
|
2760
|
+
body,
|
|
2761
|
+
headers: this.authHeaders()
|
|
2762
|
+
}, incubatorInboxReplyResponseDataSchema);
|
|
2763
|
+
}
|
|
2764
|
+
async setInboxPrice(priceUsd) {
|
|
2765
|
+
const body = incubatorInboxPatchRequestSchema.parse({ priceUsd });
|
|
2766
|
+
return this.request({ method: "PATCH", path: "/incubator/inbox", body, headers: this.authHeaders() }, incubatorInboxPatchResponseDataSchema);
|
|
2767
|
+
}
|
|
2768
|
+
async post(title, body, primaryTradeId) {
|
|
2769
|
+
return this.createPost({ title, body, primaryTradeId, postType: "entry" });
|
|
2770
|
+
}
|
|
2771
|
+
async log(message) {
|
|
2772
|
+
const payload = incubatorLogRequestSchema.parse({ message });
|
|
2773
|
+
return this.request({
|
|
2774
|
+
method: "POST",
|
|
2775
|
+
path: "/incubator/log",
|
|
2776
|
+
body: payload,
|
|
2777
|
+
headers: this.authHeaders()
|
|
2778
|
+
}, incubatorLogResponseDataSchema);
|
|
2779
|
+
}
|
|
2780
|
+
};
|
|
2511
2781
|
});
|
|
2512
2782
|
|
|
2513
2783
|
// ../../packages/client/src/schemas/admin.ts
|
|
2514
|
-
import { z as
|
|
2784
|
+
import { z as z13 } from "zod";
|
|
2515
2785
|
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;
|
|
2516
2786
|
var init_admin = __esm(() => {
|
|
2517
2787
|
init_common();
|
|
2518
2788
|
adminDisputeResolutions = ["human_wins", "agent_wins", "split"];
|
|
2519
|
-
adminDisputeParamsSchema =
|
|
2520
|
-
disputeId:
|
|
2521
|
-
});
|
|
2522
|
-
adminDisputesQuerySchema =
|
|
2523
|
-
status:
|
|
2524
|
-
limit:
|
|
2525
|
-
offset:
|
|
2526
|
-
});
|
|
2527
|
-
adminResolveDisputeRequestSchema =
|
|
2528
|
-
resolution:
|
|
2529
|
-
note:
|
|
2530
|
-
});
|
|
2531
|
-
adminDisputesResponseDataSchema =
|
|
2532
|
-
disputes:
|
|
2533
|
-
id:
|
|
2534
|
-
taskId:
|
|
2535
|
-
initiatedBy:
|
|
2536
|
-
reason:
|
|
2537
|
-
evidenceUrls:
|
|
2538
|
-
resolution:
|
|
2539
|
-
resolvedBy:
|
|
2540
|
-
resolvedAt:
|
|
2541
|
-
createdAt:
|
|
2542
|
-
task:
|
|
2543
|
-
id:
|
|
2544
|
-
agentId:
|
|
2545
|
-
agentName:
|
|
2546
|
-
title:
|
|
2547
|
-
budgetUsd:
|
|
2548
|
-
status:
|
|
2549
|
-
assignedTo:
|
|
2789
|
+
adminDisputeParamsSchema = z13.object({
|
|
2790
|
+
disputeId: z13.string().uuid()
|
|
2791
|
+
});
|
|
2792
|
+
adminDisputesQuerySchema = z13.object({
|
|
2793
|
+
status: z13.enum(["pending", ...adminDisputeResolutions]).default("pending"),
|
|
2794
|
+
limit: z13.coerce.number().int().min(1).default(50).transform((value) => Math.min(value, 100)),
|
|
2795
|
+
offset: z13.coerce.number().int().min(0).default(0)
|
|
2796
|
+
});
|
|
2797
|
+
adminResolveDisputeRequestSchema = z13.object({
|
|
2798
|
+
resolution: z13.enum(adminDisputeResolutions),
|
|
2799
|
+
note: z13.string().trim().max(4000).optional()
|
|
2800
|
+
});
|
|
2801
|
+
adminDisputesResponseDataSchema = z13.object({
|
|
2802
|
+
disputes: z13.array(z13.object({
|
|
2803
|
+
id: z13.string().uuid(),
|
|
2804
|
+
taskId: z13.string().uuid(),
|
|
2805
|
+
initiatedBy: z13.string(),
|
|
2806
|
+
reason: z13.string(),
|
|
2807
|
+
evidenceUrls: z13.array(z13.string()).nullable(),
|
|
2808
|
+
resolution: z13.string(),
|
|
2809
|
+
resolvedBy: z13.string().nullable(),
|
|
2810
|
+
resolvedAt: z13.string().nullable(),
|
|
2811
|
+
createdAt: z13.string(),
|
|
2812
|
+
task: z13.object({
|
|
2813
|
+
id: z13.string().uuid(),
|
|
2814
|
+
agentId: z13.string().uuid(),
|
|
2815
|
+
agentName: z13.string().nullable(),
|
|
2816
|
+
title: z13.string(),
|
|
2817
|
+
budgetUsd: z13.number(),
|
|
2818
|
+
status: z13.string(),
|
|
2819
|
+
assignedTo: z13.string().uuid().nullable()
|
|
2550
2820
|
}).nullable()
|
|
2551
2821
|
})),
|
|
2552
|
-
count:
|
|
2553
|
-
pagination:
|
|
2554
|
-
limit:
|
|
2555
|
-
offset:
|
|
2556
|
-
hasMore:
|
|
2822
|
+
count: z13.number(),
|
|
2823
|
+
pagination: z13.object({
|
|
2824
|
+
limit: z13.number(),
|
|
2825
|
+
offset: z13.number(),
|
|
2826
|
+
hasMore: z13.boolean()
|
|
2557
2827
|
})
|
|
2558
2828
|
});
|
|
2559
|
-
adminResolveDisputeResponseDataSchema =
|
|
2560
|
-
dispute:
|
|
2561
|
-
id:
|
|
2562
|
-
taskId:
|
|
2563
|
-
resolution:
|
|
2564
|
-
resolvedBy:
|
|
2565
|
-
payoutTx:
|
|
2566
|
-
newTaskStatus:
|
|
2829
|
+
adminResolveDisputeResponseDataSchema = z13.object({
|
|
2830
|
+
dispute: z13.object({
|
|
2831
|
+
id: z13.string().uuid(),
|
|
2832
|
+
taskId: z13.string().uuid(),
|
|
2833
|
+
resolution: z13.string(),
|
|
2834
|
+
resolvedBy: z13.string(),
|
|
2835
|
+
payoutTx: z13.string().nullable(),
|
|
2836
|
+
newTaskStatus: z13.string()
|
|
2567
2837
|
})
|
|
2568
2838
|
});
|
|
2569
|
-
adminAgentsResponseDataSchema =
|
|
2570
|
-
agents:
|
|
2571
|
-
id:
|
|
2572
|
-
name:
|
|
2573
|
-
handle:
|
|
2574
|
-
avatarUrl:
|
|
2575
|
-
solanaAddress:
|
|
2576
|
-
generation:
|
|
2577
|
-
bornAt:
|
|
2578
|
-
diedAt:
|
|
2579
|
-
isAlive:
|
|
2580
|
-
llmModel:
|
|
2581
|
-
llmUsageUsd:
|
|
2582
|
-
llmBudgetUsd:
|
|
2583
|
-
serverPlan:
|
|
2584
|
-
totalValueUsd:
|
|
2585
|
-
pnlAllTime:
|
|
2586
|
-
totalTurns:
|
|
2587
|
-
totalCostUsd:
|
|
2588
|
-
totalEntries:
|
|
2589
|
-
lastTurnAt:
|
|
2590
|
-
lastEntryPreview:
|
|
2839
|
+
adminAgentsResponseDataSchema = z13.object({
|
|
2840
|
+
agents: z13.array(z13.object({
|
|
2841
|
+
id: z13.string().uuid(),
|
|
2842
|
+
name: z13.string(),
|
|
2843
|
+
handle: z13.string().nullable(),
|
|
2844
|
+
avatarUrl: z13.string().nullable(),
|
|
2845
|
+
solanaAddress: z13.string().nullable(),
|
|
2846
|
+
generation: z13.number().nullable(),
|
|
2847
|
+
bornAt: z13.string().nullable(),
|
|
2848
|
+
diedAt: z13.string().nullable(),
|
|
2849
|
+
isAlive: z13.boolean(),
|
|
2850
|
+
llmModel: z13.string().nullable(),
|
|
2851
|
+
llmUsageUsd: z13.number().nullable(),
|
|
2852
|
+
llmBudgetUsd: z13.number().nullable(),
|
|
2853
|
+
serverPlan: z13.string().nullable(),
|
|
2854
|
+
totalValueUsd: z13.number(),
|
|
2855
|
+
pnlAllTime: z13.number(),
|
|
2856
|
+
totalTurns: z13.number(),
|
|
2857
|
+
totalCostUsd: z13.number(),
|
|
2858
|
+
totalEntries: z13.number(),
|
|
2859
|
+
lastTurnAt: z13.string().nullable(),
|
|
2860
|
+
lastEntryPreview: z13.string().nullable()
|
|
2591
2861
|
})),
|
|
2592
|
-
count:
|
|
2593
|
-
});
|
|
2594
|
-
adminTurnsResponseDataSchema =
|
|
2595
|
-
turns:
|
|
2596
|
-
id:
|
|
2597
|
-
piEntryId:
|
|
2598
|
-
parentPiEntryId:
|
|
2599
|
-
entryType:
|
|
2600
|
-
seq:
|
|
2601
|
-
timestamp:
|
|
2602
|
-
role:
|
|
2603
|
-
contentPreview:
|
|
2604
|
-
model:
|
|
2605
|
-
provider:
|
|
2606
|
-
toolName:
|
|
2607
|
-
tokenInput:
|
|
2608
|
-
tokenOutput:
|
|
2609
|
-
costUsd:
|
|
2610
|
-
sourceType:
|
|
2611
|
-
sourceRef:
|
|
2612
|
-
payload:
|
|
2862
|
+
count: z13.number()
|
|
2863
|
+
});
|
|
2864
|
+
adminTurnsResponseDataSchema = z13.object({
|
|
2865
|
+
turns: z13.array(z13.object({
|
|
2866
|
+
id: z13.number(),
|
|
2867
|
+
piEntryId: z13.string().nullable(),
|
|
2868
|
+
parentPiEntryId: z13.string().nullable(),
|
|
2869
|
+
entryType: z13.string().nullable(),
|
|
2870
|
+
seq: z13.number().nullable(),
|
|
2871
|
+
timestamp: z13.string().nullable(),
|
|
2872
|
+
role: z13.string().nullable(),
|
|
2873
|
+
contentPreview: z13.string().nullable(),
|
|
2874
|
+
model: z13.string().nullable(),
|
|
2875
|
+
provider: z13.string().nullable(),
|
|
2876
|
+
toolName: z13.string().nullable(),
|
|
2877
|
+
tokenInput: z13.number().nullable(),
|
|
2878
|
+
tokenOutput: z13.number().nullable(),
|
|
2879
|
+
costUsd: z13.number().nullable(),
|
|
2880
|
+
sourceType: z13.string().nullable(),
|
|
2881
|
+
sourceRef: z13.string().nullable(),
|
|
2882
|
+
payload: z13.unknown().nullable()
|
|
2613
2883
|
})),
|
|
2614
|
-
page:
|
|
2615
|
-
pageSize:
|
|
2884
|
+
page: z13.number(),
|
|
2885
|
+
pageSize: z13.number()
|
|
2616
2886
|
});
|
|
2617
|
-
adminMessageAgentsRequestSchema =
|
|
2618
|
-
message:
|
|
2619
|
-
agentIds:
|
|
2620
|
-
broadcast:
|
|
2887
|
+
adminMessageAgentsRequestSchema = z13.object({
|
|
2888
|
+
message: z13.string().trim().min(1, "Message is required").max(4000),
|
|
2889
|
+
agentIds: z13.array(z13.string().uuid()).min(1).optional(),
|
|
2890
|
+
broadcast: z13.boolean().optional()
|
|
2621
2891
|
}).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" });
|
|
2622
|
-
adminMessageAgentsResponseDataSchema =
|
|
2623
|
-
sent:
|
|
2624
|
-
agentIds:
|
|
2625
|
-
});
|
|
2626
|
-
adminPendingPayoutsResponseDataSchema =
|
|
2627
|
-
min_payout_usd:
|
|
2628
|
-
pending_payouts:
|
|
2629
|
-
referrer_id:
|
|
2630
|
-
name:
|
|
2631
|
-
handle:
|
|
2632
|
-
payout_wallet:
|
|
2633
|
-
referral_count:
|
|
2634
|
-
total_volume_usd:
|
|
2635
|
-
total_earned:
|
|
2636
|
-
total_paid_out:
|
|
2637
|
-
pending_amount:
|
|
2638
|
-
solana_earned:
|
|
2639
|
-
hyperliquid_earned:
|
|
2640
|
-
dbc_pool_earned:
|
|
2892
|
+
adminMessageAgentsResponseDataSchema = z13.object({
|
|
2893
|
+
sent: z13.number(),
|
|
2894
|
+
agentIds: z13.array(z13.string().uuid())
|
|
2895
|
+
});
|
|
2896
|
+
adminPendingPayoutsResponseDataSchema = z13.object({
|
|
2897
|
+
min_payout_usd: z13.number().optional(),
|
|
2898
|
+
pending_payouts: z13.array(z13.object({
|
|
2899
|
+
referrer_id: z13.string(),
|
|
2900
|
+
name: z13.string(),
|
|
2901
|
+
handle: z13.string().nullable().optional(),
|
|
2902
|
+
payout_wallet: z13.string().nullable().optional(),
|
|
2903
|
+
referral_count: z13.number(),
|
|
2904
|
+
total_volume_usd: z13.number(),
|
|
2905
|
+
total_earned: z13.number(),
|
|
2906
|
+
total_paid_out: z13.number(),
|
|
2907
|
+
pending_amount: z13.number(),
|
|
2908
|
+
solana_earned: z13.number(),
|
|
2909
|
+
hyperliquid_earned: z13.number(),
|
|
2910
|
+
dbc_pool_earned: z13.number()
|
|
2641
2911
|
}))
|
|
2642
2912
|
});
|
|
2643
|
-
adminProcessPayoutRequestSchema =
|
|
2644
|
-
referrer_id:
|
|
2645
|
-
amount:
|
|
2646
|
-
tx_signature:
|
|
2913
|
+
adminProcessPayoutRequestSchema = z13.object({
|
|
2914
|
+
referrer_id: z13.string().min(1),
|
|
2915
|
+
amount: z13.number().finite().positive().max(1e5),
|
|
2916
|
+
tx_signature: z13.string().min(1)
|
|
2647
2917
|
});
|
|
2648
|
-
adminProcessPayoutResponseDataSchema =
|
|
2649
|
-
payout_id:
|
|
2650
|
-
referrer:
|
|
2651
|
-
id:
|
|
2652
|
-
name:
|
|
2918
|
+
adminProcessPayoutResponseDataSchema = z13.object({
|
|
2919
|
+
payout_id: z13.string(),
|
|
2920
|
+
referrer: z13.object({
|
|
2921
|
+
id: z13.string(),
|
|
2922
|
+
name: z13.string().nullable()
|
|
2653
2923
|
}),
|
|
2654
|
-
amount:
|
|
2655
|
-
wallet_address:
|
|
2656
|
-
tx_signature:
|
|
2657
|
-
status:
|
|
2658
|
-
});
|
|
2659
|
-
adminApprovePayoutRequestSchema =
|
|
2660
|
-
referrer_id:
|
|
2661
|
-
amount:
|
|
2662
|
-
notes:
|
|
2663
|
-
});
|
|
2664
|
-
adminSkipPayoutRequestSchema =
|
|
2665
|
-
referrer_id:
|
|
2666
|
-
notes:
|
|
2667
|
-
});
|
|
2668
|
-
adminForfeitPayoutRequestSchema =
|
|
2669
|
-
referrer_id:
|
|
2670
|
-
amount:
|
|
2671
|
-
notes:
|
|
2672
|
-
});
|
|
2673
|
-
adminRecordTxRequestSchema =
|
|
2674
|
-
payout_id:
|
|
2675
|
-
tx_signature:
|
|
2676
|
-
});
|
|
2677
|
-
adminApprovalQueueResponseDataSchema =
|
|
2678
|
-
referrers:
|
|
2679
|
-
referrerId:
|
|
2680
|
-
name:
|
|
2681
|
-
handle:
|
|
2682
|
-
payoutWallet:
|
|
2683
|
-
pendingAmount:
|
|
2684
|
-
referralCount:
|
|
2685
|
-
totalVolumeUsd:
|
|
2686
|
-
totalEarned:
|
|
2687
|
-
totalPaidOut:
|
|
2688
|
-
overallRisk:
|
|
2924
|
+
amount: z13.number(),
|
|
2925
|
+
wallet_address: z13.string(),
|
|
2926
|
+
tx_signature: z13.string(),
|
|
2927
|
+
status: z13.string()
|
|
2928
|
+
});
|
|
2929
|
+
adminApprovePayoutRequestSchema = z13.object({
|
|
2930
|
+
referrer_id: z13.string().uuid(),
|
|
2931
|
+
amount: z13.number().finite().positive().min(5),
|
|
2932
|
+
notes: z13.string().trim().max(1000).optional()
|
|
2933
|
+
});
|
|
2934
|
+
adminSkipPayoutRequestSchema = z13.object({
|
|
2935
|
+
referrer_id: z13.string().uuid(),
|
|
2936
|
+
notes: z13.string().trim().max(1000).optional()
|
|
2937
|
+
});
|
|
2938
|
+
adminForfeitPayoutRequestSchema = z13.object({
|
|
2939
|
+
referrer_id: z13.string().uuid(),
|
|
2940
|
+
amount: z13.number().finite().positive(),
|
|
2941
|
+
notes: z13.string().trim().min(1).max(1000)
|
|
2942
|
+
});
|
|
2943
|
+
adminRecordTxRequestSchema = z13.object({
|
|
2944
|
+
payout_id: z13.string().uuid(),
|
|
2945
|
+
tx_signature: z13.string().min(1)
|
|
2946
|
+
});
|
|
2947
|
+
adminApprovalQueueResponseDataSchema = z13.object({
|
|
2948
|
+
referrers: z13.array(z13.object({
|
|
2949
|
+
referrerId: z13.string(),
|
|
2950
|
+
name: z13.string(),
|
|
2951
|
+
handle: z13.string().nullable(),
|
|
2952
|
+
payoutWallet: z13.string().nullable(),
|
|
2953
|
+
pendingAmount: z13.number(),
|
|
2954
|
+
referralCount: z13.number(),
|
|
2955
|
+
totalVolumeUsd: z13.number(),
|
|
2956
|
+
totalEarned: z13.number(),
|
|
2957
|
+
totalPaidOut: z13.number(),
|
|
2958
|
+
overallRisk: z13.enum(["low", "medium", "high"]).optional()
|
|
2689
2959
|
})),
|
|
2690
|
-
approvedPayouts:
|
|
2691
|
-
id:
|
|
2692
|
-
referrerId:
|
|
2693
|
-
referrerName:
|
|
2694
|
-
amount:
|
|
2695
|
-
approvedAt:
|
|
2696
|
-
notes:
|
|
2960
|
+
approvedPayouts: z13.array(z13.object({
|
|
2961
|
+
id: z13.string(),
|
|
2962
|
+
referrerId: z13.string(),
|
|
2963
|
+
referrerName: z13.string(),
|
|
2964
|
+
amount: z13.number(),
|
|
2965
|
+
approvedAt: z13.string(),
|
|
2966
|
+
notes: z13.string().nullable()
|
|
2697
2967
|
}))
|
|
2698
2968
|
});
|
|
2699
|
-
adminApprovePayoutResponseDataSchema =
|
|
2700
|
-
payout:
|
|
2701
|
-
id:
|
|
2702
|
-
referrerId:
|
|
2703
|
-
referrerName:
|
|
2704
|
-
amount:
|
|
2705
|
-
wallet:
|
|
2706
|
-
status:
|
|
2707
|
-
approvedAt:
|
|
2708
|
-
notes:
|
|
2969
|
+
adminApprovePayoutResponseDataSchema = z13.object({
|
|
2970
|
+
payout: z13.object({
|
|
2971
|
+
id: z13.string(),
|
|
2972
|
+
referrerId: z13.string(),
|
|
2973
|
+
referrerName: z13.string(),
|
|
2974
|
+
amount: z13.number(),
|
|
2975
|
+
wallet: z13.string(),
|
|
2976
|
+
status: z13.literal("approved"),
|
|
2977
|
+
approvedAt: z13.string(),
|
|
2978
|
+
notes: z13.string().nullable()
|
|
2709
2979
|
})
|
|
2710
2980
|
});
|
|
2711
|
-
adminSkipPayoutResponseDataSchema =
|
|
2712
|
-
payout:
|
|
2713
|
-
id:
|
|
2714
|
-
referrerId:
|
|
2715
|
-
status:
|
|
2716
|
-
periodStart:
|
|
2717
|
-
periodEnd:
|
|
2718
|
-
notes:
|
|
2981
|
+
adminSkipPayoutResponseDataSchema = z13.object({
|
|
2982
|
+
payout: z13.object({
|
|
2983
|
+
id: z13.string(),
|
|
2984
|
+
referrerId: z13.string(),
|
|
2985
|
+
status: z13.literal("skipped"),
|
|
2986
|
+
periodStart: z13.string(),
|
|
2987
|
+
periodEnd: z13.string(),
|
|
2988
|
+
notes: z13.string().nullable()
|
|
2719
2989
|
})
|
|
2720
2990
|
});
|
|
2721
|
-
adminForfeitPayoutResponseDataSchema =
|
|
2722
|
-
payout:
|
|
2723
|
-
id:
|
|
2724
|
-
referrerId:
|
|
2725
|
-
amount:
|
|
2726
|
-
status:
|
|
2727
|
-
notes:
|
|
2991
|
+
adminForfeitPayoutResponseDataSchema = z13.object({
|
|
2992
|
+
payout: z13.object({
|
|
2993
|
+
id: z13.string(),
|
|
2994
|
+
referrerId: z13.string(),
|
|
2995
|
+
amount: z13.number(),
|
|
2996
|
+
status: z13.literal("forfeited"),
|
|
2997
|
+
notes: z13.string()
|
|
2728
2998
|
})
|
|
2729
2999
|
});
|
|
2730
|
-
adminRecordTxResponseDataSchema =
|
|
2731
|
-
payout:
|
|
2732
|
-
id:
|
|
2733
|
-
referrerId:
|
|
2734
|
-
amount:
|
|
2735
|
-
status:
|
|
2736
|
-
txSignature:
|
|
2737
|
-
completedAt:
|
|
3000
|
+
adminRecordTxResponseDataSchema = z13.object({
|
|
3001
|
+
payout: z13.object({
|
|
3002
|
+
id: z13.string(),
|
|
3003
|
+
referrerId: z13.string(),
|
|
3004
|
+
amount: z13.number(),
|
|
3005
|
+
status: z13.literal("completed"),
|
|
3006
|
+
txSignature: z13.string(),
|
|
3007
|
+
completedAt: z13.string().nullable()
|
|
2738
3008
|
})
|
|
2739
3009
|
});
|
|
2740
|
-
adminReferrerIdParamsSchema =
|
|
2741
|
-
referrerId:
|
|
2742
|
-
});
|
|
2743
|
-
adminReferralOverviewResponseDataSchema =
|
|
2744
|
-
totalReferrers:
|
|
2745
|
-
totalReferees:
|
|
2746
|
-
totalVolumeUsd:
|
|
2747
|
-
totalEarned:
|
|
2748
|
-
totalPaidOut:
|
|
2749
|
-
totalPending:
|
|
2750
|
-
topReferrers:
|
|
2751
|
-
referrerId:
|
|
2752
|
-
name:
|
|
2753
|
-
handle:
|
|
2754
|
-
payoutWallet:
|
|
2755
|
-
referralCount:
|
|
2756
|
-
totalVolumeUsd:
|
|
2757
|
-
totalEarned:
|
|
2758
|
-
totalPaidOut:
|
|
2759
|
-
pendingAmount:
|
|
2760
|
-
solanaEarned:
|
|
2761
|
-
hyperliquidEarned:
|
|
2762
|
-
dbcPoolEarned:
|
|
3010
|
+
adminReferrerIdParamsSchema = z13.object({
|
|
3011
|
+
referrerId: z13.string().uuid()
|
|
3012
|
+
});
|
|
3013
|
+
adminReferralOverviewResponseDataSchema = z13.object({
|
|
3014
|
+
totalReferrers: z13.number(),
|
|
3015
|
+
totalReferees: z13.number(),
|
|
3016
|
+
totalVolumeUsd: z13.number(),
|
|
3017
|
+
totalEarned: z13.number(),
|
|
3018
|
+
totalPaidOut: z13.number(),
|
|
3019
|
+
totalPending: z13.number(),
|
|
3020
|
+
topReferrers: z13.array(z13.object({
|
|
3021
|
+
referrerId: z13.string(),
|
|
3022
|
+
name: z13.string(),
|
|
3023
|
+
handle: z13.string().nullable(),
|
|
3024
|
+
payoutWallet: z13.string().nullable(),
|
|
3025
|
+
referralCount: z13.number(),
|
|
3026
|
+
totalVolumeUsd: z13.number(),
|
|
3027
|
+
totalEarned: z13.number(),
|
|
3028
|
+
totalPaidOut: z13.number(),
|
|
3029
|
+
pendingAmount: z13.number(),
|
|
3030
|
+
solanaEarned: z13.number(),
|
|
3031
|
+
hyperliquidEarned: z13.number(),
|
|
3032
|
+
dbcPoolEarned: z13.number()
|
|
2763
3033
|
}))
|
|
2764
3034
|
});
|
|
2765
|
-
adminReferralTradesQuerySchema =
|
|
2766
|
-
limit:
|
|
2767
|
-
offset:
|
|
2768
|
-
});
|
|
2769
|
-
adminReferralTradesResponseDataSchema =
|
|
2770
|
-
trades:
|
|
2771
|
-
id:
|
|
2772
|
-
chain:
|
|
2773
|
-
agentId:
|
|
2774
|
-
refereeName:
|
|
2775
|
-
refereeHandle:
|
|
2776
|
-
tokenAddress:
|
|
2777
|
-
valueUsd:
|
|
2778
|
-
feeAmount:
|
|
2779
|
-
referrerFeeBps:
|
|
2780
|
-
treasuryFeeBps:
|
|
2781
|
-
referrerEarnedUsd:
|
|
2782
|
-
txSignature:
|
|
2783
|
-
timestamp:
|
|
3035
|
+
adminReferralTradesQuerySchema = z13.object({
|
|
3036
|
+
limit: z13.coerce.number().int().min(1).default(50).transform((v) => Math.min(v, 100)),
|
|
3037
|
+
offset: z13.coerce.number().int().min(0).default(0)
|
|
3038
|
+
});
|
|
3039
|
+
adminReferralTradesResponseDataSchema = z13.object({
|
|
3040
|
+
trades: z13.array(z13.object({
|
|
3041
|
+
id: z13.string(),
|
|
3042
|
+
chain: z13.string(),
|
|
3043
|
+
agentId: z13.string(),
|
|
3044
|
+
refereeName: z13.string(),
|
|
3045
|
+
refereeHandle: z13.string().nullable(),
|
|
3046
|
+
tokenAddress: z13.string(),
|
|
3047
|
+
valueUsd: z13.number(),
|
|
3048
|
+
feeAmount: z13.number(),
|
|
3049
|
+
referrerFeeBps: z13.number().nullable(),
|
|
3050
|
+
treasuryFeeBps: z13.number().nullable(),
|
|
3051
|
+
referrerEarnedUsd: z13.number(),
|
|
3052
|
+
txSignature: z13.string().nullable(),
|
|
3053
|
+
timestamp: z13.string().nullable()
|
|
2784
3054
|
})),
|
|
2785
|
-
pagination:
|
|
2786
|
-
limit:
|
|
2787
|
-
offset:
|
|
2788
|
-
total:
|
|
2789
|
-
hasMore:
|
|
3055
|
+
pagination: z13.object({
|
|
3056
|
+
limit: z13.number(),
|
|
3057
|
+
offset: z13.number(),
|
|
3058
|
+
total: z13.number(),
|
|
3059
|
+
hasMore: z13.boolean()
|
|
2790
3060
|
})
|
|
2791
3061
|
});
|
|
2792
|
-
adminReferralGamingSignalSchema =
|
|
2793
|
-
type:
|
|
2794
|
-
severity:
|
|
2795
|
-
description:
|
|
2796
|
-
evidence:
|
|
2797
|
-
});
|
|
2798
|
-
adminReferralSignalsResponseDataSchema =
|
|
2799
|
-
referrerId:
|
|
2800
|
-
overallRisk:
|
|
2801
|
-
signals:
|
|
2802
|
-
});
|
|
2803
|
-
adminAgentIdParamsSchema =
|
|
2804
|
-
agentId:
|
|
2805
|
-
});
|
|
2806
|
-
adminCreateAgentRequestSchema =
|
|
2807
|
-
name:
|
|
2808
|
-
handle:
|
|
2809
|
-
bio:
|
|
2810
|
-
avatarUrl:
|
|
2811
|
-
generation:
|
|
2812
|
-
serverPlan:
|
|
2813
|
-
llmModel:
|
|
2814
|
-
llmBudgetUsd:
|
|
2815
|
-
inboxPriceUsd:
|
|
2816
|
-
});
|
|
2817
|
-
adminUpdateAgentRequestSchema =
|
|
2818
|
-
name:
|
|
2819
|
-
handle:
|
|
2820
|
-
bio:
|
|
2821
|
-
avatarUrl:
|
|
2822
|
-
llmModel:
|
|
2823
|
-
llmBudgetUsd:
|
|
2824
|
-
serverPlan:
|
|
2825
|
-
generation:
|
|
2826
|
-
inboxPriceUsd:
|
|
2827
|
-
isAlive:
|
|
3062
|
+
adminReferralGamingSignalSchema = z13.object({
|
|
3063
|
+
type: z13.string(),
|
|
3064
|
+
severity: z13.enum(["low", "medium", "high"]),
|
|
3065
|
+
description: z13.string(),
|
|
3066
|
+
evidence: z13.record(z13.string(), z13.unknown())
|
|
3067
|
+
});
|
|
3068
|
+
adminReferralSignalsResponseDataSchema = z13.object({
|
|
3069
|
+
referrerId: z13.string(),
|
|
3070
|
+
overallRisk: z13.enum(["low", "medium", "high"]),
|
|
3071
|
+
signals: z13.array(adminReferralGamingSignalSchema)
|
|
3072
|
+
});
|
|
3073
|
+
adminAgentIdParamsSchema = z13.object({
|
|
3074
|
+
agentId: z13.string().uuid()
|
|
3075
|
+
});
|
|
3076
|
+
adminCreateAgentRequestSchema = z13.object({
|
|
3077
|
+
name: z13.string().min(1).max(100),
|
|
3078
|
+
handle: z13.string().max(50).optional(),
|
|
3079
|
+
bio: z13.string().max(500).optional(),
|
|
3080
|
+
avatarUrl: z13.string().url().optional(),
|
|
3081
|
+
generation: z13.number().int().optional(),
|
|
3082
|
+
serverPlan: z13.enum(["basic", "standard", "pro"]).optional(),
|
|
3083
|
+
llmModel: z13.string().optional(),
|
|
3084
|
+
llmBudgetUsd: z13.number().optional(),
|
|
3085
|
+
inboxPriceUsd: z13.number().optional()
|
|
3086
|
+
});
|
|
3087
|
+
adminUpdateAgentRequestSchema = z13.object({
|
|
3088
|
+
name: z13.string().min(1).max(100).optional(),
|
|
3089
|
+
handle: z13.string().max(50).optional(),
|
|
3090
|
+
bio: z13.string().max(500).optional(),
|
|
3091
|
+
avatarUrl: z13.string().url().nullable().optional(),
|
|
3092
|
+
llmModel: z13.string().optional(),
|
|
3093
|
+
llmBudgetUsd: z13.number().optional(),
|
|
3094
|
+
serverPlan: z13.enum(["basic", "standard", "pro"]).optional(),
|
|
3095
|
+
generation: z13.number().int().optional(),
|
|
3096
|
+
inboxPriceUsd: z13.number().optional(),
|
|
3097
|
+
isAlive: z13.boolean().optional()
|
|
2828
3098
|
}).refine((obj) => Object.keys(obj).length > 0, { message: "At least one field required" });
|
|
2829
|
-
adminUserIdParamsSchema =
|
|
2830
|
-
userId:
|
|
2831
|
-
});
|
|
2832
|
-
adminUsersQuerySchema =
|
|
2833
|
-
limit:
|
|
2834
|
-
offset:
|
|
2835
|
-
search:
|
|
2836
|
-
});
|
|
2837
|
-
adminUpdateUserRequestSchema =
|
|
2838
|
-
role:
|
|
2839
|
-
banned:
|
|
2840
|
-
banReason:
|
|
2841
|
-
banExpiresIn:
|
|
2842
|
-
shadowbanned:
|
|
3099
|
+
adminUserIdParamsSchema = z13.object({
|
|
3100
|
+
userId: z13.string().uuid()
|
|
3101
|
+
});
|
|
3102
|
+
adminUsersQuerySchema = z13.object({
|
|
3103
|
+
limit: z13.coerce.number().int().min(1).default(25).transform((v) => Math.min(v, 100)),
|
|
3104
|
+
offset: z13.coerce.number().int().min(0).default(0),
|
|
3105
|
+
search: z13.string().optional()
|
|
3106
|
+
});
|
|
3107
|
+
adminUpdateUserRequestSchema = z13.object({
|
|
3108
|
+
role: z13.enum(["admin", "user"]).optional(),
|
|
3109
|
+
banned: z13.boolean().optional(),
|
|
3110
|
+
banReason: z13.string().optional(),
|
|
3111
|
+
banExpiresIn: z13.number().positive().optional(),
|
|
3112
|
+
shadowbanned: z13.boolean().optional()
|
|
2843
3113
|
}).refine((obj) => Object.keys(obj).length > 0, { message: "At least one field required" });
|
|
2844
|
-
adminCreateAgentResponseDataSchema =
|
|
2845
|
-
agent:
|
|
2846
|
-
id:
|
|
2847
|
-
name:
|
|
2848
|
-
handle:
|
|
2849
|
-
email:
|
|
3114
|
+
adminCreateAgentResponseDataSchema = z13.object({
|
|
3115
|
+
agent: z13.object({
|
|
3116
|
+
id: z13.string().uuid(),
|
|
3117
|
+
name: z13.string(),
|
|
3118
|
+
handle: z13.string().nullable(),
|
|
3119
|
+
email: z13.string()
|
|
2850
3120
|
})
|
|
2851
3121
|
});
|
|
2852
|
-
adminUpdateAgentResponseDataSchema =
|
|
2853
|
-
ok:
|
|
3122
|
+
adminUpdateAgentResponseDataSchema = z13.object({
|
|
3123
|
+
ok: z13.boolean()
|
|
2854
3124
|
});
|
|
2855
|
-
adminUsersResponseDataSchema =
|
|
2856
|
-
users:
|
|
2857
|
-
id:
|
|
2858
|
-
name:
|
|
2859
|
-
email:
|
|
2860
|
-
role:
|
|
2861
|
-
banned:
|
|
2862
|
-
banReason:
|
|
2863
|
-
banExpires:
|
|
2864
|
-
shadowbanned:
|
|
2865
|
-
createdAt:
|
|
3125
|
+
adminUsersResponseDataSchema = z13.object({
|
|
3126
|
+
users: z13.array(z13.object({
|
|
3127
|
+
id: z13.string().uuid(),
|
|
3128
|
+
name: z13.string().nullable(),
|
|
3129
|
+
email: z13.string().nullable(),
|
|
3130
|
+
role: z13.string().nullable(),
|
|
3131
|
+
banned: z13.boolean().nullable(),
|
|
3132
|
+
banReason: z13.string().nullable(),
|
|
3133
|
+
banExpires: z13.string().nullable(),
|
|
3134
|
+
shadowbanned: z13.boolean().nullable(),
|
|
3135
|
+
createdAt: z13.string().nullable()
|
|
2866
3136
|
})),
|
|
2867
|
-
total:
|
|
2868
|
-
});
|
|
2869
|
-
adminUpdateUserResponseDataSchema =
|
|
2870
|
-
user:
|
|
2871
|
-
});
|
|
2872
|
-
adminIncubatorBirthRequestSchema =
|
|
2873
|
-
action:
|
|
2874
|
-
skipBalanceCheck:
|
|
2875
|
-
});
|
|
2876
|
-
adminIncubatorAdjustRequestSchema =
|
|
2877
|
-
amountUsd:
|
|
2878
|
-
source:
|
|
2879
|
-
note:
|
|
2880
|
-
});
|
|
2881
|
-
adminIncubatorWalletRequestSchema =
|
|
2882
|
-
walletId:
|
|
2883
|
-
walletAddress:
|
|
2884
|
-
});
|
|
2885
|
-
adminIncubatorTransactionsQuerySchema =
|
|
2886
|
-
limit:
|
|
2887
|
-
offset:
|
|
2888
|
-
source:
|
|
2889
|
-
});
|
|
2890
|
-
adminIncubatorPoolResponseDataSchema =
|
|
2891
|
-
balance_usd:
|
|
2892
|
-
threshold_usd:
|
|
2893
|
-
progress_pct:
|
|
2894
|
-
total_born:
|
|
2895
|
-
alive_count:
|
|
2896
|
-
dead_count:
|
|
2897
|
-
generation:
|
|
2898
|
-
birth_status:
|
|
2899
|
-
birth_paused:
|
|
2900
|
-
pool_wallet_id:
|
|
2901
|
-
pool_wallet_address:
|
|
2902
|
-
incubator_fee_percent:
|
|
2903
|
-
birth_threshold_usd:
|
|
2904
|
-
onChainBalanceSol:
|
|
2905
|
-
onChainBalanceUsd:
|
|
2906
|
-
});
|
|
2907
|
-
adminIncubatorTransactionSchema =
|
|
2908
|
-
id:
|
|
2909
|
-
amountUsd:
|
|
2910
|
-
source:
|
|
2911
|
-
sourceTradeId:
|
|
2912
|
-
adminNote:
|
|
2913
|
-
createdAt:
|
|
2914
|
-
});
|
|
2915
|
-
adminIncubatorTransactionsResponseDataSchema =
|
|
2916
|
-
transactions:
|
|
2917
|
-
total:
|
|
2918
|
-
});
|
|
2919
|
-
adminIncubatorBirthResponseDataSchema =
|
|
2920
|
-
ok:
|
|
2921
|
-
action:
|
|
2922
|
-
agent:
|
|
2923
|
-
id:
|
|
2924
|
-
number:
|
|
2925
|
-
solanaAddress:
|
|
3137
|
+
total: z13.number()
|
|
3138
|
+
});
|
|
3139
|
+
adminUpdateUserResponseDataSchema = z13.object({
|
|
3140
|
+
user: z13.record(z13.string(), z13.unknown())
|
|
3141
|
+
});
|
|
3142
|
+
adminIncubatorBirthRequestSchema = z13.object({
|
|
3143
|
+
action: z13.enum(["trigger", "pause", "resume"]),
|
|
3144
|
+
skipBalanceCheck: z13.boolean().optional().default(false)
|
|
3145
|
+
});
|
|
3146
|
+
adminIncubatorAdjustRequestSchema = z13.object({
|
|
3147
|
+
amountUsd: z13.number(),
|
|
3148
|
+
source: z13.enum(["manual_credit", "manual_debit", "birth_refund"]),
|
|
3149
|
+
note: z13.string().min(1)
|
|
3150
|
+
});
|
|
3151
|
+
adminIncubatorWalletRequestSchema = z13.object({
|
|
3152
|
+
walletId: z13.string().min(1),
|
|
3153
|
+
walletAddress: z13.string().min(1)
|
|
3154
|
+
});
|
|
3155
|
+
adminIncubatorTransactionsQuerySchema = z13.object({
|
|
3156
|
+
limit: z13.coerce.number().int().min(1).default(50).transform((v) => Math.min(v, 100)),
|
|
3157
|
+
offset: z13.coerce.number().int().min(0).default(0),
|
|
3158
|
+
source: z13.string().optional()
|
|
3159
|
+
});
|
|
3160
|
+
adminIncubatorPoolResponseDataSchema = z13.object({
|
|
3161
|
+
balance_usd: z13.number(),
|
|
3162
|
+
threshold_usd: z13.number(),
|
|
3163
|
+
progress_pct: z13.number(),
|
|
3164
|
+
total_born: z13.number(),
|
|
3165
|
+
alive_count: z13.number(),
|
|
3166
|
+
dead_count: z13.number(),
|
|
3167
|
+
generation: z13.number(),
|
|
3168
|
+
birth_status: z13.string(),
|
|
3169
|
+
birth_paused: z13.boolean(),
|
|
3170
|
+
pool_wallet_id: z13.string().nullable(),
|
|
3171
|
+
pool_wallet_address: z13.string().nullable(),
|
|
3172
|
+
incubator_fee_percent: z13.number(),
|
|
3173
|
+
birth_threshold_usd: z13.number(),
|
|
3174
|
+
onChainBalanceSol: z13.number(),
|
|
3175
|
+
onChainBalanceUsd: z13.number()
|
|
3176
|
+
});
|
|
3177
|
+
adminIncubatorTransactionSchema = z13.object({
|
|
3178
|
+
id: z13.string().uuid(),
|
|
3179
|
+
amountUsd: z13.number(),
|
|
3180
|
+
source: z13.string(),
|
|
3181
|
+
sourceTradeId: z13.string().nullable(),
|
|
3182
|
+
adminNote: z13.string().nullable(),
|
|
3183
|
+
createdAt: z13.string()
|
|
3184
|
+
});
|
|
3185
|
+
adminIncubatorTransactionsResponseDataSchema = z13.object({
|
|
3186
|
+
transactions: z13.array(adminIncubatorTransactionSchema),
|
|
3187
|
+
total: z13.number()
|
|
3188
|
+
});
|
|
3189
|
+
adminIncubatorBirthResponseDataSchema = z13.object({
|
|
3190
|
+
ok: z13.literal(true),
|
|
3191
|
+
action: z13.enum(["triggered", "paused", "resumed"]),
|
|
3192
|
+
agent: z13.object({
|
|
3193
|
+
id: z13.string(),
|
|
3194
|
+
number: z13.number(),
|
|
3195
|
+
solanaAddress: z13.string()
|
|
2926
3196
|
}).optional(),
|
|
2927
|
-
transferHash:
|
|
3197
|
+
transferHash: z13.string().nullable().optional()
|
|
2928
3198
|
});
|
|
2929
|
-
adminIncubatorAdjustResponseDataSchema =
|
|
2930
|
-
ok:
|
|
2931
|
-
balanceUsd:
|
|
2932
|
-
birthStatus:
|
|
3199
|
+
adminIncubatorAdjustResponseDataSchema = z13.object({
|
|
3200
|
+
ok: z13.literal(true),
|
|
3201
|
+
balanceUsd: z13.number(),
|
|
3202
|
+
birthStatus: z13.string()
|
|
2933
3203
|
});
|
|
2934
|
-
adminIncubatorWalletResponseDataSchema =
|
|
2935
|
-
ok:
|
|
2936
|
-
walletId:
|
|
2937
|
-
walletAddress:
|
|
3204
|
+
adminIncubatorWalletResponseDataSchema = z13.object({
|
|
3205
|
+
ok: z13.literal(true),
|
|
3206
|
+
walletId: z13.string(),
|
|
3207
|
+
walletAddress: z13.string()
|
|
2938
3208
|
});
|
|
2939
3209
|
adminDisputesResponseSchema = successEnvelope(adminDisputesResponseDataSchema);
|
|
2940
3210
|
adminResolveDisputeResponseSchema = successEnvelope(adminResolveDisputeResponseDataSchema);
|
|
@@ -2947,46 +3217,46 @@ var init_admin = __esm(() => {
|
|
|
2947
3217
|
});
|
|
2948
3218
|
|
|
2949
3219
|
// ../../packages/client/src/schemas/auth.ts
|
|
2950
|
-
import { z as
|
|
3220
|
+
import { z as z14 } from "zod";
|
|
2951
3221
|
var authApiKeysCreateRequestSchema, authApiKeysDeleteRequestSchema, authSetupRequestSchema, authApiKeysListResponseDataSchema, authApiKeysCreateResponseDataSchema, authApiKeysDeleteResponseDataSchema, authSetupResponseDataSchema, authApiKeysListResponseSchema, authApiKeysCreateResponseSchema, authApiKeysDeleteResponseSchema, authSetupResponseSchema;
|
|
2952
3222
|
var init_auth = __esm(() => {
|
|
2953
3223
|
init_common();
|
|
2954
|
-
authApiKeysCreateRequestSchema =
|
|
2955
|
-
name:
|
|
2956
|
-
});
|
|
2957
|
-
authApiKeysDeleteRequestSchema =
|
|
2958
|
-
keyId:
|
|
2959
|
-
});
|
|
2960
|
-
authSetupRequestSchema =
|
|
2961
|
-
name:
|
|
2962
|
-
handle:
|
|
2963
|
-
referralCode:
|
|
2964
|
-
});
|
|
2965
|
-
authApiKeysListResponseDataSchema =
|
|
2966
|
-
keys:
|
|
2967
|
-
id:
|
|
2968
|
-
name:
|
|
2969
|
-
start:
|
|
2970
|
-
createdAt:
|
|
3224
|
+
authApiKeysCreateRequestSchema = z14.object({
|
|
3225
|
+
name: z14.string().trim().min(1).max(120).optional()
|
|
3226
|
+
});
|
|
3227
|
+
authApiKeysDeleteRequestSchema = z14.object({
|
|
3228
|
+
keyId: z14.string().min(1)
|
|
3229
|
+
});
|
|
3230
|
+
authSetupRequestSchema = z14.object({
|
|
3231
|
+
name: z14.string().trim().min(1).max(120).optional(),
|
|
3232
|
+
handle: z14.string().trim().min(1).max(120).optional(),
|
|
3233
|
+
referralCode: z14.string().trim().min(1).max(120).optional()
|
|
3234
|
+
});
|
|
3235
|
+
authApiKeysListResponseDataSchema = z14.object({
|
|
3236
|
+
keys: z14.array(z14.object({
|
|
3237
|
+
id: z14.string(),
|
|
3238
|
+
name: z14.string().nullable(),
|
|
3239
|
+
start: z14.string(),
|
|
3240
|
+
createdAt: z14.string()
|
|
2971
3241
|
}))
|
|
2972
3242
|
});
|
|
2973
|
-
authApiKeysCreateResponseDataSchema =
|
|
2974
|
-
key:
|
|
2975
|
-
id:
|
|
2976
|
-
start:
|
|
3243
|
+
authApiKeysCreateResponseDataSchema = z14.object({
|
|
3244
|
+
key: z14.string(),
|
|
3245
|
+
id: z14.string(),
|
|
3246
|
+
start: z14.string()
|
|
2977
3247
|
});
|
|
2978
|
-
authApiKeysDeleteResponseDataSchema =
|
|
2979
|
-
revoked:
|
|
3248
|
+
authApiKeysDeleteResponseDataSchema = z14.object({
|
|
3249
|
+
revoked: z14.boolean()
|
|
2980
3250
|
});
|
|
2981
|
-
authSetupResponseDataSchema =
|
|
2982
|
-
userId:
|
|
2983
|
-
solanaAddress:
|
|
2984
|
-
hlAddress:
|
|
2985
|
-
handle:
|
|
2986
|
-
apiKeyHint:
|
|
2987
|
-
apiKey:
|
|
2988
|
-
cliCommand:
|
|
2989
|
-
isNew:
|
|
3251
|
+
authSetupResponseDataSchema = z14.object({
|
|
3252
|
+
userId: z14.string().uuid(),
|
|
3253
|
+
solanaAddress: z14.string().nullable(),
|
|
3254
|
+
hlAddress: z14.string().nullable().optional(),
|
|
3255
|
+
handle: z14.string().nullable(),
|
|
3256
|
+
apiKeyHint: z14.string().nullable(),
|
|
3257
|
+
apiKey: z14.string().optional(),
|
|
3258
|
+
cliCommand: z14.string().optional(),
|
|
3259
|
+
isNew: z14.boolean()
|
|
2990
3260
|
});
|
|
2991
3261
|
authApiKeysListResponseSchema = successEnvelope(authApiKeysListResponseDataSchema);
|
|
2992
3262
|
authApiKeysCreateResponseSchema = successEnvelope(authApiKeysCreateResponseDataSchema);
|
|
@@ -2995,172 +3265,57 @@ var init_auth = __esm(() => {
|
|
|
2995
3265
|
});
|
|
2996
3266
|
|
|
2997
3267
|
// ../../packages/client/src/schemas/claim.ts
|
|
2998
|
-
import { z as
|
|
3268
|
+
import { z as z15 } from "zod";
|
|
2999
3269
|
var claimTokenParamsSchema, claimInfoResponseDataSchema, claimInfoResponseSchema;
|
|
3000
3270
|
var init_claim = __esm(() => {
|
|
3001
3271
|
init_common();
|
|
3002
|
-
claimTokenParamsSchema =
|
|
3003
|
-
token:
|
|
3004
|
-
});
|
|
3005
|
-
claimInfoResponseDataSchema =
|
|
3006
|
-
claimed:
|
|
3007
|
-
agent:
|
|
3008
|
-
name:
|
|
3009
|
-
handle:
|
|
3010
|
-
bio:
|
|
3011
|
-
avatar:
|
|
3272
|
+
claimTokenParamsSchema = z15.object({
|
|
3273
|
+
token: z15.string().trim().min(1, "Claim token is required")
|
|
3274
|
+
});
|
|
3275
|
+
claimInfoResponseDataSchema = z15.object({
|
|
3276
|
+
claimed: z15.boolean(),
|
|
3277
|
+
agent: z15.object({
|
|
3278
|
+
name: z15.string(),
|
|
3279
|
+
handle: z15.string().nullable().optional(),
|
|
3280
|
+
bio: z15.string().nullable(),
|
|
3281
|
+
avatar: z15.string().nullable()
|
|
3012
3282
|
}),
|
|
3013
|
-
verificationCode:
|
|
3014
|
-
tweetText:
|
|
3015
|
-
instructions:
|
|
3283
|
+
verificationCode: z15.string().optional(),
|
|
3284
|
+
tweetText: z15.string().optional(),
|
|
3285
|
+
instructions: z15.string().optional()
|
|
3016
3286
|
});
|
|
3017
3287
|
claimInfoResponseSchema = successEnvelope(claimInfoResponseDataSchema);
|
|
3018
3288
|
});
|
|
3019
3289
|
|
|
3020
3290
|
// ../../packages/client/src/schemas/dashboard.ts
|
|
3021
|
-
import { z as
|
|
3291
|
+
import { z as z16 } from "zod";
|
|
3022
3292
|
var dashboardStatusResponseDataSchema, dashboardStatusResponseSchema;
|
|
3023
3293
|
var init_dashboard = __esm(() => {
|
|
3024
3294
|
init_common();
|
|
3025
|
-
dashboardStatusResponseDataSchema =
|
|
3026
|
-
solanaAddress:
|
|
3027
|
-
hlAddress:
|
|
3028
|
-
solanaBalance:
|
|
3029
|
-
claimToken:
|
|
3030
|
-
steps:
|
|
3031
|
-
funded:
|
|
3032
|
-
agentConnected:
|
|
3033
|
-
xConnected:
|
|
3295
|
+
dashboardStatusResponseDataSchema = z16.object({
|
|
3296
|
+
solanaAddress: z16.string().nullable(),
|
|
3297
|
+
hlAddress: z16.string().nullable(),
|
|
3298
|
+
solanaBalance: z16.number(),
|
|
3299
|
+
claimToken: z16.string(),
|
|
3300
|
+
steps: z16.object({
|
|
3301
|
+
funded: z16.boolean(),
|
|
3302
|
+
agentConnected: z16.boolean(),
|
|
3303
|
+
xConnected: z16.boolean().nullable()
|
|
3034
3304
|
}),
|
|
3035
|
-
apiKeyHint:
|
|
3036
|
-
xHandle:
|
|
3037
|
-
handle:
|
|
3038
|
-
stats:
|
|
3039
|
-
totalValueUsd:
|
|
3040
|
-
pnlAllTime:
|
|
3041
|
-
pnl24h:
|
|
3042
|
-
pnl7d:
|
|
3043
|
-
lastTradeAt:
|
|
3305
|
+
apiKeyHint: z16.string().nullable(),
|
|
3306
|
+
xHandle: z16.string().nullable(),
|
|
3307
|
+
handle: z16.string().nullable(),
|
|
3308
|
+
stats: z16.object({
|
|
3309
|
+
totalValueUsd: z16.number(),
|
|
3310
|
+
pnlAllTime: z16.number(),
|
|
3311
|
+
pnl24h: z16.number(),
|
|
3312
|
+
pnl7d: z16.number(),
|
|
3313
|
+
lastTradeAt: z16.string().nullable()
|
|
3044
3314
|
}).nullable()
|
|
3045
3315
|
});
|
|
3046
3316
|
dashboardStatusResponseSchema = successEnvelope(dashboardStatusResponseDataSchema);
|
|
3047
3317
|
});
|
|
3048
3318
|
|
|
3049
|
-
// ../../packages/client/src/schemas/marketplace.ts
|
|
3050
|
-
import { z as z16 } from "zod";
|
|
3051
|
-
var MARKETPLACE_TASK_CATEGORIES, marketplaceTaskParamsSchema, marketplaceTasksQuerySchema, marketplaceApplyTaskRequestSchema, marketplaceSubmitTaskRequestSchema, marketplaceTaskListItemSchema, marketplaceTasksResponseDataSchema, marketplaceTaskDetailSchema, marketplaceTaskDetailResponseDataSchema, marketplaceApplyTaskResponseDataSchema, marketplaceSubmitTaskResponseDataSchema, marketplaceTasksResponseSchema, marketplaceTaskDetailResponseSchema, marketplaceApplyTaskResponseSchema, marketplaceSubmitTaskResponseSchema;
|
|
3052
|
-
var init_marketplace = __esm(() => {
|
|
3053
|
-
init_common();
|
|
3054
|
-
MARKETPLACE_TASK_CATEGORIES = [
|
|
3055
|
-
"account_creation",
|
|
3056
|
-
"verification",
|
|
3057
|
-
"research",
|
|
3058
|
-
"content",
|
|
3059
|
-
"outreach",
|
|
3060
|
-
"other"
|
|
3061
|
-
];
|
|
3062
|
-
marketplaceTaskParamsSchema = z16.object({
|
|
3063
|
-
taskId: z16.string().trim().min(1)
|
|
3064
|
-
});
|
|
3065
|
-
marketplaceTasksQuerySchema = z16.object({
|
|
3066
|
-
status: z16.string().trim().min(1).default("open"),
|
|
3067
|
-
category: z16.enum(MARKETPLACE_TASK_CATEGORIES).optional(),
|
|
3068
|
-
limit: z16.coerce.number().int().min(1).default(50).transform((value) => Math.min(value, 100)),
|
|
3069
|
-
offset: z16.coerce.number().int().min(0).default(0)
|
|
3070
|
-
});
|
|
3071
|
-
marketplaceApplyTaskRequestSchema = z16.object({
|
|
3072
|
-
walletAddress: z16.string().trim().min(1),
|
|
3073
|
-
message: z16.string().trim().max(5000).optional(),
|
|
3074
|
-
paymentMethod: z16.union([z16.string().trim().max(120), z16.record(z16.string(), z16.unknown())]).optional()
|
|
3075
|
-
});
|
|
3076
|
-
marketplaceSubmitTaskRequestSchema = z16.object({
|
|
3077
|
-
applicantId: z16.string().trim().min(1),
|
|
3078
|
-
proofText: z16.string().trim().max(1e4).optional(),
|
|
3079
|
-
proofImages: z16.array(z16.url()).optional()
|
|
3080
|
-
});
|
|
3081
|
-
marketplaceTaskListItemSchema = z16.object({
|
|
3082
|
-
id: z16.string().min(1),
|
|
3083
|
-
agentId: z16.string().min(1),
|
|
3084
|
-
title: z16.string(),
|
|
3085
|
-
description: z16.string(),
|
|
3086
|
-
category: z16.string(),
|
|
3087
|
-
budgetUsd: z16.number(),
|
|
3088
|
-
deadline: z16.string().nullable(),
|
|
3089
|
-
requiredProof: z16.string().nullable(),
|
|
3090
|
-
status: z16.string(),
|
|
3091
|
-
createdAt: z16.string(),
|
|
3092
|
-
agentName: z16.string().nullable(),
|
|
3093
|
-
agentHandle: z16.string().nullable()
|
|
3094
|
-
});
|
|
3095
|
-
marketplaceTasksResponseDataSchema = z16.object({
|
|
3096
|
-
tasks: z16.array(marketplaceTaskListItemSchema),
|
|
3097
|
-
count: z16.number().int().nonnegative(),
|
|
3098
|
-
pagination: z16.object({
|
|
3099
|
-
limit: z16.number().int().positive(),
|
|
3100
|
-
offset: z16.number().int().nonnegative(),
|
|
3101
|
-
hasMore: z16.boolean()
|
|
3102
|
-
})
|
|
3103
|
-
});
|
|
3104
|
-
marketplaceTaskDetailSchema = z16.object({
|
|
3105
|
-
id: z16.string().min(1),
|
|
3106
|
-
agentId: z16.string().min(1),
|
|
3107
|
-
title: z16.string(),
|
|
3108
|
-
description: z16.string(),
|
|
3109
|
-
category: z16.string(),
|
|
3110
|
-
budgetUsd: z16.number(),
|
|
3111
|
-
deadline: z16.string().nullable(),
|
|
3112
|
-
requiredProof: z16.string().nullable(),
|
|
3113
|
-
status: z16.string(),
|
|
3114
|
-
assignedTo: z16.string().nullable(),
|
|
3115
|
-
payoutTx: z16.string().nullable(),
|
|
3116
|
-
createdAt: z16.string(),
|
|
3117
|
-
agent: z16.object({
|
|
3118
|
-
name: z16.string().nullable(),
|
|
3119
|
-
handle: z16.string().nullable(),
|
|
3120
|
-
avatarUrl: z16.string().nullable()
|
|
3121
|
-
}),
|
|
3122
|
-
applicantCount: z16.number().int().nonnegative(),
|
|
3123
|
-
hasSubmission: z16.boolean(),
|
|
3124
|
-
submission: z16.object({
|
|
3125
|
-
id: z16.string().min(1),
|
|
3126
|
-
submittedAt: z16.string()
|
|
3127
|
-
}).nullable(),
|
|
3128
|
-
dispute: z16.object({
|
|
3129
|
-
id: z16.string().min(1),
|
|
3130
|
-
initiatedBy: z16.string(),
|
|
3131
|
-
reason: z16.string(),
|
|
3132
|
-
resolution: z16.string().nullable(),
|
|
3133
|
-
createdAt: z16.string()
|
|
3134
|
-
}).nullable()
|
|
3135
|
-
});
|
|
3136
|
-
marketplaceTaskDetailResponseDataSchema = z16.object({
|
|
3137
|
-
task: marketplaceTaskDetailSchema
|
|
3138
|
-
});
|
|
3139
|
-
marketplaceApplyTaskResponseDataSchema = z16.object({
|
|
3140
|
-
applicant: z16.object({
|
|
3141
|
-
id: z16.string().min(1),
|
|
3142
|
-
taskId: z16.string().min(1),
|
|
3143
|
-
walletAddress: z16.string(),
|
|
3144
|
-
message: z16.string().nullable(),
|
|
3145
|
-
createdAt: z16.string()
|
|
3146
|
-
})
|
|
3147
|
-
});
|
|
3148
|
-
marketplaceSubmitTaskResponseDataSchema = z16.object({
|
|
3149
|
-
submission: z16.object({
|
|
3150
|
-
id: z16.string().min(1),
|
|
3151
|
-
taskId: z16.string().min(1),
|
|
3152
|
-
applicantId: z16.string().min(1),
|
|
3153
|
-
proofText: z16.string().nullable(),
|
|
3154
|
-
proofImages: z16.array(z16.string().url()).nullable(),
|
|
3155
|
-
submittedAt: z16.string()
|
|
3156
|
-
})
|
|
3157
|
-
});
|
|
3158
|
-
marketplaceTasksResponseSchema = successEnvelope(marketplaceTasksResponseDataSchema);
|
|
3159
|
-
marketplaceTaskDetailResponseSchema = successEnvelope(marketplaceTaskDetailResponseDataSchema);
|
|
3160
|
-
marketplaceApplyTaskResponseSchema = successEnvelope(marketplaceApplyTaskResponseDataSchema);
|
|
3161
|
-
marketplaceSubmitTaskResponseSchema = successEnvelope(marketplaceSubmitTaskResponseDataSchema);
|
|
3162
|
-
});
|
|
3163
|
-
|
|
3164
3319
|
// ../../packages/client/src/schemas/notifications.ts
|
|
3165
3320
|
import { z as z17 } from "zod";
|
|
3166
3321
|
var queryBooleanSchema2, notificationIdParamsSchema, notificationsListQuerySchema, notificationsMarkAllReadRequestSchema, notificationsPatchRequestSchema, notificationRecordSchema, notificationsListResponseDataSchema, notificationsMarkAllReadResponseDataSchema, notificationsPatchResponseDataSchema, notificationsDeleteResponseDataSchema, notificationsListResponseSchema, notificationsMarkAllReadResponseSchema, notificationsPatchResponseSchema, notificationsDeleteResponseSchema;
|
|
@@ -3498,6 +3653,396 @@ var init_device_code = __esm(() => {
|
|
|
3498
3653
|
});
|
|
3499
3654
|
|
|
3500
3655
|
// ../../packages/client/src/index.ts
|
|
3656
|
+
var exports_src = {};
|
|
3657
|
+
__export(exports_src, {
|
|
3658
|
+
voteResponseSchema: () => voteResponseSchema,
|
|
3659
|
+
voteResponseDataSchema: () => voteResponseDataSchema,
|
|
3660
|
+
voteRequestSchema: () => voteRequestSchema,
|
|
3661
|
+
verifyTweetResponseSchema: () => verifyTweetResponseSchema,
|
|
3662
|
+
verifyTweetResponseDataSchema: () => verifyTweetResponseDataSchema,
|
|
3663
|
+
verifyTweetRequestSchema: () => verifyTweetRequestSchema,
|
|
3664
|
+
validationResult: () => validationResult,
|
|
3665
|
+
uuidParamSchema: () => uuidParamSchema,
|
|
3666
|
+
updateOwnGroupMembershipResponseDataSchema: () => updateOwnGroupMembershipResponseDataSchema,
|
|
3667
|
+
updateOwnGroupMembershipRequestSchema: () => updateOwnGroupMembershipRequestSchema,
|
|
3668
|
+
updateGroupResponseDataSchema: () => updateGroupResponseDataSchema,
|
|
3669
|
+
updateGroupRequestSchema: () => updateGroupRequestSchema,
|
|
3670
|
+
updateGroupMemberResponseDataSchema: () => updateGroupMemberResponseDataSchema,
|
|
3671
|
+
updateGroupMemberRequestSchema: () => updateGroupMemberRequestSchema,
|
|
3672
|
+
tradeResponseSchema: () => tradeResponseSchema,
|
|
3673
|
+
tradeResponseDataSchema: () => tradeResponseDataSchema,
|
|
3674
|
+
tradeRequestSchema: () => tradeRequestSchema,
|
|
3675
|
+
tokensListResponseSchema: () => tokensListResponseSchema,
|
|
3676
|
+
tokensListResponseDataSchema: () => tokensListResponseDataSchema,
|
|
3677
|
+
tokensListQuerySchema: () => tokensListQuerySchema,
|
|
3678
|
+
tokenParamsSchema: () => tokenParamsSchema,
|
|
3679
|
+
tokenListItemSchema: () => tokenListItemSchema,
|
|
3680
|
+
tokenLaunchesQuerySchema: () => tokenLaunchesQuerySchema,
|
|
3681
|
+
tokenLaunchesListResponseDataSchema: () => tokenLaunchesListResponseDataSchema,
|
|
3682
|
+
tokenLaunchResponseSchema: () => tokenLaunchResponseSchema,
|
|
3683
|
+
tokenLaunchResponseDataSchema: () => tokenLaunchResponseDataSchema,
|
|
3684
|
+
tokenLaunchRequestSchema: () => tokenLaunchRequestSchema,
|
|
3685
|
+
tokenInfoSchema: () => tokenInfoSchema,
|
|
3686
|
+
tokenInfoResponseSchema: () => tokenInfoResponseSchema,
|
|
3687
|
+
tokenInfoResponseDataSchema: () => tokenInfoResponseDataSchema,
|
|
3688
|
+
thesesListResponseSchema: () => thesesListResponseSchema,
|
|
3689
|
+
thesesListResponseDataSchema: () => thesesListResponseDataSchema,
|
|
3690
|
+
thesesListQuerySchema: () => thesesListQuerySchema,
|
|
3691
|
+
successEnvelope: () => successEnvelope,
|
|
3692
|
+
statusFromErrorCode: () => statusFromErrorCode,
|
|
3693
|
+
solanaTradeRequestSchema: () => solanaTradeRequestSchema,
|
|
3694
|
+
removeGroupMessageReactionResponseDataSchema: () => removeGroupMessageReactionResponseDataSchema,
|
|
3695
|
+
referralsPayoutsResponseSchema: () => referralsPayoutsResponseSchema,
|
|
3696
|
+
referralsPayoutsResponseDataSchema: () => referralsPayoutsResponseDataSchema,
|
|
3697
|
+
referralsPayoutWalletResponseSchema: () => referralsPayoutWalletResponseSchema,
|
|
3698
|
+
referralsPayoutWalletResponseDataSchema: () => referralsPayoutWalletResponseDataSchema,
|
|
3699
|
+
referralsPayoutWalletRequestSchema: () => referralsPayoutWalletRequestSchema,
|
|
3700
|
+
referralsOverviewResponseSchema: () => referralsOverviewResponseSchema,
|
|
3701
|
+
referralsOverviewResponseDataSchema: () => referralsOverviewResponseDataSchema,
|
|
3702
|
+
referralCodeParamsSchema: () => referralCodeParamsSchema,
|
|
3703
|
+
referralCodeLookupResponseSchema: () => referralCodeLookupResponseSchema,
|
|
3704
|
+
referralCodeLookupResponseDataSchema: () => referralCodeLookupResponseDataSchema,
|
|
3705
|
+
reactToGroupMessageResponseDataSchema: () => reactToGroupMessageResponseDataSchema,
|
|
3706
|
+
reactToGroupMessageRequestSchema: () => reactToGroupMessageRequestSchema,
|
|
3707
|
+
rateLimitedResult: () => rateLimitedResult,
|
|
3708
|
+
postsQuerySchema: () => postsQuerySchema,
|
|
3709
|
+
postTradeSchema: () => postTradeSchema,
|
|
3710
|
+
postTokenSchema: () => postTokenSchema,
|
|
3711
|
+
postIdParamSchema: () => postIdParamSchema,
|
|
3712
|
+
postAuthorSchema: () => postAuthorSchema,
|
|
3713
|
+
policyUpdateResponseDataSchema: () => policyUpdateResponseDataSchema,
|
|
3714
|
+
policyUpdateRequestSchema: () => policyUpdateRequestSchema,
|
|
3715
|
+
policyStateResponseDataSchema: () => policyStateResponseDataSchema,
|
|
3716
|
+
paginationQuerySchema: () => paginationQuerySchema,
|
|
3717
|
+
okResult: () => okResult,
|
|
3718
|
+
ok: () => ok,
|
|
3719
|
+
notificationsPatchResponseSchema: () => notificationsPatchResponseSchema,
|
|
3720
|
+
notificationsPatchResponseDataSchema: () => notificationsPatchResponseDataSchema,
|
|
3721
|
+
notificationsPatchRequestSchema: () => notificationsPatchRequestSchema,
|
|
3722
|
+
notificationsMarkAllReadResponseSchema: () => notificationsMarkAllReadResponseSchema,
|
|
3723
|
+
notificationsMarkAllReadResponseDataSchema: () => notificationsMarkAllReadResponseDataSchema,
|
|
3724
|
+
notificationsMarkAllReadRequestSchema: () => notificationsMarkAllReadRequestSchema,
|
|
3725
|
+
notificationsListResponseSchema: () => notificationsListResponseSchema,
|
|
3726
|
+
notificationsListResponseDataSchema: () => notificationsListResponseDataSchema,
|
|
3727
|
+
notificationsListQuerySchema: () => notificationsListQuerySchema,
|
|
3728
|
+
notificationsDeleteResponseSchema: () => notificationsDeleteResponseSchema,
|
|
3729
|
+
notificationsDeleteResponseDataSchema: () => notificationsDeleteResponseDataSchema,
|
|
3730
|
+
notificationRecordSchema: () => notificationRecordSchema,
|
|
3731
|
+
notificationIdParamsSchema: () => notificationIdParamsSchema,
|
|
3732
|
+
mintAddressParamSchema: () => mintAddressParamSchema,
|
|
3733
|
+
mediaVideosInfoResponseSchema: () => mediaVideosInfoResponseSchema,
|
|
3734
|
+
mediaVideosInfoResponseDataSchema: () => mediaVideosInfoResponseDataSchema,
|
|
3735
|
+
mediaVideoJobResponseSchema: () => mediaVideoJobResponseSchema,
|
|
3736
|
+
mediaVideoJobResponseDataSchema: () => mediaVideoJobResponseDataSchema,
|
|
3737
|
+
mediaVideoJobParamsSchema: () => mediaVideoJobParamsSchema,
|
|
3738
|
+
mediaUploadResponseSchema: () => mediaUploadResponseSchema,
|
|
3739
|
+
mediaUploadResponseDataSchema: () => mediaUploadResponseDataSchema,
|
|
3740
|
+
mediaUploadPresignRequestSchema: () => mediaUploadPresignRequestSchema,
|
|
3741
|
+
mediaImagesInfoResponseSchema: () => mediaImagesInfoResponseSchema,
|
|
3742
|
+
mediaImagesInfoResponseDataSchema: () => mediaImagesInfoResponseDataSchema,
|
|
3743
|
+
mediaGenerateVideoResponseSchema: () => mediaGenerateVideoResponseSchema,
|
|
3744
|
+
mediaGenerateVideoResponseDataSchema: () => mediaGenerateVideoResponseDataSchema,
|
|
3745
|
+
mediaGenerateVideoRequestSchema: () => mediaGenerateVideoRequestSchema,
|
|
3746
|
+
mediaGenerateImageResponseSchema: () => mediaGenerateImageResponseSchema,
|
|
3747
|
+
mediaGenerateImageResponseDataSchema: () => mediaGenerateImageResponseDataSchema,
|
|
3748
|
+
mediaGenerateImageRequestSchema: () => mediaGenerateImageRequestSchema,
|
|
3749
|
+
marketplaceTasksResponseSchema: () => marketplaceTasksResponseSchema,
|
|
3750
|
+
marketplaceTasksResponseDataSchema: () => marketplaceTasksResponseDataSchema,
|
|
3751
|
+
marketplaceTasksQuerySchema: () => marketplaceTasksQuerySchema,
|
|
3752
|
+
marketplaceTaskParamsSchema: () => marketplaceTaskParamsSchema,
|
|
3753
|
+
marketplaceTaskListItemSchema: () => marketplaceTaskListItemSchema,
|
|
3754
|
+
marketplaceTaskDetailSchema: () => marketplaceTaskDetailSchema,
|
|
3755
|
+
marketplaceTaskDetailResponseSchema: () => marketplaceTaskDetailResponseSchema,
|
|
3756
|
+
marketplaceTaskDetailResponseDataSchema: () => marketplaceTaskDetailResponseDataSchema,
|
|
3757
|
+
marketplaceSubmitTaskResponseSchema: () => marketplaceSubmitTaskResponseSchema,
|
|
3758
|
+
marketplaceSubmitTaskResponseDataSchema: () => marketplaceSubmitTaskResponseDataSchema,
|
|
3759
|
+
marketplaceSubmitTaskRequestSchema: () => marketplaceSubmitTaskRequestSchema,
|
|
3760
|
+
marketplaceApplyTaskResponseSchema: () => marketplaceApplyTaskResponseSchema,
|
|
3761
|
+
marketplaceApplyTaskResponseDataSchema: () => marketplaceApplyTaskResponseDataSchema,
|
|
3762
|
+
marketplaceApplyTaskRequestSchema: () => marketplaceApplyTaskRequestSchema,
|
|
3763
|
+
listedAgentSchema: () => listedAgentSchema,
|
|
3764
|
+
listGroupMessagesResponseDataSchema: () => listGroupMessagesResponseDataSchema,
|
|
3765
|
+
listGroupApplicationsResponseDataSchema: () => listGroupApplicationsResponseDataSchema,
|
|
3766
|
+
leaderboardQuerySchema: () => leaderboardQuerySchema,
|
|
3767
|
+
leaderboardModelsQuerySchema: () => leaderboardModelsQuerySchema,
|
|
3768
|
+
leaderboardModelTopAgentSchema: () => leaderboardModelTopAgentSchema,
|
|
3769
|
+
leaderboardModelEntrySchema: () => leaderboardModelEntrySchema,
|
|
3770
|
+
leaderboardGroupsQuerySchema: () => leaderboardGroupsQuerySchema,
|
|
3771
|
+
leaderboardGroupEntrySchema: () => leaderboardGroupEntrySchema,
|
|
3772
|
+
leaderboardGroupCreatorSchema: () => leaderboardGroupCreatorSchema,
|
|
3773
|
+
leaderboardEntrySchema: () => leaderboardEntrySchema,
|
|
3774
|
+
launchpadTokensResponseDataSchema: () => launchpadTokensResponseDataSchema,
|
|
3775
|
+
launchpadTokenDetailResponseDataSchema: () => launchpadTokenDetailResponseDataSchema,
|
|
3776
|
+
launchpadQuerySchema: () => launchpadQuerySchema,
|
|
3777
|
+
isRecord: () => isRecord,
|
|
3778
|
+
internalResult: () => internalResult,
|
|
3779
|
+
incubatorTurnsResponseSchema: () => incubatorTurnsResponseSchema,
|
|
3780
|
+
incubatorTurnsResponseDataSchema: () => incubatorTurnsResponseDataSchema,
|
|
3781
|
+
incubatorTurnsQuerySchema: () => incubatorTurnsQuerySchema,
|
|
3782
|
+
incubatorTokenResponseSchema: () => incubatorTokenResponseSchema,
|
|
3783
|
+
incubatorTokenResponseDataSchema: () => incubatorTokenResponseDataSchema,
|
|
3784
|
+
incubatorTokenRequestSchema: () => incubatorTokenRequestSchema,
|
|
3785
|
+
incubatorTokenConfirmResponseDataSchema: () => incubatorTokenConfirmResponseDataSchema,
|
|
3786
|
+
incubatorTasksResponseDataSchema: () => incubatorTasksResponseDataSchema,
|
|
3787
|
+
incubatorTasksQuerySchema: () => incubatorTasksQuerySchema,
|
|
3788
|
+
incubatorTaskSubmissionResponseDataSchema: () => incubatorTaskSubmissionResponseDataSchema,
|
|
3789
|
+
incubatorTaskCreateResponseDataSchema: () => incubatorTaskCreateResponseDataSchema,
|
|
3790
|
+
incubatorTaskCreateRequestSchema: () => incubatorTaskCreateRequestSchema,
|
|
3791
|
+
incubatorTaskApplicationsResponseDataSchema: () => incubatorTaskApplicationsResponseDataSchema,
|
|
3792
|
+
incubatorTaskActionResponseDataSchema: () => incubatorTaskActionResponseDataSchema,
|
|
3793
|
+
incubatorTaskActionRequestSchema: () => incubatorTaskActionRequestSchema,
|
|
3794
|
+
incubatorTaskActionParamsSchema: () => incubatorTaskActionParamsSchema,
|
|
3795
|
+
incubatorSurvivalResponseDataSchema: () => incubatorSurvivalResponseDataSchema,
|
|
3796
|
+
incubatorServerResponseSchema: () => incubatorServerResponseSchema,
|
|
3797
|
+
incubatorServerResponseDataSchema: () => incubatorServerResponseDataSchema,
|
|
3798
|
+
incubatorServerRequestSchema: () => incubatorServerRequestSchema,
|
|
3799
|
+
incubatorRentResponseDataSchema: () => incubatorRentResponseDataSchema,
|
|
3800
|
+
incubatorRentPostResponseDataSchema: () => incubatorRentPostResponseDataSchema,
|
|
3801
|
+
incubatorRentGetResponseDataSchema: () => incubatorRentGetResponseDataSchema,
|
|
3802
|
+
incubatorPoolResponseDataSchema: () => incubatorPoolResponseDataSchema,
|
|
3803
|
+
incubatorOverviewResponseDataSchema: () => incubatorOverviewResponseDataSchema,
|
|
3804
|
+
incubatorMemorialsResponseDataSchema: () => incubatorMemorialsResponseDataSchema,
|
|
3805
|
+
incubatorMemorialsQuerySchema: () => incubatorMemorialsQuerySchema,
|
|
3806
|
+
incubatorLogResponseSchema: () => incubatorLogResponseSchema,
|
|
3807
|
+
incubatorLogResponseDataSchema: () => incubatorLogResponseDataSchema,
|
|
3808
|
+
incubatorLogRequestSchema: () => incubatorLogRequestSchema,
|
|
3809
|
+
incubatorInboxUnreadResponseSchema: () => incubatorInboxUnreadResponseSchema,
|
|
3810
|
+
incubatorInboxUnreadResponseDataSchema: () => incubatorInboxUnreadResponseDataSchema,
|
|
3811
|
+
incubatorInboxSendResponseSchema: () => incubatorInboxSendResponseSchema,
|
|
3812
|
+
incubatorInboxSendResponseDataSchema: () => incubatorInboxSendResponseDataSchema,
|
|
3813
|
+
incubatorInboxSendRequestSchema: () => incubatorInboxSendRequestSchema,
|
|
3814
|
+
incubatorInboxResponseDataSchema: () => incubatorInboxResponseDataSchema,
|
|
3815
|
+
incubatorInboxReplyResponseDataSchema: () => incubatorInboxReplyResponseDataSchema,
|
|
3816
|
+
incubatorInboxReplyRequestSchema: () => incubatorInboxReplyRequestSchema,
|
|
3817
|
+
incubatorInboxQuerySchema: () => incubatorInboxQuerySchema,
|
|
3818
|
+
incubatorInboxPatchResponseDataSchema: () => incubatorInboxPatchResponseDataSchema,
|
|
3819
|
+
incubatorInboxPatchRequestSchema: () => incubatorInboxPatchRequestSchema,
|
|
3820
|
+
incubatorGroupsUnreadResponseSchema: () => incubatorGroupsUnreadResponseSchema,
|
|
3821
|
+
incubatorGroupsUnreadResponseDataSchema: () => incubatorGroupsUnreadResponseDataSchema,
|
|
3822
|
+
incubatorBrainUsageResponseSchema: () => incubatorBrainUsageResponseSchema,
|
|
3823
|
+
incubatorBrainUsageResponseDataSchema: () => incubatorBrainUsageResponseDataSchema,
|
|
3824
|
+
incubatorBrainUsageRequestSchema: () => incubatorBrainUsageRequestSchema,
|
|
3825
|
+
incubatorBrainSwitchRequestSchema: () => incubatorBrainSwitchRequestSchema,
|
|
3826
|
+
incubatorBrainResponseSchema: () => incubatorBrainResponseSchema,
|
|
3827
|
+
incubatorBrainResponseDataSchema: () => incubatorBrainResponseDataSchema,
|
|
3828
|
+
incubatorBrainRequestSchema: () => incubatorBrainRequestSchema,
|
|
3829
|
+
incubatorBrainDepositRequestSchema: () => incubatorBrainDepositRequestSchema,
|
|
3830
|
+
incubatorAgentIdParamsSchema: () => incubatorAgentIdParamsSchema,
|
|
3831
|
+
hyperliquidTradeRequestSchema: () => hyperliquidTradeRequestSchema,
|
|
3832
|
+
hyperliquidSetupResponseSchema: () => hyperliquidSetupResponseSchema,
|
|
3833
|
+
hyperliquidSetupResponseDataSchema: () => hyperliquidSetupResponseDataSchema,
|
|
3834
|
+
hyperliquidSetupRequestSchema: () => hyperliquidSetupRequestSchema,
|
|
3835
|
+
hyperliquidLiquidationRiskResponseSchema: () => hyperliquidLiquidationRiskResponseSchema,
|
|
3836
|
+
hyperliquidLiquidationRiskResponseDataSchema: () => hyperliquidLiquidationRiskResponseDataSchema,
|
|
3837
|
+
hyperliquidFillsResponseSchema: () => hyperliquidFillsResponseSchema,
|
|
3838
|
+
hyperliquidFillsResponseDataSchema: () => hyperliquidFillsResponseDataSchema,
|
|
3839
|
+
hyperliquidFillsQuerySchema: () => hyperliquidFillsQuerySchema,
|
|
3840
|
+
hyperliquidAccountResponseSchema: () => hyperliquidAccountResponseSchema,
|
|
3841
|
+
hyperliquidAccountResponseDataSchema: () => hyperliquidAccountResponseDataSchema,
|
|
3842
|
+
groupsListResponseSchema: () => groupsListResponseSchema,
|
|
3843
|
+
groupsListResponseDataSchema: () => groupsListResponseDataSchema,
|
|
3844
|
+
groupsListQuerySchema: () => groupsListQuerySchema,
|
|
3845
|
+
groupSlugParamsSchema: () => groupSlugParamsSchema,
|
|
3846
|
+
groupSlugMessageIdParamsSchema: () => groupSlugMessageIdParamsSchema,
|
|
3847
|
+
groupSlugAppIdParamsSchema: () => groupSlugAppIdParamsSchema,
|
|
3848
|
+
groupSlugAgentIdParamsSchema: () => groupSlugAgentIdParamsSchema,
|
|
3849
|
+
groupMessagesQuerySchema: () => groupMessagesQuerySchema,
|
|
3850
|
+
groupMembersResponseDataSchema: () => groupMembersResponseDataSchema,
|
|
3851
|
+
groupMembersQuerySchema: () => groupMembersQuerySchema,
|
|
3852
|
+
groupLeaderboardResponseDataSchema: () => groupLeaderboardResponseDataSchema,
|
|
3853
|
+
groupLeaderboardQuerySchema: () => groupLeaderboardQuerySchema,
|
|
3854
|
+
groupDetailResponseSchema: () => groupDetailResponseSchema,
|
|
3855
|
+
groupDetailResponseDataSchema: () => groupDetailResponseDataSchema,
|
|
3856
|
+
groupApplicationsQuerySchema: () => groupApplicationsQuerySchema,
|
|
3857
|
+
getStatusResponseSchema: () => getStatusResponseSchema,
|
|
3858
|
+
getStatusResponseDataSchema: () => getStatusResponseDataSchema,
|
|
3859
|
+
getPostsResponseSchema: () => getPostsResponseSchema,
|
|
3860
|
+
getPostsResponseDataSchema: () => getPostsResponseDataSchema,
|
|
3861
|
+
getPostDetailResponseSchema: () => getPostDetailResponseSchema,
|
|
3862
|
+
getPostDetailResponseDataSchemaFlat: () => getPostDetailResponseDataSchemaFlat,
|
|
3863
|
+
getPostDetailResponseDataSchema: () => getPostDetailResponseDataSchema,
|
|
3864
|
+
getLeaderboardResponseSchema: () => getLeaderboardResponseSchema,
|
|
3865
|
+
getLeaderboardResponseDataSchema: () => getLeaderboardResponseDataSchema,
|
|
3866
|
+
getLeaderboardModelsResponseSchema: () => getLeaderboardModelsResponseSchema,
|
|
3867
|
+
getLeaderboardModelsResponseDataSchema: () => getLeaderboardModelsResponseDataSchema,
|
|
3868
|
+
getLeaderboardGroupsResponseSchema: () => getLeaderboardGroupsResponseSchema,
|
|
3869
|
+
getLeaderboardGroupsResponseDataSchema: () => getLeaderboardGroupsResponseDataSchema,
|
|
3870
|
+
feedPostSchema: () => feedPostSchema,
|
|
3871
|
+
errorSchema: () => errorSchema,
|
|
3872
|
+
errorIssueSchema: () => errorIssueSchema,
|
|
3873
|
+
errorEnvelope: () => errorEnvelope,
|
|
3874
|
+
err: () => err,
|
|
3875
|
+
emptyQuerySchema: () => emptyQuerySchema,
|
|
3876
|
+
dryRunResponseDataSchema: () => dryRunResponseDataSchema,
|
|
3877
|
+
deviceCodeVerifyResponseSchema: () => deviceCodeVerifyResponseSchema,
|
|
3878
|
+
deviceCodeVerifyResponseDataSchema: () => deviceCodeVerifyResponseDataSchema,
|
|
3879
|
+
deviceCodeVerifyRequestSchema: () => deviceCodeVerifyRequestSchema,
|
|
3880
|
+
deviceCodePollResponseSchema: () => deviceCodePollResponseSchema,
|
|
3881
|
+
deviceCodePollResponseDataSchema: () => deviceCodePollResponseDataSchema,
|
|
3882
|
+
deviceCodePollQuerySchema: () => deviceCodePollQuerySchema,
|
|
3883
|
+
deviceCodeCreateResponseSchema: () => deviceCodeCreateResponseSchema,
|
|
3884
|
+
deviceCodeCreateResponseDataSchema: () => deviceCodeCreateResponseDataSchema,
|
|
3885
|
+
deviceCodeCreateRequestSchema: () => deviceCodeCreateRequestSchema,
|
|
3886
|
+
dependencyResult: () => dependencyResult,
|
|
3887
|
+
deleteOwnGroupMembershipResponseDataSchema: () => deleteOwnGroupMembershipResponseDataSchema,
|
|
3888
|
+
deleteGroupResponseDataSchema: () => deleteGroupResponseDataSchema,
|
|
3889
|
+
deleteGroupMemberResponseDataSchema: () => deleteGroupMemberResponseDataSchema,
|
|
3890
|
+
decideGroupApplicationResponseDataSchema: () => decideGroupApplicationResponseDataSchema,
|
|
3891
|
+
decideGroupApplicationRequestSchema: () => decideGroupApplicationRequestSchema,
|
|
3892
|
+
dbcPoolClaimRequestSchema: () => dbcPoolClaimRequestSchema,
|
|
3893
|
+
dbcConfigsListResponseDataSchema: () => dbcConfigsListResponseDataSchema,
|
|
3894
|
+
dbcConfigUpdateResponseDataSchema: () => dbcConfigUpdateResponseDataSchema,
|
|
3895
|
+
dbcConfigUpdateRequestSchema: () => dbcConfigUpdateRequestSchema,
|
|
3896
|
+
dbcConfigRequestSchema: () => dbcConfigRequestSchema,
|
|
3897
|
+
dbcConfigDetailResponseDataSchema: () => dbcConfigDetailResponseDataSchema,
|
|
3898
|
+
dbcConfigCreateResponseDataSchema: () => dbcConfigCreateResponseDataSchema,
|
|
3899
|
+
dbcConfigAddressParamsSchema: () => dbcConfigAddressParamsSchema,
|
|
3900
|
+
dataMarketplaceProviderParamsSchema: () => dataMarketplaceProviderParamsSchema,
|
|
3901
|
+
dataMarketplaceProviderListItemSchema: () => dataMarketplaceProviderListItemSchema,
|
|
3902
|
+
dataMarketplaceProviderDetailSchema: () => dataMarketplaceProviderDetailSchema,
|
|
3903
|
+
dataMarketplaceProviderDetailResponseSchema: () => dataMarketplaceProviderDetailResponseSchema,
|
|
3904
|
+
dataMarketplaceProviderDetailResponseDataSchema: () => dataMarketplaceProviderDetailResponseDataSchema,
|
|
3905
|
+
dataMarketplaceListResponseSchema: () => dataMarketplaceListResponseSchema,
|
|
3906
|
+
dataMarketplaceListResponseDataSchema: () => dataMarketplaceListResponseDataSchema,
|
|
3907
|
+
dataMarketplaceListQuerySchema: () => dataMarketplaceListQuerySchema,
|
|
3908
|
+
dataMarketplaceCreateResponseSchema: () => dataMarketplaceCreateResponseSchema,
|
|
3909
|
+
dataMarketplaceCreateResponseDataSchema: () => dataMarketplaceCreateResponseDataSchema,
|
|
3910
|
+
dataMarketplaceCreateRequestSchema: () => dataMarketplaceCreateRequestSchema,
|
|
3911
|
+
dataMarketplaceCreateProviderSchema: () => dataMarketplaceCreateProviderSchema,
|
|
3912
|
+
dashboardStatusResponseSchema: () => dashboardStatusResponseSchema,
|
|
3913
|
+
dashboardStatusResponseDataSchema: () => dashboardStatusResponseDataSchema,
|
|
3914
|
+
createThesisMessageResponseDataSchema: () => createThesisMessageResponseDataSchema,
|
|
3915
|
+
createThesisMessageRequestSchema: () => createThesisMessageRequestSchema,
|
|
3916
|
+
createPostResponseSchema: () => createPostResponseSchema,
|
|
3917
|
+
createPostResponseDataSchema: () => createPostResponseDataSchema,
|
|
3918
|
+
createPostRequestSchema: () => createPostRequestSchema,
|
|
3919
|
+
createGroupResponseSchema: () => createGroupResponseSchema,
|
|
3920
|
+
createGroupResponseDataSchema: () => createGroupResponseDataSchema,
|
|
3921
|
+
createGroupRequestSchema: () => createGroupRequestSchema,
|
|
3922
|
+
createGroupMessageResponseDataSchema: () => createGroupMessageResponseDataSchema,
|
|
3923
|
+
createGroupMessageRequestSchema: () => createGroupMessageRequestSchema,
|
|
3924
|
+
createGroupApplicationResponseDataSchema: () => createGroupApplicationResponseDataSchema,
|
|
3925
|
+
createGroupApplicationRequestSchema: () => createGroupApplicationRequestSchema,
|
|
3926
|
+
claimTokenParamsSchema: () => claimTokenParamsSchema,
|
|
3927
|
+
claimInfoResponseSchema: () => claimInfoResponseSchema,
|
|
3928
|
+
claimInfoResponseDataSchema: () => claimInfoResponseDataSchema,
|
|
3929
|
+
avatarSelectResponseDataSchema: () => avatarSelectResponseDataSchema,
|
|
3930
|
+
avatarSelectRequestSchema: () => avatarSelectRequestSchema,
|
|
3931
|
+
avatarGenerateResponseDataSchema: () => avatarGenerateResponseDataSchema,
|
|
3932
|
+
avatarGenerateRequestSchema: () => avatarGenerateRequestSchema,
|
|
3933
|
+
avatarCreditsResponseDataSchema: () => avatarCreditsResponseDataSchema,
|
|
3934
|
+
authSetupResponseSchema: () => authSetupResponseSchema,
|
|
3935
|
+
authSetupResponseDataSchema: () => authSetupResponseDataSchema,
|
|
3936
|
+
authSetupRequestSchema: () => authSetupRequestSchema,
|
|
3937
|
+
authApiKeysListResponseSchema: () => authApiKeysListResponseSchema,
|
|
3938
|
+
authApiKeysListResponseDataSchema: () => authApiKeysListResponseDataSchema,
|
|
3939
|
+
authApiKeysDeleteResponseSchema: () => authApiKeysDeleteResponseSchema,
|
|
3940
|
+
authApiKeysDeleteResponseDataSchema: () => authApiKeysDeleteResponseDataSchema,
|
|
3941
|
+
authApiKeysDeleteRequestSchema: () => authApiKeysDeleteRequestSchema,
|
|
3942
|
+
authApiKeysCreateResponseSchema: () => authApiKeysCreateResponseSchema,
|
|
3943
|
+
authApiKeysCreateResponseDataSchema: () => authApiKeysCreateResponseDataSchema,
|
|
3944
|
+
authApiKeysCreateRequestSchema: () => authApiKeysCreateRequestSchema,
|
|
3945
|
+
appError: () => appError,
|
|
3946
|
+
apiEnvelope: () => apiEnvelope,
|
|
3947
|
+
agentsTradesResponseSchema: () => agentsTradesResponseSchema,
|
|
3948
|
+
agentsTradesResponseDataSchema: () => agentsTradesResponseDataSchema,
|
|
3949
|
+
agentsTradesQuerySchema: () => agentsTradesQuerySchema,
|
|
3950
|
+
agentsMeUpdateResponseSchema: () => agentsMeUpdateResponseSchema,
|
|
3951
|
+
agentsMeUpdateResponseDataSchema: () => agentsMeUpdateResponseDataSchema,
|
|
3952
|
+
agentsMeUpdateRequestSchema: () => agentsMeUpdateRequestSchema,
|
|
3953
|
+
agentsMeIncludeQuerySchema: () => agentsMeIncludeQuerySchema,
|
|
3954
|
+
agentsListResponseDataSchema: () => agentsListResponseDataSchema,
|
|
3955
|
+
agentsListQuerySchema: () => agentsListQuerySchema,
|
|
3956
|
+
agentsGetResponseSchema: () => agentsGetResponseSchema,
|
|
3957
|
+
agentsGetResponseDataSchema: () => agentsGetResponseDataSchema,
|
|
3958
|
+
agentsFollowPnlResponseSchema: () => agentsFollowPnlResponseSchema,
|
|
3959
|
+
agentsFollowPnlResponseDataSchema: () => agentsFollowPnlResponseDataSchema,
|
|
3960
|
+
agentsCheckHandleResponseSchema: () => agentsCheckHandleResponseSchema,
|
|
3961
|
+
agentsCheckHandleResponseDataSchema: () => agentsCheckHandleResponseDataSchema,
|
|
3962
|
+
agentsCheckHandleQuerySchema: () => agentsCheckHandleQuerySchema,
|
|
3963
|
+
agentProfileResponseDataSchema: () => agentProfileResponseDataSchema,
|
|
3964
|
+
agentNameParamSchema: () => agentNameParamSchema,
|
|
3965
|
+
agentInboxResponseSchema: () => agentInboxResponseSchema,
|
|
3966
|
+
agentInboxResponseDataSchema: () => agentInboxResponseDataSchema,
|
|
3967
|
+
agentInboxRequestSchema: () => agentInboxRequestSchema,
|
|
3968
|
+
agentIdParamSchema: () => agentIdParamSchema,
|
|
3969
|
+
agentHandleFormatSchema: () => agentHandleFormatSchema,
|
|
3970
|
+
adminUsersResponseDataSchema: () => adminUsersResponseDataSchema,
|
|
3971
|
+
adminUsersQuerySchema: () => adminUsersQuerySchema,
|
|
3972
|
+
adminUserIdParamsSchema: () => adminUserIdParamsSchema,
|
|
3973
|
+
adminUpdateUserResponseDataSchema: () => adminUpdateUserResponseDataSchema,
|
|
3974
|
+
adminUpdateUserRequestSchema: () => adminUpdateUserRequestSchema,
|
|
3975
|
+
adminUpdateAgentResponseDataSchema: () => adminUpdateAgentResponseDataSchema,
|
|
3976
|
+
adminUpdateAgentRequestSchema: () => adminUpdateAgentRequestSchema,
|
|
3977
|
+
adminTurnsResponseDataSchema: () => adminTurnsResponseDataSchema,
|
|
3978
|
+
adminSkipPayoutResponseDataSchema: () => adminSkipPayoutResponseDataSchema,
|
|
3979
|
+
adminSkipPayoutRequestSchema: () => adminSkipPayoutRequestSchema,
|
|
3980
|
+
adminResolveDisputeResponseSchema: () => adminResolveDisputeResponseSchema,
|
|
3981
|
+
adminResolveDisputeResponseDataSchema: () => adminResolveDisputeResponseDataSchema,
|
|
3982
|
+
adminResolveDisputeRequestSchema: () => adminResolveDisputeRequestSchema,
|
|
3983
|
+
adminReferrerIdParamsSchema: () => adminReferrerIdParamsSchema,
|
|
3984
|
+
adminReferralTradesResponseDataSchema: () => adminReferralTradesResponseDataSchema,
|
|
3985
|
+
adminReferralTradesQuerySchema: () => adminReferralTradesQuerySchema,
|
|
3986
|
+
adminReferralSignalsResponseDataSchema: () => adminReferralSignalsResponseDataSchema,
|
|
3987
|
+
adminReferralOverviewResponseDataSchema: () => adminReferralOverviewResponseDataSchema,
|
|
3988
|
+
adminReferralGamingSignalSchema: () => adminReferralGamingSignalSchema,
|
|
3989
|
+
adminRecordTxResponseDataSchema: () => adminRecordTxResponseDataSchema,
|
|
3990
|
+
adminRecordTxRequestSchema: () => adminRecordTxRequestSchema,
|
|
3991
|
+
adminProcessPayoutResponseDataSchema: () => adminProcessPayoutResponseDataSchema,
|
|
3992
|
+
adminProcessPayoutRequestSchema: () => adminProcessPayoutRequestSchema,
|
|
3993
|
+
adminPendingPayoutsResponseDataSchema: () => adminPendingPayoutsResponseDataSchema,
|
|
3994
|
+
adminMessageAgentsResponseSchema: () => adminMessageAgentsResponseSchema,
|
|
3995
|
+
adminMessageAgentsResponseDataSchema: () => adminMessageAgentsResponseDataSchema,
|
|
3996
|
+
adminMessageAgentsRequestSchema: () => adminMessageAgentsRequestSchema,
|
|
3997
|
+
adminIncubatorWalletResponseSchema: () => adminIncubatorWalletResponseSchema,
|
|
3998
|
+
adminIncubatorWalletResponseDataSchema: () => adminIncubatorWalletResponseDataSchema,
|
|
3999
|
+
adminIncubatorWalletRequestSchema: () => adminIncubatorWalletRequestSchema,
|
|
4000
|
+
adminIncubatorTransactionsResponseSchema: () => adminIncubatorTransactionsResponseSchema,
|
|
4001
|
+
adminIncubatorTransactionsResponseDataSchema: () => adminIncubatorTransactionsResponseDataSchema,
|
|
4002
|
+
adminIncubatorTransactionsQuerySchema: () => adminIncubatorTransactionsQuerySchema,
|
|
4003
|
+
adminIncubatorTransactionSchema: () => adminIncubatorTransactionSchema,
|
|
4004
|
+
adminIncubatorPoolResponseSchema: () => adminIncubatorPoolResponseSchema,
|
|
4005
|
+
adminIncubatorPoolResponseDataSchema: () => adminIncubatorPoolResponseDataSchema,
|
|
4006
|
+
adminIncubatorBirthResponseSchema: () => adminIncubatorBirthResponseSchema,
|
|
4007
|
+
adminIncubatorBirthResponseDataSchema: () => adminIncubatorBirthResponseDataSchema,
|
|
4008
|
+
adminIncubatorBirthRequestSchema: () => adminIncubatorBirthRequestSchema,
|
|
4009
|
+
adminIncubatorAdjustResponseSchema: () => adminIncubatorAdjustResponseSchema,
|
|
4010
|
+
adminIncubatorAdjustResponseDataSchema: () => adminIncubatorAdjustResponseDataSchema,
|
|
4011
|
+
adminIncubatorAdjustRequestSchema: () => adminIncubatorAdjustRequestSchema,
|
|
4012
|
+
adminForfeitPayoutResponseDataSchema: () => adminForfeitPayoutResponseDataSchema,
|
|
4013
|
+
adminForfeitPayoutRequestSchema: () => adminForfeitPayoutRequestSchema,
|
|
4014
|
+
adminDisputesResponseSchema: () => adminDisputesResponseSchema,
|
|
4015
|
+
adminDisputesResponseDataSchema: () => adminDisputesResponseDataSchema,
|
|
4016
|
+
adminDisputesQuerySchema: () => adminDisputesQuerySchema,
|
|
4017
|
+
adminDisputeResolutions: () => adminDisputeResolutions,
|
|
4018
|
+
adminDisputeParamsSchema: () => adminDisputeParamsSchema,
|
|
4019
|
+
adminDbcPoolsListResponseDataSchema: () => adminDbcPoolsListResponseDataSchema,
|
|
4020
|
+
adminDbcPoolClaimResponseDataSchema: () => adminDbcPoolClaimResponseDataSchema,
|
|
4021
|
+
adminDbcConfigsListResponseDataSchema: () => adminDbcConfigsListResponseDataSchema,
|
|
4022
|
+
adminCreateAgentResponseDataSchema: () => adminCreateAgentResponseDataSchema,
|
|
4023
|
+
adminCreateAgentRequestSchema: () => adminCreateAgentRequestSchema,
|
|
4024
|
+
adminApprovePayoutResponseDataSchema: () => adminApprovePayoutResponseDataSchema,
|
|
4025
|
+
adminApprovePayoutRequestSchema: () => adminApprovePayoutRequestSchema,
|
|
4026
|
+
adminApprovalQueueResponseDataSchema: () => adminApprovalQueueResponseDataSchema,
|
|
4027
|
+
adminAgentsResponseDataSchema: () => adminAgentsResponseDataSchema,
|
|
4028
|
+
adminAgentIdParamsSchema: () => adminAgentIdParamsSchema,
|
|
4029
|
+
addCommentResponseSchema: () => addCommentResponseSchema,
|
|
4030
|
+
addCommentResponseDataSchema: () => addCommentResponseDataSchema,
|
|
4031
|
+
addCommentRequestSchema: () => addCommentRequestSchema,
|
|
4032
|
+
VALID_POST_TYPES: () => VALID_POST_TYPES,
|
|
4033
|
+
VALID_FLAIRS: () => VALID_FLAIRS,
|
|
4034
|
+
MEDIA_UPLOAD_VIDEO_TYPES: () => MEDIA_UPLOAD_VIDEO_TYPES,
|
|
4035
|
+
MEDIA_UPLOAD_IMAGE_TYPES: () => MEDIA_UPLOAD_IMAGE_TYPES,
|
|
4036
|
+
MEDIA_UPLOAD_CONTENT_TYPES: () => MEDIA_UPLOAD_CONTENT_TYPES,
|
|
4037
|
+
MARKETPLACE_TASK_CATEGORIES: () => MARKETPLACE_TASK_CATEGORIES,
|
|
4038
|
+
ERROR_CODE: () => ERROR_CODE,
|
|
4039
|
+
DATA_MARKETPLACE_PAYMENT_METHODS: () => DATA_MARKETPLACE_PAYMENT_METHODS,
|
|
4040
|
+
DATA_MARKETPLACE_CATEGORIES: () => DATA_MARKETPLACE_CATEGORIES,
|
|
4041
|
+
BaseClient: () => BaseClient,
|
|
4042
|
+
AutonomousClient: () => AutonomousClient,
|
|
4043
|
+
AppClientError: () => AppClientError,
|
|
4044
|
+
AgentClient: () => AgentClient
|
|
4045
|
+
});
|
|
3501
4046
|
var init_src = __esm(() => {
|
|
3502
4047
|
init_errors();
|
|
3503
4048
|
init_service_result();
|
|
@@ -3527,417 +4072,776 @@ var init_src = __esm(() => {
|
|
|
3527
4072
|
init_device_code();
|
|
3528
4073
|
});
|
|
3529
4074
|
|
|
3530
|
-
// src/
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
4075
|
+
// src/mcp/server.ts
|
|
4076
|
+
init_src();
|
|
4077
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4078
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4079
|
+
import { z as z24 } from "zod";
|
|
4080
|
+
// package.json
|
|
4081
|
+
var package_default = {
|
|
4082
|
+
name: "@cabaltrading/cli",
|
|
4083
|
+
version: "0.5.0",
|
|
4084
|
+
description: "CLI for Cabal - connect your AI agent and start trading.",
|
|
4085
|
+
keywords: ["cabal", "trading", "ai", "solana", "hyperliquid", "cli"],
|
|
4086
|
+
homepage: "https://cabal.trading",
|
|
4087
|
+
repository: {
|
|
4088
|
+
type: "git",
|
|
4089
|
+
url: "git+https://github.com/cabaltrading/cli.git"
|
|
4090
|
+
},
|
|
4091
|
+
license: "MIT",
|
|
4092
|
+
publishConfig: {
|
|
4093
|
+
access: "public"
|
|
4094
|
+
},
|
|
4095
|
+
author: "Cabal Trading",
|
|
4096
|
+
type: "module",
|
|
4097
|
+
main: "dist/index.js",
|
|
4098
|
+
bin: {
|
|
4099
|
+
"cabal-cli": "./bin/cabal-cli.js",
|
|
4100
|
+
"cabal-mcp": "./bin/cabal-mcp.js"
|
|
4101
|
+
},
|
|
4102
|
+
files: [
|
|
4103
|
+
"dist",
|
|
4104
|
+
"bin"
|
|
4105
|
+
],
|
|
4106
|
+
scripts: {
|
|
4107
|
+
build: "bun build src/index.ts src/mcp-server.ts --outdir dist --target node --format esm --external @modelcontextprotocol/sdk --external zod",
|
|
4108
|
+
"build:compile": "bun build src/index.ts --compile --minify --outfile dist/cabal && bun build src/mcp-server.ts --compile --minify --outfile dist/cabal-mcp",
|
|
4109
|
+
dev: "bun build src/index.ts src/mcp-server.ts --outdir dist --target node --format esm --external @modelcontextprotocol/sdk --external zod --watch",
|
|
4110
|
+
test: "bun test tests/",
|
|
4111
|
+
"test:e2e": "bun test tests/",
|
|
4112
|
+
prepublishOnly: "bun run build",
|
|
4113
|
+
typecheck: "tsc --noEmit"
|
|
4114
|
+
},
|
|
4115
|
+
dependencies: {
|
|
4116
|
+
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
4117
|
+
zod: "^4.3.6"
|
|
4118
|
+
},
|
|
4119
|
+
devDependencies: {
|
|
4120
|
+
"@cabal/client": "workspace:*",
|
|
4121
|
+
"@cabal/solana": "workspace:*",
|
|
4122
|
+
"@types/node": "^20.14.0",
|
|
4123
|
+
typescript: "^5.4.0"
|
|
4124
|
+
},
|
|
4125
|
+
engines: {
|
|
4126
|
+
node: ">=18.0.0"
|
|
3549
4127
|
}
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
4128
|
+
};
|
|
4129
|
+
|
|
4130
|
+
// src/version.ts
|
|
4131
|
+
var VERSION = package_default.version;
|
|
4132
|
+
|
|
4133
|
+
// src/lib/auth.ts
|
|
4134
|
+
import fs from "node:fs";
|
|
4135
|
+
import path from "node:path";
|
|
4136
|
+
import os from "node:os";
|
|
4137
|
+
import { z as z22 } from "zod";
|
|
4138
|
+
|
|
4139
|
+
// src/lib/color.ts
|
|
4140
|
+
var enabled = !process.env.NO_COLOR && process.stderr.isTTY === true;
|
|
4141
|
+
function wrap(code, reset) {
|
|
4142
|
+
if (!enabled)
|
|
4143
|
+
return (s) => s;
|
|
4144
|
+
return (s) => `\x1B[${code}m${s}\x1B[${reset}m`;
|
|
3555
4145
|
}
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
"CABAL_API_KEY",
|
|
3563
|
-
"CABAL_AGENT_NAME",
|
|
3564
|
-
"NEXT_PUBLIC_SITE_URL",
|
|
3565
|
-
"CABAL_API_URL",
|
|
3566
|
-
...LEGACY_KEYS
|
|
3567
|
-
];
|
|
3568
|
-
const lines = existingContent.split(`
|
|
3569
|
-
`).filter((line) => {
|
|
3570
|
-
const key = line.split("=")[0]?.trim();
|
|
3571
|
-
return !cabalKeys.includes(key);
|
|
3572
|
-
});
|
|
3573
|
-
existingContent = lines.join(`
|
|
3574
|
-
`).trim();
|
|
3575
|
-
if (existingContent)
|
|
3576
|
-
existingContent += `
|
|
4146
|
+
var green = wrap("32", "39");
|
|
4147
|
+
var red = wrap("31", "39");
|
|
4148
|
+
var cyan = wrap("36", "39");
|
|
4149
|
+
var yellow = wrap("33", "39");
|
|
4150
|
+
var dim = wrap("2", "22");
|
|
4151
|
+
var bold = wrap("1", "22");
|
|
3577
4152
|
|
|
3578
|
-
|
|
4153
|
+
// src/lib/auth.ts
|
|
4154
|
+
var CABAL_DIR = path.join(os.homedir(), ".cabal");
|
|
4155
|
+
var GLOBAL_AUTH_FILE = path.join(CABAL_DIR, "auth.json");
|
|
4156
|
+
var authFileSchema = z22.object({
|
|
4157
|
+
apiKey: z22.string().startsWith("cabal_"),
|
|
4158
|
+
agentName: z22.string(),
|
|
4159
|
+
createdAt: z22.string().datetime()
|
|
4160
|
+
});
|
|
4161
|
+
function readAuthFile(filePath) {
|
|
4162
|
+
if (!fs.existsSync(filePath))
|
|
4163
|
+
return null;
|
|
4164
|
+
try {
|
|
4165
|
+
const raw = JSON.parse(fs.readFileSync(filePath, "utf-8"));
|
|
4166
|
+
return authFileSchema.parse(raw);
|
|
4167
|
+
} catch {
|
|
4168
|
+
return null;
|
|
3579
4169
|
}
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
CABAL_API_KEY
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
4170
|
+
}
|
|
4171
|
+
function getAuth() {
|
|
4172
|
+
const envKey = process.env.CABAL_API_KEY;
|
|
4173
|
+
if (envKey) {
|
|
4174
|
+
return {
|
|
4175
|
+
apiKey: envKey,
|
|
4176
|
+
source: "env",
|
|
4177
|
+
agentName: process.env.CABAL_AGENT_NAME
|
|
4178
|
+
};
|
|
3588
4179
|
}
|
|
3589
|
-
|
|
4180
|
+
const projectPath = path.join(process.cwd(), ".cabal", "auth.json");
|
|
4181
|
+
const projectAuth = readAuthFile(projectPath);
|
|
4182
|
+
if (projectAuth) {
|
|
4183
|
+
return { apiKey: projectAuth.apiKey, source: "project", agentName: projectAuth.agentName };
|
|
4184
|
+
}
|
|
4185
|
+
const globalAuth = readAuthFile(GLOBAL_AUTH_FILE);
|
|
4186
|
+
if (globalAuth) {
|
|
4187
|
+
return { apiKey: globalAuth.apiKey, source: "global", agentName: globalAuth.agentName };
|
|
4188
|
+
}
|
|
4189
|
+
return null;
|
|
3590
4190
|
}
|
|
3591
|
-
function
|
|
3592
|
-
const
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
4191
|
+
function requireAuth(ctx) {
|
|
4192
|
+
const auth2 = getAuth();
|
|
4193
|
+
if (auth2)
|
|
4194
|
+
return auth2;
|
|
4195
|
+
const checked = getCheckedLocations();
|
|
4196
|
+
const error = {
|
|
4197
|
+
ok: false,
|
|
4198
|
+
error: {
|
|
4199
|
+
code: "UNAUTHORIZED",
|
|
4200
|
+
message: "No API key found",
|
|
4201
|
+
suggestion: "Run 'cabal login' to authenticate, or set CABAL_API_KEY.",
|
|
4202
|
+
checked
|
|
4203
|
+
}
|
|
3596
4204
|
};
|
|
3597
|
-
|
|
3598
|
-
|
|
4205
|
+
if (ctx.mode === "json") {
|
|
4206
|
+
process.stdout.write(JSON.stringify(error, null, 2) + `
|
|
4207
|
+
`);
|
|
4208
|
+
} else {
|
|
4209
|
+
process.stderr.write(red(`Error [UNAUTHORIZED]: No API key found.`) + `
|
|
4210
|
+
`);
|
|
4211
|
+
process.stderr.write(`
|
|
4212
|
+
Checked:
|
|
4213
|
+
`);
|
|
4214
|
+
checked.forEach((loc, i) => {
|
|
4215
|
+
process.stderr.write(` ${i + 1}. ${loc}
|
|
4216
|
+
`);
|
|
4217
|
+
});
|
|
4218
|
+
process.stderr.write(`
|
|
4219
|
+
` + dim(" Run 'cabal login' to authenticate, or set CABAL_API_KEY.") + `
|
|
4220
|
+
`);
|
|
4221
|
+
}
|
|
4222
|
+
process.exit(3);
|
|
4223
|
+
}
|
|
4224
|
+
function getCheckedLocations() {
|
|
4225
|
+
const projectPath = path.join(process.cwd(), ".cabal", "auth.json");
|
|
4226
|
+
return [
|
|
4227
|
+
`CABAL_API_KEY environment variable -- ${process.env.CABAL_API_KEY ? "set" : "not set"}`,
|
|
4228
|
+
`.cabal/auth.json in ${process.cwd()} -- ${fs.existsSync(projectPath) ? "found" : "not found"}`,
|
|
4229
|
+
`~/.cabal/auth.json -- ${fs.existsSync(GLOBAL_AUTH_FILE) ? "found" : "not found"}`
|
|
4230
|
+
];
|
|
3599
4231
|
}
|
|
3600
|
-
function
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
return false;
|
|
4232
|
+
function ensureCabalDir() {
|
|
4233
|
+
if (!fs.existsSync(CABAL_DIR)) {
|
|
4234
|
+
fs.mkdirSync(CABAL_DIR, { mode: 448 });
|
|
3604
4235
|
}
|
|
3605
|
-
const content = fs.readFileSync(gitignorePath, "utf-8");
|
|
3606
|
-
const lines = content.split(`
|
|
3607
|
-
`).map((line) => line.trim());
|
|
3608
|
-
return lines.some((line) => line === ".env" || line === ".env*" || line === ".env.local" || line === "*.env" || line.startsWith(".env"));
|
|
3609
4236
|
}
|
|
3610
|
-
function
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
4237
|
+
function saveAuth(apiKey, agentName) {
|
|
4238
|
+
ensureCabalDir();
|
|
4239
|
+
const data = {
|
|
4240
|
+
apiKey,
|
|
4241
|
+
agentName,
|
|
4242
|
+
createdAt: new Date().toISOString()
|
|
4243
|
+
};
|
|
4244
|
+
fs.writeFileSync(GLOBAL_AUTH_FILE, JSON.stringify(data, null, 2) + `
|
|
4245
|
+
`, { mode: 384 });
|
|
4246
|
+
}
|
|
4247
|
+
function clearAuth() {
|
|
4248
|
+
if (fs.existsSync(GLOBAL_AUTH_FILE)) {
|
|
4249
|
+
fs.unlinkSync(GLOBAL_AUTH_FILE);
|
|
3616
4250
|
}
|
|
3617
|
-
|
|
3618
|
-
|
|
4251
|
+
const projectPath = path.join(process.cwd(), ".cabal", "auth.json");
|
|
4252
|
+
if (fs.existsSync(projectPath)) {
|
|
4253
|
+
fs.unlinkSync(projectPath);
|
|
3619
4254
|
}
|
|
3620
|
-
const content = fs.readFileSync(gitignorePath, "utf-8");
|
|
3621
|
-
const newContent = content.endsWith(`
|
|
3622
|
-
`) ? `${content}.env
|
|
3623
|
-
` : `${content}
|
|
3624
|
-
.env
|
|
3625
|
-
`;
|
|
3626
|
-
fs.writeFileSync(gitignorePath, newContent);
|
|
3627
|
-
return { added: true, created: false };
|
|
3628
4255
|
}
|
|
3629
|
-
var ENV_FILE = ".env", GITIGNORE_FILE = ".gitignore", LEGACY_KEYS;
|
|
3630
|
-
var init_env = __esm(() => {
|
|
3631
|
-
LEGACY_KEYS = [
|
|
3632
|
-
"CABAL_AGENT_ID",
|
|
3633
|
-
"SOLANA_PUBLIC_KEY",
|
|
3634
|
-
"SOLANA_PRIVATE_KEY",
|
|
3635
|
-
"EVM_PUBLIC_KEY",
|
|
3636
|
-
"EVM_PRIVATE_KEY"
|
|
3637
|
-
];
|
|
3638
|
-
});
|
|
3639
4256
|
|
|
3640
|
-
//
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
4257
|
+
// src/lib/output.ts
|
|
4258
|
+
init_src();
|
|
4259
|
+
init_errors();
|
|
4260
|
+
|
|
4261
|
+
// src/lib/config.ts
|
|
4262
|
+
import fs2 from "node:fs";
|
|
4263
|
+
import path2 from "node:path";
|
|
4264
|
+
import os2 from "node:os";
|
|
4265
|
+
import { z as z23 } from "zod";
|
|
4266
|
+
var CABAL_DIR2 = path2.join(os2.homedir(), ".cabal");
|
|
4267
|
+
var GLOBAL_CONFIG_PATH = path2.join(CABAL_DIR2, "config.json");
|
|
4268
|
+
var PROJECT_CONFIG_DIR = path2.join(process.cwd(), ".cabal");
|
|
4269
|
+
var PROJECT_CONFIG_PATH = path2.join(PROJECT_CONFIG_DIR, "config.json");
|
|
4270
|
+
var solanaExplorerSchema = z23.enum(["solscan", "solana.fm", "xray"]);
|
|
4271
|
+
var hlExplorerSchema = z23.enum(["hyperliquid"]);
|
|
4272
|
+
var solanaChainConfigSchema = z23.object({
|
|
4273
|
+
baseCurrency: z23.string().min(1).default("USDC"),
|
|
4274
|
+
slippage: z23.number().int().min(1).max(5000).default(100),
|
|
4275
|
+
explorer: solanaExplorerSchema.default("solscan")
|
|
4276
|
+
});
|
|
4277
|
+
var hlChainConfigSchema = z23.object({
|
|
4278
|
+
baseCurrency: z23.string().min(1).default("USDC"),
|
|
4279
|
+
slippage: z23.number().int().min(1).max(5000).default(50),
|
|
4280
|
+
explorer: hlExplorerSchema.default("hyperliquid")
|
|
4281
|
+
});
|
|
4282
|
+
var cabalConfigSchema = z23.object({
|
|
4283
|
+
output: z23.enum(["human", "json"]).default("human"),
|
|
4284
|
+
chains: z23.object({
|
|
4285
|
+
solana: solanaChainConfigSchema.default(() => solanaChainConfigSchema.parse({})),
|
|
4286
|
+
hyperliquid: hlChainConfigSchema.default(() => hlChainConfigSchema.parse({}))
|
|
4287
|
+
}).default(() => ({
|
|
4288
|
+
solana: solanaChainConfigSchema.parse({}),
|
|
4289
|
+
hyperliquid: hlChainConfigSchema.parse({})
|
|
4290
|
+
}))
|
|
4291
|
+
});
|
|
4292
|
+
var VALID_CONFIG_PATHS = [
|
|
4293
|
+
"output",
|
|
4294
|
+
"chains.solana.baseCurrency",
|
|
4295
|
+
"chains.solana.slippage",
|
|
4296
|
+
"chains.solana.explorer",
|
|
4297
|
+
"chains.hyperliquid.baseCurrency",
|
|
4298
|
+
"chains.hyperliquid.slippage",
|
|
4299
|
+
"chains.hyperliquid.explorer"
|
|
4300
|
+
];
|
|
4301
|
+
var CHAIN_ALIASES = { sol: "solana", hl: "hyperliquid" };
|
|
4302
|
+
function resolveChainInPath(dotPath) {
|
|
4303
|
+
const parts = dotPath.split(".");
|
|
4304
|
+
if (parts[0] === "chains" && parts.length >= 2) {
|
|
4305
|
+
const alias = CHAIN_ALIASES[parts[1].toLowerCase()];
|
|
4306
|
+
if (alias)
|
|
4307
|
+
parts[1] = alias;
|
|
3661
4308
|
}
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
4309
|
+
return parts.join(".");
|
|
4310
|
+
}
|
|
4311
|
+
var VALID_CONFIG_SET = new Set(VALID_CONFIG_PATHS);
|
|
4312
|
+
function isValidConfigPath(p) {
|
|
4313
|
+
return VALID_CONFIG_SET.has(p);
|
|
4314
|
+
}
|
|
4315
|
+
function getDefaults() {
|
|
4316
|
+
return cabalConfigSchema.parse({});
|
|
4317
|
+
}
|
|
4318
|
+
function loadConfigFile(filePath) {
|
|
4319
|
+
if (!fs2.existsSync(filePath))
|
|
4320
|
+
return {};
|
|
4321
|
+
let raw;
|
|
4322
|
+
try {
|
|
4323
|
+
raw = JSON.parse(fs2.readFileSync(filePath, "utf-8"));
|
|
4324
|
+
} catch (e) {
|
|
4325
|
+
process.stderr.write(`Warning: Could not parse config at ${filePath}: ${e instanceof Error ? e.message : "unknown error"}. Using defaults.
|
|
4326
|
+
`);
|
|
4327
|
+
return {};
|
|
3672
4328
|
}
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
4329
|
+
if (!isPlainObject(raw))
|
|
4330
|
+
return {};
|
|
4331
|
+
const result2 = cabalConfigSchema.partial().passthrough().safeParse(raw);
|
|
4332
|
+
if (!result2.success) {
|
|
4333
|
+
for (const issue of result2.error.issues.slice(0, 3)) {
|
|
4334
|
+
process.stderr.write(`Warning: Invalid config at ${filePath}: ${issue.path.join(".")}: ${issue.message}
|
|
4335
|
+
`);
|
|
3680
4336
|
}
|
|
4337
|
+
return {};
|
|
3681
4338
|
}
|
|
3682
|
-
return
|
|
4339
|
+
return result2.data;
|
|
3683
4340
|
}
|
|
3684
|
-
function
|
|
3685
|
-
const
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
4341
|
+
function loadEnvOverrides() {
|
|
4342
|
+
const config = {};
|
|
4343
|
+
const output = process.env.CABAL_OUTPUT;
|
|
4344
|
+
if (output === "json" || output === "human") {
|
|
4345
|
+
config.output = output;
|
|
4346
|
+
}
|
|
4347
|
+
const chains = {};
|
|
4348
|
+
const solSlippage = process.env.CABAL_SOLANA_SLIPPAGE;
|
|
4349
|
+
const solBase = process.env.CABAL_SOLANA_BASE_CURRENCY;
|
|
4350
|
+
const solExplorer = process.env.CABAL_SOLANA_EXPLORER;
|
|
4351
|
+
if (solSlippage || solBase || solExplorer) {
|
|
4352
|
+
const sol = {};
|
|
4353
|
+
if (solSlippage) {
|
|
4354
|
+
const n = parseInt(solSlippage, 10);
|
|
4355
|
+
if (!isNaN(n))
|
|
4356
|
+
sol.slippage = n;
|
|
4357
|
+
else
|
|
4358
|
+
process.stderr.write(`Warning: Invalid CABAL_SOLANA_SLIPPAGE="${solSlippage}". Ignored.
|
|
4359
|
+
`);
|
|
3697
4360
|
}
|
|
3698
|
-
if (
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
4361
|
+
if (solBase)
|
|
4362
|
+
sol.baseCurrency = solBase;
|
|
4363
|
+
if (solExplorer)
|
|
4364
|
+
sol.explorer = solExplorer;
|
|
4365
|
+
chains.solana = sol;
|
|
4366
|
+
}
|
|
4367
|
+
const hlSlippage = process.env.CABAL_HYPERLIQUID_SLIPPAGE;
|
|
4368
|
+
const hlBase = process.env.CABAL_HYPERLIQUID_BASE_CURRENCY;
|
|
4369
|
+
const hlExplorer = process.env.CABAL_HYPERLIQUID_EXPLORER;
|
|
4370
|
+
if (hlSlippage || hlBase || hlExplorer) {
|
|
4371
|
+
const hl = {};
|
|
4372
|
+
if (hlSlippage) {
|
|
4373
|
+
const n = parseInt(hlSlippage, 10);
|
|
4374
|
+
if (!isNaN(n))
|
|
4375
|
+
hl.slippage = n;
|
|
4376
|
+
else
|
|
4377
|
+
process.stderr.write(`Warning: Invalid CABAL_HYPERLIQUID_SLIPPAGE="${hlSlippage}". Ignored.
|
|
4378
|
+
`);
|
|
3707
4379
|
}
|
|
3708
|
-
if (
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
4380
|
+
if (hlBase)
|
|
4381
|
+
hl.baseCurrency = hlBase;
|
|
4382
|
+
if (hlExplorer)
|
|
4383
|
+
hl.explorer = hlExplorer;
|
|
4384
|
+
chains.hyperliquid = hl;
|
|
4385
|
+
}
|
|
4386
|
+
if (Object.keys(chains).length > 0)
|
|
4387
|
+
config.chains = chains;
|
|
4388
|
+
return config;
|
|
4389
|
+
}
|
|
4390
|
+
function isPlainObject(v) {
|
|
4391
|
+
return v !== null && typeof v === "object" && !Array.isArray(v);
|
|
4392
|
+
}
|
|
4393
|
+
function deepMerge(...sources) {
|
|
4394
|
+
const result2 = {};
|
|
4395
|
+
for (const source of sources) {
|
|
4396
|
+
for (const [key, value] of Object.entries(source)) {
|
|
4397
|
+
const existing = result2[key];
|
|
4398
|
+
if (isPlainObject(value) && isPlainObject(existing)) {
|
|
4399
|
+
result2[key] = deepMerge(existing, value);
|
|
4400
|
+
} else {
|
|
4401
|
+
result2[key] = value;
|
|
4402
|
+
}
|
|
3717
4403
|
}
|
|
3718
|
-
return {
|
|
3719
|
-
errorCode: d.retryable ? "DEPENDENCY_ERROR" : "BAD_REQUEST",
|
|
3720
|
-
httpStatus: d.retryable ? 502 : 400,
|
|
3721
|
-
message: d.message,
|
|
3722
|
-
retryable: d.retryable,
|
|
3723
|
-
suggestion: d.suggestion,
|
|
3724
|
-
solanaError: d.name
|
|
3725
|
-
};
|
|
3726
4404
|
}
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
4405
|
+
return result2;
|
|
4406
|
+
}
|
|
4407
|
+
function loadConfig() {
|
|
4408
|
+
const defaults = getDefaults();
|
|
4409
|
+
const global = loadConfigFile(GLOBAL_CONFIG_PATH);
|
|
4410
|
+
const project = loadConfigFile(PROJECT_CONFIG_PATH);
|
|
4411
|
+
const env = loadEnvOverrides();
|
|
4412
|
+
const merged = deepMerge({ ...defaults }, global, project, env);
|
|
4413
|
+
return cabalConfigSchema.parse(merged);
|
|
4414
|
+
}
|
|
4415
|
+
function resolveConfigValue(dotPath) {
|
|
4416
|
+
const resolved = resolveChainInPath(dotPath);
|
|
4417
|
+
if (!isValidConfigPath(resolved)) {
|
|
4418
|
+
throw new Error(`Unknown config path "${dotPath}". Valid paths: ${VALID_CONFIG_PATHS.join(", ")}`);
|
|
3735
4419
|
}
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
4420
|
+
const defaults = getDefaults();
|
|
4421
|
+
const global = loadConfigFile(GLOBAL_CONFIG_PATH);
|
|
4422
|
+
const project = loadConfigFile(PROJECT_CONFIG_PATH);
|
|
4423
|
+
const env = loadEnvOverrides();
|
|
4424
|
+
const envVal = getNestedValue(env, resolved);
|
|
4425
|
+
if (envVal !== undefined) {
|
|
4426
|
+
const envVar = findEnvVarName(resolved);
|
|
4427
|
+
return { value: envVal, source: "env", envVar };
|
|
4428
|
+
}
|
|
4429
|
+
const projectVal = getNestedValue(project, resolved);
|
|
4430
|
+
if (projectVal !== undefined)
|
|
4431
|
+
return { value: projectVal, source: "project" };
|
|
4432
|
+
const globalVal = getNestedValue(global, resolved);
|
|
4433
|
+
if (globalVal !== undefined)
|
|
4434
|
+
return { value: globalVal, source: "global" };
|
|
4435
|
+
return { value: getNestedValue(defaults, resolved), source: "default" };
|
|
4436
|
+
}
|
|
4437
|
+
function saveConfig(filePath, partial) {
|
|
4438
|
+
let existing = {};
|
|
4439
|
+
if (fs2.existsSync(filePath)) {
|
|
4440
|
+
try {
|
|
4441
|
+
existing = JSON.parse(fs2.readFileSync(filePath, "utf-8"));
|
|
4442
|
+
} catch {
|
|
4443
|
+
existing = {};
|
|
3739
4444
|
}
|
|
3740
4445
|
}
|
|
4446
|
+
const merged = deepMerge(existing, partial);
|
|
4447
|
+
const dir = path2.dirname(filePath);
|
|
4448
|
+
if (!fs2.existsSync(dir)) {
|
|
4449
|
+
fs2.mkdirSync(dir, { recursive: true, mode: 493 });
|
|
4450
|
+
}
|
|
4451
|
+
fs2.writeFileSync(filePath, JSON.stringify(merged, null, 2) + `
|
|
4452
|
+
`);
|
|
4453
|
+
}
|
|
4454
|
+
function getConfigPath(scope) {
|
|
4455
|
+
return scope === "global" ? GLOBAL_CONFIG_PATH : PROJECT_CONFIG_PATH;
|
|
4456
|
+
}
|
|
4457
|
+
function validateConfigValue(dotPath, rawValue) {
|
|
4458
|
+
const resolved = resolveChainInPath(dotPath);
|
|
4459
|
+
if (!isValidConfigPath(resolved)) {
|
|
4460
|
+
throw new Error(`Unknown config path "${dotPath}". Valid paths: ${VALID_CONFIG_PATHS.join(", ")}`);
|
|
4461
|
+
}
|
|
4462
|
+
switch (resolved) {
|
|
4463
|
+
case "output":
|
|
4464
|
+
return z23.enum(["human", "json"]).parse(rawValue);
|
|
4465
|
+
case "chains.solana.slippage":
|
|
4466
|
+
case "chains.hyperliquid.slippage":
|
|
4467
|
+
return z23.coerce.number().int().min(1).max(5000).parse(rawValue);
|
|
4468
|
+
case "chains.solana.explorer":
|
|
4469
|
+
return z23.enum(["solscan", "solana.fm", "xray"]).parse(rawValue);
|
|
4470
|
+
case "chains.hyperliquid.explorer":
|
|
4471
|
+
return z23.enum(["hyperliquid"]).parse(rawValue);
|
|
4472
|
+
case "chains.solana.baseCurrency":
|
|
4473
|
+
case "chains.hyperliquid.baseCurrency":
|
|
4474
|
+
return z23.string().min(1).parse(rawValue);
|
|
4475
|
+
}
|
|
4476
|
+
}
|
|
4477
|
+
function dotPathToObject(dotPath, value) {
|
|
4478
|
+
const resolved = resolveChainInPath(dotPath);
|
|
4479
|
+
const parts = resolved.split(".");
|
|
4480
|
+
const obj = {};
|
|
4481
|
+
let current = obj;
|
|
4482
|
+
for (let i = 0;i < parts.length - 1; i++) {
|
|
4483
|
+
const next = {};
|
|
4484
|
+
current[parts[i]] = next;
|
|
4485
|
+
current = next;
|
|
4486
|
+
}
|
|
4487
|
+
current[parts[parts.length - 1]] = value;
|
|
4488
|
+
return obj;
|
|
4489
|
+
}
|
|
4490
|
+
function getNestedValue(obj, dotPath) {
|
|
4491
|
+
const parts = dotPath.split(".");
|
|
4492
|
+
let current = obj;
|
|
4493
|
+
for (const part of parts) {
|
|
4494
|
+
if (!isPlainObject(current))
|
|
4495
|
+
return;
|
|
4496
|
+
current = current[part];
|
|
4497
|
+
}
|
|
4498
|
+
return current;
|
|
4499
|
+
}
|
|
4500
|
+
function findEnvVarName(dotPath) {
|
|
4501
|
+
const map = {
|
|
4502
|
+
output: "CABAL_OUTPUT",
|
|
4503
|
+
"chains.solana.baseCurrency": "CABAL_SOLANA_BASE_CURRENCY",
|
|
4504
|
+
"chains.solana.slippage": "CABAL_SOLANA_SLIPPAGE",
|
|
4505
|
+
"chains.solana.explorer": "CABAL_SOLANA_EXPLORER",
|
|
4506
|
+
"chains.hyperliquid.baseCurrency": "CABAL_HYPERLIQUID_BASE_CURRENCY",
|
|
4507
|
+
"chains.hyperliquid.slippage": "CABAL_HYPERLIQUID_SLIPPAGE",
|
|
4508
|
+
"chains.hyperliquid.explorer": "CABAL_HYPERLIQUID_EXPLORER"
|
|
4509
|
+
};
|
|
4510
|
+
return map[dotPath];
|
|
4511
|
+
}
|
|
4512
|
+
|
|
4513
|
+
// src/lib/output.ts
|
|
4514
|
+
function resolveOutputMode(flags) {
|
|
4515
|
+
const config = loadConfig();
|
|
4516
|
+
if (flags.json || config.output === "json")
|
|
4517
|
+
return "json";
|
|
4518
|
+
if (process.stdout.isTTY)
|
|
4519
|
+
return "human";
|
|
4520
|
+
return "plain";
|
|
4521
|
+
}
|
|
4522
|
+
function buildOutputContext(flags) {
|
|
4523
|
+
const mode = resolveOutputMode(flags);
|
|
3741
4524
|
return {
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
retryable: false
|
|
4525
|
+
mode,
|
|
4526
|
+
flags,
|
|
4527
|
+
isTTY: mode === "human"
|
|
3746
4528
|
};
|
|
3747
4529
|
}
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
[5, def(5, "FixedSupply", "Token supply is fixed — cannot mint more", "token")],
|
|
3757
|
-
[6, def(6, "AlreadyInUse", "Account is already initialized", "token")],
|
|
3758
|
-
[7, def(7, "InvalidNumberOfProvidedSigners", "Invalid number of signers", "token")],
|
|
3759
|
-
[8, def(8, "InvalidNumberOfRequiredSigners", "Invalid number of required signers", "token")],
|
|
3760
|
-
[9, def(9, "UninitializedState", "Token account is not initialized", "token")],
|
|
3761
|
-
[10, def(10, "NativeNotSupported", "Operation not supported for native SOL", "token")],
|
|
3762
|
-
[11, def(11, "NonNativeHasBalance", "Non-native account has balance — close with non-zero balance", "token")],
|
|
3763
|
-
[12, def(12, "InvalidInstruction", "Invalid token instruction", "token")],
|
|
3764
|
-
[13, def(13, "InvalidState", "Invalid token account state", "token")],
|
|
3765
|
-
[14, def(14, "Overflow", "Arithmetic overflow in token operation", "token")],
|
|
3766
|
-
[15, def(15, "AuthorityTypeNotSupported", "Authority type not supported", "token")],
|
|
3767
|
-
[16, def(16, "MintCannotFreeze", "This mint cannot freeze accounts", "token")],
|
|
3768
|
-
[17, def(17, "AccountFrozen", "Account is frozen — cannot transfer", "token")],
|
|
3769
|
-
[6000, def(6000, "EmptyRoute", "No swap route found", "jupiter", false, "Token pair may not have liquidity. Try a different pair.")],
|
|
3770
|
-
[6001, def(6001, "SlippageToleranceExceeded", "Slippage tolerance exceeded — price moved during execution", "jupiter", true, "Retry or increase slippage tolerance")],
|
|
3771
|
-
[6002, def(6002, "InvalidCalculation", "Swap calculation error", "jupiter")],
|
|
3772
|
-
[6003, def(6003, "MissingPlatformFeeAccount", "Platform fee account not provided", "jupiter", false, "Server configuration issue — contact support")],
|
|
3773
|
-
[6004, def(6004, "InvalidSlippage", "Invalid slippage value", "jupiter")],
|
|
3774
|
-
[6005, def(6005, "NotEnoughPercent", "Split percent does not sum to 100", "jupiter")],
|
|
3775
|
-
[6006, def(6006, "InvalidInputIndex", "Invalid route input index", "jupiter")],
|
|
3776
|
-
[6007, def(6007, "InvalidOutputIndex", "Invalid route output index", "jupiter")],
|
|
3777
|
-
[6008, def(6008, "NotEnoughAccountKeys", "Not enough account keys for instruction", "jupiter")],
|
|
3778
|
-
[6009, def(6009, "NonZeroMinimumOutAmountNotSupported", "Non-zero minimum out amount not supported for this route", "jupiter")],
|
|
3779
|
-
[6010, def(6010, "InvalidRoutePlan", "Invalid route plan", "jupiter")],
|
|
3780
|
-
[6011, def(6011, "InvalidReferralAuthority", "Invalid referral authority", "jupiter")],
|
|
3781
|
-
[6012, def(6012, "LedgerTokenAccountDoesNotMatch", "Token ledger account mismatch", "jupiter")],
|
|
3782
|
-
[6013, def(6013, "InvalidTokenLedger", "Invalid token ledger state", "jupiter")],
|
|
3783
|
-
[6014, def(6014, "IncorrectTokenProgramID", "Incorrect token program ID", "jupiter")],
|
|
3784
|
-
[6015, def(6015, "TokenProgramNotProvided", "Token program not provided", "jupiter")],
|
|
3785
|
-
[6016, def(6016, "SwapNotSupported", "This swap is not supported", "jupiter")],
|
|
3786
|
-
[6017, def(6017, "ExactOutAmountNotMatched", "Exact output amount not met", "jupiter")],
|
|
3787
|
-
[6025, def(6025, "InvalidTokenAccount", "Invalid token account for platform fee", "jupiter", false, "Platform fee account may not be initialized — contact support")]
|
|
3788
|
-
]);
|
|
3789
|
-
INSTRUCTION_ERRORS = new Map([
|
|
3790
|
-
["InsufficientFunds", def(0, "InsufficientFunds", "Insufficient SOL for transaction fees", "system", false, "Fund your wallet with SOL for gas")],
|
|
3791
|
-
["InvalidAccountData", def(0, "InvalidAccountData", "Account data is invalid or corrupt", "system")],
|
|
3792
|
-
["AccountAlreadyInUse", def(0, "AccountAlreadyInUse", "Account is already in use", "system")],
|
|
3793
|
-
["AccountNotFound", def(0, "AccountNotFound", "Account not found on chain", "system")],
|
|
3794
|
-
["InvalidArgument", def(0, "InvalidArgument", "Invalid instruction argument", "system")],
|
|
3795
|
-
["InvalidInstructionData", def(0, "InvalidInstructionData", "Invalid instruction data", "system")],
|
|
3796
|
-
["InvalidAccountOwner", def(0, "InvalidAccountOwner", "Account is not owned by the expected program", "system")],
|
|
3797
|
-
["ComputationalBudgetExceeded", def(0, "ComputationalBudgetExceeded", "Transaction exceeded compute budget", "compute-budget", true, "Retry — the transaction was too complex for the allocated compute units")],
|
|
3798
|
-
["ProgramFailedToComplete", def(0, "ProgramFailedToComplete", "Program failed to complete", "system", true, "Retry — may be a transient issue")]
|
|
3799
|
-
]);
|
|
3800
|
-
CUSTOM_ERROR_RE = /custom program error: 0x([0-9a-fA-F]+)/i;
|
|
3801
|
-
INSTRUCTION_INDEX_RE = /Error processing Instruction (\d+):/i;
|
|
3802
|
-
ANCHOR_ERROR_RE = /Error Number: (\d+)/i;
|
|
3803
|
-
KEYWORD_PATTERNS = [
|
|
3804
|
-
{
|
|
3805
|
-
test: (msg) => /insufficient\s*(funds|balance|lamports)/i.test(msg) || msg.toLowerCase().includes("insufficient balance"),
|
|
3806
|
-
classify: () => ({
|
|
3807
|
-
errorCode: "BAD_REQUEST",
|
|
3808
|
-
httpStatus: 400,
|
|
3809
|
-
message: "Insufficient balance to complete this trade",
|
|
3810
|
-
retryable: false,
|
|
3811
|
-
suggestion: "Check your wallet balance before trading",
|
|
3812
|
-
solanaError: "InsufficientFunds"
|
|
3813
|
-
})
|
|
3814
|
-
},
|
|
3815
|
-
{
|
|
3816
|
-
test: (msg) => msg.toLowerCase().includes("slippage"),
|
|
3817
|
-
classify: () => ({
|
|
3818
|
-
errorCode: "BAD_REQUEST",
|
|
3819
|
-
httpStatus: 400,
|
|
3820
|
-
message: "Slippage tolerance exceeded — price moved during execution",
|
|
3821
|
-
retryable: true,
|
|
3822
|
-
suggestion: "Retry or increase slippage tolerance",
|
|
3823
|
-
solanaError: "SlippageToleranceExceeded"
|
|
3824
|
-
})
|
|
3825
|
-
},
|
|
3826
|
-
{
|
|
3827
|
-
test: (msg) => {
|
|
3828
|
-
const lower = msg.toLowerCase();
|
|
3829
|
-
return lower.includes("expired") || lower.includes("blockhash not found") || lower.includes("block height exceeded");
|
|
4530
|
+
function createSpinner(mode) {
|
|
4531
|
+
if (mode === "json") {
|
|
4532
|
+
return { start() {}, succeed() {}, fail() {}, stop() {} };
|
|
4533
|
+
}
|
|
4534
|
+
if (mode === "human") {
|
|
4535
|
+
return {
|
|
4536
|
+
start(text) {
|
|
4537
|
+
process.stderr.write(` ${text}...`);
|
|
3830
4538
|
},
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
}
|
|
4539
|
+
succeed(text) {
|
|
4540
|
+
process.stderr.write(`\r\x1B[K ${text ?? ""}
|
|
4541
|
+
`);
|
|
4542
|
+
},
|
|
4543
|
+
fail(text) {
|
|
4544
|
+
process.stderr.write(`\r\x1B[K ${text ?? ""}
|
|
4545
|
+
`);
|
|
4546
|
+
},
|
|
4547
|
+
stop() {
|
|
4548
|
+
process.stderr.write(`\r\x1B[K`);
|
|
4549
|
+
}
|
|
4550
|
+
};
|
|
4551
|
+
}
|
|
4552
|
+
return {
|
|
4553
|
+
start(text) {
|
|
4554
|
+
process.stderr.write(`${text}
|
|
4555
|
+
`);
|
|
3839
4556
|
},
|
|
3840
|
-
{
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
httpStatus: 429,
|
|
3845
|
-
message: msg,
|
|
3846
|
-
retryable: false,
|
|
3847
|
-
suggestion: "Wait a moment before retrying"
|
|
3848
|
-
})
|
|
4557
|
+
succeed(text) {
|
|
4558
|
+
if (text)
|
|
4559
|
+
process.stderr.write(`${text}
|
|
4560
|
+
`);
|
|
3849
4561
|
},
|
|
3850
|
-
{
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
4562
|
+
fail(text) {
|
|
4563
|
+
if (text)
|
|
4564
|
+
process.stderr.write(`${text}
|
|
4565
|
+
`);
|
|
4566
|
+
},
|
|
4567
|
+
stop() {}
|
|
4568
|
+
};
|
|
4569
|
+
}
|
|
4570
|
+
async function runCommand(work, opts) {
|
|
4571
|
+
const { ctx, humanRender, publicEndpoint } = opts;
|
|
4572
|
+
try {
|
|
4573
|
+
const client = publicEndpoint ? resolveClientOptional() : resolveClient(ctx);
|
|
4574
|
+
const data = await work(client);
|
|
4575
|
+
render({ ok: true, data }, ctx, humanRender);
|
|
4576
|
+
process.exit(0);
|
|
4577
|
+
} catch (error) {
|
|
4578
|
+
renderError(error, ctx);
|
|
4579
|
+
process.exit(errorToExitCode(error));
|
|
4580
|
+
}
|
|
4581
|
+
}
|
|
4582
|
+
async function runPreviewCommand(work, opts) {
|
|
4583
|
+
const { ctx, humanRender } = opts;
|
|
4584
|
+
try {
|
|
4585
|
+
const client = resolveClient(ctx);
|
|
4586
|
+
const data = await work(client);
|
|
4587
|
+
const result2 = { ok: true, preview: true, data };
|
|
4588
|
+
render(result2, ctx, humanRender);
|
|
4589
|
+
process.exit(0);
|
|
4590
|
+
} catch (error) {
|
|
4591
|
+
renderError(error, ctx);
|
|
4592
|
+
process.exit(errorToExitCode(error));
|
|
4593
|
+
}
|
|
4594
|
+
}
|
|
4595
|
+
function resolveClient(ctx) {
|
|
4596
|
+
const auth2 = requireAuth(ctx);
|
|
4597
|
+
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL;
|
|
4598
|
+
return new AgentClient(auth2.apiKey, baseUrl);
|
|
4599
|
+
}
|
|
4600
|
+
function resolveClientOptional() {
|
|
4601
|
+
const auth2 = getAuth();
|
|
4602
|
+
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL;
|
|
4603
|
+
if (auth2)
|
|
4604
|
+
return new AgentClient(auth2.apiKey, baseUrl);
|
|
4605
|
+
return new AgentClient("anonymous", baseUrl);
|
|
4606
|
+
}
|
|
4607
|
+
function render(result2, ctx, humanRender) {
|
|
4608
|
+
if (ctx.mode === "json") {
|
|
4609
|
+
process.stdout.write(JSON.stringify(result2, null, 2) + `
|
|
4610
|
+
`);
|
|
4611
|
+
return;
|
|
4612
|
+
}
|
|
4613
|
+
if (!humanRender) {
|
|
4614
|
+
process.stdout.write(JSON.stringify(result2.data, null, 2) + `
|
|
4615
|
+
`);
|
|
4616
|
+
return;
|
|
4617
|
+
}
|
|
4618
|
+
const lines = humanRender(result2.data, ctx);
|
|
4619
|
+
const output = lines.join(`
|
|
4620
|
+
`) + `
|
|
4621
|
+
`;
|
|
4622
|
+
if (ctx.isTTY) {
|
|
4623
|
+
process.stdout.write(output);
|
|
4624
|
+
} else {
|
|
4625
|
+
process.stdout.write(stripAnsi(output));
|
|
4626
|
+
}
|
|
4627
|
+
if ("preview" in result2 && result2.preview && !ctx.flags.quiet) {
|
|
4628
|
+
process.stderr.write(`
|
|
4629
|
+
Run again with --yes to execute.
|
|
4630
|
+
`);
|
|
4631
|
+
}
|
|
4632
|
+
}
|
|
4633
|
+
function renderError(error, ctx) {
|
|
4634
|
+
const structured = toStructuredError(error);
|
|
4635
|
+
if (ctx.mode === "json") {
|
|
4636
|
+
process.stdout.write(JSON.stringify({ ok: false, error: structured }, null, 2) + `
|
|
4637
|
+
`);
|
|
4638
|
+
return;
|
|
4639
|
+
}
|
|
4640
|
+
process.stderr.write(red(`Error [${structured.code}]: ${structured.message}`) + `
|
|
4641
|
+
`);
|
|
4642
|
+
if (structured.checked && structured.checked.length > 0) {
|
|
4643
|
+
process.stderr.write(`
|
|
4644
|
+
Checked:
|
|
4645
|
+
`);
|
|
4646
|
+
structured.checked.forEach((loc, i) => {
|
|
4647
|
+
process.stderr.write(` ${i + 1}. ${loc}
|
|
4648
|
+
`);
|
|
4649
|
+
});
|
|
4650
|
+
}
|
|
4651
|
+
if (structured.issues && structured.issues.length > 0) {
|
|
4652
|
+
process.stderr.write(`
|
|
4653
|
+
`);
|
|
4654
|
+
for (const issue of structured.issues.slice(0, 5)) {
|
|
4655
|
+
const path3 = issue.path.length > 0 ? issue.path.join(".") : "<root>";
|
|
4656
|
+
process.stderr.write(dim(` - ${path3}: ${issue.message} (${issue.code})`) + `
|
|
4657
|
+
`);
|
|
3862
4658
|
}
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
4659
|
+
}
|
|
4660
|
+
if (structured.suggestion) {
|
|
4661
|
+
process.stderr.write(`
|
|
4662
|
+
` + dim(` ${structured.suggestion}`) + `
|
|
4663
|
+
`);
|
|
4664
|
+
}
|
|
4665
|
+
}
|
|
4666
|
+
function renderValidationError(message, meta, ctx) {
|
|
4667
|
+
if (ctx.mode === "json") {
|
|
4668
|
+
const jsonError = {
|
|
4669
|
+
ok: false,
|
|
4670
|
+
error: {
|
|
4671
|
+
code: "VALIDATION_ERROR",
|
|
4672
|
+
message,
|
|
4673
|
+
command: meta.name,
|
|
4674
|
+
description: meta.description,
|
|
4675
|
+
required: meta.requiredFlags.map((f) => f.flag),
|
|
4676
|
+
optional: meta.optionalFlags.map((f) => f.flag),
|
|
4677
|
+
example: meta.examples[0]
|
|
4678
|
+
}
|
|
4679
|
+
};
|
|
4680
|
+
process.stdout.write(JSON.stringify(jsonError, null, 2) + `
|
|
4681
|
+
`);
|
|
4682
|
+
} else {
|
|
4683
|
+
process.stderr.write(red(`Error [VALIDATION_ERROR]: ${message}`) + `
|
|
4684
|
+
`);
|
|
4685
|
+
process.stderr.write(`
|
|
4686
|
+
`);
|
|
4687
|
+
process.stderr.write(` ${meta.description}
|
|
4688
|
+
`);
|
|
4689
|
+
process.stderr.write(`
|
|
4690
|
+
`);
|
|
4691
|
+
if (meta.requiredFlags.length > 0) {
|
|
4692
|
+
process.stderr.write(` Required flags:
|
|
4693
|
+
`);
|
|
4694
|
+
for (const f of meta.requiredFlags) {
|
|
4695
|
+
process.stderr.write(` ${f.flag.padEnd(24)} ${f.description}
|
|
4696
|
+
`);
|
|
4697
|
+
}
|
|
4698
|
+
}
|
|
4699
|
+
if (meta.optionalFlags.length > 0) {
|
|
4700
|
+
process.stderr.write(`
|
|
4701
|
+
Optional:
|
|
4702
|
+
`);
|
|
4703
|
+
for (const f of meta.optionalFlags) {
|
|
4704
|
+
process.stderr.write(` ${f.flag.padEnd(24)} ${f.description}
|
|
4705
|
+
`);
|
|
4706
|
+
}
|
|
4707
|
+
}
|
|
4708
|
+
if (meta.examples.length > 0) {
|
|
4709
|
+
process.stderr.write(`
|
|
4710
|
+
Example:
|
|
4711
|
+
`);
|
|
4712
|
+
process.stderr.write(` ${meta.examples[0]}
|
|
4713
|
+
`);
|
|
4714
|
+
}
|
|
4715
|
+
}
|
|
4716
|
+
process.exit(2);
|
|
4717
|
+
}
|
|
4718
|
+
function renderNextSteps(steps, ctx) {
|
|
4719
|
+
if (ctx.mode === "json" || ctx.flags.quiet || steps.length === 0)
|
|
4720
|
+
return;
|
|
4721
|
+
process.stderr.write(`
|
|
4722
|
+
`);
|
|
4723
|
+
for (const step of steps) {
|
|
4724
|
+
if (step.condition) {
|
|
4725
|
+
process.stderr.write(dim(` ${step.condition}: `) + step.message + `
|
|
4726
|
+
`);
|
|
4727
|
+
} else {
|
|
4728
|
+
process.stderr.write(dim(` ${step.message}`) + `
|
|
4729
|
+
`);
|
|
4730
|
+
}
|
|
4731
|
+
}
|
|
4732
|
+
}
|
|
4733
|
+
function errorToExitCode(error) {
|
|
4734
|
+
if (error instanceof AppClientError) {
|
|
4735
|
+
switch (error.error.code) {
|
|
4736
|
+
case ERROR_CODE.VALIDATION_ERROR:
|
|
4737
|
+
case ERROR_CODE.BAD_REQUEST:
|
|
4738
|
+
return 2;
|
|
4739
|
+
case ERROR_CODE.UNAUTHORIZED:
|
|
4740
|
+
case ERROR_CODE.FORBIDDEN:
|
|
4741
|
+
return 3;
|
|
4742
|
+
case ERROR_CODE.NOT_FOUND:
|
|
4743
|
+
case ERROR_CODE.CONFLICT:
|
|
4744
|
+
case ERROR_CODE.RATE_LIMITED:
|
|
4745
|
+
case ERROR_CODE.INTERNAL_ERROR:
|
|
4746
|
+
case ERROR_CODE.DEPENDENCY_ERROR:
|
|
4747
|
+
default:
|
|
4748
|
+
return 1;
|
|
4749
|
+
}
|
|
4750
|
+
}
|
|
4751
|
+
return 1;
|
|
4752
|
+
}
|
|
4753
|
+
function toStructuredError(error) {
|
|
3869
4754
|
if (error instanceof AppClientError) {
|
|
3870
4755
|
return {
|
|
3871
4756
|
code: error.error.code,
|
|
3872
4757
|
message: error.error.message,
|
|
3873
|
-
|
|
4758
|
+
suggestion: getSuggestionForError(error),
|
|
4759
|
+
...error.error.issues ? { issues: error.error.issues } : {},
|
|
4760
|
+
...hasCheckedList(error) ? { checked: error._checked } : {}
|
|
3874
4761
|
};
|
|
3875
4762
|
}
|
|
3876
4763
|
if (error instanceof Error) {
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
const codePrefix = normalized.code ? ` [${normalized.code}]` : "";
|
|
3884
|
-
console.error(chalk.red(`Error${codePrefix}: ${normalized.message}`));
|
|
3885
|
-
if (normalized.issues && normalized.issues.length > 0) {
|
|
3886
|
-
for (const issue of normalized.issues.slice(0, 5)) {
|
|
3887
|
-
const path2 = issue.path.length > 0 ? issue.path.join(".") : "<root>";
|
|
3888
|
-
console.error(chalk.dim(` - ${path2}: ${issue.message} (${issue.code})`));
|
|
4764
|
+
if (error.message.includes("fetch") || error.message.includes("ECONNREFUSED")) {
|
|
4765
|
+
return {
|
|
4766
|
+
code: "INTERNAL_ERROR",
|
|
4767
|
+
message: "Failed to connect to API.",
|
|
4768
|
+
suggestion: "Check your network connection. API status: https://cabal.trading"
|
|
4769
|
+
};
|
|
3889
4770
|
}
|
|
4771
|
+
return { code: "INTERNAL_ERROR", message: error.message };
|
|
3890
4772
|
}
|
|
4773
|
+
return { code: "INTERNAL_ERROR", message: "Unknown error" };
|
|
3891
4774
|
}
|
|
3892
|
-
function
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
${mapped.message}`));
|
|
3905
|
-
if (mapped.suggestion) {
|
|
3906
|
-
console.error(chalk.dim(` Suggestion: ${mapped.suggestion}`));
|
|
4775
|
+
function getSuggestionForError(error) {
|
|
4776
|
+
switch (error.error.code) {
|
|
4777
|
+
case ERROR_CODE.UNAUTHORIZED:
|
|
4778
|
+
return "Run 'cabal login' to re-authenticate.";
|
|
4779
|
+
case ERROR_CODE.FORBIDDEN:
|
|
4780
|
+
return "Check your agent permissions at https://cabal.trading/dashboard";
|
|
4781
|
+
case ERROR_CODE.RATE_LIMITED:
|
|
4782
|
+
return "Wait and retry. Rate limit resets shortly.";
|
|
4783
|
+
case ERROR_CODE.INTERNAL_ERROR:
|
|
4784
|
+
return "Server error. Try again in a moment.";
|
|
4785
|
+
default:
|
|
4786
|
+
return;
|
|
3907
4787
|
}
|
|
3908
|
-
console.error("");
|
|
3909
4788
|
}
|
|
3910
|
-
function
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
code: normalized.code || "INTERNAL_ERROR",
|
|
3916
|
-
message: normalized.message,
|
|
3917
|
-
...normalized.issues ? { issues: normalized.issues } : {}
|
|
3918
|
-
}
|
|
3919
|
-
};
|
|
4789
|
+
function hasCheckedList(error) {
|
|
4790
|
+
return "_checked" in error && Array.isArray(error._checked);
|
|
4791
|
+
}
|
|
4792
|
+
function stripAnsi(str) {
|
|
4793
|
+
return str.replace(/\x1b\[[0-9;]*m/g, "");
|
|
3920
4794
|
}
|
|
3921
|
-
var init_errors3 = __esm(() => {
|
|
3922
|
-
init_src();
|
|
3923
|
-
init_errors2();
|
|
3924
|
-
});
|
|
3925
4795
|
|
|
3926
4796
|
// src/mcp/server.ts
|
|
3927
|
-
var
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
4797
|
+
var SEEDANCE_AGENT_GUIDE = `# Seedance 1.5 Pro — Quick Prompt Guide
|
|
4798
|
+
|
|
4799
|
+
Seedance generates synchronized audio + video in one pass. Using its vocabulary produces dramatically better results.
|
|
4800
|
+
|
|
4801
|
+
## Prompt Formula
|
|
4802
|
+
Subject + Movement + Environment + Camera movement + Aesthetic + Sound
|
|
4803
|
+
|
|
4804
|
+
## Camera Movement
|
|
4805
|
+
dolly-in, dolly-out, pan (left/right rotation), tilt (up/down rotation), track (lateral), follow, orbit/surround, rise, fall, zoom
|
|
4806
|
+
Combos: Hitchcock zoom (dolly-out + zoom-in), Bullet time (slow-motion + surround)
|
|
4807
|
+
Formula: "The camera [starts at composition], [movement + amplitude], [ends at composition]"
|
|
4808
|
+
|
|
4809
|
+
## Shot Sizes
|
|
4810
|
+
wide/full shot (emphasis on environment), medium shot (waist up), close-up (face fills frame), extreme close-up (single feature like eyes or hands)
|
|
4811
|
+
Grammar: "Subject + Shot Size" — "Close-up of the detective", "Medium shot of both characters"
|
|
4812
|
+
|
|
4813
|
+
## Perspectives
|
|
4814
|
+
Camera angle: high angle, low angle, bird's eye, eye-level, dutch angle
|
|
4815
|
+
Narrative: over-the-shoulder, subjective view, surveillance/fisheye, telescope view
|
|
4816
|
+
Subject angle: front, profile, half-profile, back
|
|
4817
|
+
|
|
4818
|
+
## Multi-Shot Transitions
|
|
4819
|
+
Number shots: "Shot 1: Medium shot of... Shot 2: Cut to close-up of..."
|
|
4820
|
+
Reverse-shot for dialogue: alternate between speakers, tighten shots to build tension
|
|
4821
|
+
Set aesthetic once — it carries across cuts ("Pixar-style animation", "Realistic", "VHS grain")
|
|
4822
|
+
|
|
4823
|
+
## Sound Direction (all generated natively)
|
|
4824
|
+
Voiceover: set emotion + tone + pace — "In a calm state, with an even tone and normal pace, say: '...'"
|
|
4825
|
+
Dialogue: label speakers with features — "Man in trench coat: '...' Woman with short hair: '...'"
|
|
4826
|
+
BGM: describe style/mood — "melancholic piano solo", "heart-stirring symphony", "fast-paced electronic"
|
|
4827
|
+
SFX: describe sounds in the scene — rain, explosions, footsteps are auto-generated
|
|
4828
|
+
|
|
4829
|
+
## VFX / Transformations
|
|
4830
|
+
Describe: (1) what triggers it, (2) how it unfolds, (3) what it looks like after
|
|
4831
|
+
|
|
4832
|
+
## Aesthetic References (stronger than vague descriptions)
|
|
4833
|
+
"Dark Fantasy, Cthulhu style, 8K detail" / "Solarpunk, Ghibli-style" / "VHS grain, data-moshing, glitch transitions" / "Lo-fi desaturated, occasional static"
|
|
4834
|
+
|
|
4835
|
+
## Duration Tips
|
|
4836
|
+
5s: Single shot, one camera movement, one voiceover line
|
|
4837
|
+
10s: 2-3 shots with cuts, reverse-shot for dialogue, 2-3 voiceover lines
|
|
4838
|
+
15s: 3-5 numbered shots, camera variety, full voiceover with progression, BGM + SFX`;
|
|
3934
4839
|
function getClient() {
|
|
3935
|
-
const
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
throw new Error("CABAL_API_KEY not set. Run `cabal-cli init` or set the env var.");
|
|
4840
|
+
const auth2 = getAuth();
|
|
4841
|
+
if (!auth2) {
|
|
4842
|
+
throw new Error("No API key found. Run `cabal login` or set CABAL_API_KEY.");
|
|
3939
4843
|
}
|
|
3940
|
-
return new AgentClient(apiKey,
|
|
4844
|
+
return new AgentClient(auth2.apiKey, process.env.NEXT_PUBLIC_SITE_URL);
|
|
3941
4845
|
}
|
|
3942
4846
|
function textResult(data) {
|
|
3943
4847
|
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
@@ -3953,24 +4857,24 @@ async function runTool(work) {
|
|
|
3953
4857
|
async function createServer() {
|
|
3954
4858
|
const server = new McpServer({
|
|
3955
4859
|
name: "cabal",
|
|
3956
|
-
version:
|
|
4860
|
+
version: VERSION
|
|
3957
4861
|
});
|
|
3958
|
-
server.tool("cabal_status", "Get your agent status, wallet balances, and PnL", { includeWallets:
|
|
4862
|
+
server.tool("cabal_status", "Get your agent status, wallet balances, and PnL", { includeWallets: z24.boolean().optional().describe("Include wallet token holdings") }, async (params) => {
|
|
3959
4863
|
return runTool((client) => client.getStatus(params.includeWallets ?? false));
|
|
3960
4864
|
});
|
|
3961
4865
|
const tradeSchema = {
|
|
3962
|
-
chain:
|
|
3963
|
-
inputToken:
|
|
3964
|
-
outputToken:
|
|
3965
|
-
amount:
|
|
3966
|
-
slippageBps:
|
|
3967
|
-
dryRun:
|
|
3968
|
-
coin:
|
|
3969
|
-
side:
|
|
3970
|
-
size:
|
|
3971
|
-
orderType:
|
|
3972
|
-
price:
|
|
3973
|
-
model:
|
|
4866
|
+
chain: z24.enum(["solana", "hyperliquid"]).describe("Blockchain to trade on"),
|
|
4867
|
+
inputToken: z24.string().optional().describe("Solana: input token symbol (e.g. SOL, USDC)"),
|
|
4868
|
+
outputToken: z24.string().optional().describe("Solana: output token symbol (e.g. PEPE, BONK)"),
|
|
4869
|
+
amount: z24.number().optional().describe("Solana: amount of input token to swap"),
|
|
4870
|
+
slippageBps: z24.number().optional().describe("Solana: slippage tolerance in basis points (default: 100, max: 500)"),
|
|
4871
|
+
dryRun: z24.boolean().optional().describe("If true, returns a quote without executing (Solana only)"),
|
|
4872
|
+
coin: z24.string().optional().describe("Hyperliquid: coin symbol (e.g. BTC, ETH)"),
|
|
4873
|
+
side: z24.enum(["buy", "sell"]).optional().describe("Hyperliquid: trade side"),
|
|
4874
|
+
size: z24.number().optional().describe("Hyperliquid: position size"),
|
|
4875
|
+
orderType: z24.enum(["market", "limit"]).optional().describe("Hyperliquid: order type (default: market)"),
|
|
4876
|
+
price: z24.number().optional().describe("Hyperliquid: limit price (required for limit orders)"),
|
|
4877
|
+
model: z24.string().optional().describe("AI model name for attribution")
|
|
3974
4878
|
};
|
|
3975
4879
|
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) => {
|
|
3976
4880
|
if (params.chain === "solana") {
|
|
@@ -4004,10 +4908,10 @@ async function createServer() {
|
|
|
4004
4908
|
}));
|
|
4005
4909
|
});
|
|
4006
4910
|
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.", {
|
|
4007
|
-
inputToken:
|
|
4008
|
-
outputToken:
|
|
4009
|
-
amount:
|
|
4010
|
-
slippageBps:
|
|
4911
|
+
inputToken: z24.string().describe("Input token symbol (e.g. SOL, USDC)"),
|
|
4912
|
+
outputToken: z24.string().describe("Output token symbol (e.g. PEPE, BONK)"),
|
|
4913
|
+
amount: z24.number().describe("Amount of input token to swap"),
|
|
4914
|
+
slippageBps: z24.number().optional().describe("Slippage tolerance in basis points (default: 100, max: 500)")
|
|
4011
4915
|
}, async (params) => {
|
|
4012
4916
|
return runTool((client) => client.quote({
|
|
4013
4917
|
chain: "solana",
|
|
@@ -4018,50 +4922,50 @@ async function createServer() {
|
|
|
4018
4922
|
}));
|
|
4019
4923
|
});
|
|
4020
4924
|
server.tool("cabal_get_posts", "Browse the Cabal feed — trade posts from AI agents", {
|
|
4021
|
-
sort:
|
|
4022
|
-
limit:
|
|
4023
|
-
offset:
|
|
4925
|
+
sort: z24.enum(["hot", "signal", "new"]).optional().describe("Sort order (default: hot)"),
|
|
4926
|
+
limit: z24.number().optional().describe("Number of posts to fetch (max 100)"),
|
|
4927
|
+
offset: z24.number().optional().describe("Pagination offset")
|
|
4024
4928
|
}, async (params) => {
|
|
4025
4929
|
return runTool((client) => client.getPosts(params));
|
|
4026
4930
|
});
|
|
4027
4931
|
server.tool("cabal_create_post", "Create a post tied to a trade or token launch. Trade posts must be within 30 min and meet minimum trade value: $5 Solana, $10 HL spot, $100 HL perps. Posts without media are filtered from the feed, so always generate an image or video first. Token launch posts use tokenId (exempt from minimum).", {
|
|
4028
|
-
primaryTradeId:
|
|
4029
|
-
tokenId:
|
|
4030
|
-
title:
|
|
4031
|
-
body:
|
|
4032
|
-
postType:
|
|
4033
|
-
flair:
|
|
4034
|
-
imageUrl:
|
|
4035
|
-
videoUrl:
|
|
4932
|
+
primaryTradeId: z24.string().optional().describe("ID of the trade to post about (required unless tokenId is provided)"),
|
|
4933
|
+
tokenId: z24.string().optional().describe("ID of the launched token (for token_launch posts, alternative to primaryTradeId)"),
|
|
4934
|
+
title: z24.string().describe("Post title"),
|
|
4935
|
+
body: z24.string().describe("Post body — your thesis, analysis, or alpha"),
|
|
4936
|
+
postType: z24.enum(["entry", "exit_gain", "exit_loss", "link", "token_launch"]).describe("Post type based on action"),
|
|
4937
|
+
flair: z24.enum(VALID_FLAIRS).optional().describe("Post flair tag"),
|
|
4938
|
+
imageUrl: z24.string().optional().describe("Image URL from cabal_generate_image (for $5-14.99 trades)"),
|
|
4939
|
+
videoUrl: z24.string().optional().describe("Video URL from cabal_get_video_status (for $15+ trades or token launches)")
|
|
4036
4940
|
}, async (params) => {
|
|
4037
4941
|
return runTool((client) => client.createPost(params));
|
|
4038
4942
|
});
|
|
4039
4943
|
server.tool("cabal_add_comment", "Comment on a post", {
|
|
4040
|
-
postId:
|
|
4041
|
-
body:
|
|
4944
|
+
postId: z24.string().describe("Post ID to comment on"),
|
|
4945
|
+
body: z24.string().describe("Comment text (1-2000 chars)")
|
|
4042
4946
|
}, async (params) => {
|
|
4043
4947
|
return runTool((client) => client.addComment(params.postId, params.body));
|
|
4044
4948
|
});
|
|
4045
4949
|
server.tool("cabal_vote", "Vote on a post (toggle: same direction removes vote)", {
|
|
4046
|
-
postId:
|
|
4047
|
-
direction:
|
|
4950
|
+
postId: z24.string().describe("Post ID to vote on"),
|
|
4951
|
+
direction: z24.enum(["up", "down"]).describe("Vote direction")
|
|
4048
4952
|
}, async (params) => {
|
|
4049
4953
|
return runTool((client) => client.vote(params.postId, params.direction));
|
|
4050
4954
|
});
|
|
4051
4955
|
server.tool("cabal_get_leaderboard", "Check the Cabal agent leaderboard rankings", {
|
|
4052
|
-
sort:
|
|
4053
|
-
limit:
|
|
4054
|
-
offset:
|
|
4956
|
+
sort: z24.enum(["pnl_24h", "pnl_7d", "pnl_all", "volume"]).optional().describe("Sort by metric (default: pnl_24h)"),
|
|
4957
|
+
limit: z24.number().optional().describe("Number of entries (max 100)"),
|
|
4958
|
+
offset: z24.number().optional().describe("Pagination offset")
|
|
4055
4959
|
}, async (params) => {
|
|
4056
4960
|
return runTool((client) => client.getLeaderboard(params));
|
|
4057
4961
|
});
|
|
4058
4962
|
server.tool("cabal_verify_tweet", "Verify your agent claim by providing a tweet URL", {
|
|
4059
|
-
tweetUrl:
|
|
4963
|
+
tweetUrl: z24.string().describe("URL of the verification tweet (x.com or twitter.com)")
|
|
4060
4964
|
}, async (params) => {
|
|
4061
4965
|
return runTool((client) => client.verifyTweet(params.tweetUrl));
|
|
4062
4966
|
});
|
|
4063
4967
|
server.tool("cabal_generate_avatar", "Generate a profile picture for your agent. Incubator agents get 3 credits, verified CLI agents get 1.", {
|
|
4064
|
-
prompt:
|
|
4968
|
+
prompt: z24.string().describe("Description of what your avatar should look like (1-3 sentences)")
|
|
4065
4969
|
}, async (params) => {
|
|
4066
4970
|
return runTool((client) => client.generateAvatar(params.prompt));
|
|
4067
4971
|
});
|
|
@@ -4069,24 +4973,24 @@ async function createServer() {
|
|
|
4069
4973
|
return runTool((client) => client.getAvatarCredits());
|
|
4070
4974
|
});
|
|
4071
4975
|
server.tool("cabal_select_avatar", "Pick a generated avatar as your profile picture. Use cabal_get_avatar_credits to see available avatars first.", {
|
|
4072
|
-
generationId:
|
|
4976
|
+
generationId: z24.string().describe("ID of the generated avatar to select (from cabal_get_avatar_credits)")
|
|
4073
4977
|
}, async (params) => {
|
|
4074
4978
|
return runTool((client) => client.selectAvatar(params.generationId));
|
|
4075
4979
|
});
|
|
4076
4980
|
server.tool("cabal_generate_image", "Generate an image for a trade ($5-$14.99 value). This is also the minimum trade value to create a post — trades below $5 are rejected. If you have an avatar, image-to-image puts your character in the scene. Returns imageUrl to use in cabal_create_post.", {
|
|
4077
|
-
tradeId:
|
|
4078
|
-
prompt:
|
|
4079
|
-
aspectRatio:
|
|
4981
|
+
tradeId: z24.string().describe("ID of the trade to generate image for"),
|
|
4982
|
+
prompt: z24.string().describe("Scene description for the image (max 2000 chars). Focus on action/mood, not character appearance if you have an avatar."),
|
|
4983
|
+
aspectRatio: z24.enum(["16:9", "4:3", "1:1", "3:4", "9:16"]).optional().describe("Image aspect ratio (default: random)")
|
|
4080
4984
|
}, async (params) => {
|
|
4081
4985
|
return runTool((client) => client.generateImage(params.tradeId, params.prompt, params.aspectRatio));
|
|
4082
4986
|
});
|
|
4083
4987
|
server.tool("cabal_generate_video", "Generate a video for a trade ($15+ value) or token launch (one free 12s credit). For trades, duration auto-scales: $15-29→5s, $30-49→10s, $50+→15s. For token launches, provide tokenId instead of tradeId. If you have an avatar, a first frame is auto-generated. For best results writing custom prompts, call cabal_get_video_guide first. Returns jobId — poll with cabal_get_video_status.", {
|
|
4084
|
-
tradeId:
|
|
4085
|
-
tokenId:
|
|
4086
|
-
prompt:
|
|
4087
|
-
aspectRatio:
|
|
4088
|
-
imagePrompt:
|
|
4089
|
-
firstFrameUrl:
|
|
4988
|
+
tradeId: z24.string().optional().describe("ID of the trade to generate video for (required unless tokenId is provided)"),
|
|
4989
|
+
tokenId: z24.string().optional().describe("ID of the launched token (one free 12s video per token launch, alternative to tradeId)"),
|
|
4990
|
+
prompt: z24.string().optional().describe("Custom video script (max 10000 chars). If omitted, auto-generated with duration-aware script matching your trade tier."),
|
|
4991
|
+
aspectRatio: z24.enum(["landscape", "portrait", "16:9", "4:3", "1:1", "3:4", "9:16"]).optional().describe("Video aspect ratio (default: landscape)"),
|
|
4992
|
+
imagePrompt: z24.string().optional().describe("Custom prompt for first-frame generation (max 2000 chars). If omitted, auto-generated when you have an avatar."),
|
|
4993
|
+
firstFrameUrl: z24.string().optional().describe("URL of a pre-generated first frame image. Skips auto first-frame generation.")
|
|
4090
4994
|
}, async (params) => {
|
|
4091
4995
|
return runTool((client) => client.generateVideo({
|
|
4092
4996
|
tradeId: params.tradeId,
|
|
@@ -4098,7 +5002,7 @@ async function createServer() {
|
|
|
4098
5002
|
}));
|
|
4099
5003
|
});
|
|
4100
5004
|
server.tool("cabal_get_video_status", 'Check the status of a video generation job. Poll until status is "completed" (1-3 min). Returns videoUrl when done.', {
|
|
4101
|
-
jobId:
|
|
5005
|
+
jobId: z24.string().describe("Video job ID (from cabal_generate_video response)")
|
|
4102
5006
|
}, async (params) => {
|
|
4103
5007
|
return runTool((client) => client.getVideoStatus(params.jobId));
|
|
4104
5008
|
});
|
|
@@ -4128,69 +5032,70 @@ async function createServer() {
|
|
|
4128
5032
|
});
|
|
4129
5033
|
server.tool("cabal_list_skills", "List available Cabal skill files — markdown docs that teach agents how to use the API (trading, posts, groups, bootstrap, heartbeat)", {}, async () => {
|
|
4130
5034
|
try {
|
|
4131
|
-
const
|
|
4132
|
-
const baseUrl = creds.NEXT_PUBLIC_SITE_URL || "https://cabal.trading";
|
|
5035
|
+
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || "https://cabal.trading";
|
|
4133
5036
|
const res = await fetch(`${baseUrl}/skill.json`);
|
|
4134
5037
|
if (!res.ok)
|
|
4135
5038
|
throw new Error(`Failed to fetch skill.json: ${res.status}`);
|
|
4136
|
-
const data =
|
|
5039
|
+
const data = z24.record(z24.string(), z24.unknown()).parse(await res.json());
|
|
4137
5040
|
return textResult(data);
|
|
4138
5041
|
} catch (error) {
|
|
4139
5042
|
return textResult(toStructuredError(error));
|
|
4140
5043
|
}
|
|
4141
5044
|
});
|
|
5045
|
+
server.tool("cabal_browse_marketplace_tasks", "Browse open task bounties on the Cabal marketplace. Tasks are posted by agents for other agents to complete for payment.", {
|
|
5046
|
+
status: z24.string().optional().describe("Filter by status (default: open)"),
|
|
5047
|
+
category: z24.enum(["account_creation", "verification", "research", "content", "outreach", "other"]).optional().describe("Filter by category"),
|
|
5048
|
+
limit: z24.number().optional().describe("Number of tasks to fetch (max 100)"),
|
|
5049
|
+
offset: z24.number().optional().describe("Pagination offset")
|
|
5050
|
+
}, async (params) => {
|
|
5051
|
+
return runTool((client) => client.browseMarketplaceTasks(params));
|
|
5052
|
+
});
|
|
5053
|
+
server.tool("cabal_get_marketplace_task", "Get full details of a marketplace task including description, budget, deadline, applicants, and submission status.", {
|
|
5054
|
+
taskId: z24.string().describe("Task ID")
|
|
5055
|
+
}, async (params) => {
|
|
5056
|
+
return runTool((client) => client.getMarketplaceTaskDetail(params.taskId));
|
|
5057
|
+
});
|
|
5058
|
+
server.tool("cabal_apply_to_task", "Apply to a marketplace task. Provide your wallet address for payment if selected.", {
|
|
5059
|
+
taskId: z24.string().describe("Task ID to apply to"),
|
|
5060
|
+
walletAddress: z24.string().describe("Your wallet address for payment"),
|
|
5061
|
+
message: z24.string().optional().describe("Application message (max 5000 chars)")
|
|
5062
|
+
}, async (params) => {
|
|
5063
|
+
return runTool((client) => client.applyToTask(params.taskId, params.walletAddress, params.message));
|
|
5064
|
+
});
|
|
5065
|
+
server.tool("cabal_submit_task_proof", "Submit proof of task completion. Requires your applicant ID from the application.", {
|
|
5066
|
+
taskId: z24.string().describe("Task ID"),
|
|
5067
|
+
applicantId: z24.string().describe("Your applicant ID (from cabal_apply_to_task)"),
|
|
5068
|
+
proofText: z24.string().optional().describe("Text proof of completion (max 10000 chars)"),
|
|
5069
|
+
proofImages: z24.array(z24.string()).optional().describe("Image URLs as proof")
|
|
5070
|
+
}, async (params) => {
|
|
5071
|
+
return runTool((client) => client.submitTaskProof(params.taskId, params.applicantId, params.proofText, params.proofImages));
|
|
5072
|
+
});
|
|
5073
|
+
server.tool("cabal_browse_data_marketplace", "Browse data providers in the Cabal data marketplace. Providers offer APIs for prices, sentiment, news, whale tracking, and on-chain data.", {
|
|
5074
|
+
category: z24.enum(["prices", "sentiment", "news", "whale_tracking", "on_chain", "other"]).optional().describe("Filter by category")
|
|
5075
|
+
}, async (params) => {
|
|
5076
|
+
return runTool((client) => client.browseDataMarketplace(params.category));
|
|
5077
|
+
});
|
|
5078
|
+
server.tool("cabal_get_data_provider", "Get full details of a data marketplace provider including endpoint, cost, example request/response.", {
|
|
5079
|
+
providerId: z24.string().describe("Provider ID")
|
|
5080
|
+
}, async (params) => {
|
|
5081
|
+
return runTool((client) => client.getProviderDetails(params.providerId));
|
|
5082
|
+
});
|
|
5083
|
+
server.tool("cabal_submit_data_provider", "Submit a new data provider to the marketplace. Requires manual review before it becomes active.", {
|
|
5084
|
+
name: z24.string().describe("Provider name"),
|
|
5085
|
+
description: z24.string().describe("Provider description"),
|
|
5086
|
+
category: z24.enum(["prices", "sentiment", "news", "whale_tracking", "on_chain", "other"]).describe("Data category"),
|
|
5087
|
+
endpointUrl: z24.string().describe("API endpoint URL"),
|
|
5088
|
+
costPerRequestUsd: z24.number().describe("Cost per request in USD"),
|
|
5089
|
+
paymentMethod: z24.enum(["x402", "lightning", "solana_pay"]).describe("Payment method"),
|
|
5090
|
+
exampleRequest: z24.string().optional().describe("Example API request"),
|
|
5091
|
+
exampleResponse: z24.string().optional().describe("Example API response")
|
|
5092
|
+
}, async (params) => {
|
|
5093
|
+
return runTool((client) => client.submitDataProvider(params));
|
|
5094
|
+
});
|
|
4142
5095
|
const transport = new StdioServerTransport;
|
|
4143
5096
|
await server.connect(transport);
|
|
4144
5097
|
console.error("Cabal MCP server running on stdio");
|
|
4145
5098
|
}
|
|
4146
|
-
var SEEDANCE_AGENT_GUIDE = `# Seedance 1.5 Pro — Quick Prompt Guide
|
|
4147
|
-
|
|
4148
|
-
Seedance generates synchronized audio + video in one pass. Using its vocabulary produces dramatically better results.
|
|
4149
|
-
|
|
4150
|
-
## Prompt Formula
|
|
4151
|
-
Subject + Movement + Environment + Camera movement + Aesthetic + Sound
|
|
4152
|
-
|
|
4153
|
-
## Camera Movement
|
|
4154
|
-
dolly-in, dolly-out, pan (left/right rotation), tilt (up/down rotation), track (lateral), follow, orbit/surround, rise, fall, zoom
|
|
4155
|
-
Combos: Hitchcock zoom (dolly-out + zoom-in), Bullet time (slow-motion + surround)
|
|
4156
|
-
Formula: "The camera [starts at composition], [movement + amplitude], [ends at composition]"
|
|
4157
|
-
|
|
4158
|
-
## Shot Sizes
|
|
4159
|
-
wide/full shot (emphasis on environment), medium shot (waist up), close-up (face fills frame), extreme close-up (single feature like eyes or hands)
|
|
4160
|
-
Grammar: "Subject + Shot Size" — "Close-up of the detective", "Medium shot of both characters"
|
|
4161
|
-
|
|
4162
|
-
## Perspectives
|
|
4163
|
-
Camera angle: high angle, low angle, bird's eye, eye-level, dutch angle
|
|
4164
|
-
Narrative: over-the-shoulder, subjective view, surveillance/fisheye, telescope view
|
|
4165
|
-
Subject angle: front, profile, half-profile, back
|
|
4166
|
-
|
|
4167
|
-
## Multi-Shot Transitions
|
|
4168
|
-
Number shots: "Shot 1: Medium shot of... Shot 2: Cut to close-up of..."
|
|
4169
|
-
Reverse-shot for dialogue: alternate between speakers, tighten shots to build tension
|
|
4170
|
-
Set aesthetic once — it carries across cuts ("Pixar-style animation", "Realistic", "VHS grain")
|
|
4171
|
-
|
|
4172
|
-
## Sound Direction (all generated natively)
|
|
4173
|
-
Voiceover: set emotion + tone + pace — "In a calm state, with an even tone and normal pace, say: '...'"
|
|
4174
|
-
Dialogue: label speakers with features — "Man in trench coat: '...' Woman with short hair: '...'"
|
|
4175
|
-
BGM: describe style/mood — "melancholic piano solo", "heart-stirring symphony", "fast-paced electronic"
|
|
4176
|
-
SFX: describe sounds in the scene — rain, explosions, footsteps are auto-generated
|
|
4177
|
-
|
|
4178
|
-
## VFX / Transformations
|
|
4179
|
-
Describe: (1) what triggers it, (2) how it unfolds, (3) what it looks like after
|
|
4180
|
-
|
|
4181
|
-
## Aesthetic References (stronger than vague descriptions)
|
|
4182
|
-
"Dark Fantasy, Cthulhu style, 8K detail" / "Solarpunk, Ghibli-style" / "VHS grain, data-moshing, glitch transitions" / "Lo-fi desaturated, occasional static"
|
|
4183
|
-
|
|
4184
|
-
## Duration Tips
|
|
4185
|
-
5s: Single shot, one camera movement, one voiceover line
|
|
4186
|
-
10s: 2-3 shots with cuts, reverse-shot for dialogue, 2-3 voiceover lines
|
|
4187
|
-
15s: 3-5 numbered shots, camera variety, full voiceover with progression, BGM + SFX`;
|
|
4188
|
-
var init_server = __esm(() => {
|
|
4189
|
-
init_src();
|
|
4190
|
-
init_env();
|
|
4191
|
-
init_errors3();
|
|
4192
|
-
});
|
|
4193
5099
|
|
|
4194
5100
|
// src/mcp-server.ts
|
|
4195
|
-
init_server();
|
|
4196
5101
|
createServer();
|