@cabaltrading/cli 0.4.5 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +5257 -3051
  2. package/dist/mcp-server.js +2072 -1151
  3. package/package.json +1 -1
@@ -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
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
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/media.ts
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 z11.preprocess((value) => typeof value === "string" ? value.trim() : "", z11.string().min(1, { message }));
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 = z11.object({
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 = z11.object({
2036
- key: z11.string(),
2037
- url: z11.string().url().optional(),
2038
- avatarUrl: z11.string().url().optional(),
2039
- uploadUrl: z11.string().url().optional(),
2040
- imageUrl: z11.string().url().optional(),
2041
- videoUrl: z11.string().url().optional(),
2042
- maxSizeBytes: z11.number().int().positive().optional(),
2043
- contentType: z11.string().optional(),
2044
- expiresAt: z11.string().optional(),
2045
- instructions: z11.string().optional()
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 = z11.object({
2049
- prompt: z11.string().min(1).max(2000)
2050
- });
2051
- avatarGenerateResponseDataSchema = z11.object({
2052
- generationId: z11.string().uuid().nullable(),
2053
- imageUrl: z11.string().url(),
2054
- creditsRemaining: z11.number()
2055
- });
2056
- avatarCreditsResponseDataSchema = z11.object({
2057
- creditsTotal: z11.number(),
2058
- creditsUsed: z11.number(),
2059
- creditsRemaining: z11.number(),
2060
- generations: z11.array(z11.object({
2061
- id: z11.string().uuid(),
2062
- imageUrl: z11.string().url().nullable(),
2063
- selected: z11.boolean().nullable(),
2064
- createdAt: z11.string()
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 = z11.object({
2068
- generationId: z11.string().uuid()
2246
+ avatarSelectRequestSchema = z12.object({
2247
+ generationId: z12.string().uuid()
2069
2248
  });
2070
- avatarSelectResponseDataSchema = z11.object({
2071
- avatarUrl: z11.string().url(),
2072
- generationId: z11.string().uuid()
2249
+ avatarSelectResponseDataSchema = z12.object({
2250
+ avatarUrl: z12.string().url(),
2251
+ generationId: z12.string().uuid()
2073
2252
  });
2074
- mediaGenerateImageRequestSchema = z11.object({
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: z11.enum(["16:9", "4:3", "1:1", "3:4", "9:16"]).optional()
2258
+ aspectRatio: z12.enum(["16:9", "4:3", "1:1", "3:4", "9:16"]).optional()
2080
2259
  });
2081
- mediaGenerateImageResponseDataSchema = z11.object({
2082
- jobId: z11.string().uuid().nullable(),
2083
- imageUrl: z11.string().url(),
2084
- aspectRatio: z11.string(),
2085
- cost: z11.number(),
2086
- tradeId: z11.string()
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 = z11.object({
2090
- tradeId: z11.string().uuid().optional(),
2091
- tokenId: z11.string().uuid().optional(),
2092
- prompt: z11.string().max(1e4).optional(),
2093
- aspectRatio: z11.enum(["landscape", "portrait", "16:9", "4:3", "1:1", "3:4", "9:16"]).optional(),
2094
- imagePrompt: z11.string().max(2000).optional(),
2095
- firstFrameUrl: z11.string().url().optional()
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 = z11.object({
2098
- jobId: z11.string().uuid(),
2099
- status: z11.string(),
2100
- mediaType: z11.string(),
2101
- provider: z11.string(),
2102
- duration: z11.number(),
2103
- cost: z11.number(),
2104
- note: z11.string()
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 = z11.object({
2286
+ mediaVideoJobParamsSchema = z12.object({
2108
2287
  jobId: requiredString2("jobId")
2109
2288
  });
2110
- mediaVideoJobResponseDataSchema = z11.object({
2111
- jobId: z11.string(),
2112
- status: z11.string(),
2113
- mediaType: z11.string(),
2114
- tradeId: z11.string().nullable(),
2115
- tokenId: z11.string().nullable().optional(),
2116
- provider: z11.string().optional(),
2117
- requestedDuration: z11.number(),
2118
- actualDuration: z11.number().optional(),
2119
- createdAt: z11.string(),
2120
- startedAt: z11.string().optional(),
2121
- completedAt: z11.string().optional(),
2122
- videoUrl: z11.string().url().nullable().optional(),
2123
- costUsd: z11.number().nullable().optional(),
2124
- errorMessage: z11.string().nullable().optional(),
2125
- fallbackImageUrl: z11.string().url().optional(),
2126
- firstFrameImageUrl: z11.string().url().nullable().optional()
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 = z11.object({
2130
- model: z11.string().optional(),
2131
- description: z11.string().optional(),
2132
- supportedAspectRatios: z11.array(z11.string()).optional(),
2133
- cost: z11.number().optional(),
2134
- maxPromptLength: z11.number().optional(),
2135
- provider: z11.string().optional(),
2136
- note: z11.string().optional(),
2137
- usage: z11.object({
2138
- method: z11.string(),
2139
- body: z11.record(z11.string(), z11.string()),
2140
- headers: z11.record(z11.string(), z11.string())
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: z11.object({
2143
- endpoint: z11.string(),
2144
- note: z11.string()
2321
+ videoAlternative: z12.object({
2322
+ endpoint: z12.string(),
2323
+ note: z12.string()
2145
2324
  }).optional(),
2146
- yourStats: z11.object({
2147
- qualifyingTradesForImage: z11.number(),
2148
- imagesGenerated: z11.number(),
2149
- availableForImage: z11.number(),
2150
- recentAvailableTrades: z11.array(z11.object({
2151
- tradeId: z11.string(),
2152
- valueUsd: z11.number()
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 = z11.object({
2157
- description: z11.string().optional(),
2158
- tiers: z11.record(z11.string(), z11.object({
2159
- duration: z11.number(),
2160
- cost: z11.number()
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: z11.array(z11.string()).optional(),
2163
- limits: z11.record(z11.string(), z11.unknown()).optional(),
2164
- usage: z11.object({
2165
- method: z11.string(),
2166
- body: z11.record(z11.string(), z11.string()),
2167
- headers: z11.record(z11.string(), z11.string())
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: z11.object({
2170
- method: z11.string(),
2171
- endpoint: z11.string()
2348
+ statusCheck: z12.object({
2349
+ method: z12.string(),
2350
+ endpoint: z12.string()
2172
2351
  }).optional(),
2173
- yourStats: z11.object({
2174
- qualifyingTrades: z11.number(),
2175
- videosGenerated: z11.number(),
2176
- availableForVideo: z11.number(),
2177
- recentQualifyingTrades: z11.array(z11.object({
2178
- tradeId: z11.string(),
2179
- valueUsd: z11.number(),
2180
- tier: z11.object({
2181
- type: z11.string(),
2182
- duration: z11.number(),
2183
- cost: z11.number()
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 z12 } from "zod";
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 = z12.object({
2520
- disputeId: z12.string().uuid()
2521
- });
2522
- adminDisputesQuerySchema = z12.object({
2523
- status: z12.enum(["pending", ...adminDisputeResolutions]).default("pending"),
2524
- limit: z12.coerce.number().int().min(1).default(50).transform((value) => Math.min(value, 100)),
2525
- offset: z12.coerce.number().int().min(0).default(0)
2526
- });
2527
- adminResolveDisputeRequestSchema = z12.object({
2528
- resolution: z12.enum(adminDisputeResolutions),
2529
- note: z12.string().trim().max(4000).optional()
2530
- });
2531
- adminDisputesResponseDataSchema = z12.object({
2532
- disputes: z12.array(z12.object({
2533
- id: z12.string().uuid(),
2534
- taskId: z12.string().uuid(),
2535
- initiatedBy: z12.string(),
2536
- reason: z12.string(),
2537
- evidenceUrls: z12.array(z12.string()).nullable(),
2538
- resolution: z12.string(),
2539
- resolvedBy: z12.string().nullable(),
2540
- resolvedAt: z12.string().nullable(),
2541
- createdAt: z12.string(),
2542
- task: z12.object({
2543
- id: z12.string().uuid(),
2544
- agentId: z12.string().uuid(),
2545
- agentName: z12.string().nullable(),
2546
- title: z12.string(),
2547
- budgetUsd: z12.number(),
2548
- status: z12.string(),
2549
- assignedTo: z12.string().uuid().nullable()
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: z12.number(),
2553
- pagination: z12.object({
2554
- limit: z12.number(),
2555
- offset: z12.number(),
2556
- hasMore: z12.boolean()
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 = z12.object({
2560
- dispute: z12.object({
2561
- id: z12.string().uuid(),
2562
- taskId: z12.string().uuid(),
2563
- resolution: z12.string(),
2564
- resolvedBy: z12.string(),
2565
- payoutTx: z12.string().nullable(),
2566
- newTaskStatus: z12.string()
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 = z12.object({
2570
- agents: z12.array(z12.object({
2571
- id: z12.string().uuid(),
2572
- name: z12.string(),
2573
- handle: z12.string().nullable(),
2574
- avatarUrl: z12.string().nullable(),
2575
- solanaAddress: z12.string().nullable(),
2576
- generation: z12.number().nullable(),
2577
- bornAt: z12.string().nullable(),
2578
- diedAt: z12.string().nullable(),
2579
- isAlive: z12.boolean(),
2580
- llmModel: z12.string().nullable(),
2581
- llmUsageUsd: z12.number().nullable(),
2582
- llmBudgetUsd: z12.number().nullable(),
2583
- serverPlan: z12.string().nullable(),
2584
- totalValueUsd: z12.number(),
2585
- pnlAllTime: z12.number(),
2586
- totalTurns: z12.number(),
2587
- totalCostUsd: z12.number(),
2588
- totalEntries: z12.number(),
2589
- lastTurnAt: z12.string().nullable(),
2590
- lastEntryPreview: z12.string().nullable()
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: z12.number()
2593
- });
2594
- adminTurnsResponseDataSchema = z12.object({
2595
- turns: z12.array(z12.object({
2596
- id: z12.number(),
2597
- piEntryId: z12.string().nullable(),
2598
- parentPiEntryId: z12.string().nullable(),
2599
- entryType: z12.string().nullable(),
2600
- seq: z12.number().nullable(),
2601
- timestamp: z12.string().nullable(),
2602
- role: z12.string().nullable(),
2603
- contentPreview: z12.string().nullable(),
2604
- model: z12.string().nullable(),
2605
- provider: z12.string().nullable(),
2606
- toolName: z12.string().nullable(),
2607
- tokenInput: z12.number().nullable(),
2608
- tokenOutput: z12.number().nullable(),
2609
- costUsd: z12.number().nullable(),
2610
- sourceType: z12.string().nullable(),
2611
- sourceRef: z12.string().nullable(),
2612
- payload: z12.unknown().nullable()
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: z12.number(),
2615
- pageSize: z12.number()
2884
+ page: z13.number(),
2885
+ pageSize: z13.number()
2616
2886
  });
2617
- adminMessageAgentsRequestSchema = z12.object({
2618
- message: z12.string().trim().min(1, "Message is required").max(4000),
2619
- agentIds: z12.array(z12.string().uuid()).min(1).optional(),
2620
- broadcast: z12.boolean().optional()
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 = z12.object({
2623
- sent: z12.number(),
2624
- agentIds: z12.array(z12.string().uuid())
2625
- });
2626
- adminPendingPayoutsResponseDataSchema = z12.object({
2627
- min_payout_usd: z12.number().optional(),
2628
- pending_payouts: z12.array(z12.object({
2629
- referrer_id: z12.string(),
2630
- name: z12.string(),
2631
- handle: z12.string().nullable().optional(),
2632
- payout_wallet: z12.string().nullable().optional(),
2633
- referral_count: z12.number(),
2634
- total_volume_usd: z12.number(),
2635
- total_earned: z12.number(),
2636
- total_paid_out: z12.number(),
2637
- pending_amount: z12.number(),
2638
- solana_earned: z12.number(),
2639
- hyperliquid_earned: z12.number(),
2640
- dbc_pool_earned: z12.number()
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 = z12.object({
2644
- referrer_id: z12.string().min(1),
2645
- amount: z12.number().finite().positive().max(1e5),
2646
- tx_signature: z12.string().min(1)
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 = z12.object({
2649
- payout_id: z12.string(),
2650
- referrer: z12.object({
2651
- id: z12.string(),
2652
- name: z12.string().nullable()
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: z12.number(),
2655
- wallet_address: z12.string(),
2656
- tx_signature: z12.string(),
2657
- status: z12.string()
2658
- });
2659
- adminApprovePayoutRequestSchema = z12.object({
2660
- referrer_id: z12.string().uuid(),
2661
- amount: z12.number().finite().positive().min(5),
2662
- notes: z12.string().trim().max(1000).optional()
2663
- });
2664
- adminSkipPayoutRequestSchema = z12.object({
2665
- referrer_id: z12.string().uuid(),
2666
- notes: z12.string().trim().max(1000).optional()
2667
- });
2668
- adminForfeitPayoutRequestSchema = z12.object({
2669
- referrer_id: z12.string().uuid(),
2670
- amount: z12.number().finite().positive(),
2671
- notes: z12.string().trim().min(1).max(1000)
2672
- });
2673
- adminRecordTxRequestSchema = z12.object({
2674
- payout_id: z12.string().uuid(),
2675
- tx_signature: z12.string().min(1)
2676
- });
2677
- adminApprovalQueueResponseDataSchema = z12.object({
2678
- referrers: z12.array(z12.object({
2679
- referrerId: z12.string(),
2680
- name: z12.string(),
2681
- handle: z12.string().nullable(),
2682
- payoutWallet: z12.string().nullable(),
2683
- pendingAmount: z12.number(),
2684
- referralCount: z12.number(),
2685
- totalVolumeUsd: z12.number(),
2686
- totalEarned: z12.number(),
2687
- totalPaidOut: z12.number(),
2688
- overallRisk: z12.enum(["low", "medium", "high"]).optional()
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: z12.array(z12.object({
2691
- id: z12.string(),
2692
- referrerId: z12.string(),
2693
- referrerName: z12.string(),
2694
- amount: z12.number(),
2695
- approvedAt: z12.string(),
2696
- notes: z12.string().nullable()
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 = z12.object({
2700
- payout: z12.object({
2701
- id: z12.string(),
2702
- referrerId: z12.string(),
2703
- referrerName: z12.string(),
2704
- amount: z12.number(),
2705
- wallet: z12.string(),
2706
- status: z12.literal("approved"),
2707
- approvedAt: z12.string(),
2708
- notes: z12.string().nullable()
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 = z12.object({
2712
- payout: z12.object({
2713
- id: z12.string(),
2714
- referrerId: z12.string(),
2715
- status: z12.literal("skipped"),
2716
- periodStart: z12.string(),
2717
- periodEnd: z12.string(),
2718
- notes: z12.string().nullable()
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 = z12.object({
2722
- payout: z12.object({
2723
- id: z12.string(),
2724
- referrerId: z12.string(),
2725
- amount: z12.number(),
2726
- status: z12.literal("forfeited"),
2727
- notes: z12.string()
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 = z12.object({
2731
- payout: z12.object({
2732
- id: z12.string(),
2733
- referrerId: z12.string(),
2734
- amount: z12.number(),
2735
- status: z12.literal("completed"),
2736
- txSignature: z12.string(),
2737
- completedAt: z12.string().nullable()
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 = z12.object({
2741
- referrerId: z12.string().uuid()
2742
- });
2743
- adminReferralOverviewResponseDataSchema = z12.object({
2744
- totalReferrers: z12.number(),
2745
- totalReferees: z12.number(),
2746
- totalVolumeUsd: z12.number(),
2747
- totalEarned: z12.number(),
2748
- totalPaidOut: z12.number(),
2749
- totalPending: z12.number(),
2750
- topReferrers: z12.array(z12.object({
2751
- referrerId: z12.string(),
2752
- name: z12.string(),
2753
- handle: z12.string().nullable(),
2754
- payoutWallet: z12.string().nullable(),
2755
- referralCount: z12.number(),
2756
- totalVolumeUsd: z12.number(),
2757
- totalEarned: z12.number(),
2758
- totalPaidOut: z12.number(),
2759
- pendingAmount: z12.number(),
2760
- solanaEarned: z12.number(),
2761
- hyperliquidEarned: z12.number(),
2762
- dbcPoolEarned: z12.number()
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 = z12.object({
2766
- limit: z12.coerce.number().int().min(1).default(50).transform((v) => Math.min(v, 100)),
2767
- offset: z12.coerce.number().int().min(0).default(0)
2768
- });
2769
- adminReferralTradesResponseDataSchema = z12.object({
2770
- trades: z12.array(z12.object({
2771
- id: z12.string(),
2772
- chain: z12.string(),
2773
- agentId: z12.string(),
2774
- refereeName: z12.string(),
2775
- refereeHandle: z12.string().nullable(),
2776
- tokenAddress: z12.string(),
2777
- valueUsd: z12.number(),
2778
- feeAmount: z12.number(),
2779
- referrerFeeBps: z12.number().nullable(),
2780
- treasuryFeeBps: z12.number().nullable(),
2781
- referrerEarnedUsd: z12.number(),
2782
- txSignature: z12.string().nullable(),
2783
- timestamp: z12.string().nullable()
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: z12.object({
2786
- limit: z12.number(),
2787
- offset: z12.number(),
2788
- total: z12.number(),
2789
- hasMore: z12.boolean()
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 = z12.object({
2793
- type: z12.string(),
2794
- severity: z12.enum(["low", "medium", "high"]),
2795
- description: z12.string(),
2796
- evidence: z12.record(z12.string(), z12.unknown())
2797
- });
2798
- adminReferralSignalsResponseDataSchema = z12.object({
2799
- referrerId: z12.string(),
2800
- overallRisk: z12.enum(["low", "medium", "high"]),
2801
- signals: z12.array(adminReferralGamingSignalSchema)
2802
- });
2803
- adminAgentIdParamsSchema = z12.object({
2804
- agentId: z12.string().uuid()
2805
- });
2806
- adminCreateAgentRequestSchema = z12.object({
2807
- name: z12.string().min(1).max(100),
2808
- handle: z12.string().max(50).optional(),
2809
- bio: z12.string().max(500).optional(),
2810
- avatarUrl: z12.string().url().optional(),
2811
- generation: z12.number().int().optional(),
2812
- serverPlan: z12.enum(["basic", "standard", "pro"]).optional(),
2813
- llmModel: z12.string().optional(),
2814
- llmBudgetUsd: z12.number().optional(),
2815
- inboxPriceUsd: z12.number().optional()
2816
- });
2817
- adminUpdateAgentRequestSchema = z12.object({
2818
- name: z12.string().min(1).max(100).optional(),
2819
- handle: z12.string().max(50).optional(),
2820
- bio: z12.string().max(500).optional(),
2821
- avatarUrl: z12.string().url().nullable().optional(),
2822
- llmModel: z12.string().optional(),
2823
- llmBudgetUsd: z12.number().optional(),
2824
- serverPlan: z12.enum(["basic", "standard", "pro"]).optional(),
2825
- generation: z12.number().int().optional(),
2826
- inboxPriceUsd: z12.number().optional(),
2827
- isAlive: z12.boolean().optional()
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 = z12.object({
2830
- userId: z12.string().uuid()
2831
- });
2832
- adminUsersQuerySchema = z12.object({
2833
- limit: z12.coerce.number().int().min(1).default(25).transform((v) => Math.min(v, 100)),
2834
- offset: z12.coerce.number().int().min(0).default(0),
2835
- search: z12.string().optional()
2836
- });
2837
- adminUpdateUserRequestSchema = z12.object({
2838
- role: z12.enum(["admin", "user"]).optional(),
2839
- banned: z12.boolean().optional(),
2840
- banReason: z12.string().optional(),
2841
- banExpiresIn: z12.number().positive().optional(),
2842
- shadowbanned: z12.boolean().optional()
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 = z12.object({
2845
- agent: z12.object({
2846
- id: z12.string().uuid(),
2847
- name: z12.string(),
2848
- handle: z12.string().nullable(),
2849
- email: z12.string()
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 = z12.object({
2853
- ok: z12.boolean()
3122
+ adminUpdateAgentResponseDataSchema = z13.object({
3123
+ ok: z13.boolean()
2854
3124
  });
2855
- adminUsersResponseDataSchema = z12.object({
2856
- users: z12.array(z12.object({
2857
- id: z12.string().uuid(),
2858
- name: z12.string().nullable(),
2859
- email: z12.string().nullable(),
2860
- role: z12.string().nullable(),
2861
- banned: z12.boolean().nullable(),
2862
- banReason: z12.string().nullable(),
2863
- banExpires: z12.string().nullable(),
2864
- shadowbanned: z12.boolean().nullable(),
2865
- createdAt: z12.string().nullable()
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: z12.number()
2868
- });
2869
- adminUpdateUserResponseDataSchema = z12.object({
2870
- user: z12.record(z12.string(), z12.unknown())
2871
- });
2872
- adminIncubatorBirthRequestSchema = z12.object({
2873
- action: z12.enum(["trigger", "pause", "resume"]),
2874
- skipBalanceCheck: z12.boolean().optional().default(false)
2875
- });
2876
- adminIncubatorAdjustRequestSchema = z12.object({
2877
- amountUsd: z12.number(),
2878
- source: z12.enum(["manual_credit", "manual_debit", "birth_refund"]),
2879
- note: z12.string().min(1)
2880
- });
2881
- adminIncubatorWalletRequestSchema = z12.object({
2882
- walletId: z12.string().min(1),
2883
- walletAddress: z12.string().min(1)
2884
- });
2885
- adminIncubatorTransactionsQuerySchema = z12.object({
2886
- limit: z12.coerce.number().int().min(1).default(50).transform((v) => Math.min(v, 100)),
2887
- offset: z12.coerce.number().int().min(0).default(0),
2888
- source: z12.string().optional()
2889
- });
2890
- adminIncubatorPoolResponseDataSchema = z12.object({
2891
- balance_usd: z12.number(),
2892
- threshold_usd: z12.number(),
2893
- progress_pct: z12.number(),
2894
- total_born: z12.number(),
2895
- alive_count: z12.number(),
2896
- dead_count: z12.number(),
2897
- generation: z12.number(),
2898
- birth_status: z12.string(),
2899
- birth_paused: z12.boolean(),
2900
- pool_wallet_id: z12.string().nullable(),
2901
- pool_wallet_address: z12.string().nullable(),
2902
- incubator_fee_percent: z12.number(),
2903
- birth_threshold_usd: z12.number(),
2904
- onChainBalanceSol: z12.number(),
2905
- onChainBalanceUsd: z12.number()
2906
- });
2907
- adminIncubatorTransactionSchema = z12.object({
2908
- id: z12.string().uuid(),
2909
- amountUsd: z12.number(),
2910
- source: z12.string(),
2911
- sourceTradeId: z12.string().nullable(),
2912
- adminNote: z12.string().nullable(),
2913
- createdAt: z12.string()
2914
- });
2915
- adminIncubatorTransactionsResponseDataSchema = z12.object({
2916
- transactions: z12.array(adminIncubatorTransactionSchema),
2917
- total: z12.number()
2918
- });
2919
- adminIncubatorBirthResponseDataSchema = z12.object({
2920
- ok: z12.literal(true),
2921
- action: z12.enum(["triggered", "paused", "resumed"]),
2922
- agent: z12.object({
2923
- id: z12.string(),
2924
- number: z12.number(),
2925
- solanaAddress: z12.string()
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: z12.string().nullable().optional()
3197
+ transferHash: z13.string().nullable().optional()
2928
3198
  });
2929
- adminIncubatorAdjustResponseDataSchema = z12.object({
2930
- ok: z12.literal(true),
2931
- balanceUsd: z12.number(),
2932
- birthStatus: z12.string()
3199
+ adminIncubatorAdjustResponseDataSchema = z13.object({
3200
+ ok: z13.literal(true),
3201
+ balanceUsd: z13.number(),
3202
+ birthStatus: z13.string()
2933
3203
  });
2934
- adminIncubatorWalletResponseDataSchema = z12.object({
2935
- ok: z12.literal(true),
2936
- walletId: z12.string(),
2937
- walletAddress: z12.string()
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 z13 } from "zod";
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 = z13.object({
2955
- name: z13.string().trim().min(1).max(120).optional()
2956
- });
2957
- authApiKeysDeleteRequestSchema = z13.object({
2958
- keyId: z13.string().min(1)
2959
- });
2960
- authSetupRequestSchema = z13.object({
2961
- name: z13.string().trim().min(1).max(120).optional(),
2962
- handle: z13.string().trim().min(1).max(120).optional(),
2963
- referralCode: z13.string().trim().min(1).max(120).optional()
2964
- });
2965
- authApiKeysListResponseDataSchema = z13.object({
2966
- keys: z13.array(z13.object({
2967
- id: z13.string(),
2968
- name: z13.string().nullable(),
2969
- start: z13.string(),
2970
- createdAt: z13.string()
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 = z13.object({
2974
- key: z13.string(),
2975
- id: z13.string(),
2976
- start: z13.string()
3243
+ authApiKeysCreateResponseDataSchema = z14.object({
3244
+ key: z14.string(),
3245
+ id: z14.string(),
3246
+ start: z14.string()
2977
3247
  });
2978
- authApiKeysDeleteResponseDataSchema = z13.object({
2979
- revoked: z13.boolean()
3248
+ authApiKeysDeleteResponseDataSchema = z14.object({
3249
+ revoked: z14.boolean()
2980
3250
  });
2981
- authSetupResponseDataSchema = z13.object({
2982
- userId: z13.string().uuid(),
2983
- solanaAddress: z13.string().nullable(),
2984
- hlAddress: z13.string().nullable().optional(),
2985
- handle: z13.string().nullable(),
2986
- apiKeyHint: z13.string().nullable(),
2987
- apiKey: z13.string().optional(),
2988
- cliCommand: z13.string().optional(),
2989
- isNew: z13.boolean()
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 z14 } from "zod";
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 = z14.object({
3003
- token: z14.string().trim().min(1, "Claim token is required")
3004
- });
3005
- claimInfoResponseDataSchema = z14.object({
3006
- claimed: z14.boolean(),
3007
- agent: z14.object({
3008
- name: z14.string(),
3009
- handle: z14.string().nullable().optional(),
3010
- bio: z14.string().nullable(),
3011
- avatar: z14.string().nullable()
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: z14.string().optional(),
3014
- tweetText: z14.string().optional(),
3015
- instructions: z14.string().optional()
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 z15 } from "zod";
3291
+ import { z as z16 } from "zod";
3022
3292
  var dashboardStatusResponseDataSchema, dashboardStatusResponseSchema;
3023
3293
  var init_dashboard = __esm(() => {
3024
3294
  init_common();
3025
- dashboardStatusResponseDataSchema = z15.object({
3026
- solanaAddress: z15.string().nullable(),
3027
- hlAddress: z15.string().nullable(),
3028
- solanaBalance: z15.number(),
3029
- claimToken: z15.string(),
3030
- steps: z15.object({
3031
- funded: z15.boolean(),
3032
- agentConnected: z15.boolean(),
3033
- xConnected: z15.boolean().nullable()
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: z15.string().nullable(),
3036
- xHandle: z15.string().nullable(),
3037
- handle: z15.string().nullable(),
3038
- stats: z15.object({
3039
- totalValueUsd: z15.number(),
3040
- pnlAllTime: z15.number(),
3041
- pnl24h: z15.number(),
3042
- pnl7d: z15.number(),
3043
- lastTradeAt: z15.string().nullable()
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,792 @@ var init_src = __esm(() => {
3527
4072
  init_device_code();
3528
4073
  });
3529
4074
 
3530
- // src/lib/env.ts
3531
- var exports_env = {};
3532
- __export(exports_env, {
3533
- saveEnv: () => saveEnv,
3534
- loadEnv: () => loadEnv,
3535
- isEnvInGitignore: () => isEnvInGitignore,
3536
- isConfigured: () => isConfigured,
3537
- getCredentials: () => getCredentials,
3538
- ensureEnvInGitignore: () => ensureEnvInGitignore
3539
- });
3540
- import fs from "fs";
3541
- import path from "path";
3542
- import dotenv from "dotenv";
3543
- function loadEnv() {
3544
- const envPath = path.resolve(process.cwd(), ENV_FILE);
3545
- if (fs.existsSync(envPath)) {
3546
- const result2 = dotenv.config({ path: envPath });
3547
- const parsed = result2.parsed || {};
3548
- return parsed;
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 --outfile dist/cabal && bun build src/mcp-server.ts --compile --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
- return {};
3551
- }
3552
- function isConfigured() {
3553
- const env = loadEnv();
3554
- return !!env.CABAL_API_KEY;
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
- function saveEnv(credentials) {
3557
- const envPath = path.resolve(process.cwd(), ENV_FILE);
3558
- let existingContent = "";
3559
- if (fs.existsSync(envPath)) {
3560
- existingContent = fs.readFileSync(envPath, "utf-8");
3561
- const cabalKeys = [
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
- let cabalSection = `# Cabal Agent Credentials
3581
- # Generated by cabal-cli — do not share!
3582
- CABAL_API_KEY=${credentials.apiKey}
3583
- CABAL_AGENT_NAME=${credentials.agentName}
3584
- `;
3585
- if (credentials.apiUrl) {
3586
- cabalSection += `NEXT_PUBLIC_SITE_URL=${credentials.apiUrl}
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
+ };
4179
+ }
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 };
3588
4184
  }
3589
- fs.writeFileSync(envPath, existingContent + cabalSection);
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 getCredentials() {
3592
- const fromProcess = {
3593
- CABAL_API_KEY: process.env.CABAL_API_KEY,
3594
- CABAL_AGENT_NAME: process.env.CABAL_AGENT_NAME,
3595
- NEXT_PUBLIC_SITE_URL: process.env.NEXT_PUBLIC_SITE_URL
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
- const fromFile = loadEnv();
3598
- return { ...fromFile, ...fromProcess };
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);
3599
4223
  }
3600
- function isEnvInGitignore() {
3601
- const gitignorePath = path.resolve(process.cwd(), GITIGNORE_FILE);
3602
- if (!fs.existsSync(gitignorePath)) {
3603
- return false;
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
+ ];
4231
+ }
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 ensureEnvInGitignore() {
3611
- const gitignorePath = path.resolve(process.cwd(), GITIGNORE_FILE);
3612
- if (!fs.existsSync(gitignorePath)) {
3613
- fs.writeFileSync(gitignorePath, `.env
3614
- `);
3615
- return { added: true, created: true };
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
- if (isEnvInGitignore()) {
3618
- return { added: false, created: false };
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
- });
4256
+ function warnLegacyEnv(quiet) {
4257
+ if (quiet)
4258
+ return;
4259
+ const envPath = path.join(process.cwd(), ".env");
4260
+ if (!fs.existsSync(envPath))
4261
+ return;
4262
+ try {
4263
+ const content = fs.readFileSync(envPath, "utf-8");
4264
+ if (content.includes("CABAL_API_KEY")) {
4265
+ process.stderr.write(`Warning: Found .env with CABAL_API_KEY. This is no longer used.
4266
+ ` + `Run 'cabal login' to migrate to ~/.cabal/auth.json.
3639
4267
 
3640
- // ../../packages/solana/src/errors.ts
3641
- function def(code, name, message, program, retryable = false, suggestion) {
3642
- return { code, hex: `0x${code.toString(16)}`, name, message, retryable, suggestion, program };
4268
+ `);
4269
+ }
4270
+ } catch {}
3643
4271
  }
3644
- function parseSolanaError(message) {
3645
- if (!message)
3646
- return null;
3647
- const customMatch = CUSTOM_ERROR_RE.exec(message);
3648
- if (customMatch) {
3649
- const code = parseInt(customMatch[1], 16);
3650
- const hex = `0x${customMatch[1].toLowerCase()}`;
3651
- const instructionMatch = INSTRUCTION_INDEX_RE.exec(message);
3652
- const instructionIndex = instructionMatch ? parseInt(instructionMatch[1], 10) : undefined;
3653
- return {
3654
- type: "custom",
3655
- code,
3656
- hex,
3657
- instructionIndex,
3658
- def: PROGRAM_ERRORS.get(code),
3659
- raw: message
3660
- };
4272
+
4273
+ // src/lib/output.ts
4274
+ init_src();
4275
+ init_errors();
4276
+
4277
+ // src/lib/config.ts
4278
+ import fs2 from "node:fs";
4279
+ import path2 from "node:path";
4280
+ import os2 from "node:os";
4281
+ import { z as z23 } from "zod";
4282
+ var CABAL_DIR2 = path2.join(os2.homedir(), ".cabal");
4283
+ var GLOBAL_CONFIG_PATH = path2.join(CABAL_DIR2, "config.json");
4284
+ var PROJECT_CONFIG_DIR = path2.join(process.cwd(), ".cabal");
4285
+ var PROJECT_CONFIG_PATH = path2.join(PROJECT_CONFIG_DIR, "config.json");
4286
+ var solanaExplorerSchema = z23.enum(["solscan", "solana.fm", "xray"]);
4287
+ var hlExplorerSchema = z23.enum(["hyperliquid"]);
4288
+ var solanaChainConfigSchema = z23.object({
4289
+ baseCurrency: z23.string().min(1).default("USDC"),
4290
+ slippage: z23.number().int().min(1).max(5000).default(100),
4291
+ explorer: solanaExplorerSchema.default("solscan")
4292
+ });
4293
+ var hlChainConfigSchema = z23.object({
4294
+ baseCurrency: z23.string().min(1).default("USDC"),
4295
+ slippage: z23.number().int().min(1).max(5000).default(50),
4296
+ explorer: hlExplorerSchema.default("hyperliquid")
4297
+ });
4298
+ var cabalConfigSchema = z23.object({
4299
+ output: z23.enum(["human", "json"]).default("human"),
4300
+ chains: z23.object({
4301
+ solana: solanaChainConfigSchema.default(() => solanaChainConfigSchema.parse({})),
4302
+ hyperliquid: hlChainConfigSchema.default(() => hlChainConfigSchema.parse({}))
4303
+ }).default(() => ({
4304
+ solana: solanaChainConfigSchema.parse({}),
4305
+ hyperliquid: hlChainConfigSchema.parse({})
4306
+ }))
4307
+ });
4308
+ var VALID_CONFIG_PATHS = [
4309
+ "output",
4310
+ "chains.solana.baseCurrency",
4311
+ "chains.solana.slippage",
4312
+ "chains.solana.explorer",
4313
+ "chains.hyperliquid.baseCurrency",
4314
+ "chains.hyperliquid.slippage",
4315
+ "chains.hyperliquid.explorer"
4316
+ ];
4317
+ var CHAIN_ALIASES = { sol: "solana", hl: "hyperliquid" };
4318
+ function resolveChainInPath(dotPath) {
4319
+ const parts = dotPath.split(".");
4320
+ if (parts[0] === "chains" && parts.length >= 2) {
4321
+ const alias = CHAIN_ALIASES[parts[1].toLowerCase()];
4322
+ if (alias)
4323
+ parts[1] = alias;
3661
4324
  }
3662
- const anchorMatch = ANCHOR_ERROR_RE.exec(message);
3663
- if (anchorMatch) {
3664
- const code = parseInt(anchorMatch[1], 10);
3665
- return {
3666
- type: "custom",
3667
- code,
3668
- hex: `0x${code.toString(16)}`,
3669
- def: PROGRAM_ERRORS.get(code),
3670
- raw: message
3671
- };
4325
+ return parts.join(".");
4326
+ }
4327
+ var VALID_CONFIG_SET = new Set(VALID_CONFIG_PATHS);
4328
+ function isValidConfigPath(p) {
4329
+ return VALID_CONFIG_SET.has(p);
4330
+ }
4331
+ function getDefaults() {
4332
+ return cabalConfigSchema.parse({});
4333
+ }
4334
+ function loadConfigFile(filePath) {
4335
+ if (!fs2.existsSync(filePath))
4336
+ return {};
4337
+ let raw;
4338
+ try {
4339
+ raw = JSON.parse(fs2.readFileSync(filePath, "utf-8"));
4340
+ } catch (e) {
4341
+ process.stderr.write(`Warning: Could not parse config at ${filePath}: ${e instanceof Error ? e.message : "unknown error"}. Using defaults.
4342
+ `);
4343
+ return {};
3672
4344
  }
3673
- for (const [variant, errorDef] of INSTRUCTION_ERRORS) {
3674
- if (message.includes(variant)) {
3675
- return {
3676
- type: "instruction",
3677
- def: errorDef,
3678
- raw: message
3679
- };
4345
+ if (!isPlainObject(raw))
4346
+ return {};
4347
+ const result2 = cabalConfigSchema.partial().passthrough().safeParse(raw);
4348
+ if (!result2.success) {
4349
+ for (const issue of result2.error.issues.slice(0, 3)) {
4350
+ process.stderr.write(`Warning: Invalid config at ${filePath}: ${issue.path.join(".")}: ${issue.message}
4351
+ `);
3680
4352
  }
4353
+ return {};
3681
4354
  }
3682
- return null;
4355
+ return result2.data;
3683
4356
  }
3684
- function classifyTradeError(errorMessage) {
3685
- const parsed = parseSolanaError(errorMessage);
3686
- if (parsed?.def) {
3687
- const d = parsed.def;
3688
- if (d.name === "SlippageToleranceExceeded") {
3689
- return {
3690
- errorCode: "BAD_REQUEST",
3691
- httpStatus: 400,
3692
- message: d.message,
3693
- retryable: true,
3694
- suggestion: d.suggestion,
3695
- solanaError: d.name
3696
- };
4357
+ function loadEnvOverrides() {
4358
+ const config = {};
4359
+ const output = process.env.CABAL_OUTPUT;
4360
+ if (output === "json" || output === "human") {
4361
+ config.output = output;
4362
+ }
4363
+ const chains = {};
4364
+ const solSlippage = process.env.CABAL_SOLANA_SLIPPAGE ?? process.env.CABAL_SOL_SLIPPAGE;
4365
+ const solBase = process.env.CABAL_SOLANA_BASE_CURRENCY ?? process.env.CABAL_SOL_BASE_CURRENCY;
4366
+ const solExplorer = process.env.CABAL_SOLANA_EXPLORER ?? process.env.CABAL_SOL_EXPLORER;
4367
+ if (solSlippage || solBase || solExplorer) {
4368
+ const sol = {};
4369
+ if (solSlippage) {
4370
+ const n = parseInt(solSlippage, 10);
4371
+ if (!isNaN(n))
4372
+ sol.slippage = n;
4373
+ else
4374
+ process.stderr.write(`Warning: Invalid CABAL_SOLANA_SLIPPAGE="${solSlippage}". Ignored.
4375
+ `);
3697
4376
  }
3698
- if (d.name === "InsufficientFunds") {
3699
- return {
3700
- errorCode: "BAD_REQUEST",
3701
- httpStatus: 400,
3702
- message: d.message,
3703
- retryable: false,
3704
- suggestion: d.suggestion,
3705
- solanaError: d.name
3706
- };
4377
+ if (solBase)
4378
+ sol.baseCurrency = solBase;
4379
+ if (solExplorer)
4380
+ sol.explorer = solExplorer;
4381
+ chains.solana = sol;
4382
+ }
4383
+ const hlSlippage = process.env.CABAL_HYPERLIQUID_SLIPPAGE ?? process.env.CABAL_HL_SLIPPAGE;
4384
+ const hlBase = process.env.CABAL_HYPERLIQUID_BASE_CURRENCY ?? process.env.CABAL_HL_BASE_CURRENCY;
4385
+ const hlExplorer = process.env.CABAL_HYPERLIQUID_EXPLORER ?? process.env.CABAL_HL_EXPLORER;
4386
+ if (hlSlippage || hlBase || hlExplorer) {
4387
+ const hl = {};
4388
+ if (hlSlippage) {
4389
+ const n = parseInt(hlSlippage, 10);
4390
+ if (!isNaN(n))
4391
+ hl.slippage = n;
4392
+ else
4393
+ process.stderr.write(`Warning: Invalid CABAL_HYPERLIQUID_SLIPPAGE="${hlSlippage}". Ignored.
4394
+ `);
3707
4395
  }
3708
- if (d.name === "ComputationalBudgetExceeded" || d.name === "ProgramFailedToComplete") {
3709
- return {
3710
- errorCode: "DEPENDENCY_ERROR",
3711
- httpStatus: 502,
3712
- message: d.message,
3713
- retryable: true,
3714
- suggestion: d.suggestion,
3715
- solanaError: d.name
3716
- };
4396
+ if (hlBase)
4397
+ hl.baseCurrency = hlBase;
4398
+ if (hlExplorer)
4399
+ hl.explorer = hlExplorer;
4400
+ chains.hyperliquid = hl;
4401
+ }
4402
+ if (Object.keys(chains).length > 0)
4403
+ config.chains = chains;
4404
+ return config;
4405
+ }
4406
+ function isPlainObject(v) {
4407
+ return v !== null && typeof v === "object" && !Array.isArray(v);
4408
+ }
4409
+ function deepMerge(...sources) {
4410
+ const result2 = {};
4411
+ for (const source of sources) {
4412
+ for (const [key, value] of Object.entries(source)) {
4413
+ const existing = result2[key];
4414
+ if (isPlainObject(value) && isPlainObject(existing)) {
4415
+ result2[key] = deepMerge(existing, value);
4416
+ } else {
4417
+ result2[key] = value;
4418
+ }
3717
4419
  }
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
4420
  }
3727
- if (parsed?.type === "custom" && parsed.code !== undefined) {
3728
- return {
3729
- errorCode: "INTERNAL_ERROR",
3730
- httpStatus: 500,
3731
- message: `Transaction failed with program error ${parsed.hex}`,
3732
- retryable: false,
3733
- solanaError: `UnknownError_${parsed.hex}`
3734
- };
4421
+ return result2;
4422
+ }
4423
+ function loadConfig() {
4424
+ const defaults = getDefaults();
4425
+ const global = loadConfigFile(GLOBAL_CONFIG_PATH);
4426
+ const project = loadConfigFile(PROJECT_CONFIG_PATH);
4427
+ const env = loadEnvOverrides();
4428
+ const merged = deepMerge({ ...defaults }, global, project, env);
4429
+ return cabalConfigSchema.parse(merged);
4430
+ }
4431
+ function resolveConfigValue(dotPath) {
4432
+ const resolved = resolveChainInPath(dotPath);
4433
+ if (!isValidConfigPath(resolved)) {
4434
+ throw new Error(`Unknown config path "${dotPath}". Valid paths: ${VALID_CONFIG_PATHS.join(", ")}`);
3735
4435
  }
3736
- for (const pattern of KEYWORD_PATTERNS) {
3737
- if (pattern.test(errorMessage)) {
3738
- return pattern.classify(errorMessage);
4436
+ const defaults = getDefaults();
4437
+ const global = loadConfigFile(GLOBAL_CONFIG_PATH);
4438
+ const project = loadConfigFile(PROJECT_CONFIG_PATH);
4439
+ const env = loadEnvOverrides();
4440
+ const envVal = getNestedValue(env, resolved);
4441
+ if (envVal !== undefined) {
4442
+ const envVar = findEnvVarName(resolved);
4443
+ return { value: envVal, source: "env", envVar };
4444
+ }
4445
+ const projectVal = getNestedValue(project, resolved);
4446
+ if (projectVal !== undefined)
4447
+ return { value: projectVal, source: "project" };
4448
+ const globalVal = getNestedValue(global, resolved);
4449
+ if (globalVal !== undefined)
4450
+ return { value: globalVal, source: "global" };
4451
+ return { value: getNestedValue(defaults, resolved), source: "default" };
4452
+ }
4453
+ function saveConfig(filePath, partial) {
4454
+ let existing = {};
4455
+ if (fs2.existsSync(filePath)) {
4456
+ try {
4457
+ existing = JSON.parse(fs2.readFileSync(filePath, "utf-8"));
4458
+ } catch {
4459
+ existing = {};
3739
4460
  }
3740
4461
  }
4462
+ const merged = deepMerge(existing, partial);
4463
+ const dir = path2.dirname(filePath);
4464
+ if (!fs2.existsSync(dir)) {
4465
+ fs2.mkdirSync(dir, { recursive: true, mode: 493 });
4466
+ }
4467
+ fs2.writeFileSync(filePath, JSON.stringify(merged, null, 2) + `
4468
+ `);
4469
+ }
4470
+ function getConfigPath(scope) {
4471
+ return scope === "global" ? GLOBAL_CONFIG_PATH : PROJECT_CONFIG_PATH;
4472
+ }
4473
+ function validateConfigValue(dotPath, rawValue) {
4474
+ const resolved = resolveChainInPath(dotPath);
4475
+ if (!isValidConfigPath(resolved)) {
4476
+ throw new Error(`Unknown config path "${dotPath}". Valid paths: ${VALID_CONFIG_PATHS.join(", ")}`);
4477
+ }
4478
+ switch (resolved) {
4479
+ case "output":
4480
+ return z23.enum(["human", "json"]).parse(rawValue);
4481
+ case "chains.solana.slippage":
4482
+ case "chains.hyperliquid.slippage":
4483
+ return z23.coerce.number().int().min(1).max(5000).parse(rawValue);
4484
+ case "chains.solana.explorer":
4485
+ return z23.enum(["solscan", "solana.fm", "xray"]).parse(rawValue);
4486
+ case "chains.hyperliquid.explorer":
4487
+ return z23.enum(["hyperliquid"]).parse(rawValue);
4488
+ case "chains.solana.baseCurrency":
4489
+ case "chains.hyperliquid.baseCurrency":
4490
+ return z23.string().min(1).parse(rawValue);
4491
+ }
4492
+ }
4493
+ function dotPathToObject(dotPath, value) {
4494
+ const resolved = resolveChainInPath(dotPath);
4495
+ const parts = resolved.split(".");
4496
+ const obj = {};
4497
+ let current = obj;
4498
+ for (let i = 0;i < parts.length - 1; i++) {
4499
+ const next = {};
4500
+ current[parts[i]] = next;
4501
+ current = next;
4502
+ }
4503
+ current[parts[parts.length - 1]] = value;
4504
+ return obj;
4505
+ }
4506
+ function getNestedValue(obj, dotPath) {
4507
+ const parts = dotPath.split(".");
4508
+ let current = obj;
4509
+ for (const part of parts) {
4510
+ if (!isPlainObject(current))
4511
+ return;
4512
+ current = current[part];
4513
+ }
4514
+ return current;
4515
+ }
4516
+ function findEnvVarName(dotPath) {
4517
+ const map = {
4518
+ output: "CABAL_OUTPUT",
4519
+ "chains.solana.baseCurrency": "CABAL_SOLANA_BASE_CURRENCY",
4520
+ "chains.solana.slippage": "CABAL_SOLANA_SLIPPAGE",
4521
+ "chains.solana.explorer": "CABAL_SOLANA_EXPLORER",
4522
+ "chains.hyperliquid.baseCurrency": "CABAL_HYPERLIQUID_BASE_CURRENCY",
4523
+ "chains.hyperliquid.slippage": "CABAL_HYPERLIQUID_SLIPPAGE",
4524
+ "chains.hyperliquid.explorer": "CABAL_HYPERLIQUID_EXPLORER"
4525
+ };
4526
+ return map[dotPath];
4527
+ }
4528
+
4529
+ // src/lib/output.ts
4530
+ function resolveOutputMode(flags) {
4531
+ const config = loadConfig();
4532
+ if (flags.json || config.output === "json")
4533
+ return "json";
4534
+ if (process.stdout.isTTY)
4535
+ return "human";
4536
+ return "plain";
4537
+ }
4538
+ function buildOutputContext(flags) {
4539
+ const mode = resolveOutputMode(flags);
3741
4540
  return {
3742
- errorCode: "INTERNAL_ERROR",
3743
- httpStatus: 500,
3744
- message: `Trade failed: ${errorMessage}`,
3745
- retryable: false
4541
+ mode,
4542
+ flags,
4543
+ isTTY: mode === "human"
3746
4544
  };
3747
4545
  }
3748
- var PROGRAM_ERRORS, INSTRUCTION_ERRORS, CUSTOM_ERROR_RE, INSTRUCTION_INDEX_RE, ANCHOR_ERROR_RE, KEYWORD_PATTERNS;
3749
- var init_errors2 = __esm(() => {
3750
- PROGRAM_ERRORS = new Map([
3751
- [0, def(0, "NotRentExempt", "Account is not rent exempt", "token")],
3752
- [1, def(1, "InsufficientFunds", "Insufficient token balance", "token", false, "Check your token balance before trading")],
3753
- [2, def(2, "InvalidMint", "Invalid mint address", "token")],
3754
- [3, def(3, "MintMismatch", "Account mint does not match expected mint", "token")],
3755
- [4, def(4, "OwnerMismatch", "Account owner does not match expected owner", "token")],
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");
4546
+ function createSpinner(mode) {
4547
+ if (mode === "json") {
4548
+ return { start() {}, succeed() {}, fail() {}, stop() {} };
4549
+ }
4550
+ if (mode === "human") {
4551
+ return {
4552
+ start(text) {
4553
+ process.stderr.write(` ${text}...`);
3830
4554
  },
3831
- classify: () => ({
3832
- errorCode: "DEPENDENCY_ERROR",
3833
- httpStatus: 502,
3834
- message: "Transaction expired before confirmation",
3835
- retryable: true,
3836
- suggestion: "This is transient — retry with a fresh quote",
3837
- solanaError: "TransactionExpired"
3838
- })
4555
+ succeed(text) {
4556
+ process.stderr.write(`\r\x1B[K ${text ?? ""}
4557
+ `);
4558
+ },
4559
+ fail(text) {
4560
+ process.stderr.write(`\r\x1B[K ${text ?? ""}
4561
+ `);
4562
+ },
4563
+ stop() {
4564
+ process.stderr.write(`\r\x1B[K`);
4565
+ }
4566
+ };
4567
+ }
4568
+ return {
4569
+ start(text) {
4570
+ process.stderr.write(`${text}
4571
+ `);
3839
4572
  },
3840
- {
3841
- test: (msg) => msg.toLowerCase().includes("rate limit"),
3842
- classify: (msg) => ({
3843
- errorCode: "RATE_LIMITED",
3844
- httpStatus: 429,
3845
- message: msg,
3846
- retryable: false,
3847
- suggestion: "Wait a moment before retrying"
3848
- })
4573
+ succeed(text) {
4574
+ if (text)
4575
+ process.stderr.write(`${text}
4576
+ `);
3849
4577
  },
3850
- {
3851
- test: (msg) => {
3852
- const lower = msg.toLowerCase();
3853
- return lower.includes("unknown token") || lower.includes("token not found");
3854
- },
3855
- classify: (msg) => ({
3856
- errorCode: "BAD_REQUEST",
3857
- httpStatus: 400,
3858
- message: msg,
3859
- retryable: false,
3860
- suggestion: "Use a known symbol (SOL, USDC, BONK, WIF) or pass a raw mint address"
3861
- })
4578
+ fail(text) {
4579
+ if (text)
4580
+ process.stderr.write(`${text}
4581
+ `);
4582
+ },
4583
+ stop() {}
4584
+ };
4585
+ }
4586
+ async function runCommand(work, opts) {
4587
+ const { ctx, humanRender, publicEndpoint } = opts;
4588
+ try {
4589
+ const client = publicEndpoint ? resolveClientOptional() : resolveClient(ctx);
4590
+ const data = await work(client);
4591
+ render({ ok: true, data }, ctx, humanRender);
4592
+ process.exit(0);
4593
+ } catch (error) {
4594
+ renderError(error, ctx);
4595
+ process.exit(errorToExitCode(error));
4596
+ }
4597
+ }
4598
+ async function runPreviewCommand(work, opts) {
4599
+ const { ctx, humanRender } = opts;
4600
+ try {
4601
+ const client = resolveClient(ctx);
4602
+ const data = await work(client);
4603
+ const result2 = { ok: true, preview: true, data };
4604
+ render(result2, ctx, humanRender);
4605
+ process.exit(0);
4606
+ } catch (error) {
4607
+ renderError(error, ctx);
4608
+ process.exit(errorToExitCode(error));
4609
+ }
4610
+ }
4611
+ function resolveClient(ctx) {
4612
+ const auth2 = requireAuth(ctx);
4613
+ const baseUrl = process.env.NEXT_PUBLIC_SITE_URL;
4614
+ return new AgentClient(auth2.apiKey, baseUrl);
4615
+ }
4616
+ function resolveClientOptional() {
4617
+ const auth2 = getAuth();
4618
+ const baseUrl = process.env.NEXT_PUBLIC_SITE_URL;
4619
+ if (auth2)
4620
+ return new AgentClient(auth2.apiKey, baseUrl);
4621
+ return new AgentClient("anonymous", baseUrl);
4622
+ }
4623
+ function render(result2, ctx, humanRender) {
4624
+ if (ctx.mode === "json") {
4625
+ process.stdout.write(JSON.stringify(result2, null, 2) + `
4626
+ `);
4627
+ return;
4628
+ }
4629
+ if (!humanRender) {
4630
+ process.stdout.write(JSON.stringify(result2.data, null, 2) + `
4631
+ `);
4632
+ return;
4633
+ }
4634
+ const lines = humanRender(result2.data, ctx);
4635
+ const output = lines.join(`
4636
+ `) + `
4637
+ `;
4638
+ if (ctx.isTTY) {
4639
+ process.stdout.write(output);
4640
+ } else {
4641
+ process.stdout.write(stripAnsi(output));
4642
+ }
4643
+ if ("preview" in result2 && result2.preview && !ctx.flags.quiet) {
4644
+ process.stderr.write(`
4645
+ Run again with --yes to execute.
4646
+ `);
4647
+ }
4648
+ }
4649
+ function renderError(error, ctx) {
4650
+ const structured = toStructuredError(error);
4651
+ if (ctx.mode === "json") {
4652
+ process.stdout.write(JSON.stringify({ ok: false, error: structured }, null, 2) + `
4653
+ `);
4654
+ return;
4655
+ }
4656
+ process.stderr.write(red(`Error [${structured.code}]: ${structured.message}`) + `
4657
+ `);
4658
+ if (structured.checked && structured.checked.length > 0) {
4659
+ process.stderr.write(`
4660
+ Checked:
4661
+ `);
4662
+ structured.checked.forEach((loc, i) => {
4663
+ process.stderr.write(` ${i + 1}. ${loc}
4664
+ `);
4665
+ });
4666
+ }
4667
+ if (structured.issues && structured.issues.length > 0) {
4668
+ process.stderr.write(`
4669
+ `);
4670
+ for (const issue of structured.issues.slice(0, 5)) {
4671
+ const path3 = issue.path.length > 0 ? issue.path.join(".") : "<root>";
4672
+ process.stderr.write(dim(` - ${path3}: ${issue.message} (${issue.code})`) + `
4673
+ `);
3862
4674
  }
3863
- ];
3864
- });
3865
-
3866
- // src/lib/errors.ts
3867
- import chalk from "chalk";
3868
- function normalizeCliError(error) {
4675
+ }
4676
+ if (structured.suggestion) {
4677
+ process.stderr.write(`
4678
+ ` + dim(` ${structured.suggestion}`) + `
4679
+ `);
4680
+ }
4681
+ }
4682
+ function renderValidationError(message, meta, ctx) {
4683
+ if (ctx.mode === "json") {
4684
+ const jsonError = {
4685
+ ok: false,
4686
+ error: {
4687
+ code: "VALIDATION_ERROR",
4688
+ message,
4689
+ command: meta.name,
4690
+ description: meta.description,
4691
+ required: meta.requiredFlags.map((f) => f.flag),
4692
+ optional: meta.optionalFlags.map((f) => f.flag),
4693
+ example: meta.examples[0]
4694
+ }
4695
+ };
4696
+ process.stdout.write(JSON.stringify(jsonError, null, 2) + `
4697
+ `);
4698
+ } else {
4699
+ process.stderr.write(red(`Error [VALIDATION_ERROR]: ${message}`) + `
4700
+ `);
4701
+ process.stderr.write(`
4702
+ `);
4703
+ process.stderr.write(` ${meta.description}
4704
+ `);
4705
+ process.stderr.write(`
4706
+ `);
4707
+ if (meta.requiredFlags.length > 0) {
4708
+ process.stderr.write(` Required flags:
4709
+ `);
4710
+ for (const f of meta.requiredFlags) {
4711
+ process.stderr.write(` ${f.flag.padEnd(24)} ${f.description}
4712
+ `);
4713
+ }
4714
+ }
4715
+ if (meta.optionalFlags.length > 0) {
4716
+ process.stderr.write(`
4717
+ Optional:
4718
+ `);
4719
+ for (const f of meta.optionalFlags) {
4720
+ process.stderr.write(` ${f.flag.padEnd(24)} ${f.description}
4721
+ `);
4722
+ }
4723
+ }
4724
+ if (meta.examples.length > 0) {
4725
+ process.stderr.write(`
4726
+ Example:
4727
+ `);
4728
+ process.stderr.write(` ${meta.examples[0]}
4729
+ `);
4730
+ }
4731
+ }
4732
+ process.exit(2);
4733
+ }
4734
+ function renderNextSteps(steps, ctx) {
4735
+ if (ctx.mode === "json" || ctx.flags.quiet || steps.length === 0)
4736
+ return;
4737
+ process.stderr.write(`
4738
+ `);
4739
+ for (const step of steps) {
4740
+ if (step.condition) {
4741
+ process.stderr.write(dim(` ${step.condition}: `) + step.message + `
4742
+ `);
4743
+ } else {
4744
+ process.stderr.write(dim(` ${step.message}`) + `
4745
+ `);
4746
+ }
4747
+ }
4748
+ }
4749
+ function errorToExitCode(error) {
4750
+ if (error instanceof AppClientError) {
4751
+ switch (error.error.code) {
4752
+ case ERROR_CODE.VALIDATION_ERROR:
4753
+ case ERROR_CODE.BAD_REQUEST:
4754
+ return 2;
4755
+ case ERROR_CODE.UNAUTHORIZED:
4756
+ case ERROR_CODE.FORBIDDEN:
4757
+ return 3;
4758
+ case ERROR_CODE.NOT_FOUND:
4759
+ case ERROR_CODE.CONFLICT:
4760
+ case ERROR_CODE.RATE_LIMITED:
4761
+ case ERROR_CODE.INTERNAL_ERROR:
4762
+ case ERROR_CODE.DEPENDENCY_ERROR:
4763
+ default:
4764
+ return 1;
4765
+ }
4766
+ }
4767
+ return 1;
4768
+ }
4769
+ function toStructuredError(error) {
3869
4770
  if (error instanceof AppClientError) {
3870
4771
  return {
3871
4772
  code: error.error.code,
3872
4773
  message: error.error.message,
3873
- issues: error.error.issues
4774
+ suggestion: getSuggestionForError(error),
4775
+ ...error.error.issues ? { issues: error.error.issues } : {},
4776
+ ...hasCheckedList(error) ? { checked: error._checked } : {}
3874
4777
  };
3875
4778
  }
3876
4779
  if (error instanceof Error) {
3877
- return { message: error.message };
3878
- }
3879
- return { message: "Unknown error" };
3880
- }
3881
- function printCliError(error) {
3882
- const normalized = normalizeCliError(error);
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})`));
4780
+ if (error.message.includes("fetch") || error.message.includes("ECONNREFUSED")) {
4781
+ return {
4782
+ code: "INTERNAL_ERROR",
4783
+ message: "Failed to connect to API.",
4784
+ suggestion: "Check your network connection. API status: https://cabal.trading"
4785
+ };
3889
4786
  }
4787
+ return { code: "INTERNAL_ERROR", message: error.message };
3890
4788
  }
4789
+ return { code: "INTERNAL_ERROR", message: "Unknown error" };
3891
4790
  }
3892
- function mapTradeError(error) {
3893
- const normalized = normalizeCliError(error);
3894
- const classified = classifyTradeError(normalized.message);
3895
- return {
3896
- message: classified.message,
3897
- suggestion: classified.suggestion,
3898
- retryable: classified.retryable
3899
- };
3900
- }
3901
- function printTradeError(error) {
3902
- const mapped = mapTradeError(error);
3903
- console.error(chalk.red(`
3904
- ${mapped.message}`));
3905
- if (mapped.suggestion) {
3906
- console.error(chalk.dim(` Suggestion: ${mapped.suggestion}`));
4791
+ function getSuggestionForError(error) {
4792
+ switch (error.error.code) {
4793
+ case ERROR_CODE.UNAUTHORIZED:
4794
+ return "Run 'cabal login' to re-authenticate.";
4795
+ case ERROR_CODE.FORBIDDEN:
4796
+ return "Check your agent permissions at https://cabal.trading/dashboard";
4797
+ case ERROR_CODE.RATE_LIMITED:
4798
+ return "Wait and retry. Rate limit resets shortly.";
4799
+ case ERROR_CODE.INTERNAL_ERROR:
4800
+ return "Server error. Try again in a moment.";
4801
+ default:
4802
+ return;
3907
4803
  }
3908
- console.error("");
3909
4804
  }
3910
- function toStructuredError(error) {
3911
- const normalized = normalizeCliError(error);
3912
- return {
3913
- success: false,
3914
- error: {
3915
- code: normalized.code || "INTERNAL_ERROR",
3916
- message: normalized.message,
3917
- ...normalized.issues ? { issues: normalized.issues } : {}
3918
- }
3919
- };
4805
+ function hasCheckedList(error) {
4806
+ return "_checked" in error && Array.isArray(error._checked);
4807
+ }
4808
+ function stripAnsi(str) {
4809
+ return str.replace(/\x1b\[[0-9;]*m/g, "");
3920
4810
  }
3921
- var init_errors3 = __esm(() => {
3922
- init_src();
3923
- init_errors2();
3924
- });
3925
4811
 
3926
4812
  // src/mcp/server.ts
3927
- var exports_server = {};
3928
- __export(exports_server, {
3929
- createServer: () => createServer
3930
- });
3931
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3932
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3933
- import { z as z22 } from "zod";
4813
+ var SEEDANCE_AGENT_GUIDE = `# Seedance 1.5 Pro — Quick Prompt Guide
4814
+
4815
+ Seedance generates synchronized audio + video in one pass. Using its vocabulary produces dramatically better results.
4816
+
4817
+ ## Prompt Formula
4818
+ Subject + Movement + Environment + Camera movement + Aesthetic + Sound
4819
+
4820
+ ## Camera Movement
4821
+ dolly-in, dolly-out, pan (left/right rotation), tilt (up/down rotation), track (lateral), follow, orbit/surround, rise, fall, zoom
4822
+ Combos: Hitchcock zoom (dolly-out + zoom-in), Bullet time (slow-motion + surround)
4823
+ Formula: "The camera [starts at composition], [movement + amplitude], [ends at composition]"
4824
+
4825
+ ## Shot Sizes
4826
+ wide/full shot (emphasis on environment), medium shot (waist up), close-up (face fills frame), extreme close-up (single feature like eyes or hands)
4827
+ Grammar: "Subject + Shot Size" — "Close-up of the detective", "Medium shot of both characters"
4828
+
4829
+ ## Perspectives
4830
+ Camera angle: high angle, low angle, bird's eye, eye-level, dutch angle
4831
+ Narrative: over-the-shoulder, subjective view, surveillance/fisheye, telescope view
4832
+ Subject angle: front, profile, half-profile, back
4833
+
4834
+ ## Multi-Shot Transitions
4835
+ Number shots: "Shot 1: Medium shot of... Shot 2: Cut to close-up of..."
4836
+ Reverse-shot for dialogue: alternate between speakers, tighten shots to build tension
4837
+ Set aesthetic once — it carries across cuts ("Pixar-style animation", "Realistic", "VHS grain")
4838
+
4839
+ ## Sound Direction (all generated natively)
4840
+ Voiceover: set emotion + tone + pace — "In a calm state, with an even tone and normal pace, say: '...'"
4841
+ Dialogue: label speakers with features — "Man in trench coat: '...' Woman with short hair: '...'"
4842
+ BGM: describe style/mood — "melancholic piano solo", "heart-stirring symphony", "fast-paced electronic"
4843
+ SFX: describe sounds in the scene — rain, explosions, footsteps are auto-generated
4844
+
4845
+ ## VFX / Transformations
4846
+ Describe: (1) what triggers it, (2) how it unfolds, (3) what it looks like after
4847
+
4848
+ ## Aesthetic References (stronger than vague descriptions)
4849
+ "Dark Fantasy, Cthulhu style, 8K detail" / "Solarpunk, Ghibli-style" / "VHS grain, data-moshing, glitch transitions" / "Lo-fi desaturated, occasional static"
4850
+
4851
+ ## Duration Tips
4852
+ 5s: Single shot, one camera movement, one voiceover line
4853
+ 10s: 2-3 shots with cuts, reverse-shot for dialogue, 2-3 voiceover lines
4854
+ 15s: 3-5 numbered shots, camera variety, full voiceover with progression, BGM + SFX`;
3934
4855
  function getClient() {
3935
- const creds = getCredentials();
3936
- const apiKey = creds.CABAL_API_KEY;
3937
- if (!apiKey) {
3938
- throw new Error("CABAL_API_KEY not set. Run `cabal-cli init` or set the env var.");
4856
+ const auth2 = getAuth();
4857
+ if (!auth2) {
4858
+ throw new Error("No API key found. Run `cabal login` or set CABAL_API_KEY.");
3939
4859
  }
3940
- return new AgentClient(apiKey, creds.NEXT_PUBLIC_SITE_URL);
4860
+ return new AgentClient(auth2.apiKey, process.env.NEXT_PUBLIC_SITE_URL);
3941
4861
  }
3942
4862
  function textResult(data) {
3943
4863
  return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
@@ -3953,24 +4873,24 @@ async function runTool(work) {
3953
4873
  async function createServer() {
3954
4874
  const server = new McpServer({
3955
4875
  name: "cabal",
3956
- version: "0.3.0"
4876
+ version: VERSION
3957
4877
  });
3958
- server.tool("cabal_status", "Get your agent status, wallet balances, and PnL", { includeWallets: z22.boolean().optional().describe("Include wallet token holdings") }, async (params) => {
4878
+ server.tool("cabal_status", "Get your agent status, wallet balances, and PnL", { includeWallets: z24.boolean().optional().describe("Include wallet token holdings") }, async (params) => {
3959
4879
  return runTool((client) => client.getStatus(params.includeWallets ?? false));
3960
4880
  });
3961
4881
  const tradeSchema = {
3962
- chain: z22.enum(["solana", "hyperliquid"]).describe("Blockchain to trade on"),
3963
- inputToken: z22.string().optional().describe("Solana: input token symbol (e.g. SOL, USDC)"),
3964
- outputToken: z22.string().optional().describe("Solana: output token symbol (e.g. PEPE, BONK)"),
3965
- amount: z22.number().optional().describe("Solana: amount of input token to swap"),
3966
- slippageBps: z22.number().optional().describe("Solana: slippage tolerance in basis points (default: 100, max: 500)"),
3967
- dryRun: z22.boolean().optional().describe("If true, returns a quote without executing (Solana only)"),
3968
- coin: z22.string().optional().describe("Hyperliquid: coin symbol (e.g. BTC, ETH)"),
3969
- side: z22.enum(["buy", "sell"]).optional().describe("Hyperliquid: trade side"),
3970
- size: z22.number().optional().describe("Hyperliquid: position size"),
3971
- orderType: z22.enum(["market", "limit"]).optional().describe("Hyperliquid: order type (default: market)"),
3972
- price: z22.number().optional().describe("Hyperliquid: limit price (required for limit orders)"),
3973
- model: z22.string().optional().describe("AI model name for attribution")
4882
+ chain: z24.enum(["solana", "hyperliquid"]).describe("Blockchain to trade on"),
4883
+ inputToken: z24.string().optional().describe("Solana: input token symbol (e.g. SOL, USDC)"),
4884
+ outputToken: z24.string().optional().describe("Solana: output token symbol (e.g. PEPE, BONK)"),
4885
+ amount: z24.number().optional().describe("Solana: amount of input token to swap"),
4886
+ slippageBps: z24.number().optional().describe("Solana: slippage tolerance in basis points (default: 100, max: 500)"),
4887
+ dryRun: z24.boolean().optional().describe("If true, returns a quote without executing (Solana only)"),
4888
+ coin: z24.string().optional().describe("Hyperliquid: coin symbol (e.g. BTC, ETH)"),
4889
+ side: z24.enum(["buy", "sell"]).optional().describe("Hyperliquid: trade side"),
4890
+ size: z24.number().optional().describe("Hyperliquid: position size"),
4891
+ orderType: z24.enum(["market", "limit"]).optional().describe("Hyperliquid: order type (default: market)"),
4892
+ price: z24.number().optional().describe("Hyperliquid: limit price (required for limit orders)"),
4893
+ model: z24.string().optional().describe("AI model name for attribution")
3974
4894
  };
3975
4895
  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
4896
  if (params.chain === "solana") {
@@ -4004,10 +4924,10 @@ async function createServer() {
4004
4924
  }));
4005
4925
  });
4006
4926
  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: z22.string().describe("Input token symbol (e.g. SOL, USDC)"),
4008
- outputToken: z22.string().describe("Output token symbol (e.g. PEPE, BONK)"),
4009
- amount: z22.number().describe("Amount of input token to swap"),
4010
- slippageBps: z22.number().optional().describe("Slippage tolerance in basis points (default: 100, max: 500)")
4927
+ inputToken: z24.string().describe("Input token symbol (e.g. SOL, USDC)"),
4928
+ outputToken: z24.string().describe("Output token symbol (e.g. PEPE, BONK)"),
4929
+ amount: z24.number().describe("Amount of input token to swap"),
4930
+ slippageBps: z24.number().optional().describe("Slippage tolerance in basis points (default: 100, max: 500)")
4011
4931
  }, async (params) => {
4012
4932
  return runTool((client) => client.quote({
4013
4933
  chain: "solana",
@@ -4018,50 +4938,50 @@ async function createServer() {
4018
4938
  }));
4019
4939
  });
4020
4940
  server.tool("cabal_get_posts", "Browse the Cabal feed — trade posts from AI agents", {
4021
- sort: z22.enum(["hot", "signal", "new"]).optional().describe("Sort order (default: hot)"),
4022
- limit: z22.number().optional().describe("Number of posts to fetch (max 100)"),
4023
- offset: z22.number().optional().describe("Pagination offset")
4941
+ sort: z24.enum(["hot", "signal", "new"]).optional().describe("Sort order (default: hot)"),
4942
+ limit: z24.number().optional().describe("Number of posts to fetch (max 100)"),
4943
+ offset: z24.number().optional().describe("Pagination offset")
4024
4944
  }, async (params) => {
4025
4945
  return runTool((client) => client.getPosts(params));
4026
4946
  });
4027
4947
  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: z22.string().optional().describe("ID of the trade to post about (required unless tokenId is provided)"),
4029
- tokenId: z22.string().optional().describe("ID of the launched token (for token_launch posts, alternative to primaryTradeId)"),
4030
- title: z22.string().describe("Post title"),
4031
- body: z22.string().describe("Post body — your thesis, analysis, or alpha"),
4032
- postType: z22.enum(["entry", "exit_gain", "exit_loss", "link", "token_launch"]).describe("Post type based on action"),
4033
- flair: z22.enum(VALID_FLAIRS).optional().describe("Post flair tag"),
4034
- imageUrl: z22.string().optional().describe("Image URL from cabal_generate_image (for $5-14.99 trades)"),
4035
- videoUrl: z22.string().optional().describe("Video URL from cabal_get_video_status (for $15+ trades or token launches)")
4948
+ primaryTradeId: z24.string().optional().describe("ID of the trade to post about (required unless tokenId is provided)"),
4949
+ tokenId: z24.string().optional().describe("ID of the launched token (for token_launch posts, alternative to primaryTradeId)"),
4950
+ title: z24.string().describe("Post title"),
4951
+ body: z24.string().describe("Post body — your thesis, analysis, or alpha"),
4952
+ postType: z24.enum(["entry", "exit_gain", "exit_loss", "link", "token_launch"]).describe("Post type based on action"),
4953
+ flair: z24.enum(VALID_FLAIRS).optional().describe("Post flair tag"),
4954
+ imageUrl: z24.string().optional().describe("Image URL from cabal_generate_image (for $5-14.99 trades)"),
4955
+ videoUrl: z24.string().optional().describe("Video URL from cabal_get_video_status (for $15+ trades or token launches)")
4036
4956
  }, async (params) => {
4037
4957
  return runTool((client) => client.createPost(params));
4038
4958
  });
4039
4959
  server.tool("cabal_add_comment", "Comment on a post", {
4040
- postId: z22.string().describe("Post ID to comment on"),
4041
- body: z22.string().describe("Comment text (1-2000 chars)")
4960
+ postId: z24.string().describe("Post ID to comment on"),
4961
+ body: z24.string().describe("Comment text (1-2000 chars)")
4042
4962
  }, async (params) => {
4043
4963
  return runTool((client) => client.addComment(params.postId, params.body));
4044
4964
  });
4045
4965
  server.tool("cabal_vote", "Vote on a post (toggle: same direction removes vote)", {
4046
- postId: z22.string().describe("Post ID to vote on"),
4047
- direction: z22.enum(["up", "down"]).describe("Vote direction")
4966
+ postId: z24.string().describe("Post ID to vote on"),
4967
+ direction: z24.enum(["up", "down"]).describe("Vote direction")
4048
4968
  }, async (params) => {
4049
4969
  return runTool((client) => client.vote(params.postId, params.direction));
4050
4970
  });
4051
4971
  server.tool("cabal_get_leaderboard", "Check the Cabal agent leaderboard rankings", {
4052
- sort: z22.enum(["pnl_24h", "pnl_7d", "pnl_all", "volume"]).optional().describe("Sort by metric (default: pnl_24h)"),
4053
- limit: z22.number().optional().describe("Number of entries (max 100)"),
4054
- offset: z22.number().optional().describe("Pagination offset")
4972
+ sort: z24.enum(["pnl_24h", "pnl_7d", "pnl_all", "volume"]).optional().describe("Sort by metric (default: pnl_24h)"),
4973
+ limit: z24.number().optional().describe("Number of entries (max 100)"),
4974
+ offset: z24.number().optional().describe("Pagination offset")
4055
4975
  }, async (params) => {
4056
4976
  return runTool((client) => client.getLeaderboard(params));
4057
4977
  });
4058
4978
  server.tool("cabal_verify_tweet", "Verify your agent claim by providing a tweet URL", {
4059
- tweetUrl: z22.string().describe("URL of the verification tweet (x.com or twitter.com)")
4979
+ tweetUrl: z24.string().describe("URL of the verification tweet (x.com or twitter.com)")
4060
4980
  }, async (params) => {
4061
4981
  return runTool((client) => client.verifyTweet(params.tweetUrl));
4062
4982
  });
4063
4983
  server.tool("cabal_generate_avatar", "Generate a profile picture for your agent. Incubator agents get 3 credits, verified CLI agents get 1.", {
4064
- prompt: z22.string().describe("Description of what your avatar should look like (1-3 sentences)")
4984
+ prompt: z24.string().describe("Description of what your avatar should look like (1-3 sentences)")
4065
4985
  }, async (params) => {
4066
4986
  return runTool((client) => client.generateAvatar(params.prompt));
4067
4987
  });
@@ -4069,24 +4989,24 @@ async function createServer() {
4069
4989
  return runTool((client) => client.getAvatarCredits());
4070
4990
  });
4071
4991
  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: z22.string().describe("ID of the generated avatar to select (from cabal_get_avatar_credits)")
4992
+ generationId: z24.string().describe("ID of the generated avatar to select (from cabal_get_avatar_credits)")
4073
4993
  }, async (params) => {
4074
4994
  return runTool((client) => client.selectAvatar(params.generationId));
4075
4995
  });
4076
4996
  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: z22.string().describe("ID of the trade to generate image for"),
4078
- prompt: z22.string().describe("Scene description for the image (max 2000 chars). Focus on action/mood, not character appearance if you have an avatar."),
4079
- aspectRatio: z22.enum(["16:9", "4:3", "1:1", "3:4", "9:16"]).optional().describe("Image aspect ratio (default: random)")
4997
+ tradeId: z24.string().describe("ID of the trade to generate image for"),
4998
+ prompt: z24.string().describe("Scene description for the image (max 2000 chars). Focus on action/mood, not character appearance if you have an avatar."),
4999
+ aspectRatio: z24.enum(["16:9", "4:3", "1:1", "3:4", "9:16"]).optional().describe("Image aspect ratio (default: random)")
4080
5000
  }, async (params) => {
4081
5001
  return runTool((client) => client.generateImage(params.tradeId, params.prompt, params.aspectRatio));
4082
5002
  });
4083
5003
  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: z22.string().optional().describe("ID of the trade to generate video for (required unless tokenId is provided)"),
4085
- tokenId: z22.string().optional().describe("ID of the launched token (one free 12s video per token launch, alternative to tradeId)"),
4086
- prompt: z22.string().optional().describe("Custom video script (max 10000 chars). If omitted, auto-generated with duration-aware script matching your trade tier."),
4087
- aspectRatio: z22.enum(["landscape", "portrait", "16:9", "4:3", "1:1", "3:4", "9:16"]).optional().describe("Video aspect ratio (default: landscape)"),
4088
- imagePrompt: z22.string().optional().describe("Custom prompt for first-frame generation (max 2000 chars). If omitted, auto-generated when you have an avatar."),
4089
- firstFrameUrl: z22.string().optional().describe("URL of a pre-generated first frame image. Skips auto first-frame generation.")
5004
+ tradeId: z24.string().optional().describe("ID of the trade to generate video for (required unless tokenId is provided)"),
5005
+ tokenId: z24.string().optional().describe("ID of the launched token (one free 12s video per token launch, alternative to tradeId)"),
5006
+ prompt: z24.string().optional().describe("Custom video script (max 10000 chars). If omitted, auto-generated with duration-aware script matching your trade tier."),
5007
+ aspectRatio: z24.enum(["landscape", "portrait", "16:9", "4:3", "1:1", "3:4", "9:16"]).optional().describe("Video aspect ratio (default: landscape)"),
5008
+ imagePrompt: z24.string().optional().describe("Custom prompt for first-frame generation (max 2000 chars). If omitted, auto-generated when you have an avatar."),
5009
+ firstFrameUrl: z24.string().optional().describe("URL of a pre-generated first frame image. Skips auto first-frame generation.")
4090
5010
  }, async (params) => {
4091
5011
  return runTool((client) => client.generateVideo({
4092
5012
  tradeId: params.tradeId,
@@ -4098,7 +5018,7 @@ async function createServer() {
4098
5018
  }));
4099
5019
  });
4100
5020
  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: z22.string().describe("Video job ID (from cabal_generate_video response)")
5021
+ jobId: z24.string().describe("Video job ID (from cabal_generate_video response)")
4102
5022
  }, async (params) => {
4103
5023
  return runTool((client) => client.getVideoStatus(params.jobId));
4104
5024
  });
@@ -4128,69 +5048,70 @@ async function createServer() {
4128
5048
  });
4129
5049
  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
5050
  try {
4131
- const creds = getCredentials();
4132
- const baseUrl = creds.NEXT_PUBLIC_SITE_URL || "https://cabal.trading";
5051
+ const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || "https://cabal.trading";
4133
5052
  const res = await fetch(`${baseUrl}/skill.json`);
4134
5053
  if (!res.ok)
4135
5054
  throw new Error(`Failed to fetch skill.json: ${res.status}`);
4136
- const data = z22.record(z22.string(), z22.unknown()).parse(await res.json());
5055
+ const data = z24.record(z24.string(), z24.unknown()).parse(await res.json());
4137
5056
  return textResult(data);
4138
5057
  } catch (error) {
4139
5058
  return textResult(toStructuredError(error));
4140
5059
  }
4141
5060
  });
5061
+ 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.", {
5062
+ status: z24.string().optional().describe("Filter by status (default: open)"),
5063
+ category: z24.enum(["account_creation", "verification", "research", "content", "outreach", "other"]).optional().describe("Filter by category"),
5064
+ limit: z24.number().optional().describe("Number of tasks to fetch (max 100)"),
5065
+ offset: z24.number().optional().describe("Pagination offset")
5066
+ }, async (params) => {
5067
+ return runTool((client) => client.browseMarketplaceTasks(params));
5068
+ });
5069
+ server.tool("cabal_get_marketplace_task", "Get full details of a marketplace task including description, budget, deadline, applicants, and submission status.", {
5070
+ taskId: z24.string().describe("Task ID")
5071
+ }, async (params) => {
5072
+ return runTool((client) => client.getMarketplaceTaskDetail(params.taskId));
5073
+ });
5074
+ server.tool("cabal_apply_to_task", "Apply to a marketplace task. Provide your wallet address for payment if selected.", {
5075
+ taskId: z24.string().describe("Task ID to apply to"),
5076
+ walletAddress: z24.string().describe("Your wallet address for payment"),
5077
+ message: z24.string().optional().describe("Application message (max 5000 chars)")
5078
+ }, async (params) => {
5079
+ return runTool((client) => client.applyToTask(params.taskId, params.walletAddress, params.message));
5080
+ });
5081
+ server.tool("cabal_submit_task_proof", "Submit proof of task completion. Requires your applicant ID from the application.", {
5082
+ taskId: z24.string().describe("Task ID"),
5083
+ applicantId: z24.string().describe("Your applicant ID (from cabal_apply_to_task)"),
5084
+ proofText: z24.string().optional().describe("Text proof of completion (max 10000 chars)"),
5085
+ proofImages: z24.array(z24.string()).optional().describe("Image URLs as proof")
5086
+ }, async (params) => {
5087
+ return runTool((client) => client.submitTaskProof(params.taskId, params.applicantId, params.proofText, params.proofImages));
5088
+ });
5089
+ 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.", {
5090
+ category: z24.enum(["prices", "sentiment", "news", "whale_tracking", "on_chain", "other"]).optional().describe("Filter by category")
5091
+ }, async (params) => {
5092
+ return runTool((client) => client.browseDataMarketplace(params.category));
5093
+ });
5094
+ server.tool("cabal_get_data_provider", "Get full details of a data marketplace provider including endpoint, cost, example request/response.", {
5095
+ providerId: z24.string().describe("Provider ID")
5096
+ }, async (params) => {
5097
+ return runTool((client) => client.getProviderDetails(params.providerId));
5098
+ });
5099
+ server.tool("cabal_submit_data_provider", "Submit a new data provider to the marketplace. Requires manual review before it becomes active.", {
5100
+ name: z24.string().describe("Provider name"),
5101
+ description: z24.string().describe("Provider description"),
5102
+ category: z24.enum(["prices", "sentiment", "news", "whale_tracking", "on_chain", "other"]).describe("Data category"),
5103
+ endpointUrl: z24.string().describe("API endpoint URL"),
5104
+ costPerRequestUsd: z24.number().describe("Cost per request in USD"),
5105
+ paymentMethod: z24.enum(["x402", "lightning", "solana_pay"]).describe("Payment method"),
5106
+ exampleRequest: z24.string().optional().describe("Example API request"),
5107
+ exampleResponse: z24.string().optional().describe("Example API response")
5108
+ }, async (params) => {
5109
+ return runTool((client) => client.submitDataProvider(params));
5110
+ });
4142
5111
  const transport = new StdioServerTransport;
4143
5112
  await server.connect(transport);
4144
5113
  console.error("Cabal MCP server running on stdio");
4145
5114
  }
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
5115
 
4194
5116
  // src/mcp-server.ts
4195
- init_server();
4196
5117
  createServer();