@hightop/sdk 0.1.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.
@@ -0,0 +1,1138 @@
1
+ // ═══════════════════════════════════════════════════════════════════════════
2
+ // Hightop Agent API package metadata — AUTO-GENERATED — do not edit manually
3
+ // Generated by scripts/generateAgentPackageSdk.ts
4
+ // ═══════════════════════════════════════════════════════════════════════════
5
+ /* eslint-disable */
6
+ export const AGENT_API_CONTRACT_VERSION = '1.5.0';
7
+ function isAgentSdkRecord(value) {
8
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
9
+ }
10
+ export const agentErrorDetailsValidators = {
11
+ idempotency_request_in_progress: (value) => isAgentSdkRecord(value) && typeof value['idempotency_key'] === 'string',
12
+ idempotency_key_reuse_mismatch: (value) => isAgentSdkRecord(value) &&
13
+ typeof value['idempotency_key'] === 'string' &&
14
+ typeof value['original_method'] === 'string' &&
15
+ typeof value['original_path'] === 'string',
16
+ slippage_exceeded: (value) => isAgentSdkRecord(value) &&
17
+ typeof value['quote_id'] === 'string' &&
18
+ typeof value['expected_out'] === 'string' &&
19
+ typeof value['min_amount_out'] === 'string',
20
+ quote_already_consumed: (value) => isAgentSdkRecord(value) &&
21
+ typeof value['quote_id'] === 'string' &&
22
+ (value['consumed_at'] === null || typeof value['consumed_at'] === 'string') &&
23
+ (value['consumed_by_operation_id'] === undefined || typeof value['consumed_by_operation_id'] === 'string'),
24
+ quote_expired: (value) => isAgentSdkRecord(value) && typeof value['quote_id'] === 'string' && typeof value['expired_at'] === 'string',
25
+ rate_limited: (value) => isAgentSdkRecord(value) &&
26
+ typeof value['limit_count'] === 'number' &&
27
+ typeof value['attempted_count'] === 'number' &&
28
+ ['transaction'].includes(value['period']),
29
+ limit_exceeded: (value) => (isAgentSdkRecord(value) &&
30
+ typeof value['cap'] === 'number' &&
31
+ typeof value['observed'] === 'number' &&
32
+ ['rolling_30d', 'active'].includes(value['period'])) ||
33
+ (isAgentSdkRecord(value) && typeof value['max_endpoints'] === 'number'),
34
+ ltv_too_high: (value) => isAgentSdkRecord(value) &&
35
+ typeof value['current_ltv'] === 'string' &&
36
+ typeof value['estimated_ltv_after'] === 'string' &&
37
+ typeof value['max_ltv_after'] === 'string',
38
+ ltv_target_unreachable: (value) => isAgentSdkRecord(value) &&
39
+ typeof value['current_ltv'] === 'string' &&
40
+ typeof value['target_ltv'] === 'string' &&
41
+ typeof value['max_repay_usd'] === 'string' &&
42
+ typeof value['required_repay_usd'] === 'string' &&
43
+ typeof value['estimated_ltv_after'] === 'string',
44
+ };
45
+ function normalizeAgentApiError(value) {
46
+ if (!isAgentSdkRecord(value) || typeof value.code !== 'string' || typeof value.message !== 'string') {
47
+ return null;
48
+ }
49
+ const error = {
50
+ code: value.code,
51
+ message: value.message,
52
+ };
53
+ if (isAgentSdkRecord(value.details)) {
54
+ error.details = value.details;
55
+ }
56
+ if (isAgentSdkRecord(value.remediation) &&
57
+ typeof value.remediation.action === 'string' &&
58
+ typeof value.remediation.message === 'string') {
59
+ error.remediation = {
60
+ action: value.remediation.action,
61
+ message: value.remediation.message,
62
+ };
63
+ }
64
+ return error;
65
+ }
66
+ function getAgentApiErrorInternal(error, depth) {
67
+ if (depth > 4 || !isAgentSdkRecord(error)) {
68
+ return null;
69
+ }
70
+ const agentError = normalizeAgentApiError(error.agentError);
71
+ if (agentError) {
72
+ return agentError;
73
+ }
74
+ if (error.ok === false) {
75
+ const envelopeError = normalizeAgentApiError(error.error);
76
+ if (envelopeError) {
77
+ return envelopeError;
78
+ }
79
+ }
80
+ const bareError = normalizeAgentApiError(error);
81
+ if (bareError) {
82
+ return bareError;
83
+ }
84
+ return getAgentApiErrorInternal(error.response, depth + 1);
85
+ }
86
+ export function getAgentApiError(error) {
87
+ return getAgentApiErrorInternal(error, 0);
88
+ }
89
+ export function isAgentErrorCode(error, code) {
90
+ return error.code === code && agentErrorDetailsValidators[code](error.details);
91
+ }
92
+ export function getAgentApiErrorByCode(error, code) {
93
+ const agentError = getAgentApiError(error);
94
+ if (!agentError || !isAgentErrorCode(agentError, code)) {
95
+ return null;
96
+ }
97
+ return agentError;
98
+ }
99
+ export const agentApiEndpoints = [
100
+ {
101
+ key: 'GET /v1/agent/self',
102
+ method: 'GET',
103
+ path: '/v1/agent/self',
104
+ pathParams: [],
105
+ queryParams: [],
106
+ bodyParams: [],
107
+ requestSchema: null,
108
+ bodySchema: null,
109
+ responseSchema: 'agentApiSelfResponse',
110
+ requestType: null,
111
+ responseType: 'AgentApiSelfResponse',
112
+ idempotencyRequired: false,
113
+ routeClass: 'read',
114
+ description: 'Return the authenticated agent and scoped wallet context.',
115
+ },
116
+ {
117
+ key: 'GET /v1/agent/self/usage',
118
+ method: 'GET',
119
+ path: '/v1/agent/self/usage',
120
+ pathParams: [],
121
+ queryParams: [],
122
+ bodyParams: [],
123
+ requestSchema: null,
124
+ bodySchema: null,
125
+ responseSchema: 'agentApiSelfUsageResponse',
126
+ requestType: null,
127
+ responseType: 'AgentApiSelfUsageResponse',
128
+ idempotencyRequired: false,
129
+ routeClass: 'read',
130
+ description: 'Return current Agent API rate-limit and usage state.',
131
+ },
132
+ {
133
+ key: 'GET /v1/agent/capabilities',
134
+ method: 'GET',
135
+ path: '/v1/agent/capabilities',
136
+ pathParams: [],
137
+ queryParams: [],
138
+ bodyParams: [],
139
+ requestSchema: null,
140
+ bodySchema: null,
141
+ responseSchema: 'agentApiCapabilitiesResponse',
142
+ requestType: null,
143
+ responseType: 'AgentApiCapabilitiesResponse',
144
+ idempotencyRequired: false,
145
+ routeClass: 'read',
146
+ description: 'Return Agent API capabilities for the authenticated agent.',
147
+ },
148
+ {
149
+ key: 'GET /v1/agent/capabilities.json',
150
+ method: 'GET',
151
+ path: '/v1/agent/capabilities.json',
152
+ pathParams: [],
153
+ queryParams: [],
154
+ bodyParams: [],
155
+ requestSchema: null,
156
+ bodySchema: null,
157
+ responseSchema: 'agentApiCapabilitiesResponse',
158
+ requestType: null,
159
+ responseType: 'AgentApiCapabilitiesResponse',
160
+ idempotencyRequired: false,
161
+ routeClass: 'read',
162
+ description: 'Return Agent API capabilities as JSON.',
163
+ },
164
+ {
165
+ key: 'GET /v1/agent/account',
166
+ method: 'GET',
167
+ path: '/v1/agent/account',
168
+ pathParams: [],
169
+ queryParams: [],
170
+ bodyParams: [],
171
+ requestSchema: null,
172
+ bodySchema: null,
173
+ responseSchema: 'agentApiAccountResponse',
174
+ requestType: null,
175
+ responseType: 'AgentApiAccountResponse',
176
+ idempotencyRequired: false,
177
+ routeClass: 'read',
178
+ description: 'Return a scoped account summary for the authenticated agent wallet.',
179
+ },
180
+ {
181
+ key: 'GET /v1/agent/assets',
182
+ method: 'GET',
183
+ path: '/v1/agent/assets',
184
+ pathParams: [],
185
+ queryParams: ['cursor', 'limit'],
186
+ bodyParams: [],
187
+ requestSchema: 'agentApiResourceListQuery',
188
+ bodySchema: null,
189
+ responseSchema: 'agentApiAssetsResponse',
190
+ requestType: 'AgentApiResourceListQuery',
191
+ responseType: 'AgentApiAssetsResponse',
192
+ idempotencyRequired: false,
193
+ routeClass: 'read',
194
+ description: 'List assets visible to the authenticated agent.',
195
+ },
196
+ {
197
+ key: 'GET /v1/agent/protocols',
198
+ method: 'GET',
199
+ path: '/v1/agent/protocols',
200
+ pathParams: [],
201
+ queryParams: ['cursor', 'limit'],
202
+ bodyParams: [],
203
+ requestSchema: 'agentApiResourceListQuery',
204
+ bodySchema: null,
205
+ responseSchema: 'agentApiProtocolsResponse',
206
+ requestType: 'AgentApiResourceListQuery',
207
+ responseType: 'AgentApiProtocolsResponse',
208
+ idempotencyRequired: false,
209
+ routeClass: 'read',
210
+ description: 'List protocols visible to the authenticated agent.',
211
+ },
212
+ {
213
+ key: 'GET /v1/agent/balances',
214
+ method: 'GET',
215
+ path: '/v1/agent/balances',
216
+ pathParams: [],
217
+ queryParams: ['cursor', 'limit'],
218
+ bodyParams: [],
219
+ requestSchema: 'agentApiResourceListQuery',
220
+ bodySchema: null,
221
+ responseSchema: 'agentApiBalancesResponse',
222
+ requestType: 'AgentApiResourceListQuery',
223
+ responseType: 'AgentApiBalancesResponse',
224
+ idempotencyRequired: false,
225
+ routeClass: 'read',
226
+ description: 'List balances for the authenticated agent wallet.',
227
+ },
228
+ {
229
+ key: 'GET /v1/agent/balances/cash',
230
+ method: 'GET',
231
+ path: '/v1/agent/balances/cash',
232
+ pathParams: [],
233
+ queryParams: ['cursor', 'limit'],
234
+ bodyParams: [],
235
+ requestSchema: 'agentApiResourceListQuery',
236
+ bodySchema: null,
237
+ responseSchema: 'agentApiBalancesResponse',
238
+ requestType: 'AgentApiResourceListQuery',
239
+ responseType: 'AgentApiBalancesResponse',
240
+ idempotencyRequired: false,
241
+ routeClass: 'read',
242
+ description: 'List cash balances for the authenticated agent wallet.',
243
+ },
244
+ {
245
+ key: 'GET /v1/agent/activity',
246
+ method: 'GET',
247
+ path: '/v1/agent/activity',
248
+ pathParams: [],
249
+ queryParams: ['cursor', 'limit', 'type', 'since'],
250
+ bodyParams: [],
251
+ requestSchema: 'agentApiActivityQuery',
252
+ bodySchema: null,
253
+ responseSchema: 'agentApiActivityResponse',
254
+ requestType: 'AgentApiActivityQuery',
255
+ responseType: 'AgentApiActivityResponse',
256
+ idempotencyRequired: false,
257
+ routeClass: 'read',
258
+ description: 'List scoped Activity rows for the authenticated agent wallet without marking them read.',
259
+ },
260
+ {
261
+ key: 'GET /v1/agent/operations',
262
+ method: 'GET',
263
+ path: '/v1/agent/operations',
264
+ pathParams: [],
265
+ queryParams: ['cursor', 'limit', 'status', 'type', 'since'],
266
+ bodyParams: [],
267
+ requestSchema: 'agentApiOperationsQuery',
268
+ bodySchema: null,
269
+ responseSchema: 'agentApiOperationsResponse',
270
+ requestType: 'AgentApiOperationsQuery',
271
+ responseType: 'AgentApiOperationsResponse',
272
+ idempotencyRequired: false,
273
+ routeClass: 'read',
274
+ description: 'List AgentOperation rows for the authenticated agent.',
275
+ },
276
+ {
277
+ key: 'GET /v1/agent/operations/{id}',
278
+ method: 'GET',
279
+ path: '/v1/agent/operations/{id}',
280
+ pathParams: ['id'],
281
+ queryParams: ['include'],
282
+ bodyParams: [],
283
+ requestSchema: 'agentApiOperationDetailQuery',
284
+ bodySchema: null,
285
+ responseSchema: 'agentApiOperationResponse',
286
+ requestType: 'AgentApiOperationDetailQuery',
287
+ responseType: 'AgentApiOperationResponse',
288
+ idempotencyRequired: false,
289
+ routeClass: 'read',
290
+ description: 'Get one AgentOperation for the authenticated agent.',
291
+ },
292
+ {
293
+ key: 'GET /v1/agent/recipients',
294
+ method: 'GET',
295
+ path: '/v1/agent/recipients',
296
+ pathParams: [],
297
+ queryParams: ['cursor', 'limit'],
298
+ bodyParams: [],
299
+ requestSchema: 'agentApiRecipientsQuery',
300
+ bodySchema: null,
301
+ responseSchema: 'agentApiRecipientsResponse',
302
+ requestType: 'AgentApiRecipientsQuery',
303
+ responseType: 'AgentApiRecipientsResponse',
304
+ idempotencyRequired: false,
305
+ routeClass: 'read',
306
+ description: 'List payment recipients visible to the authenticated agent wallet.',
307
+ },
308
+ {
309
+ key: 'GET /v1/agent/recipients/{id}',
310
+ method: 'GET',
311
+ path: '/v1/agent/recipients/{id}',
312
+ pathParams: ['id'],
313
+ queryParams: [],
314
+ bodyParams: [],
315
+ requestSchema: 'agentApiRecipientDetailQuery',
316
+ bodySchema: null,
317
+ responseSchema: 'agentApiRecipientResponse',
318
+ requestType: 'AgentApiRecipientDetailQuery',
319
+ responseType: 'AgentApiRecipientResponse',
320
+ idempotencyRequired: false,
321
+ routeClass: 'read',
322
+ description: 'Get one recipient visible to the authenticated agent wallet.',
323
+ },
324
+ {
325
+ key: 'POST /v1/agent/recipients/resolve',
326
+ method: 'POST',
327
+ path: '/v1/agent/recipients/resolve',
328
+ pathParams: [],
329
+ queryParams: [],
330
+ bodyParams: ['to', 'asset', 'action'],
331
+ requestSchema: 'agentApiRecipientResolveRequest',
332
+ bodySchema: 'agentApiRecipientResolveRequest',
333
+ responseSchema: 'agentApiRecipientResponse',
334
+ requestType: 'AgentApiRecipientResolveRequest',
335
+ responseType: 'AgentApiRecipientResponse',
336
+ idempotencyRequired: false,
337
+ routeClass: 'read',
338
+ description: 'Resolve an agent-facing recipient identifier.',
339
+ },
340
+ {
341
+ key: 'POST /v1/agent/payments',
342
+ method: 'POST',
343
+ path: '/v1/agent/payments',
344
+ pathParams: [],
345
+ queryParams: [],
346
+ bodyParams: ['to', 'asset', 'deliver_as', 'note', 'slippage_percent', 'prefer', 'amount', 'amount_usd'],
347
+ requestSchema: 'agentApiPaymentCreateRequest',
348
+ bodySchema: 'agentApiPaymentCreateRequest',
349
+ responseSchema: 'agentApiWriteResponse',
350
+ requestType: 'AgentApiPaymentCreateRequest',
351
+ responseType: 'AgentApiWriteResponse',
352
+ idempotencyRequired: true,
353
+ routeClass: 'write',
354
+ description: 'Create a payment operation.',
355
+ },
356
+ {
357
+ key: 'GET /v1/agent/payments',
358
+ method: 'GET',
359
+ path: '/v1/agent/payments',
360
+ pathParams: [],
361
+ queryParams: ['cursor', 'limit'],
362
+ bodyParams: [],
363
+ requestSchema: 'agentApiResourceListQuery',
364
+ bodySchema: null,
365
+ responseSchema: 'agentApiOperationsResponse',
366
+ requestType: 'AgentApiResourceListQuery',
367
+ responseType: 'AgentApiOperationsResponse',
368
+ idempotencyRequired: false,
369
+ routeClass: 'read',
370
+ description: 'List payment operations for the authenticated agent.',
371
+ },
372
+ {
373
+ key: 'GET /v1/agent/payments/{id}',
374
+ method: 'GET',
375
+ path: '/v1/agent/payments/{id}',
376
+ pathParams: ['id'],
377
+ queryParams: ['include'],
378
+ bodyParams: [],
379
+ requestSchema: 'agentApiResourceDetailQuery',
380
+ bodySchema: null,
381
+ responseSchema: 'agentApiOperationResponse',
382
+ requestType: 'AgentApiResourceDetailQuery',
383
+ responseType: 'AgentApiOperationResponse',
384
+ idempotencyRequired: false,
385
+ routeClass: 'read',
386
+ description: 'Get one payment operation for the authenticated agent.',
387
+ },
388
+ {
389
+ key: 'POST /v1/agent/one-off-payments',
390
+ method: 'POST',
391
+ path: '/v1/agent/one-off-payments',
392
+ pathParams: [],
393
+ queryParams: [],
394
+ bodyParams: ['to', 'asset', 'note', 'unlock_delay_seconds', 'expires_in_seconds', 'amount', 'amount_usd'],
395
+ requestSchema: 'agentApiOneOffPaymentCreateRequest',
396
+ bodySchema: 'agentApiOneOffPaymentCreateRequest',
397
+ responseSchema: 'agentApiWriteResponse',
398
+ requestType: 'AgentApiOneOffPaymentCreateRequest',
399
+ responseType: 'AgentApiWriteResponse',
400
+ idempotencyRequired: true,
401
+ routeClass: 'write',
402
+ description: 'Create a one-off payment operation.',
403
+ },
404
+ {
405
+ key: 'GET /v1/agent/one-off-payments',
406
+ method: 'GET',
407
+ path: '/v1/agent/one-off-payments',
408
+ pathParams: [],
409
+ queryParams: ['cursor', 'limit'],
410
+ bodyParams: [],
411
+ requestSchema: 'agentApiResourceListQuery',
412
+ bodySchema: null,
413
+ responseSchema: 'agentApiOperationsResponse',
414
+ requestType: 'AgentApiResourceListQuery',
415
+ responseType: 'AgentApiOperationsResponse',
416
+ idempotencyRequired: false,
417
+ routeClass: 'read',
418
+ description: 'List one-off payment operations for the authenticated agent.',
419
+ },
420
+ {
421
+ key: 'GET /v1/agent/one-off-payments/{id}',
422
+ method: 'GET',
423
+ path: '/v1/agent/one-off-payments/{id}',
424
+ pathParams: ['id'],
425
+ queryParams: ['include'],
426
+ bodyParams: [],
427
+ requestSchema: 'agentApiResourceDetailQuery',
428
+ bodySchema: null,
429
+ responseSchema: 'agentApiOperationResponse',
430
+ requestType: 'AgentApiResourceDetailQuery',
431
+ responseType: 'AgentApiOperationResponse',
432
+ idempotencyRequired: false,
433
+ routeClass: 'read',
434
+ description: 'Get a one-off payment operation for the authenticated agent.',
435
+ },
436
+ {
437
+ key: 'POST /v1/agent/withdrawals/to-bank',
438
+ method: 'POST',
439
+ path: '/v1/agent/withdrawals/to-bank',
440
+ pathParams: [],
441
+ queryParams: [],
442
+ bodyParams: ['method_id', 'asset', 'note', 'amount', 'amount_usd'],
443
+ requestSchema: 'agentApiWithdrawalToBankRequest',
444
+ bodySchema: 'agentApiWithdrawalToBankRequest',
445
+ responseSchema: 'agentApiWriteResponse',
446
+ requestType: 'AgentApiWithdrawalToBankRequest',
447
+ responseType: 'AgentApiWriteResponse',
448
+ idempotencyRequired: true,
449
+ routeClass: 'write',
450
+ description: 'Create a bank withdrawal operation.',
451
+ },
452
+ {
453
+ key: 'POST /v1/agent/withdrawals/to-crypto',
454
+ method: 'POST',
455
+ path: '/v1/agent/withdrawals/to-crypto',
456
+ pathParams: [],
457
+ queryParams: [],
458
+ bodyParams: ['destination_id', 'asset', 'note', 'amount', 'amount_usd'],
459
+ requestSchema: 'agentApiWithdrawalToCryptoRequest',
460
+ bodySchema: 'agentApiWithdrawalToCryptoRequest',
461
+ responseSchema: 'agentApiWriteResponse',
462
+ requestType: 'AgentApiWithdrawalToCryptoRequest',
463
+ responseType: 'AgentApiWriteResponse',
464
+ idempotencyRequired: true,
465
+ routeClass: 'write',
466
+ description: 'Create a crypto withdrawal operation.',
467
+ },
468
+ {
469
+ key: 'GET /v1/agent/withdrawals',
470
+ method: 'GET',
471
+ path: '/v1/agent/withdrawals',
472
+ pathParams: [],
473
+ queryParams: ['cursor', 'limit'],
474
+ bodyParams: [],
475
+ requestSchema: 'agentApiResourceListQuery',
476
+ bodySchema: null,
477
+ responseSchema: 'agentApiOperationsResponse',
478
+ requestType: 'AgentApiResourceListQuery',
479
+ responseType: 'AgentApiOperationsResponse',
480
+ idempotencyRequired: false,
481
+ routeClass: 'read',
482
+ description: 'List withdrawal operations for the authenticated agent.',
483
+ },
484
+ {
485
+ key: 'GET /v1/agent/withdrawals/{id}',
486
+ method: 'GET',
487
+ path: '/v1/agent/withdrawals/{id}',
488
+ pathParams: ['id'],
489
+ queryParams: ['include'],
490
+ bodyParams: [],
491
+ requestSchema: 'agentApiResourceDetailQuery',
492
+ bodySchema: null,
493
+ responseSchema: 'agentApiOperationResponse',
494
+ requestType: 'AgentApiResourceDetailQuery',
495
+ responseType: 'AgentApiOperationResponse',
496
+ idempotencyRequired: false,
497
+ routeClass: 'read',
498
+ description: 'Get one withdrawal operation for the authenticated agent.',
499
+ },
500
+ {
501
+ key: 'GET /v1/agent/withdrawal-methods',
502
+ method: 'GET',
503
+ path: '/v1/agent/withdrawal-methods',
504
+ pathParams: [],
505
+ queryParams: ['cursor', 'limit'],
506
+ bodyParams: [],
507
+ requestSchema: 'agentApiResourceListQuery',
508
+ bodySchema: null,
509
+ responseSchema: 'agentApiWithdrawalMethodsResponse',
510
+ requestType: 'AgentApiResourceListQuery',
511
+ responseType: 'AgentApiWithdrawalMethodsResponse',
512
+ idempotencyRequired: false,
513
+ routeClass: 'read',
514
+ description: 'List withdrawal methods visible to the authenticated agent wallet.',
515
+ },
516
+ {
517
+ key: 'GET /v1/agent/deposit-methods',
518
+ method: 'GET',
519
+ path: '/v1/agent/deposit-methods',
520
+ pathParams: [],
521
+ queryParams: ['cursor', 'limit'],
522
+ bodyParams: [],
523
+ requestSchema: 'agentApiResourceListQuery',
524
+ bodySchema: null,
525
+ responseSchema: 'agentApiDepositMethodsResponse',
526
+ requestType: 'AgentApiResourceListQuery',
527
+ responseType: 'AgentApiDepositMethodsResponse',
528
+ idempotencyRequired: false,
529
+ routeClass: 'read',
530
+ description: 'List deposit methods for the authenticated agent wallet.',
531
+ },
532
+ {
533
+ key: 'GET /v1/agent/deposit-address',
534
+ method: 'GET',
535
+ path: '/v1/agent/deposit-address',
536
+ pathParams: [],
537
+ queryParams: ['asset', 'chain'],
538
+ bodyParams: [],
539
+ requestSchema: 'agentApiDepositAddressQuery',
540
+ bodySchema: null,
541
+ responseSchema: 'agentApiDepositAddressResponse',
542
+ requestType: 'AgentApiDepositAddressQuery',
543
+ responseType: 'AgentApiDepositAddressResponse',
544
+ idempotencyRequired: false,
545
+ routeClass: 'read',
546
+ description: 'Return a Base deposit address for an asset.',
547
+ },
548
+ {
549
+ key: 'GET /v1/agent/earn',
550
+ method: 'GET',
551
+ path: '/v1/agent/earn',
552
+ pathParams: [],
553
+ queryParams: ['cursor', 'limit'],
554
+ bodyParams: [],
555
+ requestSchema: 'agentApiResourceListQuery',
556
+ bodySchema: null,
557
+ responseSchema: 'agentApiEarnResponse',
558
+ requestType: 'AgentApiResourceListQuery',
559
+ responseType: 'AgentApiEarnResponse',
560
+ idempotencyRequired: false,
561
+ routeClass: 'read',
562
+ description: 'List earn positions for the authenticated agent wallet.',
563
+ },
564
+ {
565
+ key: 'GET /v1/agent/earn/{id}',
566
+ method: 'GET',
567
+ path: '/v1/agent/earn/{id}',
568
+ pathParams: ['id'],
569
+ queryParams: [],
570
+ bodyParams: [],
571
+ requestSchema: 'agentApiEarnDetailQuery',
572
+ bodySchema: null,
573
+ responseSchema: 'agentApiEarnPositionResponse',
574
+ requestType: 'AgentApiEarnDetailQuery',
575
+ responseType: 'AgentApiEarnPositionResponse',
576
+ idempotencyRequired: false,
577
+ routeClass: 'read',
578
+ description: 'Get one earn position for the authenticated agent wallet.',
579
+ },
580
+ {
581
+ key: 'GET /v1/agent/earn/opportunities',
582
+ method: 'GET',
583
+ path: '/v1/agent/earn/opportunities',
584
+ pathParams: [],
585
+ queryParams: ['cursor', 'limit'],
586
+ bodyParams: [],
587
+ requestSchema: 'agentApiResourceListQuery',
588
+ bodySchema: null,
589
+ responseSchema: 'agentApiEarnOpportunitiesResponse',
590
+ requestType: 'AgentApiResourceListQuery',
591
+ responseType: 'AgentApiEarnOpportunitiesResponse',
592
+ idempotencyRequired: false,
593
+ routeClass: 'read',
594
+ description: 'List earn opportunities available to the authenticated agent.',
595
+ },
596
+ {
597
+ key: 'POST /v1/agent/earn/deposit',
598
+ method: 'POST',
599
+ path: '/v1/agent/earn/deposit',
600
+ pathParams: [],
601
+ queryParams: [],
602
+ bodyParams: ['asset', 'vault_id', 'use_best_available', 'amount', 'amount_usd'],
603
+ requestSchema: 'agentApiEarnDepositRequest',
604
+ bodySchema: 'agentApiEarnDepositRequest',
605
+ responseSchema: 'agentApiWriteResponse',
606
+ requestType: 'AgentApiEarnDepositRequest',
607
+ responseType: 'AgentApiWriteResponse',
608
+ idempotencyRequired: true,
609
+ routeClass: 'write',
610
+ description: 'Create an earn deposit operation.',
611
+ },
612
+ {
613
+ key: 'POST /v1/agent/earn/withdraw',
614
+ method: 'POST',
615
+ path: '/v1/agent/earn/withdraw',
616
+ pathParams: [],
617
+ queryParams: [],
618
+ bodyParams: ['position_id', 'withdraw_all', 'destination_asset', 'allow_conversion', 'amount', 'amount_usd'],
619
+ requestSchema: 'agentApiEarnWithdrawRequest',
620
+ bodySchema: 'agentApiEarnWithdrawRequest',
621
+ responseSchema: 'agentApiWriteResponse',
622
+ requestType: 'AgentApiEarnWithdrawRequest',
623
+ responseType: 'AgentApiWriteResponse',
624
+ idempotencyRequired: true,
625
+ routeClass: 'write',
626
+ description: 'Create an earn withdrawal operation.',
627
+ },
628
+ {
629
+ key: 'POST /v1/agent/earn/move',
630
+ method: 'POST',
631
+ path: '/v1/agent/earn/move',
632
+ pathParams: [],
633
+ queryParams: [],
634
+ bodyParams: ['from_position_id', 'move_all', 'to_vault_id', 'to_best_available', 'amount', 'amount_usd'],
635
+ requestSchema: 'agentApiEarnMoveRequest',
636
+ bodySchema: 'agentApiEarnMoveRequest',
637
+ responseSchema: 'agentApiWriteResponse',
638
+ requestType: 'AgentApiEarnMoveRequest',
639
+ responseType: 'AgentApiWriteResponse',
640
+ idempotencyRequired: true,
641
+ routeClass: 'write',
642
+ description: 'Create an earn move operation.',
643
+ },
644
+ {
645
+ key: 'POST /v1/agent/earn/rewards/claim',
646
+ method: 'POST',
647
+ path: '/v1/agent/earn/rewards/claim',
648
+ pathParams: [],
649
+ queryParams: [],
650
+ bodyParams: ['protocols'],
651
+ requestSchema: 'agentApiEarnRewardsClaimRequest',
652
+ bodySchema: 'agentApiEarnRewardsClaimRequest',
653
+ responseSchema: 'agentApiWriteResponse',
654
+ requestType: 'AgentApiEarnRewardsClaimRequest',
655
+ responseType: 'AgentApiWriteResponse',
656
+ idempotencyRequired: true,
657
+ routeClass: 'write',
658
+ description: 'Create a rewards claim operation.',
659
+ },
660
+ {
661
+ key: 'GET /v1/agent/borrow',
662
+ method: 'GET',
663
+ path: '/v1/agent/borrow',
664
+ pathParams: [],
665
+ queryParams: [],
666
+ bodyParams: [],
667
+ requestSchema: null,
668
+ bodySchema: null,
669
+ responseSchema: 'agentApiBorrowResponse',
670
+ requestType: null,
671
+ responseType: 'AgentApiBorrowResponse',
672
+ idempotencyRequired: false,
673
+ routeClass: 'read',
674
+ description: 'Return borrow summary for the authenticated agent wallet.',
675
+ },
676
+ {
677
+ key: 'POST /v1/agent/borrow',
678
+ method: 'POST',
679
+ path: '/v1/agent/borrow',
680
+ pathParams: [],
681
+ queryParams: [],
682
+ bodyParams: ['asset', 'max_ltv_after', 'amount', 'amount_usd'],
683
+ requestSchema: 'agentApiBorrowRequest',
684
+ bodySchema: 'agentApiBorrowRequest',
685
+ responseSchema: 'agentApiWriteResponse',
686
+ requestType: 'AgentApiBorrowRequest',
687
+ responseType: 'AgentApiWriteResponse',
688
+ idempotencyRequired: true,
689
+ routeClass: 'write',
690
+ description: 'Create a borrow operation for USDC or GREEN.',
691
+ },
692
+ {
693
+ key: 'GET /v1/agent/borrow/collateral',
694
+ method: 'GET',
695
+ path: '/v1/agent/borrow/collateral',
696
+ pathParams: [],
697
+ queryParams: ['cursor', 'limit'],
698
+ bodyParams: [],
699
+ requestSchema: 'agentApiResourceListQuery',
700
+ bodySchema: null,
701
+ responseSchema: 'agentApiCollateralResponse',
702
+ requestType: 'AgentApiResourceListQuery',
703
+ responseType: 'AgentApiCollateralResponse',
704
+ idempotencyRequired: false,
705
+ routeClass: 'read',
706
+ description: 'List collateral for the authenticated agent wallet.',
707
+ },
708
+ {
709
+ key: 'POST /v1/agent/borrow/repay',
710
+ method: 'POST',
711
+ path: '/v1/agent/borrow/repay',
712
+ pathParams: [],
713
+ queryParams: [],
714
+ bodyParams: ['asset', 'repay_all', 'source_asset', 'allow_conversion', 'amount', 'amount_usd'],
715
+ requestSchema: 'agentApiBorrowRepayRequest',
716
+ bodySchema: 'agentApiBorrowRepayRequest',
717
+ responseSchema: 'agentApiWriteResponse',
718
+ requestType: 'AgentApiBorrowRepayRequest',
719
+ responseType: 'AgentApiWriteResponse',
720
+ idempotencyRequired: true,
721
+ routeClass: 'write',
722
+ description: 'Create a debt repayment operation.',
723
+ },
724
+ {
725
+ key: 'POST /v1/agent/borrow/deleverage',
726
+ method: 'POST',
727
+ path: '/v1/agent/borrow/deleverage',
728
+ pathParams: [],
729
+ queryParams: [],
730
+ bodyParams: [
731
+ 'target_ltv',
732
+ 'max_repay_amount_usd',
733
+ 'source_asset',
734
+ 'use_available_cash_first',
735
+ 'allow_conversion',
736
+ 'allow_partial',
737
+ ],
738
+ requestSchema: 'agentApiDeleverageRequest',
739
+ bodySchema: 'agentApiDeleverageRequest',
740
+ responseSchema: 'agentApiWriteResponse',
741
+ requestType: 'AgentApiDeleverageRequest',
742
+ responseType: 'AgentApiWriteResponse',
743
+ idempotencyRequired: true,
744
+ routeClass: 'write',
745
+ description: 'Create a target-LTV deleverage operation.',
746
+ },
747
+ {
748
+ key: 'POST /v1/agent/borrow/collateral/add',
749
+ method: 'POST',
750
+ path: '/v1/agent/borrow/collateral/add',
751
+ pathParams: [],
752
+ queryParams: [],
753
+ bodyParams: ['asset', 'source_asset', 'allow_conversion', 'amount', 'amount_usd'],
754
+ requestSchema: 'agentApiCollateralAddRequest',
755
+ bodySchema: 'agentApiCollateralAddRequest',
756
+ responseSchema: 'agentApiWriteResponse',
757
+ requestType: 'AgentApiCollateralAddRequest',
758
+ responseType: 'AgentApiWriteResponse',
759
+ idempotencyRequired: true,
760
+ routeClass: 'write',
761
+ description: 'Create a collateral add operation.',
762
+ },
763
+ {
764
+ key: 'POST /v1/agent/borrow/collateral/remove',
765
+ method: 'POST',
766
+ path: '/v1/agent/borrow/collateral/remove',
767
+ pathParams: [],
768
+ queryParams: [],
769
+ bodyParams: ['asset', 'remove_all', 'max_ltv_after', 'amount', 'amount_usd'],
770
+ requestSchema: 'agentApiCollateralRemoveRequest',
771
+ bodySchema: 'agentApiCollateralRemoveRequest',
772
+ responseSchema: 'agentApiWriteResponse',
773
+ requestType: 'AgentApiCollateralRemoveRequest',
774
+ responseType: 'AgentApiWriteResponse',
775
+ idempotencyRequired: true,
776
+ routeClass: 'write',
777
+ description: 'Create a collateral remove operation.',
778
+ },
779
+ {
780
+ key: 'POST /v1/agent/conversions/quote',
781
+ method: 'POST',
782
+ path: '/v1/agent/conversions/quote',
783
+ pathParams: [],
784
+ queryParams: [],
785
+ bodyParams: [
786
+ 'from_asset',
787
+ 'to_asset',
788
+ 'from_vault_address',
789
+ 'to_vault_address',
790
+ 'slippage_percent',
791
+ 'amount',
792
+ 'amount_usd',
793
+ ],
794
+ requestSchema: 'agentApiConversionQuoteRequest',
795
+ bodySchema: 'agentApiConversionQuoteRequest',
796
+ responseSchema: 'agentApiConversionQuoteResponse',
797
+ requestType: 'AgentApiConversionQuoteRequest',
798
+ responseType: 'AgentApiConversionQuoteResponse',
799
+ idempotencyRequired: true,
800
+ routeClass: 'simulate',
801
+ description: 'Create a stateful conversion quote.',
802
+ },
803
+ {
804
+ key: 'POST /v1/agent/conversions',
805
+ method: 'POST',
806
+ path: '/v1/agent/conversions',
807
+ pathParams: [],
808
+ queryParams: [],
809
+ bodyParams: ['quote_id'],
810
+ requestSchema: 'agentApiConversionExecuteRequest',
811
+ bodySchema: 'agentApiConversionExecuteRequest',
812
+ responseSchema: 'agentApiWriteResponse',
813
+ requestType: 'AgentApiConversionExecuteRequest',
814
+ responseType: 'AgentApiWriteResponse',
815
+ idempotencyRequired: true,
816
+ routeClass: 'write',
817
+ description: 'Execute a conversion from a quote.',
818
+ },
819
+ {
820
+ key: 'GET /v1/agent/conversions',
821
+ method: 'GET',
822
+ path: '/v1/agent/conversions',
823
+ pathParams: [],
824
+ queryParams: ['cursor', 'limit'],
825
+ bodyParams: [],
826
+ requestSchema: 'agentApiResourceListQuery',
827
+ bodySchema: null,
828
+ responseSchema: 'agentApiOperationsResponse',
829
+ requestType: 'AgentApiResourceListQuery',
830
+ responseType: 'AgentApiOperationsResponse',
831
+ idempotencyRequired: false,
832
+ routeClass: 'read',
833
+ description: 'List conversion operations for the authenticated agent.',
834
+ },
835
+ {
836
+ key: 'GET /v1/agent/conversions/{id}',
837
+ method: 'GET',
838
+ path: '/v1/agent/conversions/{id}',
839
+ pathParams: ['id'],
840
+ queryParams: ['include'],
841
+ bodyParams: [],
842
+ requestSchema: 'agentApiResourceDetailQuery',
843
+ bodySchema: null,
844
+ responseSchema: 'agentApiOperationResponse',
845
+ requestType: 'AgentApiResourceDetailQuery',
846
+ responseType: 'AgentApiOperationResponse',
847
+ idempotencyRequired: false,
848
+ routeClass: 'read',
849
+ description: 'Get one conversion operation for the authenticated agent.',
850
+ },
851
+ {
852
+ key: 'GET /v1/agent/trusted-destinations',
853
+ method: 'GET',
854
+ path: '/v1/agent/trusted-destinations',
855
+ pathParams: [],
856
+ queryParams: ['cursor', 'limit'],
857
+ bodyParams: [],
858
+ requestSchema: 'agentApiResourceListQuery',
859
+ bodySchema: null,
860
+ responseSchema: 'agentApiRecipientsResponse',
861
+ requestType: 'AgentApiResourceListQuery',
862
+ responseType: 'AgentApiRecipientsResponse',
863
+ idempotencyRequired: false,
864
+ routeClass: 'read',
865
+ description: 'List trusted destinations visible to the authenticated agent wallet.',
866
+ },
867
+ {
868
+ key: 'GET /v1/agent/trusted-destinations/{id}',
869
+ method: 'GET',
870
+ path: '/v1/agent/trusted-destinations/{id}',
871
+ pathParams: ['id'],
872
+ queryParams: [],
873
+ bodyParams: [],
874
+ requestSchema: 'agentApiRecipientDetailQuery',
875
+ bodySchema: null,
876
+ responseSchema: 'agentApiRecipientResponse',
877
+ requestType: 'AgentApiRecipientDetailQuery',
878
+ responseType: 'AgentApiRecipientResponse',
879
+ idempotencyRequired: false,
880
+ routeClass: 'read',
881
+ description: 'Get one trusted destination visible to the authenticated agent wallet.',
882
+ },
883
+ {
884
+ key: 'GET /v1/agent/recurring-payments',
885
+ method: 'GET',
886
+ path: '/v1/agent/recurring-payments',
887
+ pathParams: [],
888
+ queryParams: ['cursor', 'limit'],
889
+ bodyParams: [],
890
+ requestSchema: 'agentApiResourceListQuery',
891
+ bodySchema: null,
892
+ responseSchema: 'agentApiRecipientsResponse',
893
+ requestType: 'AgentApiResourceListQuery',
894
+ responseType: 'AgentApiRecipientsResponse',
895
+ idempotencyRequired: false,
896
+ routeClass: 'read',
897
+ description: 'List recurring payment recipients visible to the authenticated agent wallet.',
898
+ },
899
+ {
900
+ key: 'GET /v1/agent/recurring-payments/{id}',
901
+ method: 'GET',
902
+ path: '/v1/agent/recurring-payments/{id}',
903
+ pathParams: ['id'],
904
+ queryParams: [],
905
+ bodyParams: [],
906
+ requestSchema: 'agentApiRecipientDetailQuery',
907
+ bodySchema: null,
908
+ responseSchema: 'agentApiRecipientResponse',
909
+ requestType: 'AgentApiRecipientDetailQuery',
910
+ responseType: 'AgentApiRecipientResponse',
911
+ idempotencyRequired: false,
912
+ routeClass: 'read',
913
+ description: 'Get one recurring payment recipient visible to the authenticated agent wallet.',
914
+ },
915
+ {
916
+ key: 'POST /v1/agent/simulate',
917
+ method: 'POST',
918
+ path: '/v1/agent/simulate',
919
+ pathParams: [],
920
+ queryParams: [],
921
+ bodyParams: ['method', 'path', 'body'],
922
+ requestSchema: 'agentApiSimulateRequest',
923
+ bodySchema: 'agentApiSimulateRequest',
924
+ responseSchema: 'agentApiSimulateResponse',
925
+ requestType: 'AgentApiSimulateRequest',
926
+ responseType: 'AgentApiSimulateResponse',
927
+ idempotencyRequired: false,
928
+ routeClass: 'simulate',
929
+ description: 'Simulate a write request without broadcasting.',
930
+ },
931
+ {
932
+ key: 'POST /v1/agent/x402/sign',
933
+ method: 'POST',
934
+ path: '/v1/agent/x402/sign',
935
+ pathParams: [],
936
+ queryParams: [],
937
+ bodyParams: ['payment_requirements', 'pay_to', 'amount', 'target_url', 'max_timeout_seconds'],
938
+ requestSchema: 'agentApiX402SignRequest',
939
+ bodySchema: 'agentApiX402SignRequest',
940
+ responseSchema: 'agentApiX402SignResponse',
941
+ requestType: 'AgentApiX402SignRequest',
942
+ responseType: 'AgentApiX402SignResponse',
943
+ idempotencyRequired: true,
944
+ routeClass: 'write',
945
+ description: 'Sign a Base USDC x402 payment authorization from an x402 payment requirement.',
946
+ },
947
+ {
948
+ key: 'POST /v1/agent/x402/quote',
949
+ method: 'POST',
950
+ path: '/v1/agent/x402/quote',
951
+ pathParams: [],
952
+ queryParams: [],
953
+ bodyParams: ['url', 'method', 'body', 'timeout_ms'],
954
+ requestSchema: 'agentApiX402QuoteRequest',
955
+ bodySchema: 'agentApiX402QuoteRequest',
956
+ responseSchema: 'agentApiX402QuoteResponse',
957
+ requestType: 'AgentApiX402QuoteRequest',
958
+ responseType: 'AgentApiX402QuoteResponse',
959
+ idempotencyRequired: false,
960
+ routeClass: 'simulate',
961
+ description: 'Fetch a URL and return its supported x402 price without paying.',
962
+ },
963
+ {
964
+ key: 'POST /v1/agent/x402/purchase',
965
+ method: 'POST',
966
+ path: '/v1/agent/x402/purchase',
967
+ pathParams: [],
968
+ queryParams: [],
969
+ bodyParams: ['url', 'method', 'body', 'max_amount'],
970
+ requestSchema: 'agentApiX402PurchaseRequest',
971
+ bodySchema: 'agentApiX402PurchaseRequest',
972
+ responseSchema: 'agentApiX402PurchaseResponse',
973
+ requestType: 'AgentApiX402PurchaseRequest',
974
+ responseType: 'AgentApiX402PurchaseResponse',
975
+ idempotencyRequired: true,
976
+ routeClass: 'write',
977
+ description: 'Fetch a URL, satisfy an x402 challenge when required, and return the upstream response.',
978
+ },
979
+ {
980
+ key: 'POST /v1/agent/webhooks',
981
+ method: 'POST',
982
+ path: '/v1/agent/webhooks',
983
+ pathParams: [],
984
+ queryParams: [],
985
+ bodyParams: ['url', 'description', 'event_types'],
986
+ requestSchema: 'agentApiWebhookCreateRequest',
987
+ bodySchema: 'agentApiWebhookCreateRequest',
988
+ responseSchema: 'agentApiWebhookCreateResponse',
989
+ requestType: 'AgentApiWebhookCreateRequest',
990
+ responseType: 'AgentApiWebhookCreateResponse',
991
+ idempotencyRequired: true,
992
+ routeClass: 'webhook_management',
993
+ description: 'Create an outbound webhook endpoint.',
994
+ },
995
+ {
996
+ key: 'GET /v1/agent/webhooks',
997
+ method: 'GET',
998
+ path: '/v1/agent/webhooks',
999
+ pathParams: [],
1000
+ queryParams: ['cursor', 'limit'],
1001
+ bodyParams: [],
1002
+ requestSchema: 'agentApiResourceListQuery',
1003
+ bodySchema: null,
1004
+ responseSchema: 'agentApiWebhooksResponse',
1005
+ requestType: 'AgentApiResourceListQuery',
1006
+ responseType: 'AgentApiWebhooksResponse',
1007
+ idempotencyRequired: false,
1008
+ routeClass: 'webhook_management',
1009
+ description: 'List outbound webhook endpoints for the authenticated agent.',
1010
+ },
1011
+ {
1012
+ key: 'GET /v1/agent/webhooks/{id}',
1013
+ method: 'GET',
1014
+ path: '/v1/agent/webhooks/{id}',
1015
+ pathParams: ['id'],
1016
+ queryParams: ['include'],
1017
+ bodyParams: [],
1018
+ requestSchema: 'agentApiResourceDetailQuery',
1019
+ bodySchema: null,
1020
+ responseSchema: 'agentApiWebhookResponse',
1021
+ requestType: 'AgentApiResourceDetailQuery',
1022
+ responseType: 'AgentApiWebhookResponse',
1023
+ idempotencyRequired: false,
1024
+ routeClass: 'webhook_management',
1025
+ description: 'Get one outbound webhook endpoint for the authenticated agent.',
1026
+ },
1027
+ {
1028
+ key: 'PATCH /v1/agent/webhooks/{id}',
1029
+ method: 'PATCH',
1030
+ path: '/v1/agent/webhooks/{id}',
1031
+ pathParams: ['id'],
1032
+ queryParams: [],
1033
+ bodyParams: ['url', 'description', 'event_types', 'enabled'],
1034
+ requestSchema: 'agentApiWebhookPatchRequest',
1035
+ bodySchema: 'agentApiWebhookPatchRequest',
1036
+ responseSchema: 'agentApiWebhookResponse',
1037
+ requestType: 'AgentApiWebhookPatchRequest',
1038
+ responseType: 'AgentApiWebhookResponse',
1039
+ idempotencyRequired: true,
1040
+ routeClass: 'webhook_management',
1041
+ description: 'Update an outbound webhook endpoint.',
1042
+ },
1043
+ {
1044
+ key: 'DELETE /v1/agent/webhooks/{id}',
1045
+ method: 'DELETE',
1046
+ path: '/v1/agent/webhooks/{id}',
1047
+ pathParams: ['id'],
1048
+ queryParams: [],
1049
+ bodyParams: [],
1050
+ requestSchema: 'agentApiWebhookDeleteRequest',
1051
+ bodySchema: 'agentApiWebhookDeleteRequest',
1052
+ responseSchema: 'agentApiWebhookDeleteResponse',
1053
+ requestType: 'AgentApiWebhookDeleteRequest',
1054
+ responseType: 'AgentApiWebhookDeleteResponse',
1055
+ idempotencyRequired: true,
1056
+ routeClass: 'webhook_management',
1057
+ description: 'Delete or disable an outbound webhook endpoint.',
1058
+ },
1059
+ {
1060
+ key: 'POST /v1/agent/webhooks/{id}/rotate-secret',
1061
+ method: 'POST',
1062
+ path: '/v1/agent/webhooks/{id}/rotate-secret',
1063
+ pathParams: ['id'],
1064
+ queryParams: [],
1065
+ bodyParams: [],
1066
+ requestSchema: 'agentApiWebhookRotateSecretRequest',
1067
+ bodySchema: 'agentApiWebhookRotateSecretRequest',
1068
+ responseSchema: 'agentApiWebhookRotateSecretResponse',
1069
+ requestType: 'AgentApiWebhookRotateSecretRequest',
1070
+ responseType: 'AgentApiWebhookRotateSecretResponse',
1071
+ idempotencyRequired: true,
1072
+ routeClass: 'webhook_management',
1073
+ description: 'Rotate an outbound webhook signing secret.',
1074
+ },
1075
+ {
1076
+ key: 'GET /v1/agent/webhooks/{id}/deliveries',
1077
+ method: 'GET',
1078
+ path: '/v1/agent/webhooks/{id}/deliveries',
1079
+ pathParams: ['id'],
1080
+ queryParams: ['cursor', 'limit', 'status', 'event_id'],
1081
+ bodyParams: [],
1082
+ requestSchema: 'agentApiWebhookDeliveriesQuery',
1083
+ bodySchema: null,
1084
+ responseSchema: 'agentApiWebhookDeliveriesResponse',
1085
+ requestType: 'AgentApiWebhookDeliveriesQuery',
1086
+ responseType: 'AgentApiWebhookDeliveriesResponse',
1087
+ idempotencyRequired: false,
1088
+ routeClass: 'read',
1089
+ description: 'List webhook delivery attempts for one outbound webhook endpoint.',
1090
+ },
1091
+ {
1092
+ key: 'POST /v1/agent/webhooks/{id}/test',
1093
+ method: 'POST',
1094
+ path: '/v1/agent/webhooks/{id}/test',
1095
+ pathParams: ['id'],
1096
+ queryParams: [],
1097
+ bodyParams: [],
1098
+ requestSchema: 'agentApiWebhookTestRequest',
1099
+ bodySchema: 'agentApiWebhookTestRequest',
1100
+ responseSchema: 'agentApiWebhookTestResponse',
1101
+ requestType: 'AgentApiWebhookTestRequest',
1102
+ responseType: 'AgentApiWebhookTestResponse',
1103
+ idempotencyRequired: true,
1104
+ routeClass: 'webhook_management',
1105
+ description: 'Send a webhook.test delivery to an outbound webhook endpoint.',
1106
+ },
1107
+ ];
1108
+ export function getAgentApiEndpoint(key) {
1109
+ const endpoint = agentApiEndpoints.find((candidate) => candidate.key === key);
1110
+ if (!endpoint) {
1111
+ throw new Error(`Unknown Agent API endpoint: ${key}`);
1112
+ }
1113
+ return endpoint;
1114
+ }
1115
+ export function buildAgentApiPath(pathTemplate, pathParams = {}) {
1116
+ return pathTemplate.replace(/\{([^}]+)\}/g, (_, name) => {
1117
+ const value = pathParams[name];
1118
+ if (value === undefined || value === null || value === '') {
1119
+ throw new Error(`Missing Agent API path parameter: ${name}`);
1120
+ }
1121
+ const segment = String(value);
1122
+ let decodedSegment = segment;
1123
+ try {
1124
+ decodedSegment = decodeURIComponent(segment);
1125
+ }
1126
+ catch {
1127
+ decodedSegment = segment;
1128
+ }
1129
+ if (decodedSegment === '.' ||
1130
+ decodedSegment === '..' ||
1131
+ decodedSegment.includes('/') ||
1132
+ decodedSegment.includes('\\')) {
1133
+ throw new Error(`Unsafe Agent API path parameter: ${name}`);
1134
+ }
1135
+ return encodeURIComponent(segment);
1136
+ });
1137
+ }
1138
+ //# sourceMappingURL=agent-api.js.map