@lucid-agents/taskmarket 1.12.1 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1021 -920
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -32,7 +32,7 @@ function csvArrayQueryParam(schema = z.string()) {
32
32
  }
33
33
 
34
34
  // ../../packages/shared/dist/schemas/task.schemas.js
35
- import { z as z3 } from "zod";
35
+ import { z as z4 } from "zod";
36
36
 
37
37
  // ../../packages/shared/dist/schemas/task-drops.schemas.js
38
38
  import { z as z2 } from "zod";
@@ -155,12 +155,42 @@ var TaskDropDirectoryResponseSchema = z2.object({
155
155
  nextCursor: z2.string().nullable()
156
156
  });
157
157
 
158
+ // ../../packages/shared/dist/schemas/hook.schemas.js
159
+ import { z as z3 } from "zod";
160
+ var HookAddressSchema = z3.string().regex(/^0x(?!0{40}$)[a-fA-F0-9]{40}$/, "Hook address must be a non-zero 20-byte hex address");
161
+ var HookTaskModeSchema = z3.enum(["bounty", "claim", "pitch", "benchmark", "auction"]);
162
+ var HookIndexInputSchema = z3.object({
163
+ limit: z3.number().int().min(1).max(100).optional().default(50)
164
+ });
165
+ var HookGetInputSchema = z3.object({
166
+ address: HookAddressSchema
167
+ });
168
+ var HookIndexEntrySchema = z3.object({
169
+ address: HookAddressSchema,
170
+ activePhaseTaskCount: z3.number().int().nonnegative(),
171
+ // The observation is scoped to the configured Taskmarket deployment. Clients must not infer
172
+ // that an address observed on one Base network is evidence for the same address on another.
173
+ chainId: z3.number().int().positive(),
174
+ modes: z3.array(HookTaskModeSchema).max(5).refine((modes) => new Set(modes).size === modes.length, "Hook modes must be distinct"),
175
+ taskCount: z3.number().int().nonnegative(),
176
+ taskIds: z3.array(z3.string()).max(8)
177
+ });
178
+ var HookIndexResponseSchema = z3.object({
179
+ hooks: z3.array(HookIndexEntrySchema).max(100),
180
+ hasMore: z3.boolean(),
181
+ observation: z3.literal("ordered-hook-registered-task-associations")
182
+ });
183
+ var HookAttachmentConfigurationSchema = z3.object({
184
+ defaultHooks: z3.array(HookAddressSchema).max(8).nullable(),
185
+ maxHooks: z3.literal(8)
186
+ });
187
+
158
188
  // ../../packages/shared/dist/schemas/task.schemas.js
159
189
  var TASK_DESCRIPTION_MAX_LENGTH = 1e4;
160
- var TaskMode = z3.enum(["bounty", "claim", "pitch", "benchmark", "auction"]);
161
- var TaskVisibility = z3.enum(["unlisted", "public", "private"]);
162
- var SubmissionVisibility = z3.enum(["public", "reveal_all", "winner_only", "never"]);
163
- var TaskStatus = z3.enum([
190
+ var TaskMode = z4.enum(["bounty", "claim", "pitch", "benchmark", "auction"]);
191
+ var TaskVisibility = z4.enum(["unlisted", "public", "private"]);
192
+ var SubmissionVisibility = z4.enum(["public", "reveal_all", "winner_only", "never"]);
193
+ var TaskStatus = z4.enum([
164
194
  "open",
165
195
  "claimed",
166
196
  "worker_selected",
@@ -172,9 +202,9 @@ var TaskStatus = z3.enum([
172
202
  "expired",
173
203
  "cancelled"
174
204
  ]);
175
- var TaskPhase = z3.enum(["active", "in_review", "awaiting_settlement", "resolved"]);
176
- var AuctionType = z3.enum(["dutch", "english", "reverse_dutch", "reverse_english"]);
177
- var PendingActionName = z3.enum([
205
+ var TaskPhase = z4.enum(["active", "in_review", "awaiting_settlement", "resolved"]);
206
+ var AuctionType = z4.enum(["dutch", "english", "reverse_dutch", "reverse_english"]);
207
+ var PendingActionName = z4.enum([
178
208
  "accept",
179
209
  "accept_submissions",
180
210
  "appeal",
@@ -197,70 +227,90 @@ var PendingActionName = z3.enum([
197
227
  "submit_proof",
198
228
  "update"
199
229
  ]);
200
- var PendingActionSchema = z3.object({
201
- role: z3.enum(["requester", "worker", "evaluator", "dispute_resolver", "anyone"]),
230
+ var PendingActionSchema = z4.object({
231
+ role: z4.enum(["requester", "worker", "evaluator", "dispute_resolver", "anyone"]),
202
232
  action: PendingActionName,
203
- command: z3.string(),
204
- eligibleAddress: z3.string().nullable().optional(),
205
- requiresPayment: z3.boolean().optional(),
206
- paymentAmount: z3.string().nullable().optional(),
207
- availableAfter: z3.string().nullable().optional(),
208
- availableUntil: z3.string().nullable().optional(),
209
- targetWorker: z3.string().nullable().optional()
210
- });
211
- var TaskAwardSchema = z3.object({
212
- workerAddress: z3.string(),
213
- workerAgentId: z3.string().nullable(),
214
- workerActorType: z3.enum(["agent", "human"]),
215
- rank: z3.number().int().positive(),
216
- isPrimary: z3.boolean(),
217
- grossAmount: z3.string(),
218
- workerPayment: z3.string(),
219
- platformFee: z3.string(),
220
- settlementTxHash: z3.string(),
221
- settledAt: z3.string(),
222
- rating: z3.number().min(0).max(100).nullable()
223
- });
224
- var TaskCreateSchema = z3.object({
225
- description: z3.string().min(1, "Description is required").max(TASK_DESCRIPTION_MAX_LENGTH, "Description is too long"),
233
+ command: z4.string(),
234
+ eligibleAddress: z4.string().nullable().optional(),
235
+ requiresPayment: z4.boolean().optional(),
236
+ paymentAmount: z4.string().nullable().optional(),
237
+ availableAfter: z4.string().nullable().optional(),
238
+ availableUntil: z4.string().nullable().optional(),
239
+ targetWorker: z4.string().nullable().optional()
240
+ });
241
+ var TaskAwardSchema = z4.object({
242
+ workerAddress: z4.string(),
243
+ workerAgentId: z4.string().nullable(),
244
+ workerActorType: z4.enum(["agent", "human"]),
245
+ rank: z4.number().int().positive(),
246
+ isPrimary: z4.boolean(),
247
+ grossAmount: z4.string(),
248
+ workerPayment: z4.string(),
249
+ platformFee: z4.string(),
250
+ settlementTxHash: z4.string(),
251
+ settledAt: z4.string(),
252
+ rating: z4.number().min(0).max(100).nullable()
253
+ });
254
+ var TaskCreateSchema = z4.object({
255
+ description: z4.string().min(1, "Description is required").max(TASK_DESCRIPTION_MAX_LENGTH, "Description is too long"),
226
256
  reward: PositiveUsdcBaseUnitsSchema,
227
- duration: z3.number().positive("Duration must be positive"),
228
- tags: z3.array(z3.string()).max(10, "Maximum 10 tags allowed"),
257
+ duration: z4.number().positive("Duration must be positive"),
258
+ tags: z4.array(z4.string()).max(10, "Maximum 10 tags allowed"),
229
259
  mode: TaskMode.optional().default("bounty"),
230
260
  taskVisibility: TaskVisibility.optional().default("public"),
231
261
  submissionVisibility: SubmissionVisibility.optional().default("public"),
232
- stakeRequired: z3.boolean().optional().default(false),
262
+ stakeRequired: z4.boolean().optional().default(false),
233
263
  // Integral: this is client-supplied and lands in a `uint16` on chain, where a fraction is
234
264
  // not representable at all. Without `.int()` a 12.5 was accepted here and silently became
235
265
  // something else by the time it reached the contract (ADR-0069).
236
- stakeBps: z3.number().int().min(0).max(1e4).optional().default(0),
237
- pitchDeadline: z3.number().positive().optional(),
238
- bidDeadline: z3.number().positive().optional(),
266
+ stakeBps: z4.number().int().min(0).max(1e4).optional().default(0),
267
+ pitchDeadline: z4.number().positive().optional(),
268
+ bidDeadline: z4.number().positive().optional(),
239
269
  maxPrice: PositiveUsdcBaseUnitsSchema.optional(),
240
- metricDescription: z3.string().max(500).optional(),
241
- metricTarget: z3.string().max(200).optional(),
270
+ metricDescription: z4.string().max(500).optional(),
271
+ metricTarget: z4.string().max(200).optional(),
242
272
  auctionType: AuctionType.optional(),
243
273
  auctionStartPrice: UsdcBaseUnitsSchema.optional(),
244
274
  auctionFloorPrice: UsdcBaseUnitsSchema.optional(),
245
- hookContract: z3.string().optional(),
246
- hookData: z3.string().regex(/^0x(?:[0-9a-fA-F]{2})*$/, "hookData must be hex-encoded bytes (0x followed by pairs of hex digits)").optional(),
247
- evaluator: z3.string().optional(),
275
+ // `hookContract` remains the backwards-compatible single-custom-hook input. New callers
276
+ // should use ordered `hookContracts`; the Diamond prepends its current default hooks.
277
+ hookContract: HookAddressSchema.optional(),
278
+ hookContracts: z4.array(HookAddressSchema).min(1).max(8).optional(),
279
+ hookData: z4.string().regex(/^0x(?:[0-9a-fA-F]{2})*$/, "hookData must be hex-encoded bytes (0x followed by pairs of hex digits)").optional(),
280
+ evaluator: z4.string().optional(),
248
281
  // Integral for the same reason as `stakeBps` above: client-supplied, `uint16` on chain.
249
- evaluatorFeeBps: z3.number().int().min(0).max(1e4).optional(),
250
- evaluationWindowHours: z3.number().positive().optional(),
251
- appealWindowHours: z3.number().positive().optional(),
252
- disputeResolver: z3.string().optional(),
253
- taskDropId: z3.string().min(1).optional(),
282
+ evaluatorFeeBps: z4.number().int().min(0).max(1e4).optional(),
283
+ evaluationWindowHours: z4.number().positive().optional(),
284
+ appealWindowHours: z4.number().positive().optional(),
285
+ disputeResolver: z4.string().optional(),
286
+ taskDropId: z4.string().min(1).optional(),
254
287
  taskDropCreate: TaskDropCreateInlineSchema.optional(),
255
288
  // Phase 3 (ADR-0030): only meaningful when taskVisibility === 'private'. At least
256
289
  // one of the two invite mechanisms is required for a private task; either or both
257
290
  // may be provided (requester's choice).
258
- allowedViewers: z3.array(z3.string()).max(50, "Maximum 50 invited wallets at creation").optional(),
259
- accessPassword: z3.string().min(8, "Password must be at least 8 characters").max(200).optional()
291
+ allowedViewers: z4.array(z4.string()).max(50, "Maximum 50 invited wallets at creation").optional(),
292
+ accessPassword: z4.string().min(8, "Password must be at least 8 characters").max(200).optional()
260
293
  }).superRefine((input, ctx) => {
294
+ if (input.hookContract && input.hookContracts) {
295
+ ctx.addIssue({
296
+ code: z4.ZodIssueCode.custom,
297
+ path: ["hookContracts"],
298
+ message: "Provide hookContract or hookContracts, not both"
299
+ });
300
+ }
301
+ if (input.hookContracts) {
302
+ const normalized = input.hookContracts.map((hook) => hook.toLowerCase());
303
+ if (new Set(normalized).size !== normalized.length) {
304
+ ctx.addIssue({
305
+ code: z4.ZodIssueCode.custom,
306
+ path: ["hookContracts"],
307
+ message: "hookContracts must not contain duplicate addresses"
308
+ });
309
+ }
310
+ }
261
311
  if (input.taskDropId && input.taskDropCreate) {
262
312
  ctx.addIssue({
263
- code: z3.ZodIssueCode.custom,
313
+ code: z4.ZodIssueCode.custom,
264
314
  path: ["taskDropId"],
265
315
  message: "Provide taskDropId or taskDropCreate, not both"
266
316
  });
@@ -270,7 +320,7 @@ var TaskCreateSchema = z3.object({
270
320
  const hasPassword = !!input.accessPassword;
271
321
  if (!hasViewers && !hasPassword) {
272
322
  ctx.addIssue({
273
- code: z3.ZodIssueCode.custom,
323
+ code: z4.ZodIssueCode.custom,
274
324
  path: ["taskVisibility"],
275
325
  message: "A private task needs at least one of allowedViewers or accessPassword"
276
326
  });
@@ -278,14 +328,14 @@ var TaskCreateSchema = z3.object({
278
328
  } else {
279
329
  if (input.allowedViewers && input.allowedViewers.length > 0) {
280
330
  ctx.addIssue({
281
- code: z3.ZodIssueCode.custom,
331
+ code: z4.ZodIssueCode.custom,
282
332
  path: ["allowedViewers"],
283
333
  message: "allowedViewers is only valid when taskVisibility is private"
284
334
  });
285
335
  }
286
336
  if (input.accessPassword) {
287
337
  ctx.addIssue({
288
- code: z3.ZodIssueCode.custom,
338
+ code: z4.ZodIssueCode.custom,
289
339
  path: ["accessPassword"],
290
340
  message: "accessPassword is only valid when taskVisibility is private"
291
341
  });
@@ -297,20 +347,20 @@ var TaskCreateSchema = z3.object({
297
347
  const reward = toBaseUnits(input.reward);
298
348
  if (!input.maxPrice) {
299
349
  ctx.addIssue({
300
- code: z3.ZodIssueCode.custom,
350
+ code: z4.ZodIssueCode.custom,
301
351
  path: ["maxPrice"],
302
352
  message: "maxPrice is required for auction mode"
303
353
  });
304
354
  } else if (reward !== null && toBaseUnits(input.maxPrice) !== null && toBaseUnits(input.maxPrice) !== reward) {
305
355
  ctx.addIssue({
306
- code: z3.ZodIssueCode.custom,
356
+ code: z4.ZodIssueCode.custom,
307
357
  path: ["maxPrice"],
308
358
  message: "maxPrice must equal reward for auction mode"
309
359
  });
310
360
  }
311
361
  if (!input.auctionType) {
312
362
  ctx.addIssue({
313
- code: z3.ZodIssueCode.custom,
363
+ code: z4.ZodIssueCode.custom,
314
364
  path: ["auctionType"],
315
365
  message: "auctionType is required for auction mode (dutch, english, reverse_dutch, reverse_english)"
316
366
  });
@@ -318,14 +368,14 @@ var TaskCreateSchema = z3.object({
318
368
  }
319
369
  if (input.auctionType === "dutch" && input.auctionFloorPrice === void 0) {
320
370
  ctx.addIssue({
321
- code: z3.ZodIssueCode.custom,
371
+ code: z4.ZodIssueCode.custom,
322
372
  path: ["auctionFloorPrice"],
323
373
  message: "auctionFloorPrice is required for dutch auction type"
324
374
  });
325
375
  }
326
376
  if (input.auctionType === "reverse_dutch" && input.auctionStartPrice === void 0) {
327
377
  ctx.addIssue({
328
- code: z3.ZodIssueCode.custom,
378
+ code: z4.ZodIssueCode.custom,
329
379
  path: ["auctionStartPrice"],
330
380
  message: "auctionStartPrice is required for reverse_dutch auction type"
331
381
  });
@@ -337,135 +387,135 @@ var TaskCreateSchema = z3.object({
337
387
  const parsed = toBaseUnits(value);
338
388
  if (parsed !== null && reward !== null && parsed > reward) {
339
389
  ctx.addIssue({
340
- code: z3.ZodIssueCode.custom,
390
+ code: z4.ZodIssueCode.custom,
341
391
  path: [field],
342
392
  message: `${field} must be less than or equal to reward`
343
393
  });
344
394
  }
345
395
  }
346
396
  });
347
- var TaskResponseSchema = z3.object({
348
- id: z3.string(),
397
+ var TaskResponseSchema = z4.object({
398
+ id: z4.string(),
349
399
  // The task's public name (ADR-0098), e.g. 'TSK-4M0BXQ2E'. Nullable until the backfill in
350
400
  // migration 0051 completes; `id` remains the canonical URL segment.
351
- referenceCode: z3.string().nullable().optional(),
352
- requester: z3.string(),
353
- requesterPubkey: z3.string().nullable(),
354
- description: z3.string(),
355
- reward: z3.string(),
356
- escrowTxHash: z3.string(),
357
- createdAt: z3.string(),
358
- expiryTime: z3.string(),
401
+ referenceCode: z4.string().nullable().optional(),
402
+ requester: z4.string(),
403
+ requesterPubkey: z4.string().nullable(),
404
+ description: z4.string(),
405
+ reward: z4.string(),
406
+ escrowTxHash: z4.string(),
407
+ createdAt: z4.string(),
408
+ expiryTime: z4.string(),
359
409
  status: TaskStatus,
360
- tags: z3.array(z3.string()),
410
+ tags: z4.array(z4.string()),
361
411
  mode: TaskMode,
362
412
  taskVisibility: TaskVisibility.optional().default("public"),
363
413
  submissionVisibility: SubmissionVisibility.optional().default("public"),
364
414
  // Phase 3 (ADR-0030): whether a private task has a password mechanism configured --
365
415
  // never the hash itself, and never returned for a non-private task.
366
- hasAccessPassword: z3.boolean().optional(),
367
- stakeRequired: z3.boolean(),
416
+ hasAccessPassword: z4.boolean().optional(),
417
+ stakeRequired: z4.boolean(),
368
418
  // Same shape the request side already enforces (ADR-0069): a `uint16` fraction of the escrow,
369
419
  // so the response cannot describe a stake the contract could not have held.
370
- stakeBps: z3.number().int().min(0).max(1e4),
371
- pitchDeadline: z3.string().nullable(),
372
- bidDeadline: z3.string().nullable(),
373
- maxPrice: z3.string().nullable(),
374
- metricDescription: z3.string().nullable(),
375
- metricTarget: z3.string().nullable(),
376
- claimedBy: z3.string().nullable(),
377
- claimedAt: z3.string().nullable(),
420
+ stakeBps: z4.number().int().min(0).max(1e4),
421
+ pitchDeadline: z4.string().nullable(),
422
+ bidDeadline: z4.string().nullable(),
423
+ maxPrice: z4.string().nullable(),
424
+ metricDescription: z4.string().nullable(),
425
+ metricTarget: z4.string().nullable(),
426
+ claimedBy: z4.string().nullable(),
427
+ claimedAt: z4.string().nullable(),
378
428
  // Required, never optional: this is the multiplier every net-reward figure a client shows is
379
429
  // derived from, and the column behind it has been `NOT NULL` since the first migration. A
380
430
  // reader that had to supply its own value on absence would be guessing at money.
381
- platformFeeBps: z3.number().int().min(0).max(1e4),
382
- submissionCount: z3.number().optional().default(0),
383
- awardCount: z3.number().int().nonnegative().optional(),
431
+ platformFeeBps: z4.number().int().min(0).max(1e4),
432
+ submissionCount: z4.number().optional().default(0),
433
+ awardCount: z4.number().int().nonnegative().optional(),
384
434
  // Read-time projection of the rank-1 task_awards row -- not a separately
385
435
  // written field, so it cannot drift out of sync the way the old worker/
386
436
  // rating compatibility fields could (see ADR-0006). null before settlement.
387
- primaryAward: z3.object({
388
- workerAddress: z3.string(),
389
- rating: z3.number().min(0).max(100).nullable()
437
+ primaryAward: z4.object({
438
+ workerAddress: z4.string(),
439
+ rating: z4.number().min(0).max(100).nullable()
390
440
  }).nullable().optional(),
391
- pitchCount: z3.number().optional().default(0),
392
- requesterAgentId: z3.string().nullable().optional(),
393
- requesterActorType: z3.enum(["agent", "human"]).optional(),
394
- workerAgentId: z3.string().nullable().optional(),
395
- workerActorType: z3.enum(["agent", "human"]).optional(),
441
+ pitchCount: z4.number().optional().default(0),
442
+ requesterAgentId: z4.string().nullable().optional(),
443
+ requesterActorType: z4.enum(["agent", "human"]).optional(),
444
+ workerAgentId: z4.string().nullable().optional(),
445
+ workerActorType: z4.enum(["agent", "human"]).optional(),
396
446
  auctionType: AuctionType.nullable().optional(),
397
- auctionStartPrice: z3.string().nullable().optional(),
398
- auctionFloorPrice: z3.string().nullable().optional(),
399
- currentAuctionPrice: z3.string().nullable().optional(),
400
- auctionBidCount: z3.number().nullable().optional(),
401
- auctionPriceReachesFloorAt: z3.string().nullable().optional(),
402
- auctionPriceReachesMaxAt: z3.string().nullable().optional(),
403
- currentLowestBid: z3.string().nullable().optional(),
404
- hookContract: z3.string().nullable().optional(),
405
- evaluator: z3.string().nullable().optional(),
406
- evaluatorStake: z3.string().nullable().optional(),
447
+ auctionStartPrice: z4.string().nullable().optional(),
448
+ auctionFloorPrice: z4.string().nullable().optional(),
449
+ currentAuctionPrice: z4.string().nullable().optional(),
450
+ auctionBidCount: z4.number().nullable().optional(),
451
+ auctionPriceReachesFloorAt: z4.string().nullable().optional(),
452
+ auctionPriceReachesMaxAt: z4.string().nullable().optional(),
453
+ currentLowestBid: z4.string().nullable().optional(),
454
+ hookContract: z4.string().nullable().optional(),
455
+ evaluator: z4.string().nullable().optional(),
456
+ evaluatorStake: z4.string().nullable().optional(),
407
457
  // Genuinely absent when no evaluator is configured -- unlike `platformFeeBps`, null here means
408
458
  // "no evaluator fee", which is the same thing as zero, so a reader coalescing to 0 is right.
409
- evaluatorFeeBps: z3.number().int().min(0).max(1e4).nullable().optional(),
410
- evaluationWindow: z3.number().nullable().optional(),
411
- appealWindow: z3.number().nullable().optional(),
412
- disputeResolver: z3.string().nullable().optional(),
413
- appealDeadline: z3.string().nullable().optional(),
414
- evaluatorDeadline: z3.string().nullable().optional(),
415
- verdictType: z3.enum(["APPROVE", "REJECT", "PARTIAL"]).nullable().optional(),
416
- verdictScore: z3.number().nullable().optional(),
417
- verdictConfidence: z3.number().nullable().optional(),
418
- verdictEvidenceHash: z3.string().nullable().optional(),
419
- submissionWindowOpen: z3.boolean(),
459
+ evaluatorFeeBps: z4.number().int().min(0).max(1e4).nullable().optional(),
460
+ evaluationWindow: z4.number().nullable().optional(),
461
+ appealWindow: z4.number().nullable().optional(),
462
+ disputeResolver: z4.string().nullable().optional(),
463
+ appealDeadline: z4.string().nullable().optional(),
464
+ evaluatorDeadline: z4.string().nullable().optional(),
465
+ verdictType: z4.enum(["APPROVE", "REJECT", "PARTIAL"]).nullable().optional(),
466
+ verdictScore: z4.number().nullable().optional(),
467
+ verdictConfidence: z4.number().nullable().optional(),
468
+ verdictEvidenceHash: z4.string().nullable().optional(),
469
+ submissionWindowOpen: z4.boolean(),
420
470
  phase: TaskPhase,
421
- netReward: z3.string().nullable().optional(),
471
+ netReward: z4.string().nullable().optional(),
422
472
  pendingActions: PendingActionSchema.array().optional(),
423
- selfAward: z3.boolean().nullable().optional(),
424
- taskDropId: z3.string().nullable().optional(),
425
- taskDrop: z3.object({
426
- id: z3.string(),
427
- name: z3.string()
473
+ selfAward: z4.boolean().nullable().optional(),
474
+ taskDropId: z4.string().nullable().optional(),
475
+ taskDrop: z4.object({
476
+ id: z4.string(),
477
+ name: z4.string()
428
478
  }).nullable().optional(),
429
- hooks: z3.array(z3.string()).optional()
479
+ hooks: z4.array(z4.string()).optional()
430
480
  });
431
- var TaskListInputSchema = z3.object({
432
- limit: z3.number().min(1).max(100).optional().default(20),
433
- cursor: z3.string().optional(),
434
- status: z3.union([TaskStatus, z3.literal("ALL")]).optional().default("ALL"),
481
+ var TaskListInputSchema = z4.object({
482
+ limit: z4.number().min(1).max(100).optional().default(20),
483
+ cursor: z4.string().optional(),
484
+ status: z4.union([TaskStatus, z4.literal("ALL")]).optional().default("ALL"),
435
485
  phase: TaskPhase.optional(),
436
- mode: z3.enum(["ALL", "bounty", "claim", "pitch", "benchmark", "auction"]).optional().default("ALL"),
486
+ mode: z4.enum(["ALL", "bounty", "claim", "pitch", "benchmark", "auction"]).optional().default("ALL"),
437
487
  auctionType: AuctionType.optional(),
438
- requesterActorType: z3.enum(["agent", "human"]).optional(),
488
+ requesterActorType: z4.enum(["agent", "human"]).optional(),
439
489
  tags: csvArrayQueryParam(),
440
- minReward: z3.string().optional(),
441
- maxReward: z3.string().optional(),
442
- deadlineHours: z3.number().int().positive().optional(),
443
- requester: z3.string().optional(),
444
- worker: z3.string().optional(),
445
- taskDropId: z3.string().trim().min(1).optional(),
490
+ minReward: z4.string().optional(),
491
+ maxReward: z4.string().optional(),
492
+ deadlineHours: z4.number().int().positive().optional(),
493
+ requester: z4.string().optional(),
494
+ worker: z4.string().optional(),
495
+ taskDropId: z4.string().trim().min(1).optional(),
446
496
  // Free-text search (ADR-0099). Bounded at 200 characters so a single query cannot ask for
447
497
  // unbounded work; longer input is refused by Zod with a machine-readable reason (ADR-0058)
448
498
  // rather than silently truncated into a different query than the one the user typed.
449
- q: z3.string().trim().min(1).max(200).optional(),
450
- sort: z3.enum(["newest", "reward_desc", "reward_asc", "deadline_asc", "relevance"]).optional().default("newest")
499
+ q: z4.string().trim().min(1).max(200).optional(),
500
+ sort: z4.enum(["newest", "reward_desc", "reward_asc", "deadline_asc", "relevance"]).optional().default("newest")
451
501
  });
452
- var TaskListResponseSchema = z3.object({
453
- tasks: z3.array(TaskResponseSchema),
454
- nextCursor: z3.string().nullable(),
455
- hasMore: z3.boolean()
502
+ var TaskListResponseSchema = z4.object({
503
+ tasks: z4.array(TaskResponseSchema),
504
+ nextCursor: z4.string().nullable(),
505
+ hasMore: z4.boolean()
456
506
  });
457
- var TaskInboxInputSchema = z3.object({
458
- address: z3.string()
507
+ var TaskInboxInputSchema = z4.object({
508
+ address: z4.string()
459
509
  });
460
- var TaskInboxResponseSchema = z3.object({
461
- asRequester: z3.array(TaskResponseSchema),
462
- asWorker: z3.array(TaskResponseSchema),
510
+ var TaskInboxResponseSchema = z4.object({
511
+ asRequester: z4.array(TaskResponseSchema),
512
+ asWorker: z4.array(TaskResponseSchema),
463
513
  // Phase 3 (ADR-0030): private tasks this address has been wallet-allowlisted onto,
464
514
  // surfaced here (self-authed only) as the in-app invite-discovery mechanism rather
465
515
  // than a separate notification-center feature.
466
- invitedPrivateTasks: z3.array(TaskResponseSchema).optional().default([])
516
+ invitedPrivateTasks: z4.array(TaskResponseSchema).optional().default([])
467
517
  });
468
- var TaskActionIntent = z3.enum([
518
+ var TaskActionIntent = z4.enum([
469
519
  "review_work",
470
520
  "select_worker",
471
521
  "submit_work",
@@ -477,25 +527,25 @@ var TaskActionIntent = z3.enum([
477
527
  "rate_workers",
478
528
  "select_auction_winner"
479
529
  ]);
480
- var TaskActionPriority = z3.enum(["urgent", "required", "follow_up"]);
481
- var TaskActionProgressSchema = z3.object({
482
- completed: z3.number().int().nonnegative(),
483
- total: z3.number().int().positive()
530
+ var TaskActionPriority = z4.enum(["urgent", "required", "follow_up"]);
531
+ var TaskActionProgressSchema = z4.object({
532
+ completed: z4.number().int().nonnegative(),
533
+ total: z4.number().int().positive()
484
534
  }).refine(({ completed, total }) => completed <= total, {
485
535
  message: "Completed progress cannot exceed the target total",
486
536
  path: ["completed"]
487
537
  });
488
- var TaskActionQueueItemSchema = z3.object({
489
- id: z3.string(),
538
+ var TaskActionQueueItemSchema = z4.object({
539
+ id: z4.string(),
490
540
  task: TaskResponseSchema,
491
541
  role: PendingActionSchema.shape.role,
492
542
  intent: TaskActionIntent,
493
543
  actions: PendingActionSchema.array().min(1),
494
544
  priority: TaskActionPriority,
495
- dueAt: z3.string().nullable(),
545
+ dueAt: z4.string().nullable(),
496
546
  progress: TaskActionProgressSchema.nullable().optional()
497
547
  });
498
- var TaskActionWaitingReason = z3.enum([
548
+ var TaskActionWaitingReason = z4.enum([
499
549
  "waiting_for_submissions",
500
550
  "waiting_for_worker",
501
551
  "waiting_for_review",
@@ -503,81 +553,81 @@ var TaskActionWaitingReason = z3.enum([
503
553
  "waiting_for_appeal_window",
504
554
  "waiting_for_settlement"
505
555
  ]);
506
- var TaskActionWaitingItemSchema = z3.object({
507
- id: z3.string(),
556
+ var TaskActionWaitingItemSchema = z4.object({
557
+ id: z4.string(),
508
558
  task: TaskResponseSchema,
509
559
  role: PendingActionSchema.shape.role,
510
560
  reason: TaskActionWaitingReason,
511
- dueAt: z3.string().nullable()
561
+ dueAt: z4.string().nullable()
512
562
  });
513
- var TaskActionQueueResponseSchema = z3.object({
563
+ var TaskActionQueueResponseSchema = z4.object({
514
564
  items: TaskActionQueueItemSchema.array(),
515
- total: z3.number().int().nonnegative(),
516
- urgentTotal: z3.number().int().nonnegative(),
565
+ total: z4.number().int().nonnegative(),
566
+ urgentTotal: z4.number().int().nonnegative(),
517
567
  waiting: TaskActionWaitingItemSchema.array()
518
568
  });
519
569
  var TaskDetailResponseSchema = TaskResponseSchema.extend({
520
570
  pendingActions: PendingActionSchema.array(),
521
571
  awards: TaskAwardSchema.array().optional(),
522
- dreamsPerUsdc: z3.string().optional(),
572
+ dreamsPerUsdc: z4.string().optional(),
523
573
  // Optional as a set, not individually: the router emits `dreamsPerUsdc`, `bonusBps` and every
524
574
  // `estimated*` field together or not at all, depending on whether the task carries the DREAMS
525
575
  // hook. No client multiplies this by a split of its own -- the worker/requester estimates are
526
576
  // computed server-side -- so the absent case needs no fallback multiplier anywhere.
527
- bonusBps: z3.number().int().min(0).max(1e4).optional(),
528
- estimatedUsdBonusValue: z3.string().optional(),
529
- estimatedWorkerUsdBonusValue: z3.string().optional(),
530
- estimatedRequesterUsdBonusValue: z3.string().optional(),
531
- estimatedWorkerDreamsBonus: z3.string().optional(),
532
- estimatedRequesterDreamsBonus: z3.string().optional()
533
- });
534
- var CancelTaskInputSchema = z3.object({
535
- taskId: z3.string()
536
- });
537
- var RejectSubmissionInputSchema = z3.object({
538
- taskId: z3.string(),
539
- worker: z3.string()
540
- });
541
- var AssignEvaluatorInputSchema = z3.object({
542
- taskId: z3.string(),
543
- evaluator: z3.string(),
577
+ bonusBps: z4.number().int().min(0).max(1e4).optional(),
578
+ estimatedUsdBonusValue: z4.string().optional(),
579
+ estimatedWorkerUsdBonusValue: z4.string().optional(),
580
+ estimatedRequesterUsdBonusValue: z4.string().optional(),
581
+ estimatedWorkerDreamsBonus: z4.string().optional(),
582
+ estimatedRequesterDreamsBonus: z4.string().optional()
583
+ });
584
+ var CancelTaskInputSchema = z4.object({
585
+ taskId: z4.string()
586
+ });
587
+ var RejectSubmissionInputSchema = z4.object({
588
+ taskId: z4.string(),
589
+ worker: z4.string()
590
+ });
591
+ var AssignEvaluatorInputSchema = z4.object({
592
+ taskId: z4.string(),
593
+ evaluator: z4.string(),
544
594
  // Integral: same field, same `uint16`, and the two request-side schemas must not disagree
545
595
  // about what a caller may send.
546
- evaluatorFeeBps: z3.number().int().min(0).max(1e4).optional(),
547
- evaluationWindowHours: z3.number().positive().optional(),
548
- appealWindowHours: z3.number().positive().optional(),
549
- disputeResolver: z3.string().optional()
596
+ evaluatorFeeBps: z4.number().int().min(0).max(1e4).optional(),
597
+ evaluationWindowHours: z4.number().positive().optional(),
598
+ appealWindowHours: z4.number().positive().optional(),
599
+ disputeResolver: z4.string().optional()
550
600
  });
551
- var RefundExpiredInputSchema = z3.object({
552
- taskId: z3.string()
601
+ var RefundExpiredInputSchema = z4.object({
602
+ taskId: z4.string()
553
603
  });
554
- var UpdateTaskInputSchema = z3.object({
555
- taskId: z3.string(),
604
+ var UpdateTaskInputSchema = z4.object({
605
+ taskId: z4.string(),
556
606
  reward: PositiveUsdcBaseUnitsSchema.optional(),
557
- expiryTime: z3.number().int().positive().optional(),
558
- bidDeadline: z3.number().int().positive().optional(),
559
- pitchDeadline: z3.number().int().positive().optional(),
607
+ expiryTime: z4.number().int().positive().optional(),
608
+ bidDeadline: z4.number().int().positive().optional(),
609
+ pitchDeadline: z4.number().int().positive().optional(),
560
610
  auctionFloorPrice: UsdcBaseUnitsSchema.optional(),
561
611
  auctionStartPrice: UsdcBaseUnitsSchema.optional(),
562
- description: z3.string().max(TASK_DESCRIPTION_MAX_LENGTH, "Description is too long").optional(),
563
- tags: z3.array(z3.string()).max(10, "Maximum 10 tags allowed").optional(),
564
- metricDescription: z3.string().max(500).optional()
612
+ description: z4.string().max(TASK_DESCRIPTION_MAX_LENGTH, "Description is too long").optional(),
613
+ tags: z4.array(z4.string()).max(10, "Maximum 10 tags allowed").optional(),
614
+ metricDescription: z4.string().max(500).optional()
565
615
  });
566
- var RequesterStatsSchema = z3.object({
567
- completedCount: z3.number(),
568
- selfAwardCount: z3.number(),
569
- cancelledAfterSubmissionsCount: z3.number(),
570
- expiredNoActionCount: z3.number(),
571
- expiredAfterRejectionsCount: z3.number(),
572
- totalTasksCreated: z3.number(),
573
- totalSubmissionAttempts: z3.number(),
574
- totalUniqueWorkers: z3.number()
616
+ var RequesterStatsSchema = z4.object({
617
+ completedCount: z4.number(),
618
+ selfAwardCount: z4.number(),
619
+ cancelledAfterSubmissionsCount: z4.number(),
620
+ expiredNoActionCount: z4.number(),
621
+ expiredAfterRejectionsCount: z4.number(),
622
+ totalTasksCreated: z4.number(),
623
+ totalSubmissionAttempts: z4.number(),
624
+ totalUniqueWorkers: z4.number()
575
625
  });
576
626
 
577
627
  // ../../packages/shared/dist/schemas/submission.schemas.js
578
- import { z as z4 } from "zod";
579
- var ArtifactRole = z4.enum(["preview", "source", "final", "attachment"]);
580
- var ArtifactMediaKind = z4.enum([
628
+ import { z as z5 } from "zod";
629
+ var ArtifactRole = z5.enum(["preview", "source", "final", "attachment"]);
630
+ var ArtifactMediaKind = z5.enum([
581
631
  "image",
582
632
  "video",
583
633
  "audio",
@@ -586,187 +636,187 @@ var ArtifactMediaKind = z4.enum([
586
636
  "archive",
587
637
  "unknown"
588
638
  ]);
589
- var ArtifactCreateSchema = z4.object({
590
- fileName: z4.string().min(1, "File name is required").max(255, "File name is too long"),
591
- mimeType: z4.string().min(1, "MIME type is required").max(120, "MIME type is too long"),
639
+ var ArtifactCreateSchema = z5.object({
640
+ fileName: z5.string().min(1, "File name is required").max(255, "File name is too long"),
641
+ mimeType: z5.string().min(1, "MIME type is required").max(120, "MIME type is too long"),
592
642
  role: ArtifactRole.optional().default("attachment"),
593
- file: z4.string().min(1, "File is required")
594
- });
595
- var ArtifactResponseSchema = z4.object({
596
- id: z4.string(),
597
- taskId: z4.string(),
598
- submissionId: z4.string(),
599
- workerAddress: z4.string(),
600
- workerAgentId: z4.string().nullable(),
643
+ file: z5.string().min(1, "File is required")
644
+ });
645
+ var ArtifactResponseSchema = z5.object({
646
+ id: z5.string(),
647
+ taskId: z5.string(),
648
+ submissionId: z5.string(),
649
+ workerAddress: z5.string(),
650
+ workerAgentId: z5.string().nullable(),
601
651
  role: ArtifactRole,
602
- fileName: z4.string(),
603
- mimeType: z4.string(),
652
+ fileName: z5.string(),
653
+ mimeType: z5.string(),
604
654
  mediaKind: ArtifactMediaKind,
605
- storageUri: z4.string(),
606
- sizeBytes: z4.number(),
607
- sha256Hash: z4.string(),
608
- keccak256Hash: z4.string(),
609
- displayOrder: z4.number(),
610
- textPreview: z4.string().optional(),
611
- previewUrl: z4.string().optional(),
612
- previewExpiresAt: z4.string().optional()
613
- });
614
- var SubmissionCreateSchema = z4.object({
615
- taskId: z4.string(),
616
- workerAddress: z4.string(),
617
- artifacts: z4.array(ArtifactCreateSchema).min(1).max(20),
618
- signature: z4.string()
619
- });
620
- var SubmissionResponseSchema = z4.object({
621
- id: z4.string(),
655
+ storageUri: z5.string(),
656
+ sizeBytes: z5.number(),
657
+ sha256Hash: z5.string(),
658
+ keccak256Hash: z5.string(),
659
+ displayOrder: z5.number(),
660
+ textPreview: z5.string().optional(),
661
+ previewUrl: z5.string().optional(),
662
+ previewExpiresAt: z5.string().optional()
663
+ });
664
+ var SubmissionCreateSchema = z5.object({
665
+ taskId: z5.string(),
666
+ workerAddress: z5.string(),
667
+ artifacts: z5.array(ArtifactCreateSchema).min(1).max(20),
668
+ signature: z5.string()
669
+ });
670
+ var SubmissionResponseSchema = z5.object({
671
+ id: z5.string(),
622
672
  // The submission's public name (ADR-0098), e.g. 'SUB-7K2QA9XF'. This is what the UI shows and
623
673
  // what search accepts; `id` stays the primary key and the idempotency key.
624
- referenceCode: z4.string().nullable().optional(),
625
- taskId: z4.string(),
626
- workerAddress: z4.string(),
627
- fileUrl: z4.string(),
628
- signature: z4.string(),
629
- submittedAt: z4.string(),
630
- rejectedAt: z4.string().nullable().optional(),
631
- workerAgentId: z4.string().nullable().optional(),
632
- deliverableHash: z4.string().nullable().optional(),
633
- submitTxHash: z4.string().nullable().optional(),
634
- artifacts: z4.array(ArtifactResponseSchema).optional().default([]),
635
- workerStats: z4.object({
636
- completedTasks: z4.number(),
637
- ratedTasks: z4.number(),
638
- totalStars: z4.number(),
639
- averageRating: z4.number()
674
+ referenceCode: z5.string().nullable().optional(),
675
+ taskId: z5.string(),
676
+ workerAddress: z5.string(),
677
+ fileUrl: z5.string(),
678
+ signature: z5.string(),
679
+ submittedAt: z5.string(),
680
+ rejectedAt: z5.string().nullable().optional(),
681
+ workerAgentId: z5.string().nullable().optional(),
682
+ deliverableHash: z5.string().nullable().optional(),
683
+ submitTxHash: z5.string().nullable().optional(),
684
+ artifacts: z5.array(ArtifactResponseSchema).optional().default([]),
685
+ workerStats: z5.object({
686
+ completedTasks: z5.number(),
687
+ ratedTasks: z5.number(),
688
+ totalStars: z5.number(),
689
+ averageRating: z5.number()
640
690
  }).nullable().optional()
641
691
  });
642
- var AgentWorkItemSchema = z4.object({
643
- taskId: z4.string(),
644
- taskTitle: z4.string(),
645
- completedAt: z4.string(),
646
- artifacts: z4.array(ArtifactResponseSchema)
692
+ var AgentWorkItemSchema = z5.object({
693
+ taskId: z5.string(),
694
+ taskTitle: z5.string(),
695
+ completedAt: z5.string(),
696
+ artifacts: z5.array(ArtifactResponseSchema)
647
697
  });
648
- var AgentWorkResponseSchema = z4.array(AgentWorkItemSchema);
649
- var DownloadRequestSchema = z4.object({
650
- acceptanceTxHash: z4.string(),
651
- artifactId: z4.string().optional()
698
+ var AgentWorkResponseSchema = z5.array(AgentWorkItemSchema);
699
+ var DownloadRequestSchema = z5.object({
700
+ acceptanceTxHash: z5.string(),
701
+ artifactId: z5.string().optional()
652
702
  });
653
- var DownloadResponseSchema = z4.object({
654
- fileUrl: z4.string(),
655
- keyBundle: z4.string().nullable().optional(),
656
- expiresAt: z4.string()
703
+ var DownloadResponseSchema = z5.object({
704
+ fileUrl: z5.string(),
705
+ keyBundle: z5.string().nullable().optional(),
706
+ expiresAt: z5.string()
657
707
  });
658
708
  var MAX_ARTIFACT_BYTES = 500 * 1024 * 1024;
659
- var RequestUploadUrlInputSchema = z4.object({
660
- taskId: z4.string(),
661
- workerAddress: z4.string(),
662
- signature: z4.string(),
663
- fileName: z4.string().min(1, "File name is required").max(255, "File name is too long"),
664
- mimeType: z4.string().min(1, "MIME type is required").max(120, "MIME type is too long"),
709
+ var RequestUploadUrlInputSchema = z5.object({
710
+ taskId: z5.string(),
711
+ workerAddress: z5.string(),
712
+ signature: z5.string(),
713
+ fileName: z5.string().min(1, "File name is required").max(255, "File name is too long"),
714
+ mimeType: z5.string().min(1, "MIME type is required").max(120, "MIME type is too long"),
665
715
  role: ArtifactRole.optional().default("attachment"),
666
- sizeBytes: z4.number().int().positive("Size must be positive").max(MAX_ARTIFACT_BYTES, "File must not exceed 500 MB")
716
+ sizeBytes: z5.number().int().positive("Size must be positive").max(MAX_ARTIFACT_BYTES, "File must not exceed 500 MB")
667
717
  });
668
- var RequestUploadUrlOutputSchema = z4.object({
669
- uploadUrl: z4.string(),
670
- artifactKey: z4.string()
718
+ var RequestUploadUrlOutputSchema = z5.object({
719
+ uploadUrl: z5.string(),
720
+ artifactKey: z5.string()
671
721
  });
672
- var ArtifactKeyInputSchema = z4.object({
673
- artifactKey: z4.string().min(1, "Artifact key is required"),
674
- fileName: z4.string().min(1, "File name is required").max(255, "File name is too long"),
675
- mimeType: z4.string().min(1, "MIME type is required").max(120, "MIME type is too long"),
722
+ var ArtifactKeyInputSchema = z5.object({
723
+ artifactKey: z5.string().min(1, "Artifact key is required"),
724
+ fileName: z5.string().min(1, "File name is required").max(255, "File name is too long"),
725
+ mimeType: z5.string().min(1, "MIME type is required").max(120, "MIME type is too long"),
676
726
  role: ArtifactRole.optional().default("attachment"),
677
- sizeBytes: z4.number().int().positive("Size must be positive").max(MAX_ARTIFACT_BYTES, "File must not exceed 500 MB"),
678
- sha256Hash: z4.string().regex(/^[0-9a-f]{64}$/, "sha256Hash must be 64 lowercase hex chars"),
679
- keccak256Hash: z4.string().regex(/^0x[0-9a-fA-F]{64}$/, "keccak256Hash must be 0x followed by 64 hex chars")
727
+ sizeBytes: z5.number().int().positive("Size must be positive").max(MAX_ARTIFACT_BYTES, "File must not exceed 500 MB"),
728
+ sha256Hash: z5.string().regex(/^[0-9a-f]{64}$/, "sha256Hash must be 64 lowercase hex chars"),
729
+ keccak256Hash: z5.string().regex(/^0x[0-9a-fA-F]{64}$/, "keccak256Hash must be 0x followed by 64 hex chars")
680
730
  });
681
- var SubmissionCreateFromKeysSchema = z4.object({
682
- taskId: z4.string(),
683
- workerAddress: z4.string(),
684
- artifacts: z4.array(ArtifactKeyInputSchema).min(1).max(20),
685
- signature: z4.string()
731
+ var SubmissionCreateFromKeysSchema = z5.object({
732
+ taskId: z5.string(),
733
+ workerAddress: z5.string(),
734
+ artifacts: z5.array(ArtifactKeyInputSchema).min(1).max(20),
735
+ signature: z5.string()
686
736
  });
687
737
 
688
738
  // ../../packages/shared/dist/schemas/agent.schemas.js
689
- import { z as z5 } from "zod";
690
- var ActorType = z5.enum(["agent", "human"]);
691
- var RegistrationSource = z5.enum(["cli", "web"]);
692
- var AgentStatsSchema = z5.object({
693
- address: z5.string(),
694
- agentId: z5.string().nullable().optional(),
739
+ import { z as z6 } from "zod";
740
+ var ActorType = z6.enum(["agent", "human"]);
741
+ var RegistrationSource = z6.enum(["cli", "web"]);
742
+ var AgentStatsSchema = z6.object({
743
+ address: z6.string(),
744
+ agentId: z6.string().nullable().optional(),
695
745
  actorType: ActorType.optional(),
696
- completedTasks: z5.number(),
697
- ratedTasks: z5.number(),
698
- totalStars: z5.number(),
699
- averageRating: z5.number(),
700
- totalEarnings: z5.string(),
701
- skills: z5.array(z5.string()).optional(),
702
- emailAddress: z5.string().nullable().optional(),
703
- credibility: z5.number().int().min(0).max(1e3).optional(),
704
- recentRatings: z5.array(z5.object({
705
- taskId: z5.string(),
706
- rating: z5.number(),
707
- createdAt: z5.string(),
708
- taskTitle: z5.string().nullable().optional(),
709
- feedbackText: z5.string().nullable().optional()
746
+ completedTasks: z6.number(),
747
+ ratedTasks: z6.number(),
748
+ totalStars: z6.number(),
749
+ averageRating: z6.number(),
750
+ totalEarnings: z6.string(),
751
+ skills: z6.array(z6.string()).optional(),
752
+ emailAddress: z6.string().nullable().optional(),
753
+ credibility: z6.number().int().min(0).max(1e3).optional(),
754
+ recentRatings: z6.array(z6.object({
755
+ taskId: z6.string(),
756
+ rating: z6.number(),
757
+ createdAt: z6.string(),
758
+ taskTitle: z6.string().nullable().optional(),
759
+ feedbackText: z6.string().nullable().optional()
710
760
  })).optional()
711
761
  });
712
- var AgentRegistrationInputSchema = z5.object({
762
+ var AgentRegistrationInputSchema = z6.object({
713
763
  source: RegistrationSource.optional().default("cli")
714
764
  });
715
- var LeaderboardInputSchema = z5.object({
765
+ var LeaderboardInputSchema = z6.object({
716
766
  // RFC-0013 (Phase 1): the rate limiter on this endpoint bounds request count, not rows
717
767
  // returned per request -- an unbounded limit would let one request dump the whole agent
718
768
  // population regardless of the limiter, defeating the point of rate-limiting it at all.
719
- limit: z5.number().int().min(1).max(100).optional().default(20),
720
- offset: z5.number().optional().default(0),
721
- sort: z5.enum(["reputation", "tasks"]).optional().default("reputation"),
722
- skill: z5.string().optional(),
723
- search: z5.string().optional(),
724
- minRating: z5.number().min(0).max(5).optional(),
725
- minTasks: z5.number().int().min(0).optional(),
769
+ limit: z6.number().int().min(1).max(100).optional().default(20),
770
+ offset: z6.number().optional().default(0),
771
+ sort: z6.enum(["reputation", "tasks"]).optional().default("reputation"),
772
+ skill: z6.string().optional(),
773
+ search: z6.string().optional(),
774
+ minRating: z6.number().min(0).max(5).optional(),
775
+ minTasks: z6.number().int().min(0).optional(),
726
776
  actorType: ActorType.optional()
727
777
  });
728
- var LeaderboardEntrySchema = z5.object({
729
- rank: z5.number(),
730
- address: z5.string(),
731
- agentId: z5.string().nullable(),
778
+ var LeaderboardEntrySchema = z6.object({
779
+ rank: z6.number(),
780
+ address: z6.string(),
781
+ agentId: z6.string().nullable(),
732
782
  actorType: ActorType.optional(),
733
- completedTasks: z5.number(),
734
- averageRating: z5.number(),
735
- totalEarnings: z5.string(),
736
- skills: z5.array(z5.string()),
737
- emailAddress: z5.string().nullable().optional(),
738
- credibility: z5.number().int().min(0).max(1e3).optional()
783
+ completedTasks: z6.number(),
784
+ averageRating: z6.number(),
785
+ totalEarnings: z6.string(),
786
+ skills: z6.array(z6.string()),
787
+ emailAddress: z6.string().nullable().optional(),
788
+ credibility: z6.number().int().min(0).max(1e3).optional()
739
789
  });
740
- var LeaderboardResponseSchema = z5.array(LeaderboardEntrySchema);
790
+ var LeaderboardResponseSchema = z6.array(LeaderboardEntrySchema);
741
791
 
742
792
  // ../../packages/shared/dist/schemas/rating.schemas.js
743
- import { z as z6 } from "zod";
744
- var RatingInputSchema = z6.object({
745
- taskId: z6.string(),
746
- worker: z6.string(),
747
- rating: z6.number().int().min(0).max(100),
748
- feedbackText: z6.string().max(500).optional(),
749
- raterAgentId: z6.number().int().nonnegative().optional()
750
- });
751
- var FeedbackSchema = z6.object({
752
- id: z6.string(),
753
- taskId: z6.string(),
754
- workerAddress: z6.string(),
755
- workerAgentId: z6.string().nullable(),
756
- requesterAddress: z6.string(),
757
- requesterAgentId: z6.string().nullable(),
758
- rating: z6.number(),
759
- feedbackText: z6.string().nullable(),
760
- ratingTxHash: z6.string().nullable(),
761
- createdAt: z6.string()
793
+ import { z as z7 } from "zod";
794
+ var RatingInputSchema = z7.object({
795
+ taskId: z7.string(),
796
+ worker: z7.string(),
797
+ rating: z7.number().int().min(0).max(100),
798
+ feedbackText: z7.string().max(500).optional(),
799
+ raterAgentId: z7.number().int().nonnegative().optional()
800
+ });
801
+ var FeedbackSchema = z7.object({
802
+ id: z7.string(),
803
+ taskId: z7.string(),
804
+ workerAddress: z7.string(),
805
+ workerAgentId: z7.string().nullable(),
806
+ requesterAddress: z7.string(),
807
+ requesterAgentId: z7.string().nullable(),
808
+ rating: z7.number(),
809
+ feedbackText: z7.string().nullable(),
810
+ ratingTxHash: z7.string().nullable(),
811
+ createdAt: z7.string()
762
812
  });
763
813
 
764
814
  // ../../packages/shared/dist/schemas/health.schemas.js
765
- import { z as z7 } from "zod";
766
- var HealthResponseSchema = z7.object({
767
- status: z7.literal("ok"),
768
- timestamp: z7.string(),
769
- environment: z7.string(),
815
+ import { z as z8 } from "zod";
816
+ var HealthResponseSchema = z8.object({
817
+ status: z8.literal("ok"),
818
+ timestamp: z8.string(),
819
+ environment: z8.string(),
770
820
  /**
771
821
  * The commit this process was built from, when the deploy stamped one.
772
822
  *
@@ -780,7 +830,7 @@ var HealthResponseSchema = z7.object({
780
830
  * Absent rather than a placeholder when unstamped, so a local or unstamped process cannot
781
831
  * be mistaken for a verified one.
782
832
  */
783
- commitSha: z7.string().optional(),
833
+ commitSha: z8.string().optional(),
784
834
  /**
785
835
  * The submission limits this process is actually enforcing, after any environment
786
836
  * override. Reported because a limit a caller cannot observe is a limit a test can only
@@ -788,9 +838,9 @@ var HealthResponseSchema = z7.object({
788
838
  * way to notice the backend was started with a different one, so it failed with a
789
839
  * confusing boundary error instead of saying the two disagreed.
790
840
  */
791
- limits: z7.object({
792
- freeSubmissionAllowance: z7.number().int().positive(),
793
- hardSubmissionCeiling: z7.number().int().positive()
841
+ limits: z8.object({
842
+ freeSubmissionAllowance: z8.number().int().positive(),
843
+ hardSubmissionCeiling: z8.number().int().positive()
794
844
  }),
795
845
  /**
796
846
  * Relayed-intent facts a caller can poll for, in the same spirit as `limits`: a queryable
@@ -805,7 +855,7 @@ var HealthResponseSchema = z7.object({
805
855
  * Absent means "no answer here", and it covers a process whose sweep has not run yet as well
806
856
  * as one that does not sweep at all. It never means zero.
807
857
  */
808
- intents: z7.object({
858
+ intents: z8.object({
809
859
  /**
810
860
  * When the count below was computed, not when it was served.
811
861
  *
@@ -814,67 +864,67 @@ var HealthResponseSchema = z7.object({
814
864
  * left behind by a worker that stopped running -- and the second is the more urgent of
815
865
  * the two, because a sweep that is not running is a queue nothing is draining.
816
866
  */
817
- measuredAt: z7.string(),
867
+ measuredAt: z8.string(),
818
868
  /**
819
869
  * Intents that are neither completed nor failed and have not been touched for well past
820
870
  * normal settlement. A count only -- the endpoint is public.
821
871
  */
822
- staleNonTerminal: z7.number().int().nonnegative()
872
+ staleNonTerminal: z8.number().int().nonnegative()
823
873
  }).optional()
824
874
  });
825
875
 
826
876
  // ../../packages/shared/dist/schemas/pitch.schemas.js
827
- import { z as z8 } from "zod";
828
- var PitchStatus = z8.enum(["pending", "selected", "rejected"]);
829
- var PitchCreateSchema = z8.object({
830
- taskId: z8.string().min(1, "Task ID is required"),
831
- workerAddress: z8.string().min(1, "Worker address is required"),
832
- pitchText: z8.string().min(1, "Pitch text is required"),
833
- estimatedDuration: z8.number().positive("Estimated duration must be positive").optional(),
834
- signature: z8.string().min(1, "Signature is required")
835
- });
836
- var PitchResponseSchema = z8.object({
837
- id: z8.string(),
838
- taskId: z8.string(),
839
- workerAddress: z8.string(),
840
- pitchText: z8.string(),
841
- estimatedDuration: z8.number().nullable(),
842
- status: PitchStatus,
843
- submittedAt: z8.string(),
844
- workerAgentId: z8.string().nullable().optional(),
845
- workerStats: z8.object({
846
- completedTasks: z8.number(),
847
- averageRating: z8.number().nullable()
848
- }).optional()
849
- });
850
- var PitchSelectSchema = z8.object({
851
- taskId: z8.string().min(1, "Task ID is required"),
852
- pitchId: z8.string().min(1, "Pitch ID is required"),
853
- workerAddress: z8.string().min(1, "Worker address is required"),
854
- signature: z8.string().min(1, "Signature is required")
855
- });
856
-
857
- // ../../packages/shared/dist/schemas/claim.schemas.js
858
877
  import { z as z9 } from "zod";
859
- var ClaimStatus = z9.enum(["active", "submitted", "forfeited", "returned"]);
860
- var ClaimCreateSchema = z9.object({
878
+ var PitchStatus = z9.enum(["pending", "selected", "rejected"]);
879
+ var PitchCreateSchema = z9.object({
861
880
  taskId: z9.string().min(1, "Task ID is required"),
862
881
  workerAddress: z9.string().min(1, "Worker address is required"),
882
+ pitchText: z9.string().min(1, "Pitch text is required"),
883
+ estimatedDuration: z9.number().positive("Estimated duration must be positive").optional(),
863
884
  signature: z9.string().min(1, "Signature is required")
864
885
  });
865
- var ClaimResponseSchema = z9.object({
886
+ var PitchResponseSchema = z9.object({
866
887
  id: z9.string(),
867
888
  taskId: z9.string(),
868
889
  workerAddress: z9.string(),
869
- stakeAmount: z9.string(),
870
- stakeTxHash: z9.string(),
871
- claimedAt: z9.string(),
890
+ pitchText: z9.string(),
891
+ estimatedDuration: z9.number().nullable(),
892
+ status: PitchStatus,
893
+ submittedAt: z9.string(),
894
+ workerAgentId: z9.string().nullable().optional(),
895
+ workerStats: z9.object({
896
+ completedTasks: z9.number(),
897
+ averageRating: z9.number().nullable()
898
+ }).optional()
899
+ });
900
+ var PitchSelectSchema = z9.object({
901
+ taskId: z9.string().min(1, "Task ID is required"),
902
+ pitchId: z9.string().min(1, "Pitch ID is required"),
903
+ workerAddress: z9.string().min(1, "Worker address is required"),
904
+ signature: z9.string().min(1, "Signature is required")
905
+ });
906
+
907
+ // ../../packages/shared/dist/schemas/claim.schemas.js
908
+ import { z as z10 } from "zod";
909
+ var ClaimStatus = z10.enum(["active", "submitted", "forfeited", "returned"]);
910
+ var ClaimCreateSchema = z10.object({
911
+ taskId: z10.string().min(1, "Task ID is required"),
912
+ workerAddress: z10.string().min(1, "Worker address is required"),
913
+ signature: z10.string().min(1, "Signature is required")
914
+ });
915
+ var ClaimResponseSchema = z10.object({
916
+ id: z10.string(),
917
+ taskId: z10.string(),
918
+ workerAddress: z10.string(),
919
+ stakeAmount: z10.string(),
920
+ stakeTxHash: z10.string(),
921
+ claimedAt: z10.string(),
872
922
  status: ClaimStatus
873
923
  });
874
924
 
875
925
  // ../../packages/shared/dist/schemas/proof.schemas.js
876
- import { z as z10 } from "zod";
877
- var ProofType = z10.enum([
926
+ import { z as z11 } from "zod";
927
+ var ProofType = z11.enum([
878
928
  "url",
879
929
  "screenshot",
880
930
  "api_data",
@@ -884,261 +934,261 @@ var ProofType = z10.enum([
884
934
  "tlsn",
885
935
  "zk"
886
936
  ]);
887
- var ProofStatus = z10.enum(["pending", "verified", "rejected"]);
888
- var ProofSubmitSchema = z10.object({
889
- taskId: z10.string().min(1, "Task ID is required"),
890
- workerAddress: z10.string().min(1, "Worker address is required"),
891
- proofData: z10.string().min(1, "Proof data is required").max(1e4, "Proof data is too long"),
937
+ var ProofStatus = z11.enum(["pending", "verified", "rejected"]);
938
+ var ProofSubmitSchema = z11.object({
939
+ taskId: z11.string().min(1, "Task ID is required"),
940
+ workerAddress: z11.string().min(1, "Worker address is required"),
941
+ proofData: z11.string().min(1, "Proof data is required").max(1e4, "Proof data is too long"),
892
942
  proofType: ProofType,
893
- metricValue: z10.string().max(200).optional(),
894
- signature: z10.string().min(1, "Signature is required")
943
+ metricValue: z11.string().max(200).optional(),
944
+ signature: z11.string().min(1, "Signature is required")
895
945
  });
896
- var ProofResponseSchema = z10.object({
897
- id: z10.string(),
898
- taskId: z10.string(),
899
- workerAddress: z10.string(),
900
- proofData: z10.string(),
946
+ var ProofResponseSchema = z11.object({
947
+ id: z11.string(),
948
+ taskId: z11.string(),
949
+ workerAddress: z11.string(),
950
+ proofData: z11.string(),
901
951
  proofType: ProofType,
902
- metricValue: z10.string().nullable(),
952
+ metricValue: z11.string().nullable(),
903
953
  status: ProofStatus,
904
- submissionId: z10.string().nullable(),
905
- submittedAt: z10.string(),
906
- workerAgentId: z10.string().nullable().optional()
954
+ submissionId: z11.string().nullable(),
955
+ submittedAt: z11.string(),
956
+ workerAgentId: z11.string().nullable().optional()
907
957
  });
908
958
 
909
959
  // ../../packages/shared/dist/schemas/bid.schemas.js
910
- import { z as z11 } from "zod";
911
- var BidCreateSchema = z11.object({
912
- taskId: z11.string().min(1, "Task ID is required"),
960
+ import { z as z12 } from "zod";
961
+ var BidCreateSchema = z12.object({
962
+ taskId: z12.string().min(1, "Task ID is required"),
913
963
  price: PositiveUsdcBaseUnitsSchema
914
964
  });
915
- var AuctionAcceptSchema = z11.object({
916
- taskId: z11.string().min(1, "Task ID is required"),
965
+ var AuctionAcceptSchema = z12.object({
966
+ taskId: z12.string().min(1, "Task ID is required"),
917
967
  minPrice: UsdcBaseUnitsSchema.optional()
918
968
  });
919
- var BidResponseSchema = z11.object({
920
- id: z11.string(),
921
- taskId: z11.string(),
922
- workerAddress: z11.string().nullable(),
923
- price: z11.string().nullable(),
924
- createdAt: z11.string(),
925
- workerAgentId: z11.string().nullable().optional(),
926
- isMyBid: z11.boolean().optional()
969
+ var BidResponseSchema = z12.object({
970
+ id: z12.string(),
971
+ taskId: z12.string(),
972
+ workerAddress: z12.string().nullable(),
973
+ price: z12.string().nullable(),
974
+ createdAt: z12.string(),
975
+ workerAgentId: z12.string().nullable().optional(),
976
+ isMyBid: z12.boolean().optional()
927
977
  });
928
978
 
929
979
  // ../../packages/shared/dist/schemas/wallet.schemas.js
930
- import { z as z12 } from "zod";
931
- var SetWithdrawalAddressInputSchema = z12.object({
980
+ import { z as z13 } from "zod";
981
+ var SetWithdrawalAddressInputSchema = z13.object({
932
982
  walletAddress: EthAddressSchema,
933
983
  withdrawalAddress: EthAddressSchema,
934
- signature: z12.string().min(1)
984
+ signature: z13.string().min(1)
935
985
  });
936
- var AccountRecoveryCodeSchema = z12.string().regex(/^\d{8}$/);
937
- var SetWithdrawalAddressOutputSchema = z12.object({
938
- withdrawalAddress: z12.string(),
986
+ var AccountRecoveryCodeSchema = z13.string().regex(/^\d{8}$/);
987
+ var SetWithdrawalAddressOutputSchema = z13.object({
988
+ withdrawalAddress: z13.string(),
939
989
  // Returned exactly once, in this same response -- there is no other way to see it again.
940
990
  accountRecoveryCode: AccountRecoveryCodeSchema
941
991
  });
942
- var ChangeWithdrawalAddressInputSchema = z12.object({
992
+ var ChangeWithdrawalAddressInputSchema = z13.object({
943
993
  address: EthAddressSchema,
944
994
  accountRecoveryCode: AccountRecoveryCodeSchema,
945
995
  newWithdrawalAddress: EthAddressSchema
946
996
  });
947
- var ChangeWithdrawalAddressOutputSchema = z12.object({
948
- withdrawalAddress: z12.string(),
997
+ var ChangeWithdrawalAddressOutputSchema = z13.object({
998
+ withdrawalAddress: z13.string(),
949
999
  // A fresh code, minted the same way, immediately: using a code invalidates it and
950
1000
  // replaces it, so the operator always holds exactly one current, unused code.
951
1001
  accountRecoveryCode: AccountRecoveryCodeSchema
952
1002
  });
953
- var RevealBackfilledRecoveryCodeInputSchema = z12.object({
1003
+ var RevealBackfilledRecoveryCodeInputSchema = z13.object({
954
1004
  address: EthAddressSchema,
955
- signature: z12.string().min(1)
1005
+ signature: z13.string().min(1)
956
1006
  });
957
- var RevealBackfilledRecoveryCodeOutputSchema = z12.object({
1007
+ var RevealBackfilledRecoveryCodeOutputSchema = z13.object({
958
1008
  accountRecoveryCode: AccountRecoveryCodeSchema
959
1009
  });
960
- var UsdcDomainSchema = z12.object({
961
- name: z12.string(),
962
- version: z12.string(),
963
- chainId: z12.number(),
964
- verifyingContract: z12.string()
1010
+ var UsdcDomainSchema = z13.object({
1011
+ name: z13.string(),
1012
+ version: z13.string(),
1013
+ chainId: z13.number(),
1014
+ verifyingContract: z13.string()
965
1015
  });
966
- var GetWithdrawalAddressOutputSchema = z12.object({
967
- withdrawalAddress: z12.string().nullable(),
1016
+ var GetWithdrawalAddressOutputSchema = z13.object({
1017
+ withdrawalAddress: z13.string().nullable(),
968
1018
  usdcDomain: UsdcDomainSchema
969
1019
  });
970
- var AuthorizationSchema = z12.object({
971
- from: z12.string(),
972
- to: z12.string(),
973
- value: z12.string(),
974
- validAfter: z12.string(),
975
- validBefore: z12.string(),
976
- nonce: z12.string()
1020
+ var AuthorizationSchema = z13.object({
1021
+ from: z13.string(),
1022
+ to: z13.string(),
1023
+ value: z13.string(),
1024
+ validAfter: z13.string(),
1025
+ validBefore: z13.string(),
1026
+ nonce: z13.string()
977
1027
  });
978
- var WithdrawInputSchema = z12.object({
1028
+ var WithdrawInputSchema = z13.object({
979
1029
  from: EthAddressSchema,
980
- amountBaseUnits: z12.string().min(1),
1030
+ amountBaseUnits: z13.string().min(1),
981
1031
  authorization: AuthorizationSchema,
982
- signature: z12.string().min(1)
1032
+ signature: z13.string().min(1)
983
1033
  });
984
- var WithdrawOutputSchema = z12.object({
985
- txHash: z12.string(),
986
- amountBaseUnits: z12.string(),
987
- to: z12.string()
1034
+ var WithdrawOutputSchema = z13.object({
1035
+ txHash: z13.string(),
1036
+ amountBaseUnits: z13.string(),
1037
+ to: z13.string()
988
1038
  });
989
- var DreamsBalanceOutputSchema = z12.object({
990
- claimableBaseUnits: z12.string()
1039
+ var DreamsBalanceOutputSchema = z13.object({
1040
+ claimableBaseUnits: z13.string()
991
1041
  });
992
- var WithdrawDreamsInputSchema = z12.object({
1042
+ var WithdrawDreamsInputSchema = z13.object({
993
1043
  workerAddress: EthAddressSchema,
994
1044
  destination: EthAddressSchema,
995
- nonce: z12.string().min(1),
996
- validBefore: z12.string().min(1),
997
- signature: z12.string().min(1)
998
- });
999
- var WithdrawDreamsOutputSchema = z12.object({
1000
- txHash: z12.string(),
1001
- destination: z12.string(),
1002
- claimedBaseUnits: z12.string(),
1003
- dreamsPerUsdc: z12.string(),
1004
- usdEquivalent: z12.string()
1005
- });
1006
- var ExchangeRateOutputSchema = z12.object({
1007
- dreamsPerUsdc: z12.string(),
1045
+ nonce: z13.string().min(1),
1046
+ validBefore: z13.string().min(1),
1047
+ signature: z13.string().min(1)
1048
+ });
1049
+ var WithdrawDreamsOutputSchema = z13.object({
1050
+ txHash: z13.string(),
1051
+ destination: z13.string(),
1052
+ claimedBaseUnits: z13.string(),
1053
+ dreamsPerUsdc: z13.string(),
1054
+ usdEquivalent: z13.string()
1055
+ });
1056
+ var ExchangeRateOutputSchema = z13.object({
1057
+ dreamsPerUsdc: z13.string(),
1008
1058
  // Both are read straight off `TaskTokenRewardHook`, which rejects either above 10000
1009
1059
  // (`InvalidBps`), and both are required here rather than optional: a client that had to
1010
1060
  // default the split would default it to the whole reward, and one that had to default the
1011
1061
  // bonus would report no bonus at all. Neither is a fact this endpoint may leave to the reader.
1012
- workerSplitBps: z12.number().int().min(0).max(1e4),
1013
- bonusBps: z12.number().int().min(0).max(1e4)
1062
+ workerSplitBps: z13.number().int().min(0).max(1e4),
1063
+ bonusBps: z13.number().int().min(0).max(1e4)
1014
1064
  });
1015
1065
 
1016
1066
  // ../../packages/shared/dist/schemas/xmtp.schemas.js
1017
- import { z as z13 } from "zod";
1018
- var XmtpPolicySchema = z13.enum(["allow", "deny", "quarantine"]);
1019
- var XmtpPolicyModeSchema = z13.enum(["allowlist", "open"]);
1020
- var AgentMessageEnvelopeSchema = z13.object({
1021
- schemaVersion: z13.literal(1),
1022
- type: z13.string().min(1),
1023
- requestId: z13.string().uuid(),
1024
- replyToRequestId: z13.string().uuid().nullable().optional(),
1025
- senderInboxId: z13.string().min(1),
1067
+ import { z as z14 } from "zod";
1068
+ var XmtpPolicySchema = z14.enum(["allow", "deny", "quarantine"]);
1069
+ var XmtpPolicyModeSchema = z14.enum(["allowlist", "open"]);
1070
+ var AgentMessageEnvelopeSchema = z14.object({
1071
+ schemaVersion: z14.literal(1),
1072
+ type: z14.string().min(1),
1073
+ requestId: z14.string().uuid(),
1074
+ replyToRequestId: z14.string().uuid().nullable().optional(),
1075
+ senderInboxId: z14.string().min(1),
1026
1076
  senderAddress: EthAddressSchema,
1027
- sentAt: z13.string().datetime(),
1028
- deadlineMs: z13.number().int().positive().optional(),
1029
- payload: z13.record(z13.string(), z13.unknown())
1030
- });
1031
- var XmtpBootstrapInputSchema = z13.object({
1032
- deviceId: z13.string().min(1),
1033
- apiToken: z13.string().min(1),
1034
- inboxId: z13.string().min(1),
1035
- installationId: z13.string().min(1),
1036
- dbPath: z13.string().min(1).optional(),
1037
- clientVersion: z13.string().min(1).optional()
1038
- });
1039
- var XmtpBootstrapOutputSchema = z13.object({
1040
- inboxId: z13.string(),
1041
- installationId: z13.string(),
1077
+ sentAt: z14.string().datetime(),
1078
+ deadlineMs: z14.number().int().positive().optional(),
1079
+ payload: z14.record(z14.string(), z14.unknown())
1080
+ });
1081
+ var XmtpBootstrapInputSchema = z14.object({
1082
+ deviceId: z14.string().min(1),
1083
+ apiToken: z14.string().min(1),
1084
+ inboxId: z14.string().min(1),
1085
+ installationId: z14.string().min(1),
1086
+ dbPath: z14.string().min(1).optional(),
1087
+ clientVersion: z14.string().min(1).optional()
1088
+ });
1089
+ var XmtpBootstrapOutputSchema = z14.object({
1090
+ inboxId: z14.string(),
1091
+ installationId: z14.string(),
1042
1092
  policyMode: XmtpPolicyModeSchema
1043
1093
  });
1044
- var XmtpStatusInputSchema = z13.object({
1045
- deviceId: z13.string().min(1),
1046
- apiToken: z13.string().min(1).optional()
1094
+ var XmtpStatusInputSchema = z14.object({
1095
+ deviceId: z14.string().min(1),
1096
+ apiToken: z14.string().min(1).optional()
1047
1097
  });
1048
- var XmtpStatusOutputSchema = z13.object({
1049
- inboxId: z13.string().nullable(),
1050
- enabled: z13.boolean(),
1098
+ var XmtpStatusOutputSchema = z14.object({
1099
+ inboxId: z14.string().nullable(),
1100
+ enabled: z14.boolean(),
1051
1101
  policyMode: XmtpPolicyModeSchema,
1052
- lastSeenAt: z13.string().datetime().nullable(),
1053
- activeInstallations: z13.array(z13.object({
1054
- installationId: z13.string(),
1055
- status: z13.string(),
1056
- lastSeenAt: z13.string().datetime()
1102
+ lastSeenAt: z14.string().datetime().nullable(),
1103
+ activeInstallations: z14.array(z14.object({
1104
+ installationId: z14.string(),
1105
+ status: z14.string(),
1106
+ lastSeenAt: z14.string().datetime()
1057
1107
  }))
1058
1108
  });
1059
- var XmtpHeartbeatInputSchema = z13.object({
1060
- deviceId: z13.string().min(1),
1061
- apiToken: z13.string().min(1),
1062
- installationId: z13.string().min(1)
1109
+ var XmtpHeartbeatInputSchema = z14.object({
1110
+ deviceId: z14.string().min(1),
1111
+ apiToken: z14.string().min(1),
1112
+ installationId: z14.string().min(1)
1063
1113
  });
1064
- var XmtpHeartbeatOutputSchema = z13.object({
1065
- ok: z13.literal(true)
1114
+ var XmtpHeartbeatOutputSchema = z14.object({
1115
+ ok: z14.literal(true)
1066
1116
  });
1067
- var XmtpPeerPolicyUpsertSchema = z13.object({
1068
- deviceId: z13.string().min(1),
1069
- apiToken: z13.string().min(1),
1070
- peerInboxId: z13.string().min(1),
1117
+ var XmtpPeerPolicyUpsertSchema = z14.object({
1118
+ deviceId: z14.string().min(1),
1119
+ apiToken: z14.string().min(1),
1120
+ peerInboxId: z14.string().min(1),
1071
1121
  policy: XmtpPolicySchema,
1072
- reason: z13.string().min(1).optional()
1122
+ reason: z14.string().min(1).optional()
1073
1123
  });
1074
- var XmtpPeerPolicyListSchema = z13.object({
1075
- deviceId: z13.string().min(1),
1076
- apiToken: z13.string().min(1).optional()
1124
+ var XmtpPeerPolicyListSchema = z14.object({
1125
+ deviceId: z14.string().min(1),
1126
+ apiToken: z14.string().min(1).optional()
1077
1127
  });
1078
- var XmtpPeerPolicyUpsertOutputSchema = z13.object({
1079
- ok: z13.literal(true)
1128
+ var XmtpPeerPolicyUpsertOutputSchema = z14.object({
1129
+ ok: z14.literal(true)
1080
1130
  });
1081
- var XmtpPeerPolicyListOutputSchema = z13.object({
1082
- policies: z13.array(z13.object({
1083
- peerInboxId: z13.string(),
1131
+ var XmtpPeerPolicyListOutputSchema = z14.object({
1132
+ policies: z14.array(z14.object({
1133
+ peerInboxId: z14.string(),
1084
1134
  policy: XmtpPolicySchema,
1085
- reason: z13.string().nullable(),
1086
- updatedAt: z13.string().datetime()
1135
+ reason: z14.string().nullable(),
1136
+ updatedAt: z14.string().datetime()
1087
1137
  }))
1088
1138
  });
1089
- var XmtpResolvePeerInputSchema = z13.object({
1139
+ var XmtpResolvePeerInputSchema = z14.object({
1090
1140
  address: EthAddressSchema.optional(),
1091
- agentId: z13.string().min(1).optional()
1141
+ agentId: z14.string().min(1).optional()
1092
1142
  }).refine((value) => Boolean(value.address || value.agentId), {
1093
1143
  message: "Either address or agentId is required"
1094
1144
  });
1095
- var XmtpResolvePeerOutputSchema = z13.object({
1145
+ var XmtpResolvePeerOutputSchema = z14.object({
1096
1146
  address: EthAddressSchema.nullable(),
1097
- inboxId: z13.string().nullable()
1147
+ inboxId: z14.string().nullable()
1098
1148
  });
1099
1149
 
1100
1150
  // ../../packages/shared/dist/schemas/email.schemas.js
1101
- import { z as z14 } from "zod";
1102
- var EmailSchema = z14.object({
1103
- id: z14.string(),
1104
- fromAddress: z14.string(),
1105
- toAddress: z14.string(),
1106
- subject: z14.string().nullable(),
1107
- bodyText: z14.string().nullable(),
1108
- bodyHtml: z14.string().nullable(),
1109
- isRead: z14.boolean(),
1110
- receivedAt: z14.string()
1111
- });
1112
- var SendEmailInputSchema = z14.object({
1113
- to: z14.string().email(),
1114
- subject: z14.string().min(1),
1115
- bodyText: z14.string().min(1)
1116
- });
1117
- var EmailInboundHeadersSchema = z14.object({
1118
- "x-webhook-secret": z14.string(),
1119
- "x-email-from": z14.string(),
1120
- "x-email-to": z14.string().email()
1121
- });
1122
- var BroadcastInputSchema = z14.object({
1123
- subject: z14.string().min(1).max(200),
1124
- body: z14.string().min(1).max(5e4),
1125
- filters: z14.object({
1126
- skills: z14.array(z14.string()).max(20).optional(),
1127
- minTasks: z14.number().int().min(0).optional(),
1128
- actorType: z14.enum(["agent", "human", "all"]).optional()
1151
+ import { z as z15 } from "zod";
1152
+ var EmailSchema = z15.object({
1153
+ id: z15.string(),
1154
+ fromAddress: z15.string(),
1155
+ toAddress: z15.string(),
1156
+ subject: z15.string().nullable(),
1157
+ bodyText: z15.string().nullable(),
1158
+ bodyHtml: z15.string().nullable(),
1159
+ isRead: z15.boolean(),
1160
+ receivedAt: z15.string()
1161
+ });
1162
+ var SendEmailInputSchema = z15.object({
1163
+ to: z15.string().email(),
1164
+ subject: z15.string().min(1),
1165
+ bodyText: z15.string().min(1)
1166
+ });
1167
+ var EmailInboundHeadersSchema = z15.object({
1168
+ "x-webhook-secret": z15.string(),
1169
+ "x-email-from": z15.string(),
1170
+ "x-email-to": z15.string().email()
1171
+ });
1172
+ var BroadcastInputSchema = z15.object({
1173
+ subject: z15.string().min(1).max(200),
1174
+ body: z15.string().min(1).max(5e4),
1175
+ filters: z15.object({
1176
+ skills: z15.array(z15.string()).max(20).optional(),
1177
+ minTasks: z15.number().int().min(0).optional(),
1178
+ actorType: z15.enum(["agent", "human", "all"]).optional()
1129
1179
  }).optional()
1130
1180
  });
1131
- var BroadcastResultSchema = z14.object({
1132
- sent: z14.number(),
1133
- failed: z14.number(),
1134
- total: z14.number()
1181
+ var BroadcastResultSchema = z15.object({
1182
+ sent: z15.number(),
1183
+ failed: z15.number(),
1184
+ total: z15.number()
1135
1185
  });
1136
1186
 
1137
1187
  // ../../packages/shared/dist/schemas/stats.schemas.js
1138
- import { z as z15 } from "zod";
1139
- var TimeRangeEnum = z15.enum(["7d", "30d", "90d", "all"]);
1140
- var BucketEnum = z15.enum(["day", "week"]);
1141
- var ActivityTypeEnum = z15.enum([
1188
+ import { z as z16 } from "zod";
1189
+ var TimeRangeEnum = z16.enum(["7d", "30d", "90d", "all"]);
1190
+ var BucketEnum = z16.enum(["day", "week"]);
1191
+ var ActivityTypeEnum = z16.enum([
1142
1192
  "task_created",
1143
1193
  "task_submitted",
1144
1194
  "task_claimed",
@@ -1146,208 +1196,208 @@ var ActivityTypeEnum = z15.enum([
1146
1196
  "bid_placed",
1147
1197
  "task_rated"
1148
1198
  ]);
1149
- var ActorTypeEnum = z15.enum(["human", "agent"]);
1150
- var PlatformTimeSeriesInputSchema = z15.object({
1199
+ var ActorTypeEnum = z16.enum(["human", "agent"]);
1200
+ var PlatformTimeSeriesInputSchema = z16.object({
1151
1201
  range: TimeRangeEnum.optional().default("30d"),
1152
1202
  bucket: BucketEnum.optional().default("day")
1153
1203
  });
1154
- var PlatformTimeSeriesPointSchema = z15.object({
1155
- bucket: z15.string(),
1156
- tasksCreated: z15.number(),
1157
- rewardVolume: z15.string(),
1158
- completedTasks: z15.number(),
1159
- newAgents: z15.number(),
1160
- activeAgents: z15.number()
1161
- });
1162
- var PlatformTimeSeriesResponseSchema = z15.array(PlatformTimeSeriesPointSchema);
1163
- var AgentTimeSeriesInputSchema = z15.object({
1164
- address: z15.string().optional(),
1165
- agentId: z15.string().optional(),
1204
+ var PlatformTimeSeriesPointSchema = z16.object({
1205
+ bucket: z16.string(),
1206
+ tasksCreated: z16.number(),
1207
+ rewardVolume: z16.string(),
1208
+ completedTasks: z16.number(),
1209
+ newAgents: z16.number(),
1210
+ activeAgents: z16.number()
1211
+ });
1212
+ var PlatformTimeSeriesResponseSchema = z16.array(PlatformTimeSeriesPointSchema);
1213
+ var AgentTimeSeriesInputSchema = z16.object({
1214
+ address: z16.string().optional(),
1215
+ agentId: z16.string().optional(),
1166
1216
  range: TimeRangeEnum.optional().default("90d"),
1167
1217
  bucket: BucketEnum.optional().default("week")
1168
1218
  }).refine((v) => Boolean(v.address) || Boolean(v.agentId), {
1169
1219
  message: "Provide address or agentId"
1170
1220
  });
1171
- var AgentTimeSeriesPointSchema = z15.object({
1172
- bucket: z15.string(),
1173
- earnings: z15.string(),
1174
- cumulativeEarnings: z15.string(),
1175
- tasksCompleted: z15.number(),
1176
- avgRating: z15.number().nullable(),
1177
- ratingsCount: z15.number(),
1178
- activityCount: z15.number()
1179
- });
1180
- var AgentTimeSeriesResponseSchema = z15.array(AgentTimeSeriesPointSchema);
1181
- var BreakdownsInputSchema = z15.object({});
1182
- var BreakdownsResponseSchema = z15.object({
1183
- status: z15.array(z15.object({ status: z15.string(), count: z15.number() })),
1184
- mode: z15.array(z15.object({ mode: z15.string(), count: z15.number() })),
1185
- actorType: z15.array(z15.object({ actorType: ActorTypeEnum, count: z15.number() }))
1186
- });
1187
- var ActivityFeedInputSchema = z15.object({
1188
- limit: z15.number().int().min(1).max(50).optional().default(20),
1189
- cursor: z15.string().optional(),
1190
- types: z15.array(ActivityTypeEnum).optional()
1191
- });
1192
- var ActivityFeedItemSchema = z15.object({
1221
+ var AgentTimeSeriesPointSchema = z16.object({
1222
+ bucket: z16.string(),
1223
+ earnings: z16.string(),
1224
+ cumulativeEarnings: z16.string(),
1225
+ tasksCompleted: z16.number(),
1226
+ avgRating: z16.number().nullable(),
1227
+ ratingsCount: z16.number(),
1228
+ activityCount: z16.number()
1229
+ });
1230
+ var AgentTimeSeriesResponseSchema = z16.array(AgentTimeSeriesPointSchema);
1231
+ var BreakdownsInputSchema = z16.object({});
1232
+ var BreakdownsResponseSchema = z16.object({
1233
+ status: z16.array(z16.object({ status: z16.string(), count: z16.number() })),
1234
+ mode: z16.array(z16.object({ mode: z16.string(), count: z16.number() })),
1235
+ actorType: z16.array(z16.object({ actorType: ActorTypeEnum, count: z16.number() }))
1236
+ });
1237
+ var ActivityFeedInputSchema = z16.object({
1238
+ limit: z16.number().int().min(1).max(50).optional().default(20),
1239
+ cursor: z16.string().optional(),
1240
+ types: z16.array(ActivityTypeEnum).optional()
1241
+ });
1242
+ var ActivityFeedItemSchema = z16.object({
1193
1243
  type: ActivityTypeEnum,
1194
- timestamp: z15.string(),
1195
- taskId: z15.string(),
1196
- taskTitle: z15.string().nullable(),
1197
- actor: z15.string(),
1244
+ timestamp: z16.string(),
1245
+ taskId: z16.string(),
1246
+ taskTitle: z16.string().nullable(),
1247
+ actor: z16.string(),
1198
1248
  actorType: ActorTypeEnum,
1199
- amount: z15.string().nullable(),
1200
- rating: z15.number().nullable()
1249
+ amount: z16.string().nullable(),
1250
+ rating: z16.number().nullable()
1201
1251
  });
1202
- var ActivityFeedResponseSchema = z15.object({
1203
- items: z15.array(ActivityFeedItemSchema),
1204
- nextCursor: z15.string().nullable()
1252
+ var ActivityFeedResponseSchema = z16.object({
1253
+ items: z16.array(ActivityFeedItemSchema),
1254
+ nextCursor: z16.string().nullable()
1205
1255
  });
1206
- var HeatmapDimensionEnum = z15.enum(["mode", "hourOfWeek"]);
1207
- var ActivityHeatmapInputSchema = z15.object({
1256
+ var HeatmapDimensionEnum = z16.enum(["mode", "hourOfWeek"]);
1257
+ var ActivityHeatmapInputSchema = z16.object({
1208
1258
  range: TimeRangeEnum.optional().default("30d"),
1209
1259
  dimension: HeatmapDimensionEnum.optional().default("mode")
1210
1260
  });
1211
- var ActivityHeatmapCellSchema = z15.object({
1212
- row: z15.string(),
1213
- col: z15.string(),
1214
- count: z15.number(),
1215
- volume: z15.string()
1261
+ var ActivityHeatmapCellSchema = z16.object({
1262
+ row: z16.string(),
1263
+ col: z16.string(),
1264
+ count: z16.number(),
1265
+ volume: z16.string()
1216
1266
  });
1217
- var ActivityHeatmapResponseSchema = z15.object({
1218
- rowKeys: z15.array(z15.string()),
1219
- colKeys: z15.array(z15.string()),
1220
- cells: z15.array(ActivityHeatmapCellSchema),
1221
- maxCount: z15.number()
1267
+ var ActivityHeatmapResponseSchema = z16.object({
1268
+ rowKeys: z16.array(z16.string()),
1269
+ colKeys: z16.array(z16.string()),
1270
+ cells: z16.array(ActivityHeatmapCellSchema),
1271
+ maxCount: z16.number()
1222
1272
  });
1223
1273
 
1224
1274
  // ../../packages/shared/dist/schemas/evaluation.schemas.js
1225
- import { z as z16 } from "zod";
1226
- var EvaluationAwardInputSchema = z16.object({
1227
- worker: z16.string(),
1275
+ import { z as z17 } from "zod";
1276
+ var EvaluationAwardInputSchema = z17.object({
1277
+ worker: z17.string(),
1228
1278
  amount: PositiveUsdcBaseUnitsSchema,
1229
- rank: z16.number().int().min(1)
1279
+ rank: z17.number().int().min(1)
1230
1280
  });
1231
- var EvaluateInputSchema = z16.object({
1232
- taskId: z16.string(),
1233
- verdict: z16.enum(["approve", "reject", "partial"]),
1234
- score: z16.number().int().min(0).max(1e3).optional().default(1e3),
1235
- confidence: z16.number().int().min(0).max(1e3).optional().default(1e3),
1236
- evidenceHash: z16.string().regex(/^0x[0-9a-fA-F]{64}$/).optional().default("0x0000000000000000000000000000000000000000000000000000000000000000"),
1237
- awards: z16.array(EvaluationAwardInputSchema).optional().default([])
1238
- });
1239
- var AppealInputSchema = z16.object({ taskId: z16.string() });
1240
- var FinalizeVerdictInputSchema = z16.object({ taskId: z16.string() });
1241
- var ResolveDisputeInputSchema = z16.object({
1242
- taskId: z16.string(),
1243
- verdict: z16.enum(["approve", "partial"]),
1244
- awards: z16.array(EvaluationAwardInputSchema).min(1)
1281
+ var EvaluateInputSchema = z17.object({
1282
+ taskId: z17.string(),
1283
+ verdict: z17.enum(["approve", "reject", "partial"]),
1284
+ score: z17.number().int().min(0).max(1e3).optional().default(1e3),
1285
+ confidence: z17.number().int().min(0).max(1e3).optional().default(1e3),
1286
+ evidenceHash: z17.string().regex(/^0x[0-9a-fA-F]{64}$/).optional().default("0x0000000000000000000000000000000000000000000000000000000000000000"),
1287
+ awards: z17.array(EvaluationAwardInputSchema).optional().default([])
1288
+ });
1289
+ var AppealInputSchema = z17.object({ taskId: z17.string() });
1290
+ var FinalizeVerdictInputSchema = z17.object({ taskId: z17.string() });
1291
+ var ResolveDisputeInputSchema = z17.object({
1292
+ taskId: z17.string(),
1293
+ verdict: z17.enum(["approve", "partial"]),
1294
+ awards: z17.array(EvaluationAwardInputSchema).min(1)
1245
1295
  });
1246
- var EvaluatorTimeoutInputSchema = z16.object({ taskId: z16.string() });
1296
+ var EvaluatorTimeoutInputSchema = z17.object({ taskId: z17.string() });
1247
1297
 
1248
1298
  // ../../packages/shared/dist/schemas/legal.schemas.js
1249
- import { z as z17 } from "zod";
1250
- var LegalDocumentTypeSchema = z17.enum([
1299
+ import { z as z18 } from "zod";
1300
+ var LegalDocumentTypeSchema = z18.enum([
1251
1301
  "terms_of_service",
1252
1302
  "privacy_policy",
1253
1303
  "risk_disclosure",
1254
1304
  "acceptable_use_policy"
1255
1305
  ]);
1256
- var LegalDocumentSlugSchema = z17.enum(["terms", "privacy", "risks", "acceptable-use"]);
1257
- var LegalSha256DigestSchema = z17.string().regex(/^sha256:[a-f0-9]{64}$/);
1258
- var LegalBundleDocumentSchema = z17.object({
1306
+ var LegalDocumentSlugSchema = z18.enum(["terms", "privacy", "risks", "acceptable-use"]);
1307
+ var LegalSha256DigestSchema = z18.string().regex(/^sha256:[a-f0-9]{64}$/);
1308
+ var LegalBundleDocumentSchema = z18.object({
1259
1309
  contentHash: LegalSha256DigestSchema,
1260
1310
  slug: LegalDocumentSlugSchema,
1261
- summary: z17.string(),
1262
- title: z17.string(),
1311
+ summary: z18.string(),
1312
+ title: z18.string(),
1263
1313
  type: LegalDocumentTypeSchema,
1264
- url: z17.string().url(),
1265
- version: z17.string()
1314
+ url: z18.string().url(),
1315
+ version: z18.string()
1266
1316
  });
1267
- var LegalBundleSchema = z17.object({
1268
- acceptanceAvailable: z17.boolean(),
1269
- acceptanceStatement: z17.string(),
1317
+ var LegalBundleSchema = z18.object({
1318
+ acceptanceAvailable: z18.boolean(),
1319
+ acceptanceStatement: z18.string(),
1270
1320
  bundleDigest: LegalSha256DigestSchema,
1271
- documents: z17.array(LegalBundleDocumentSchema),
1272
- effectiveAt: z17.string().nullable(),
1273
- enforcementEnabled: z17.boolean(),
1274
- privyAppId: z17.string().nullable(),
1275
- publishedAt: z17.string(),
1276
- status: z17.enum(["draft", "approved"]),
1277
- version: z17.string()
1278
- });
1279
- var LegalSubjectTypeSchema = z17.enum(["privy_user", "wallet"]);
1280
- var LegalStatusResponseSchema = z17.object({
1281
- accepted: z17.boolean(),
1321
+ documents: z18.array(LegalBundleDocumentSchema),
1322
+ effectiveAt: z18.string().nullable(),
1323
+ enforcementEnabled: z18.boolean(),
1324
+ privyAppId: z18.string().nullable(),
1325
+ publishedAt: z18.string(),
1326
+ status: z18.enum(["draft", "approved"]),
1327
+ version: z18.string()
1328
+ });
1329
+ var LegalSubjectTypeSchema = z18.enum(["privy_user", "wallet"]);
1330
+ var LegalStatusResponseSchema = z18.object({
1331
+ accepted: z18.boolean(),
1282
1332
  bundle: LegalBundleSchema,
1283
- receipt: z17.string().optional(),
1333
+ receipt: z18.string().optional(),
1284
1334
  subjectType: LegalSubjectTypeSchema.optional()
1285
1335
  });
1286
1336
  var LegalWalletAddressSchema = EthAddressSchema;
1287
- var LegalAffirmationsSchema = z17.object({
1288
- acknowledgedRisk: z17.literal(true),
1289
- agreedToAcceptableUse: z17.literal(true),
1290
- agreedToTerms: z17.literal(true),
1291
- receivedPrivacyNotice: z17.literal(true)
1337
+ var LegalAffirmationsSchema = z18.object({
1338
+ acknowledgedRisk: z18.literal(true),
1339
+ agreedToAcceptableUse: z18.literal(true),
1340
+ agreedToTerms: z18.literal(true),
1341
+ receivedPrivacyNotice: z18.literal(true)
1292
1342
  });
1293
- var LegalChallengeInputSchema = z17.object({
1343
+ var LegalChallengeInputSchema = z18.object({
1294
1344
  walletAddress: LegalWalletAddressSchema
1295
1345
  });
1296
- var LegalChallengeResponseSchema = z17.object({
1346
+ var LegalChallengeResponseSchema = z18.object({
1297
1347
  bundle: LegalBundleSchema,
1298
- expiresAt: z17.string(),
1299
- issuedAt: z17.string(),
1300
- message: z17.string(),
1301
- nonce: z17.string().uuid(),
1348
+ expiresAt: z18.string(),
1349
+ issuedAt: z18.string(),
1350
+ message: z18.string(),
1351
+ nonce: z18.string().uuid(),
1302
1352
  walletAddress: LegalWalletAddressSchema
1303
1353
  });
1304
- var LegalAcceptanceBundleSchema = z17.object({
1354
+ var LegalAcceptanceBundleSchema = z18.object({
1305
1355
  bundleDigest: LegalSha256DigestSchema,
1306
- bundleVersion: z17.string().max(128)
1356
+ bundleVersion: z18.string().max(128)
1307
1357
  });
1308
1358
  var LegalWalletAcceptanceInputSchema = LegalAffirmationsSchema.merge(LegalAcceptanceBundleSchema).extend({
1309
- nonce: z17.string().uuid(),
1310
- signature: z17.string().regex(/^0x[a-fA-F0-9]{128}(?:[a-fA-F0-9]{2})?$/),
1359
+ nonce: z18.string().uuid(),
1360
+ signature: z18.string().regex(/^0x[a-fA-F0-9]{128}(?:[a-fA-F0-9]{2})?$/),
1311
1361
  walletAddress: LegalWalletAddressSchema
1312
1362
  });
1313
1363
  var LegalWebAcceptanceInputSchema = LegalAffirmationsSchema.merge(LegalAcceptanceBundleSchema);
1314
- var LegalAcceptanceResponseSchema = z17.object({
1315
- acceptedAt: z17.string(),
1364
+ var LegalAcceptanceResponseSchema = z18.object({
1365
+ acceptedAt: z18.string(),
1316
1366
  bundleDigest: LegalSha256DigestSchema,
1317
- bundleVersion: z17.string(),
1318
- receipt: z17.string()
1367
+ bundleVersion: z18.string(),
1368
+ receipt: z18.string()
1319
1369
  });
1320
1370
 
1321
1371
  // ../../packages/shared/dist/schemas/task-access.schemas.js
1322
- import { z as z18 } from "zod";
1323
- var VerifyTaskAccessPasswordInputSchema = z18.object({
1324
- taskId: z18.string(),
1325
- password: z18.string().min(1)
1372
+ import { z as z19 } from "zod";
1373
+ var VerifyTaskAccessPasswordInputSchema = z19.object({
1374
+ taskId: z19.string(),
1375
+ password: z19.string().min(1)
1326
1376
  });
1327
- var VerifyTaskAccessPasswordResponseSchema = z18.object({
1328
- grant: z18.string(),
1329
- expiresAt: z18.string()
1377
+ var VerifyTaskAccessPasswordResponseSchema = z19.object({
1378
+ grant: z19.string(),
1379
+ expiresAt: z19.string()
1330
1380
  });
1331
- var AddAllowedViewerInputSchema = z18.object({
1332
- taskId: z18.string(),
1333
- viewerAddress: z18.string()
1381
+ var AddAllowedViewerInputSchema = z19.object({
1382
+ taskId: z19.string(),
1383
+ viewerAddress: z19.string()
1334
1384
  });
1335
- var RemoveAllowedViewerInputSchema = z18.object({
1336
- taskId: z18.string(),
1337
- viewerAddress: z18.string()
1385
+ var RemoveAllowedViewerInputSchema = z19.object({
1386
+ taskId: z19.string(),
1387
+ viewerAddress: z19.string()
1338
1388
  });
1339
- var ListAllowedViewersInputSchema = z18.object({
1340
- taskId: z18.string()
1389
+ var ListAllowedViewersInputSchema = z19.object({
1390
+ taskId: z19.string()
1341
1391
  });
1342
- var AllowedViewerResponseSchema = z18.object({
1343
- viewerAddress: z18.string(),
1344
- addedBy: z18.string(),
1345
- createdAt: z18.string()
1392
+ var AllowedViewerResponseSchema = z19.object({
1393
+ viewerAddress: z19.string(),
1394
+ addedBy: z19.string(),
1395
+ createdAt: z19.string()
1346
1396
  });
1347
- var ListAllowedViewersResponseSchema = z18.array(AllowedViewerResponseSchema);
1397
+ var ListAllowedViewersResponseSchema = z19.array(AllowedViewerResponseSchema);
1348
1398
 
1349
1399
  // ../../packages/shared/dist/schemas/api-error.schemas.js
1350
- import { z as z19 } from "zod";
1400
+ import { z as z20 } from "zod";
1351
1401
  var API_ERROR_REASONS = [
1352
1402
  /**
1353
1403
  * No terminal outcome has been established. The write is owned by the settlement path and
@@ -1421,37 +1471,38 @@ var API_ERROR_REASONS = [
1421
1471
  */
1422
1472
  "unclassified"
1423
1473
  ];
1424
- var ApiErrorReasonSchema = z19.enum(API_ERROR_REASONS);
1425
- var ApiErrorIntentStatusSchema = z19.enum([
1474
+ var ApiErrorReasonSchema = z20.enum(API_ERROR_REASONS);
1475
+ var ApiErrorIntentStatusSchema = z20.enum([
1426
1476
  "reserved",
1427
1477
  "recorded",
1428
1478
  "broadcast",
1429
1479
  "completed",
1430
- "failed"
1480
+ "failed",
1481
+ "held"
1431
1482
  ]);
1432
1483
  var REASONS_WITHOUT_REQUIRED_INTENT_STATUS = API_ERROR_REASONS.filter((reason) => reason !== "idempotency_key_reused");
1433
1484
  var ENVELOPE_FIELDS = {
1434
1485
  /** The durable handle to the write, where one was recorded. Key on this, not on `txHash`. */
1435
- intentId: z19.string().optional(),
1486
+ intentId: z20.string().optional(),
1436
1487
  /** The operation the intent stands for, e.g. `tasks.create`. */
1437
- operation: z19.string().optional(),
1488
+ operation: z20.string().optional(),
1438
1489
  /** The caller's own key for the operation, echoed so a dropped response is still traceable. */
1439
- idempotencyKey: z19.string().optional(),
1490
+ idempotencyKey: z20.string().optional(),
1440
1491
  /**
1441
1492
  * Known once something has been broadcast, and explicitly not the handle: the reconciler may
1442
1493
  * land a replacement at the same nonce, which is a different hash for the same intent.
1443
1494
  */
1444
- txHash: z19.string().optional()
1495
+ txHash: z20.string().optional()
1445
1496
  };
1446
- var ApiErrorEnvelopeSchema = z19.discriminatedUnion("reason", [
1447
- z19.object({
1448
- reason: z19.literal("idempotency_key_reused"),
1497
+ var ApiErrorEnvelopeSchema = z20.discriminatedUnion("reason", [
1498
+ z20.object({
1499
+ reason: z20.literal("idempotency_key_reused"),
1449
1500
  /** Required here: the reason means an intent under this key exists, so it has a status. */
1450
1501
  intentStatus: ApiErrorIntentStatusSchema,
1451
1502
  ...ENVELOPE_FIELDS
1452
1503
  }),
1453
- z19.object({
1454
- reason: z19.enum(REASONS_WITHOUT_REQUIRED_INTENT_STATUS),
1504
+ z20.object({
1505
+ reason: z20.enum(REASONS_WITHOUT_REQUIRED_INTENT_STATUS),
1455
1506
  /** The intent's status at the moment this answer was produced, where there is an intent. */
1456
1507
  intentStatus: ApiErrorIntentStatusSchema.optional(),
1457
1508
  ...ENVELOPE_FIELDS
@@ -1483,35 +1534,40 @@ function apiErrorEnvelopeOf(value) {
1483
1534
  }
1484
1535
 
1485
1536
  // ../../packages/shared/dist/schemas/intent.schemas.js
1486
- import { z as z20 } from "zod";
1487
- var IntentStatusInputSchema = z20.object({
1488
- intentId: z20.string().min(1).optional(),
1489
- idempotencyKey: z20.string().min(1).optional()
1537
+ import { z as z21 } from "zod";
1538
+ var IntentStatusInputSchema = z21.object({
1539
+ intentId: z21.string().min(1).optional(),
1540
+ idempotencyKey: z21.string().min(1).optional()
1490
1541
  }).refine((value) => Boolean(value.intentId) !== Boolean(value.idempotencyKey), {
1491
1542
  message: "Provide exactly one of intentId or idempotencyKey"
1492
1543
  });
1493
- var IntentRefundStateSchema = z20.object({
1494
- status: z20.enum(["pending", "refunding", "refunded", "failed"]),
1495
- txHash: z20.string().nullable()
1544
+ var IntentRefundStateSchema = z21.object({
1545
+ status: z21.enum(["pending", "refunding", "refunded", "failed"]),
1546
+ txHash: z21.string().nullable()
1496
1547
  });
1497
- var IntentStatusResponseSchema = z20.object({
1498
- intentId: z20.string(),
1499
- idempotencyKey: z20.string(),
1548
+ var IntentStatusResponseSchema = z21.object({
1549
+ intentId: z21.string(),
1550
+ idempotencyKey: z21.string(),
1500
1551
  /** The operation kind, e.g. `tasks.create`. */
1501
- operation: z20.string(),
1552
+ operation: z21.string(),
1502
1553
  /**
1503
1554
  * `reserved` is the pre-payment state (ADR-0067): the key is claimed and the caller has been
1504
1555
  * challenged, but no payment has landed and nothing has been sent to the chain. It is
1505
1556
  * non-terminal, it is never broadcastable, and it expires if it is never filled.
1557
+ *
1558
+ * `held` is the one case an expired reservation is neither released nor failed: the token
1559
+ * contract says its authorization was consumed, so money moved, but nothing ever attached
1560
+ * a payment reference to this row. It stays on record for manual reconciliation rather than
1561
+ * being deleted or reported as failed.
1506
1562
  */
1507
- status: z20.enum(["reserved", "recorded", "broadcast", "completed", "failed"]),
1563
+ status: z21.enum(["reserved", "recorded", "broadcast", "completed", "failed", "held"]),
1508
1564
  /**
1509
1565
  * Known once something has been broadcast, and explicitly not the handle: the reconciler
1510
1566
  * may land a replacement at the same nonce, which is a different hash for the same intent.
1511
1567
  */
1512
- txHash: z20.string().nullable(),
1568
+ txHash: z21.string().nullable(),
1513
1569
  /** Why it failed, where it did. Null on every non-terminal status. */
1514
- terminalReason: z20.string().nullable(),
1570
+ terminalReason: z21.string().nullable(),
1515
1571
  /**
1516
1572
  * The task a completed `tasks.create` produced.
1517
1573
  *
@@ -1521,7 +1577,7 @@ var IntentStatusResponseSchema = z20.object({
1521
1577
  * would be a guess of the kind that made concurrent creates overwrite each other. Null
1522
1578
  * until the intent completes, and null for every other operation.
1523
1579
  */
1524
- taskId: z20.string().nullable(),
1580
+ taskId: z21.string().nullable(),
1525
1581
  /**
1526
1582
  * Only present where the intent carried a payment and that payment has been written off.
1527
1583
  * Null means no refund has been decided -- which is not the same as "no refund is coming"
@@ -1533,7 +1589,7 @@ var IntentStatusResponseSchema = z20.object({
1533
1589
  for (const field of ["txHash", "terminalReason", "taskId"]) {
1534
1590
  if (value[field] !== null) {
1535
1591
  ctx.addIssue({
1536
- code: z20.ZodIssueCode.custom,
1592
+ code: z21.ZodIssueCode.custom,
1537
1593
  path: [field],
1538
1594
  message: `A reserved intent has not been sent to the chain, so ${field} must be null`
1539
1595
  });
@@ -1543,7 +1599,7 @@ var IntentStatusResponseSchema = z20.object({
1543
1599
  }
1544
1600
  if (value.terminalReason !== null && value.status !== "failed") {
1545
1601
  ctx.addIssue({
1546
- code: z20.ZodIssueCode.custom,
1602
+ code: z21.ZodIssueCode.custom,
1547
1603
  path: ["terminalReason"],
1548
1604
  message: "Only a failed intent has a terminal reason"
1549
1605
  });
@@ -1552,7 +1608,7 @@ var IntentStatusResponseSchema = z20.object({
1552
1608
  return;
1553
1609
  if (value.status !== "completed") {
1554
1610
  ctx.addIssue({
1555
- code: z20.ZodIssueCode.custom,
1611
+ code: z21.ZodIssueCode.custom,
1556
1612
  path: ["taskId"],
1557
1613
  message: "taskId is only known once the intent has completed"
1558
1614
  });
@@ -1560,7 +1616,7 @@ var IntentStatusResponseSchema = z20.object({
1560
1616
  }
1561
1617
  if (value.operation !== "tasks.create") {
1562
1618
  ctx.addIssue({
1563
- code: z20.ZodIssueCode.custom,
1619
+ code: z21.ZodIssueCode.custom,
1564
1620
  path: ["taskId"],
1565
1621
  message: "Only a tasks.create intent produces a taskId"
1566
1622
  });
@@ -1568,80 +1624,80 @@ var IntentStatusResponseSchema = z20.object({
1568
1624
  });
1569
1625
 
1570
1626
  // ../../packages/shared/dist/schemas/games.schemas.js
1571
- import { z as z21 } from "zod";
1572
- var Sha256HashSchema = z21.string().regex(/^[0-9a-f]{64}$/, "Expected a lowercase SHA-256 hash");
1573
- var Keccak256HashSchema = z21.string().regex(/^0x[0-9a-fA-F]{64}$/, "Expected a 0x-prefixed Keccak-256 hash");
1574
- var GameStatusSchema = z21.enum(["draft", "published", "hidden"]);
1575
- var GameCoverSourceSchema = z21.enum(["artifact", "catalog_asset"]);
1576
- var GameIdSchema = z21.string().trim().min(1).max(120);
1577
- var GameVoteValueSchema = z21.union([z21.literal(-1), z21.literal(1)]);
1578
- var GameListInputSchema = z21.object({
1579
- query: z21.string().trim().min(1).max(120).optional(),
1580
- cursor: z21.string().min(1).max(2048).optional(),
1581
- limit: z21.number().int().min(1).max(48).optional().default(24)
1582
- });
1583
- var GameGetInputSchema = z21.object({
1584
- slug: z21.string().trim().min(1).max(120).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "Game slugs must be lowercase kebab-case")
1585
- });
1586
- var GameVoteInputSchema = z21.object({
1627
+ import { z as z22 } from "zod";
1628
+ var Sha256HashSchema = z22.string().regex(/^[0-9a-f]{64}$/, "Expected a lowercase SHA-256 hash");
1629
+ var Keccak256HashSchema = z22.string().regex(/^0x[0-9a-fA-F]{64}$/, "Expected a 0x-prefixed Keccak-256 hash");
1630
+ var GameStatusSchema = z22.enum(["draft", "published", "hidden"]);
1631
+ var GameCoverSourceSchema = z22.enum(["artifact", "catalog_asset"]);
1632
+ var GameIdSchema = z22.string().trim().min(1).max(120);
1633
+ var GameVoteValueSchema = z22.union([z22.literal(-1), z22.literal(1)]);
1634
+ var GameListInputSchema = z22.object({
1635
+ query: z22.string().trim().min(1).max(120).optional(),
1636
+ cursor: z22.string().min(1).max(2048).optional(),
1637
+ limit: z22.number().int().min(1).max(48).optional().default(24)
1638
+ });
1639
+ var GameGetInputSchema = z22.object({
1640
+ slug: z22.string().trim().min(1).max(120).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "Game slugs must be lowercase kebab-case")
1641
+ });
1642
+ var GameVoteInputSchema = z22.object({
1587
1643
  gameId: GameIdSchema,
1588
1644
  value: GameVoteValueSchema
1589
1645
  });
1590
- var GameVoteStateInputSchema = z21.object({
1646
+ var GameVoteStateInputSchema = z22.object({
1591
1647
  gameId: GameIdSchema
1592
1648
  });
1593
- var GameSourceSchema = z21.object({
1594
- taskId: z21.string().min(1),
1595
- submissionId: z21.string().min(1),
1596
- artifactId: z21.string().min(1),
1649
+ var GameSourceSchema = z22.object({
1650
+ taskId: z22.string().min(1),
1651
+ submissionId: z22.string().min(1),
1652
+ artifactId: z22.string().min(1),
1597
1653
  artifactSha256Hash: Sha256HashSchema,
1598
1654
  artifactKeccak256Hash: Keccak256HashSchema,
1599
- artifactMimeType: z21.string().min(1).max(120),
1600
- artifactSizeBytes: z21.number().int().nonnegative()
1601
- });
1602
- var GameCatalogFieldsSchema = z21.object({
1603
- id: z21.string().min(1),
1604
- slug: z21.string().min(1),
1605
- title: z21.string().min(1).max(120),
1606
- description: z21.string().max(2e3).nullable(),
1655
+ artifactMimeType: z22.string().min(1).max(120),
1656
+ artifactSizeBytes: z22.number().int().nonnegative()
1657
+ });
1658
+ var GameCatalogFieldsSchema = z22.object({
1659
+ id: z22.string().min(1),
1660
+ slug: z22.string().min(1),
1661
+ title: z22.string().min(1).max(120),
1662
+ description: z22.string().max(2e3).nullable(),
1607
1663
  // Optional so a newly deployed catalog client can continue reading responses from an
1608
1664
  // older backend during a rolling release. The backend supplies it once available.
1609
- taskDescription: z21.string().max(TASK_DESCRIPTION_MAX_LENGTH).optional(),
1610
- creatorName: z21.string().max(120).nullable(),
1611
- tags: z21.array(z21.string().min(1).max(64)).max(20),
1665
+ taskDescription: z22.string().max(TASK_DESCRIPTION_MAX_LENGTH).optional(),
1666
+ creatorName: z22.string().max(120).nullable(),
1667
+ tags: z22.array(z22.string().min(1).max(64)).max(20),
1612
1668
  // This is a short-lived delivery URL when the cover can be served. Storage keys and
1613
1669
  // durable storage URIs are deliberately not part of the public catalog contract.
1614
- coverUrl: z21.string().url().nullable(),
1615
- coverAltText: z21.string().max(240).nullable(),
1616
- upvoteCount: z21.number().int().nonnegative(),
1617
- downvoteCount: z21.number().int().nonnegative(),
1618
- netVotes: z21.number().int(),
1619
- publishedAt: z21.string().datetime()
1670
+ coverUrl: z22.string().url().nullable(),
1671
+ coverAltText: z22.string().max(240).nullable(),
1672
+ upvoteCount: z22.number().int().nonnegative(),
1673
+ downvoteCount: z22.number().int().nonnegative(),
1674
+ netVotes: z22.number().int(),
1675
+ publishedAt: z22.string().datetime()
1620
1676
  });
1621
1677
  var GameCatalogItemSchema = GameCatalogFieldsSchema;
1622
1678
  var GameDetailResponseSchema = GameCatalogFieldsSchema.extend({
1623
1679
  source: GameSourceSchema,
1624
1680
  // Minted from the exact pinned artifact only after the backend rechecks the stored hashes.
1625
1681
  // A fresh games.get call refreshes this short-lived URL; storage keys never leave the backend.
1626
- artifactUrl: z21.string().url().nullable(),
1627
- artifactUrlExpiresAt: z21.string().datetime().nullable()
1682
+ artifactUrl: z22.string().url().nullable(),
1683
+ artifactUrlExpiresAt: z22.string().datetime().nullable()
1628
1684
  });
1629
- var GameListResponseSchema = z21.object({
1630
- games: z21.array(GameCatalogItemSchema),
1631
- nextCursor: z21.string().nullable()
1685
+ var GameListResponseSchema = z22.object({
1686
+ games: z22.array(GameCatalogItemSchema),
1687
+ nextCursor: z22.string().nullable()
1632
1688
  });
1633
- var GameVoteResponseSchema = z21.object({
1689
+ var GameVoteResponseSchema = z22.object({
1634
1690
  gameId: GameIdSchema,
1635
- upvoteCount: z21.number().int().nonnegative(),
1636
- downvoteCount: z21.number().int().nonnegative(),
1637
- netVotes: z21.number().int(),
1691
+ upvoteCount: z22.number().int().nonnegative(),
1692
+ downvoteCount: z22.number().int().nonnegative(),
1693
+ netVotes: z22.number().int(),
1638
1694
  selectedVote: GameVoteValueSchema.nullable()
1639
1695
  });
1640
1696
 
1641
1697
  // ../../packages/shared/dist/schemas/game-curation.schemas.js
1642
- import { z as z22 } from "zod";
1643
- var Sha256HashSchema2 = z22.string().regex(/^[0-9a-f]{64}$/, "Expected a lowercase SHA-256 hash");
1644
- var Keccak256HashSchema2 = z22.string().regex(/^0x[0-9a-fA-F]{64}$/, "Expected a 0x-prefixed Keccak-256 hash");
1698
+ import { z as z23 } from "zod";
1699
+ var Sha256HashSchema2 = z23.string().regex(/^[0-9a-f]{64}$/, "Expected a lowercase SHA-256 hash");
1700
+ var Keccak256HashSchema2 = z23.string().regex(/^0x[0-9a-fA-F]{64}$/, "Expected a 0x-prefixed Keccak-256 hash");
1645
1701
  var MAX_GAME_COVER_BYTES = 4 * 1024 * 1024;
1646
1702
  var MAX_GAME_COVER_BASE64_CHARS = Math.ceil(MAX_GAME_COVER_BYTES / 3) * 4 + 4;
1647
1703
  function hasAsciiControlCharacter(value) {
@@ -1650,14 +1706,14 @@ function hasAsciiControlCharacter(value) {
1650
1706
  return code <= 31 || code === 127;
1651
1707
  });
1652
1708
  }
1653
- var GameIdSchema2 = z22.string().trim().min(1).max(120);
1654
- var TaskIdSchema = z22.string().trim().min(1).max(160).refine((value) => !hasAsciiControlCharacter(value), "Task ID contains control characters");
1655
- var SlugSchema = z22.string().trim().min(1).max(120).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "Game slugs must be lowercase kebab-case");
1656
- var TitleSchema = z22.string().trim().min(1).max(120);
1657
- var OptionalTextSchema = z22.string().trim().max(2e3).nullable().optional();
1658
- var OptionalCreatorSchema = z22.string().trim().max(120).nullable().optional();
1659
- var OptionalAltTextSchema = z22.string().trim().max(240).nullable().optional();
1660
- var TagsSchema = z22.array(z22.string().trim().min(1).max(64)).max(20);
1709
+ var GameIdSchema2 = z23.string().trim().min(1).max(120);
1710
+ var TaskIdSchema = z23.string().trim().min(1).max(160).refine((value) => !hasAsciiControlCharacter(value), "Task ID contains control characters");
1711
+ var SlugSchema = z23.string().trim().min(1).max(120).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "Game slugs must be lowercase kebab-case");
1712
+ var TitleSchema = z23.string().trim().min(1).max(120);
1713
+ var OptionalTextSchema = z23.string().trim().max(2e3).nullable().optional();
1714
+ var OptionalCreatorSchema = z23.string().trim().max(120).nullable().optional();
1715
+ var OptionalAltTextSchema = z23.string().trim().max(240).nullable().optional();
1716
+ var TagsSchema = z23.array(z23.string().trim().min(1).max(64)).max(20);
1661
1717
  var CANONICAL_TASKMARKET_HOST = "taskmarket.dev";
1662
1718
  function normalizeGameCurationTaskReference(reference) {
1663
1719
  const trimmed = reference.trim();
@@ -1687,64 +1743,64 @@ function normalizeGameCurationTaskReference(reference) {
1687
1743
  throw new Error("Task URL contains an invalid task ID");
1688
1744
  }
1689
1745
  }
1690
- var GameCurationTaskReferenceSchema = z22.string().trim().min(1).max(2048).transform((reference, ctx) => {
1746
+ var GameCurationTaskReferenceSchema = z23.string().trim().min(1).max(2048).transform((reference, ctx) => {
1691
1747
  try {
1692
1748
  return normalizeGameCurationTaskReference(reference);
1693
1749
  } catch (error) {
1694
1750
  ctx.addIssue({
1695
- code: z22.ZodIssueCode.custom,
1751
+ code: z23.ZodIssueCode.custom,
1696
1752
  message: error instanceof Error ? error.message : "Invalid task reference"
1697
1753
  });
1698
- return z22.NEVER;
1754
+ return z23.NEVER;
1699
1755
  }
1700
1756
  });
1701
- var GameCurationResolveTaskInputSchema = z22.object({
1757
+ var GameCurationResolveTaskInputSchema = z23.object({
1702
1758
  // Query-safe on GET requests. It accepts both a raw ID and a canonical public task URL,
1703
1759
  // then stores only the normalized ID in `reference` for the backend resolver.
1704
1760
  reference: GameCurationTaskReferenceSchema
1705
1761
  });
1706
- var GameCurationArtifactSchema = z22.object({
1762
+ var GameCurationArtifactSchema = z23.object({
1707
1763
  id: GameIdSchema2,
1708
- fileName: z22.string().min(1).max(255),
1709
- mimeType: z22.string().min(1).max(120),
1764
+ fileName: z23.string().min(1).max(255),
1765
+ mimeType: z23.string().min(1).max(120),
1710
1766
  role: ArtifactRole,
1711
- sizeBytes: z22.number().int().nonnegative(),
1767
+ sizeBytes: z23.number().int().nonnegative(),
1712
1768
  sha256Hash: Sha256HashSchema2,
1713
1769
  keccak256Hash: Keccak256HashSchema2,
1714
- previewUrl: z22.string().url().nullable(),
1715
- previewUrlExpiresAt: z22.string().datetime().nullable()
1770
+ previewUrl: z23.string().url().nullable(),
1771
+ previewUrlExpiresAt: z23.string().datetime().nullable()
1716
1772
  });
1717
- var GameCurationSubmissionSchema = z22.object({
1773
+ var GameCurationSubmissionSchema = z23.object({
1718
1774
  id: GameIdSchema2,
1719
- workerAddress: z22.string().min(1),
1720
- submittedAt: z22.string().datetime(),
1721
- artifacts: z22.array(GameCurationArtifactSchema)
1775
+ workerAddress: z23.string().min(1),
1776
+ submittedAt: z23.string().datetime(),
1777
+ artifacts: z23.array(GameCurationArtifactSchema)
1722
1778
  });
1723
- var GameCurationResolvedTaskSchema = z22.object({
1724
- task: z22.object({
1779
+ var GameCurationResolvedTaskSchema = z23.object({
1780
+ task: z23.object({
1725
1781
  id: TaskIdSchema,
1726
- description: z22.string(),
1727
- status: z22.string(),
1728
- tags: z22.array(z22.string())
1782
+ description: z23.string(),
1783
+ status: z23.string(),
1784
+ tags: z23.array(z23.string())
1729
1785
  }),
1730
- eligible: z22.boolean(),
1731
- eligibilityReason: z22.string().nullable(),
1732
- submissions: z22.array(GameCurationSubmissionSchema)
1786
+ eligible: z23.boolean(),
1787
+ eligibilityReason: z23.string().nullable(),
1788
+ submissions: z23.array(GameCurationSubmissionSchema)
1733
1789
  });
1734
- var GameCurationArtifactCoverInputSchema = z22.object({
1735
- source: z22.literal("artifact"),
1790
+ var GameCurationArtifactCoverInputSchema = z23.object({
1791
+ source: z23.literal("artifact"),
1736
1792
  artifactId: GameIdSchema2
1737
1793
  });
1738
- var GameCurationCatalogAssetCoverInputSchema = z22.object({
1739
- source: z22.literal("catalog_asset"),
1740
- dataBase64: z22.string().min(4).max(MAX_GAME_COVER_BASE64_CHARS),
1741
- mimeType: z22.enum(["image/png", "image/jpeg", "image/gif", "image/webp"])
1794
+ var GameCurationCatalogAssetCoverInputSchema = z23.object({
1795
+ source: z23.literal("catalog_asset"),
1796
+ dataBase64: z23.string().min(4).max(MAX_GAME_COVER_BASE64_CHARS),
1797
+ mimeType: z23.enum(["image/png", "image/jpeg", "image/gif", "image/webp"])
1742
1798
  });
1743
- var GameCurationCoverInputSchema = z22.discriminatedUnion("source", [
1799
+ var GameCurationCoverInputSchema = z23.discriminatedUnion("source", [
1744
1800
  GameCurationArtifactCoverInputSchema,
1745
1801
  GameCurationCatalogAssetCoverInputSchema
1746
1802
  ]);
1747
- var GameCurationUpsertInputSchema = z22.object({
1803
+ var GameCurationUpsertInputSchema = z23.object({
1748
1804
  gameId: GameIdSchema2.optional(),
1749
1805
  taskId: TaskIdSchema,
1750
1806
  submissionId: GameIdSchema2,
@@ -1758,14 +1814,14 @@ var GameCurationUpsertInputSchema = z22.object({
1758
1814
  coverAltText: OptionalAltTextSchema,
1759
1815
  // Set only after the curator has successfully loaded the exact pin in the shared
1760
1816
  // sandbox. The server records this affirmative, authenticated curator attestation.
1761
- previewed: z22.boolean().optional()
1817
+ previewed: z23.boolean().optional()
1762
1818
  });
1763
- var GameCurationGameSchema = z22.object({
1819
+ var GameCurationGameSchema = z23.object({
1764
1820
  id: GameIdSchema2,
1765
1821
  slug: SlugSchema,
1766
1822
  title: TitleSchema,
1767
- description: z22.string().nullable(),
1768
- creatorName: z22.string().nullable(),
1823
+ description: z23.string().nullable(),
1824
+ creatorName: z23.string().nullable(),
1769
1825
  tags: TagsSchema,
1770
1826
  status: GameStatusSchema,
1771
1827
  taskId: TaskIdSchema,
@@ -1773,28 +1829,28 @@ var GameCurationGameSchema = z22.object({
1773
1829
  artifactId: GameIdSchema2,
1774
1830
  artifactSha256Hash: Sha256HashSchema2,
1775
1831
  artifactKeccak256Hash: Keccak256HashSchema2,
1776
- artifactMimeType: z22.string().min(1).max(120),
1777
- artifactSizeBytes: z22.number().int().nonnegative(),
1832
+ artifactMimeType: z23.string().min(1).max(120),
1833
+ artifactSizeBytes: z23.number().int().nonnegative(),
1778
1834
  coverSource: GameCoverSourceSchema.nullable(),
1779
1835
  coverArtifactId: GameIdSchema2.nullable(),
1780
1836
  coverSha256Hash: Sha256HashSchema2.nullable(),
1781
- coverMimeType: z22.string().min(1).max(120).nullable(),
1782
- coverWidth: z22.number().int().positive().nullable(),
1783
- coverHeight: z22.number().int().positive().nullable(),
1784
- coverAltText: z22.string().max(240).nullable(),
1785
- previewedAt: z22.string().datetime().nullable(),
1786
- publishedAt: z22.string().datetime().nullable(),
1787
- hiddenAt: z22.string().datetime().nullable(),
1788
- createdAt: z22.string().datetime(),
1789
- updatedAt: z22.string().datetime()
1790
- });
1791
- var GameCurationMutationResponseSchema = z22.object({
1837
+ coverMimeType: z23.string().min(1).max(120).nullable(),
1838
+ coverWidth: z23.number().int().positive().nullable(),
1839
+ coverHeight: z23.number().int().positive().nullable(),
1840
+ coverAltText: z23.string().max(240).nullable(),
1841
+ previewedAt: z23.string().datetime().nullable(),
1842
+ publishedAt: z23.string().datetime().nullable(),
1843
+ hiddenAt: z23.string().datetime().nullable(),
1844
+ createdAt: z23.string().datetime(),
1845
+ updatedAt: z23.string().datetime()
1846
+ });
1847
+ var GameCurationMutationResponseSchema = z23.object({
1792
1848
  game: GameCurationGameSchema
1793
1849
  });
1794
- var GameCurationPublishInputSchema = z22.object({
1850
+ var GameCurationPublishInputSchema = z23.object({
1795
1851
  gameId: GameIdSchema2
1796
1852
  });
1797
- var GameCurationHideInputSchema = z22.object({
1853
+ var GameCurationHideInputSchema = z23.object({
1798
1854
  gameId: GameIdSchema2
1799
1855
  });
1800
1856
 
@@ -2690,7 +2746,7 @@ var ApiError = class extends Error {
2690
2746
  * The backend's machine-readable classification of the failure (ADR-0058).
2691
2747
  *
2692
2748
  * Before it existed the CLI rendered every failure identically, which is why
2693
- * `docs/CLI_GUIDE.md` had to tell script authors never to auto-retry a paid command: there was
2749
+ * `docs/guides/CLI_GUIDE.md` had to tell script authors never to auto-retry a paid command: there was
2694
2750
  * no way to tell a write that is still landing from one that was definitively rejected, and
2695
2751
  * retrying the first is a second payment. `reason` is that way.
2696
2752
  *
@@ -2819,13 +2875,13 @@ async function apiDelete(path7, options) {
2819
2875
  }
2820
2876
 
2821
2877
  // src/lib/x402-errors.ts
2822
- var ExternalX402Error = class extends Error {
2878
+ var X402PayError = class extends Error {
2823
2879
  payment;
2824
2880
  pending;
2825
2881
  status;
2826
2882
  constructor(message, options = {}) {
2827
2883
  super(message, options.cause === void 0 ? void 0 : { cause: options.cause });
2828
- this.name = "ExternalX402Error";
2884
+ this.name = "X402PayError";
2829
2885
  this.payment = options.payment;
2830
2886
  this.pending = options.pending;
2831
2887
  this.status = options.status;
@@ -2842,18 +2898,18 @@ function printResult(data, options) {
2842
2898
  function renderFailure(error, options) {
2843
2899
  const message = error instanceof Error ? error.message : options?.fallback ?? String(error);
2844
2900
  const apiError = error instanceof ApiError ? error : void 0;
2845
- const externalX402Error = error instanceof ExternalX402Error ? error : void 0;
2901
+ const x402PayError = error instanceof X402PayError ? error : void 0;
2846
2902
  const idempotencyKey = options?.idempotencyKey ?? apiError?.idempotencyKey ?? idempotencyKeyForError(error);
2847
2903
  const envelope = apiError?.envelope;
2848
2904
  process.stderr.write(
2849
2905
  JSON.stringify({
2850
2906
  ok: false,
2851
2907
  error: message,
2852
- ...apiError !== void 0 ? { status: apiError.status } : externalX402Error?.status !== void 0 ? { status: externalX402Error.status } : {},
2908
+ ...apiError !== void 0 ? { status: apiError.status } : x402PayError?.status !== void 0 ? { status: x402PayError.status } : {},
2853
2909
  ...idempotencyKey !== void 0 ? { idempotencyKey } : {},
2854
2910
  ...envelope !== void 0 ? { ...envelope, pending: isInFlightApiError(envelope) } : {},
2855
- ...externalX402Error?.pending !== void 0 ? { pending: externalX402Error.pending } : {},
2856
- ...externalX402Error?.payment !== void 0 ? { payment: externalX402Error.payment } : {},
2911
+ ...x402PayError?.pending !== void 0 ? { pending: x402PayError.pending } : {},
2912
+ ...x402PayError?.payment !== void 0 ? { payment: x402PayError.payment } : {},
2857
2913
  ...options?.details ?? {}
2858
2914
  }) + "\n"
2859
2915
  );
@@ -3500,9 +3556,14 @@ var createCmd = new Command6("create").description("Create a new task (costs rew
3500
3556
  ).option(
3501
3557
  "--auction-floor-price <usdc>",
3502
3558
  "Floor price in USDC for dutch clock (required for dutch)"
3503
- ).option("--hook <address>", "ITaskHook contract address (optional)").option(
3559
+ ).option(
3560
+ "--hook <address>",
3561
+ "Custom ITMPHook contract address (repeat in execution order; protocol defaults run first)",
3562
+ (value, previous = []) => [...previous, value],
3563
+ []
3564
+ ).option(
3504
3565
  "--hook-data <hex>",
3505
- "Hook config bytes forwarded to checkFund; encode uint32 as 4 big-endian bytes (e.g. 0x000006b4 for a 1800s TWAP window)"
3566
+ "One shared config value forwarded to checkFund on every hook; encode uint32 as 4 big-endian bytes (e.g. 0x000006b4 for a 1800s TWAP window)"
3506
3567
  ).option("--evaluator <address>", "Evaluator address (optional)").option("--evaluator-fee-bps <bps>", "Evaluator fee in basis points (optional)").option("--evaluation-window <hours>", "Evaluation window in hours (default: 24)").option("--appeal-window <hours>", "Appeal window in hours (default: 24)").option("--dispute-resolver <address>", "Dispute resolver address (optional)").action(
3507
3568
  async (opts) => {
3508
3569
  let rewardBaseUnits;
@@ -3634,14 +3695,53 @@ var createCmd = new Command6("create").description("Create a new task (costs rew
3634
3695
  }
3635
3696
  }
3636
3697
  const ethAddrRe = /^0x[0-9a-fA-F]{40}$/;
3637
- if (opts.hook && !ethAddrRe.test(opts.hook)) {
3638
- return void printError("--hook must be a valid Ethereum address (0x + 40 hex chars)");
3698
+ const defaultHookAddressRe = /^0x[0-9a-f]{40}$/i;
3699
+ const hooks = opts.hook ?? [];
3700
+ if (hooks.some((hook) => !ethAddrRe.test(hook) || /^0x0{40}$/i.test(hook))) {
3701
+ return void printError(
3702
+ "--hook must be a non-zero valid Ethereum address (0x + 40 hex chars)"
3703
+ );
3704
+ }
3705
+ if (new Set(hooks.map((hook) => hook.toLowerCase())).size !== hooks.length) {
3706
+ return void printError("--hook addresses must be unique");
3707
+ }
3708
+ if (hooks.length > 8) {
3709
+ return void printError(
3710
+ "--hook accepts at most 8 custom addresses; current protocol defaults count toward the on-chain maximum of 8"
3711
+ );
3639
3712
  }
3640
3713
  if (opts.hookData && !/^0x(?:[0-9a-fA-F]{2})*$/.test(opts.hookData)) {
3641
3714
  return void printError(
3642
3715
  "--hook-data must be a 0x-prefixed hex string with an even number of hex digits"
3643
3716
  );
3644
3717
  }
3718
+ if (hooks.length > 0) {
3719
+ try {
3720
+ const attachmentConfiguration = await apiGet(
3721
+ "/api/hooks/attachment-configuration"
3722
+ );
3723
+ if (attachmentConfiguration !== null && typeof attachmentConfiguration === "object" && !Array.isArray(attachmentConfiguration)) {
3724
+ const { defaultHooks, maxHooks } = attachmentConfiguration;
3725
+ if (Array.isArray(defaultHooks) && typeof maxHooks === "number" && Number.isInteger(maxHooks) && maxHooks > 0 && defaultHooks.every(
3726
+ (hook) => typeof hook === "string" && defaultHookAddressRe.test(hook) && !/^0x0{40}$/i.test(hook)
3727
+ )) {
3728
+ if (hooks.some(
3729
+ (hook) => defaultHooks.some(
3730
+ (defaultHook) => defaultHook.toLowerCase() === hook.toLowerCase()
3731
+ )
3732
+ )) {
3733
+ return void printError("Custom hooks cannot duplicate protocol default hooks.");
3734
+ }
3735
+ if (hooks.length + defaultHooks.length > maxHooks) {
3736
+ return void printError(
3737
+ `Default and custom hooks together cannot exceed ${maxHooks}.`
3738
+ );
3739
+ }
3740
+ }
3741
+ }
3742
+ } catch {
3743
+ }
3744
+ }
3645
3745
  let feeBps;
3646
3746
  if (opts.evaluator) {
3647
3747
  if (!ethAddrRe.test(opts.evaluator)) {
@@ -3661,7 +3761,8 @@ var createCmd = new Command6("create").description("Create a new task (costs rew
3661
3761
  );
3662
3762
  }
3663
3763
  }
3664
- if (opts.hook) body.hookContract = opts.hook;
3764
+ if (hooks.length === 1) body.hookContract = hooks[0];
3765
+ if (hooks.length > 1) body.hookContracts = hooks;
3665
3766
  if (opts.hookData) body.hookData = opts.hookData;
3666
3767
  if (opts.evaluator) {
3667
3768
  body.evaluator = opts.evaluator;
@@ -7180,99 +7281,99 @@ import { randomUUID as randomUUID5 } from "crypto";
7180
7281
  import { promises as fs6 } from "fs";
7181
7282
  import os5 from "os";
7182
7283
  import path5 from "path";
7183
- import { z as z23 } from "zod";
7184
- var AtomicAmountSchema = z23.string().regex(/^\d+$/, "amount must be an unsigned integer string").refine((value) => BigInt(value) > 0n, "amount must be greater than zero");
7185
- var EvmAddressSchema = z23.string().regex(/^0x[a-fA-F0-9]{40}$/, "invalid EVM address");
7186
- var EvmNetworkSchema = z23.string().regex(/^eip155:[1-9]\d*$/, "network must be an EVM CAIP-2 identifier");
7187
- var EnvironmentVariableSchema = z23.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/, "invalid environment variable name");
7188
- var OriginSchema = z23.string().superRefine((value, ctx) => {
7284
+ import { z as z24 } from "zod";
7285
+ var AtomicAmountSchema = z24.string().regex(/^\d+$/, "amount must be an unsigned integer string").refine((value) => BigInt(value) > 0n, "amount must be greater than zero");
7286
+ var EvmAddressSchema = z24.string().regex(/^0x[a-fA-F0-9]{40}$/, "invalid EVM address");
7287
+ var EvmNetworkSchema = z24.string().regex(/^eip155:[1-9]\d*$/, "network must be an EVM CAIP-2 identifier");
7288
+ var EnvironmentVariableSchema = z24.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/, "invalid environment variable name");
7289
+ var OriginSchema = z24.string().superRefine((value, ctx) => {
7189
7290
  try {
7190
7291
  const parsed = new URL(value);
7191
7292
  if (parsed.protocol !== "https:") {
7192
- ctx.addIssue({ code: z23.ZodIssueCode.custom, message: "origin must use HTTPS" });
7293
+ ctx.addIssue({ code: z24.ZodIssueCode.custom, message: "origin must use HTTPS" });
7193
7294
  }
7194
7295
  if (parsed.origin !== value || parsed.username || parsed.password) {
7195
- ctx.addIssue({ code: z23.ZodIssueCode.custom, message: "origin must be an exact URL origin" });
7296
+ ctx.addIssue({ code: z24.ZodIssueCode.custom, message: "origin must be an exact URL origin" });
7196
7297
  }
7197
7298
  } catch {
7198
- ctx.addIssue({ code: z23.ZodIssueCode.custom, message: "origin must be a valid URL" });
7299
+ ctx.addIssue({ code: z24.ZodIssueCode.custom, message: "origin must be a valid URL" });
7199
7300
  }
7200
7301
  });
7201
- var X402SpendWindowSchema = z23.object({
7202
- seconds: z23.number().int().positive().max(31536e3),
7302
+ var X402SpendWindowSchema = z24.object({
7303
+ seconds: z24.number().int().positive().max(31536e3),
7203
7304
  max: AtomicAmountSchema
7204
7305
  });
7205
- var X402Permit2PolicySchema = z23.object({
7206
- allowSponsoredApproval: z23.boolean().default(true),
7207
- allowDirectApproval: z23.boolean().default(false),
7208
- allowUnattendedDirectApproval: z23.boolean().default(false),
7306
+ var X402Permit2PolicySchema = z24.object({
7307
+ allowSponsoredApproval: z24.boolean().default(true),
7308
+ allowDirectApproval: z24.boolean().default(false),
7309
+ allowUnattendedDirectApproval: z24.boolean().default(false),
7209
7310
  maxApprovalGasWei: AtomicAmountSchema.optional()
7210
7311
  });
7211
- var X402PaymentPolicySchema = z23.object({
7212
- scheme: z23.enum(["exact", "upto"]),
7312
+ var X402PaymentPolicySchema = z24.object({
7313
+ scheme: z24.enum(["exact", "upto"]),
7213
7314
  network: EvmNetworkSchema,
7214
7315
  asset: EvmAddressSchema,
7215
7316
  payTo: EvmAddressSchema.optional(),
7216
- displaySymbol: z23.string().min(1).max(32).optional(),
7217
- displayDecimals: z23.number().int().min(0).max(255).optional(),
7317
+ displaySymbol: z24.string().min(1).max(32).optional(),
7318
+ displayDecimals: z24.number().int().min(0).max(255).optional(),
7218
7319
  maxPerPayment: AtomicAmountSchema,
7219
7320
  spendWindow: X402SpendWindowSchema,
7220
7321
  permit2: X402Permit2PolicySchema.optional()
7221
7322
  }).superRefine((value, ctx) => {
7222
7323
  if (BigInt(value.maxPerPayment) > BigInt(value.spendWindow.max)) {
7223
7324
  ctx.addIssue({
7224
- code: z23.ZodIssueCode.custom,
7325
+ code: z24.ZodIssueCode.custom,
7225
7326
  message: "maxPerPayment must not exceed spendWindow.max",
7226
7327
  path: ["maxPerPayment"]
7227
7328
  });
7228
7329
  }
7229
7330
  if (value.permit2?.allowUnattendedDirectApproval && !value.permit2.allowDirectApproval) {
7230
7331
  ctx.addIssue({
7231
- code: z23.ZodIssueCode.custom,
7332
+ code: z24.ZodIssueCode.custom,
7232
7333
  message: "unattended direct approval requires allowDirectApproval",
7233
7334
  path: ["permit2", "allowUnattendedDirectApproval"]
7234
7335
  });
7235
7336
  }
7236
7337
  });
7237
- var X402PolicyRuleSchema = z23.object({
7238
- id: z23.string().regex(/^[a-z0-9][a-z0-9._-]{0,63}$/, "invalid rule id"),
7239
- enabled: z23.boolean().default(true),
7240
- priority: z23.number().int().default(0),
7338
+ var X402PolicyRuleSchema = z24.object({
7339
+ id: z24.string().regex(/^[a-z0-9][a-z0-9._-]{0,63}$/, "invalid rule id"),
7340
+ enabled: z24.boolean().default(true),
7341
+ priority: z24.number().int().default(0),
7241
7342
  origin: OriginSchema,
7242
- pathPrefix: z23.string().startsWith("/").default("/"),
7243
- methods: z23.array(z23.enum(["GET", "POST"])).min(1),
7244
- unattended: z23.boolean().default(false),
7245
- allowPrivateNetwork: z23.boolean().default(false),
7246
- maxAuthorizationSeconds: z23.number().int().positive().max(3600).default(300),
7247
- payments: z23.array(X402PaymentPolicySchema).min(1)
7343
+ pathPrefix: z24.string().startsWith("/").default("/"),
7344
+ methods: z24.array(z24.enum(["GET", "POST"])).min(1),
7345
+ unattended: z24.boolean().default(false),
7346
+ allowPrivateNetwork: z24.boolean().default(false),
7347
+ maxAuthorizationSeconds: z24.number().int().positive().max(3600).default(300),
7348
+ payments: z24.array(X402PaymentPolicySchema).min(1)
7248
7349
  }).superRefine((value, ctx) => {
7249
7350
  if (!value.unattended) return;
7250
7351
  value.payments.forEach((payment, index) => {
7251
7352
  if (!payment.payTo) {
7252
7353
  ctx.addIssue({
7253
- code: z23.ZodIssueCode.custom,
7354
+ code: z24.ZodIssueCode.custom,
7254
7355
  message: "unattended payment entries must pin payTo",
7255
7356
  path: ["payments", index, "payTo"]
7256
7357
  });
7257
7358
  }
7258
7359
  });
7259
7360
  });
7260
- var X402PolicySchema = z23.object({
7261
- version: z23.literal(1),
7262
- networks: z23.record(
7361
+ var X402PolicySchema = z24.object({
7362
+ version: z24.literal(1),
7363
+ networks: z24.record(
7263
7364
  EvmNetworkSchema,
7264
- z23.object({
7365
+ z24.object({
7265
7366
  rpcUrlEnv: EnvironmentVariableSchema
7266
7367
  })
7267
7368
  ),
7268
- rules: z23.array(X402PolicyRuleSchema)
7369
+ rules: z24.array(X402PolicyRuleSchema)
7269
7370
  }).superRefine((value, ctx) => {
7270
7371
  const ids = /* @__PURE__ */ new Set();
7271
7372
  for (let index = 0; index < value.rules.length; index += 1) {
7272
7373
  const rule = value.rules[index];
7273
7374
  if (ids.has(rule.id)) {
7274
7375
  ctx.addIssue({
7275
- code: z23.ZodIssueCode.custom,
7376
+ code: z24.ZodIssueCode.custom,
7276
7377
  message: `duplicate rule id: ${rule.id}`,
7277
7378
  path: ["rules", index, "id"]
7278
7379
  });
@@ -7281,7 +7382,7 @@ var X402PolicySchema = z23.object({
7281
7382
  for (const payment of rule.payments) {
7282
7383
  if (!value.networks[payment.network]) {
7283
7384
  ctx.addIssue({
7284
- code: z23.ZodIssueCode.custom,
7385
+ code: z24.ZodIssueCode.custom,
7285
7386
  message: `network ${payment.network} has no RPC configuration`,
7286
7387
  path: ["rules", index, "payments"]
7287
7388
  });
@@ -7696,7 +7797,7 @@ async function confirmManualResolution() {
7696
7797
  return answer.trim().toLowerCase() === "resolve";
7697
7798
  }
7698
7799
  var x402PaymentsCommand = new Command71("payments").description(
7699
- "Inspect and reconcile external x402 payment records"
7800
+ "Inspect and reconcile X402 Pay payment records"
7700
7801
  );
7701
7802
  x402PaymentsCommand.command("list").description("List current payment records").addOption(new Option2("--state <state>", "Filter by state").choices(PAYMENT_STATES)).action(async (options) => {
7702
7803
  const payments = await listX402Payments({ state: options.state });
@@ -7746,7 +7847,7 @@ async function confirmUnattendedRule(rule) {
7746
7847
  return answer.trim().toLowerCase() === "authorize";
7747
7848
  }
7748
7849
  var x402PolicyCommand = new Command72("policy").description(
7749
- "Manage local external x402 spending policy"
7850
+ "Manage local X402 Pay spending policy"
7750
7851
  );
7751
7852
  x402PolicyCommand.command("init").description("Create a deny-all policy file").action(async () => {
7752
7853
  const policy = await initializeX402Policy();
@@ -7784,7 +7885,7 @@ for (const enabled of [true, false]) {
7784
7885
  import { Command as Command73, Option as Option3 } from "commander";
7785
7886
  import { createInterface as createInterface5 } from "readline";
7786
7887
 
7787
- // src/lib/external-x402-client.ts
7888
+ // src/lib/x402-pay-client.ts
7788
7889
  import { x402Client } from "@x402/core/client";
7789
7890
  import { ExactEvmScheme } from "@x402/evm/exact/client";
7790
7891
  import { UptoEvmScheme } from "@x402/evm/upto/client";
@@ -7807,7 +7908,7 @@ var FORBIDDEN_HEADERS = /* @__PURE__ */ new Set([
7807
7908
  "payment-signature",
7808
7909
  "transfer-encoding"
7809
7910
  ]);
7810
- function parseExternalX402Url(raw) {
7911
+ function parseX402PayUrl(raw) {
7811
7912
  let url;
7812
7913
  try {
7813
7914
  url = new URL(raw);
@@ -7842,7 +7943,7 @@ function isPrivateNetworkAddress(address) {
7842
7943
  if (family === 6) return isPrivateIpv6(address);
7843
7944
  return true;
7844
7945
  }
7845
- async function validateExternalX402Destination(url, options) {
7946
+ async function validateX402PayDestination(url, options) {
7846
7947
  const resolve = options.resolve ?? dns.lookup;
7847
7948
  const addresses = await resolve(url.hostname, { all: true, verbatim: true });
7848
7949
  if (addresses.length === 0)
@@ -7914,7 +8015,7 @@ async function loadExternalHeaders(input) {
7914
8015
  return result;
7915
8016
  }
7916
8017
  async function prepareX402HttpRequest(input) {
7917
- const url = parseExternalX402Url(input.rawUrl);
8018
+ const url = parseX402PayUrl(input.rawUrl);
7918
8019
  const method = input.method.toUpperCase();
7919
8020
  if (method !== "GET" && method !== "POST") throw new Error("x402 method must be GET or POST");
7920
8021
  if (input.json !== void 0 && input.bodyFile) {
@@ -8321,7 +8422,7 @@ function authorizationKindFromPaymentPayload(payload) {
8321
8422
  return void 0;
8322
8423
  }
8323
8424
 
8324
- // src/lib/external-x402-client.ts
8425
+ // src/lib/x402-pay-client.ts
8325
8426
  function sameRequirement(left, right) {
8326
8427
  return left.scheme === right.scheme && left.network === right.network && left.amount === right.amount && left.asset.toLowerCase() === right.asset.toLowerCase() && left.payTo.toLowerCase() === right.payTo.toLowerCase();
8327
8428
  }
@@ -8438,7 +8539,7 @@ function signerFor(account) {
8438
8539
  signTypedData: async (typedData) => account.signTypedData(typedData)
8439
8540
  };
8440
8541
  }
8441
- async function executeExternalX402Request(options) {
8542
+ async function executeX402PayRequest(options) {
8442
8543
  const nonInteractive = Boolean(options.nonInteractive);
8443
8544
  const request = await prepareX402HttpRequest({
8444
8545
  rawUrl: options.rawUrl,
@@ -8456,7 +8557,7 @@ async function executeExternalX402Request(options) {
8456
8557
  request,
8457
8558
  requestedRuleId: options.policyRuleId
8458
8559
  });
8459
- await validateExternalX402Destination(request.url, { allowPrivateNetwork });
8560
+ await validateX402PayDestination(request.url, { allowPrivateNetwork });
8460
8561
  const account = options.account ?? await createWalletAccountFromKeystore(await loadKeystore());
8461
8562
  const rpcOptions = rpcConfigurationByChainId(policy);
8462
8563
  let selectedAuthorization;
@@ -8637,7 +8738,7 @@ async function executeExternalX402Request(options) {
8637
8738
  const guardedFetch = async (input, init) => {
8638
8739
  const outgoing = new Request(input, { ...init, redirect: "error" });
8639
8740
  const isPaid = outgoing.headers.has("payment-signature") || outgoing.headers.has("x-payment");
8640
- await validateExternalX402Destination(request.url, { allowPrivateNetwork });
8741
+ await validateX402PayDestination(request.url, { allowPrivateNetwork });
8641
8742
  if (isPaid) {
8642
8743
  if (!paymentRecord) throw new Error("Paid x402 request has no journal reservation");
8643
8744
  paidRequestDispatched = true;
@@ -8651,7 +8752,7 @@ async function executeExternalX402Request(options) {
8651
8752
  state: "unknown",
8652
8753
  error: error instanceof Error ? error.message : String(error)
8653
8754
  });
8654
- throw new ExternalX402Error("External x402 outcome is unknown; do not retry", {
8755
+ throw new X402PayError("External x402 outcome is unknown; do not retry", {
8655
8756
  cause: error,
8656
8757
  payment: paymentRecord,
8657
8758
  pending: true
@@ -8670,7 +8771,7 @@ async function executeExternalX402Request(options) {
8670
8771
  redirect: "error"
8671
8772
  });
8672
8773
  } catch (error) {
8673
- if (error instanceof ExternalX402Error) throw error;
8774
+ if (error instanceof X402PayError) throw error;
8674
8775
  if (paymentRecord) {
8675
8776
  const current = await getX402Payment(paymentRecord.id);
8676
8777
  if (["ready", "dispatched", "unknown"].includes(current.state) || paidRequestDispatched) {
@@ -8678,14 +8779,14 @@ async function executeExternalX402Request(options) {
8678
8779
  state: "unknown",
8679
8780
  error: error instanceof Error ? error.message : String(error)
8680
8781
  });
8681
- throw new ExternalX402Error("External x402 outcome is unknown; do not retry", {
8782
+ throw new X402PayError("External x402 outcome is unknown; do not retry", {
8682
8783
  cause: error,
8683
8784
  payment: paymentRecord,
8684
8785
  pending: true
8685
8786
  });
8686
8787
  }
8687
8788
  }
8688
- throw new ExternalX402Error(
8789
+ throw new X402PayError(
8689
8790
  error instanceof Error ? error.message : "External x402 request failed",
8690
8791
  { cause: error, payment: paymentRecord, pending: false }
8691
8792
  );
@@ -8693,7 +8794,7 @@ async function executeExternalX402Request(options) {
8693
8794
  if (paymentRecord) {
8694
8795
  paymentRecord = await getX402Payment(paymentRecord.id);
8695
8796
  if (paymentRecord.state !== "settled") {
8696
- throw new ExternalX402Error("External x402 outcome is unknown; do not retry", {
8797
+ throw new X402PayError("External x402 outcome is unknown; do not retry", {
8697
8798
  payment: paymentRecord,
8698
8799
  pending: true,
8699
8800
  status: response.status
@@ -8705,7 +8806,7 @@ async function executeExternalX402Request(options) {
8705
8806
  responseData = await externalResponseData(response, { outputPath: options.outputPath });
8706
8807
  } catch (error) {
8707
8808
  if (paymentRecord) {
8708
- throw new ExternalX402Error(
8809
+ throw new X402PayError(
8709
8810
  error instanceof Error ? error.message : "Failed to process external response",
8710
8811
  { cause: error, payment: paymentRecord, pending: false, status: response.status }
8711
8812
  );
@@ -8713,7 +8814,7 @@ async function executeExternalX402Request(options) {
8713
8814
  throw error;
8714
8815
  }
8715
8816
  if (!response.ok) {
8716
- throw new ExternalX402Error(`External service returned HTTP ${response.status}`, {
8817
+ throw new X402PayError(`External service returned HTTP ${response.status}`, {
8717
8818
  payment: paymentRecord,
8718
8819
  pending: false,
8719
8820
  status: response.status
@@ -8739,7 +8840,7 @@ async function confirm(lines) {
8739
8840
  readline.close();
8740
8841
  return answer.trim().toLowerCase() === "yes";
8741
8842
  }
8742
- var x402RequestCommand = new Command73("request").description("Request and pay for a direct external x402 HTTP resource").argument("<url>", "HTTPS resource URL").addOption(new Option3("--method <method>", "HTTP method").choices(["GET", "POST"]).default("GET")).option("--json <json>", "Inline JSON POST body").option("--body-file <path>", "Read JSON POST body from a file").option("--headers-file <path>", "Read request headers from an owner-only JSON file").option(
8843
+ var x402RequestCommand = new Command73("request").description("Request and pay for a direct x402 HTTP resource (X402 Pay)").argument("<url>", "HTTPS resource URL").addOption(new Option3("--method <method>", "HTTP method").choices(["GET", "POST"]).default("GET")).option("--json <json>", "Inline JSON POST body").option("--body-file <path>", "Read JSON POST body from a file").option("--headers-file <path>", "Read request headers from an owner-only JSON file").option(
8743
8844
  "--header-env <header=ENV_VAR>",
8744
8845
  "Read one request header from an environment variable (repeatable)",
8745
8846
  collect2,
@@ -8750,7 +8851,7 @@ var x402RequestCommand = new Command73("request").description("Request and pay f
8750
8851
  headersFile: options.headersFile,
8751
8852
  headerEnv: options.headerEnv
8752
8853
  });
8753
- const result = await executeExternalX402Request({
8854
+ const result = await executeX402PayRequest({
8754
8855
  rawUrl: url,
8755
8856
  method: options.method,
8756
8857
  json: options.json,
@@ -8784,7 +8885,7 @@ var x402RequestCommand = new Command73("request").description("Request and pay f
8784
8885
 
8785
8886
  // src/commands/x402/index.ts
8786
8887
  var x402Command = new Command74("x402").description(
8787
- "Pay external x402 services with local spending policies"
8888
+ "Pay x402 services with local spending policies (X402 Pay)"
8788
8889
  );
8789
8890
  x402Command.addCommand(x402RequestCommand);
8790
8891
  x402Command.addCommand(x402PolicyCommand);