@agent-receipts/schema 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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Webaes
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,65 @@
1
+ # @agent-receipts/schema
2
+
3
+ Zod schemas and TypeScript types for the [Action Receipt Protocol](https://github.com/webaesbyamin/agent-receipts).
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @agent-receipts/schema
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import { ActionReceipt, validate, CreateReceiptInput } from '@agent-receipts/schema'
15
+
16
+ // Validate a receipt object
17
+ const result = validate(ActionReceipt, someObject)
18
+ if (result.success) {
19
+ console.log('Valid receipt:', result.data.receipt_id)
20
+ } else {
21
+ console.log('Invalid:', result.error)
22
+ }
23
+
24
+ // Validate create input
25
+ const input = validate(CreateReceiptInput, {
26
+ action: 'generate_report',
27
+ input_hash: 'sha256:abc123...',
28
+ })
29
+ ```
30
+
31
+ ## Schemas
32
+
33
+ | Schema | Description |
34
+ |--------|-------------|
35
+ | `ActionReceipt` | Full receipt with all fields |
36
+ | `SignablePayload` | Deterministic fields used for signing |
37
+ | `CreateReceiptInput` | Input for creating a new receipt |
38
+ | `CompleteReceiptInput` | Input for completing a pending receipt |
39
+ | `VerifyResponse` | Response from verification |
40
+ | `ListReceiptsQuery` | Query parameters for listing receipts |
41
+ | `PaginationMeta` | Pagination metadata |
42
+ | `ErrorResponse` | Structured error response |
43
+
44
+ ## Enums
45
+
46
+ | Enum | Values |
47
+ |------|--------|
48
+ | `ReceiptStatus` | `pending`, `completed`, `failed`, `timeout` |
49
+ | `ReceiptType` | `action` |
50
+ | `Environment` | `development`, `staging`, `production` |
51
+ | `ErrorCode` | `VALIDATION_ERROR`, `NOT_FOUND`, `VERIFICATION_FAILED`, `INTERNAL_ERROR` |
52
+
53
+ ## Utilities
54
+
55
+ - `validate(schema, data)` — Validate data against any schema, returns `{ success, data?, error? }`
56
+ - `formatZodError(error)` — Format a Zod error into a human-readable string
57
+ - `createErrorResponse(code, message)` — Create a structured error response
58
+
59
+ ## JSON Schema
60
+
61
+ The package includes `receipt.schema.json` for non-TypeScript consumers. This is auto-generated from the Zod schemas.
62
+
63
+ ## License
64
+
65
+ MIT
@@ -0,0 +1,479 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const ReceiptStatus: z.ZodEnum<["pending", "completed", "failed", "timeout"]>;
4
+ type ReceiptStatus = z.infer<typeof ReceiptStatus>;
5
+ declare const ReceiptType: z.ZodEnum<["action", "verification", "judgment", "arbitration"]>;
6
+ type ReceiptType = z.infer<typeof ReceiptType>;
7
+ declare const Environment: z.ZodEnum<["production", "staging", "test"]>;
8
+ type Environment = z.infer<typeof Environment>;
9
+ declare const ErrorCode: z.ZodEnum<["UNAUTHORIZED", "KEY_REVOKED", "FORBIDDEN", "RECEIPT_NOT_FOUND", "CHAIN_NOT_FOUND", "AGENT_NOT_FOUND", "RECEIPT_NOT_PENDING", "RECEIPT_IMMUTABLE", "RATE_LIMIT_EXCEEDED", "VALIDATION_ERROR", "INTERNAL_ERROR"]>;
10
+ type ErrorCode = z.infer<typeof ErrorCode>;
11
+
12
+ /**
13
+ * The 12 fields that are cryptographically signed.
14
+ * These fields are extracted from a receipt and serialized as canonical JSON
15
+ * before signing with Ed25519.
16
+ */
17
+ declare const SignablePayload: z.ZodObject<{
18
+ receipt_id: z.ZodString;
19
+ chain_id: z.ZodString;
20
+ receipt_type: z.ZodEnum<["action", "verification", "judgment", "arbitration"]>;
21
+ agent_id: z.ZodString;
22
+ org_id: z.ZodString;
23
+ action: z.ZodString;
24
+ input_hash: z.ZodString;
25
+ output_hash: z.ZodNullable<z.ZodString>;
26
+ status: z.ZodEnum<["pending", "completed", "failed", "timeout"]>;
27
+ timestamp: z.ZodString;
28
+ completed_at: z.ZodNullable<z.ZodString>;
29
+ environment: z.ZodEnum<["production", "staging", "test"]>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ status: "pending" | "completed" | "failed" | "timeout";
32
+ action: string;
33
+ receipt_id: string;
34
+ chain_id: string;
35
+ receipt_type: "action" | "verification" | "judgment" | "arbitration";
36
+ agent_id: string;
37
+ org_id: string;
38
+ input_hash: string;
39
+ output_hash: string | null;
40
+ timestamp: string;
41
+ completed_at: string | null;
42
+ environment: "production" | "staging" | "test";
43
+ }, {
44
+ status: "pending" | "completed" | "failed" | "timeout";
45
+ action: string;
46
+ receipt_id: string;
47
+ chain_id: string;
48
+ receipt_type: "action" | "verification" | "judgment" | "arbitration";
49
+ agent_id: string;
50
+ org_id: string;
51
+ input_hash: string;
52
+ output_hash: string | null;
53
+ timestamp: string;
54
+ completed_at: string | null;
55
+ environment: "production" | "staging" | "test";
56
+ }>;
57
+ type SignablePayload = z.infer<typeof SignablePayload>;
58
+ /**
59
+ * The complete receipt object as returned by the API.
60
+ */
61
+ declare const ActionReceipt: z.ZodObject<{
62
+ receipt_id: z.ZodString;
63
+ parent_receipt_id: z.ZodNullable<z.ZodString>;
64
+ chain_id: z.ZodString;
65
+ receipt_type: z.ZodEnum<["action", "verification", "judgment", "arbitration"]>;
66
+ agent_id: z.ZodString;
67
+ org_id: z.ZodString;
68
+ action: z.ZodString;
69
+ input_hash: z.ZodString;
70
+ output_hash: z.ZodNullable<z.ZodString>;
71
+ output_summary: z.ZodNullable<z.ZodString>;
72
+ model: z.ZodNullable<z.ZodString>;
73
+ tokens_in: z.ZodNullable<z.ZodNumber>;
74
+ tokens_out: z.ZodNullable<z.ZodNumber>;
75
+ cost_usd: z.ZodNullable<z.ZodNumber>;
76
+ latency_ms: z.ZodNullable<z.ZodNumber>;
77
+ tool_calls: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
78
+ timestamp: z.ZodString;
79
+ completed_at: z.ZodNullable<z.ZodString>;
80
+ status: z.ZodEnum<["pending", "completed", "failed", "timeout"]>;
81
+ error: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
82
+ environment: z.ZodEnum<["production", "staging", "test"]>;
83
+ tags: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
84
+ constraints: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
85
+ constraint_result: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
86
+ signature: z.ZodString;
87
+ verify_url: z.ZodString;
88
+ callback_verified: z.ZodNullable<z.ZodBoolean>;
89
+ confidence: z.ZodNullable<z.ZodNumber>;
90
+ metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
91
+ }, "strip", z.ZodTypeAny, {
92
+ status: "pending" | "completed" | "failed" | "timeout";
93
+ action: string;
94
+ receipt_id: string;
95
+ chain_id: string;
96
+ receipt_type: "action" | "verification" | "judgment" | "arbitration";
97
+ agent_id: string;
98
+ org_id: string;
99
+ input_hash: string;
100
+ output_hash: string | null;
101
+ timestamp: string;
102
+ completed_at: string | null;
103
+ environment: "production" | "staging" | "test";
104
+ parent_receipt_id: string | null;
105
+ output_summary: string | null;
106
+ model: string | null;
107
+ tokens_in: number | null;
108
+ tokens_out: number | null;
109
+ cost_usd: number | null;
110
+ latency_ms: number | null;
111
+ tool_calls: string[] | null;
112
+ error: Record<string, unknown> | null;
113
+ tags: string[] | null;
114
+ constraints: Record<string, unknown> | null;
115
+ constraint_result: Record<string, unknown> | null;
116
+ signature: string;
117
+ verify_url: string;
118
+ callback_verified: boolean | null;
119
+ confidence: number | null;
120
+ metadata: Record<string, unknown>;
121
+ }, {
122
+ status: "pending" | "completed" | "failed" | "timeout";
123
+ action: string;
124
+ receipt_id: string;
125
+ chain_id: string;
126
+ receipt_type: "action" | "verification" | "judgment" | "arbitration";
127
+ agent_id: string;
128
+ org_id: string;
129
+ input_hash: string;
130
+ output_hash: string | null;
131
+ timestamp: string;
132
+ completed_at: string | null;
133
+ environment: "production" | "staging" | "test";
134
+ parent_receipt_id: string | null;
135
+ output_summary: string | null;
136
+ model: string | null;
137
+ tokens_in: number | null;
138
+ tokens_out: number | null;
139
+ cost_usd: number | null;
140
+ latency_ms: number | null;
141
+ tool_calls: string[] | null;
142
+ error: Record<string, unknown> | null;
143
+ tags: string[] | null;
144
+ constraints: Record<string, unknown> | null;
145
+ constraint_result: Record<string, unknown> | null;
146
+ signature: string;
147
+ verify_url: string;
148
+ callback_verified: boolean | null;
149
+ confidence: number | null;
150
+ metadata: Record<string, unknown>;
151
+ }>;
152
+ type ActionReceipt = z.infer<typeof ActionReceipt>;
153
+
154
+ /**
155
+ * What the client sends to POST /api/v1/receipts.
156
+ */
157
+ declare const CreateReceiptInput: z.ZodObject<{
158
+ agent_id: z.ZodString;
159
+ action: z.ZodString;
160
+ input_hash: z.ZodString;
161
+ receipt_type: z.ZodDefault<z.ZodEnum<["action", "verification", "judgment", "arbitration"]>>;
162
+ status: z.ZodDefault<z.ZodEnum<["pending", "completed", "failed", "timeout"]>>;
163
+ environment: z.ZodDefault<z.ZodEnum<["production", "staging", "test"]>>;
164
+ parent_receipt_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
165
+ output_hash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
166
+ output_summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
167
+ model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
168
+ tokens_in: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
169
+ tokens_out: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
170
+ cost_usd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
171
+ latency_ms: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
172
+ tool_calls: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
173
+ tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
174
+ confidence: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
175
+ callback_verified: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
176
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
177
+ }, "strip", z.ZodTypeAny, {
178
+ status: "pending" | "completed" | "failed" | "timeout";
179
+ action: string;
180
+ receipt_type: "action" | "verification" | "judgment" | "arbitration";
181
+ agent_id: string;
182
+ input_hash: string;
183
+ environment: "production" | "staging" | "test";
184
+ output_hash?: string | null | undefined;
185
+ parent_receipt_id?: string | null | undefined;
186
+ output_summary?: string | null | undefined;
187
+ model?: string | null | undefined;
188
+ tokens_in?: number | null | undefined;
189
+ tokens_out?: number | null | undefined;
190
+ cost_usd?: number | null | undefined;
191
+ latency_ms?: number | null | undefined;
192
+ tool_calls?: string[] | null | undefined;
193
+ tags?: string[] | null | undefined;
194
+ callback_verified?: boolean | null | undefined;
195
+ confidence?: number | null | undefined;
196
+ metadata?: Record<string, unknown> | undefined;
197
+ }, {
198
+ action: string;
199
+ agent_id: string;
200
+ input_hash: string;
201
+ status?: "pending" | "completed" | "failed" | "timeout" | undefined;
202
+ receipt_type?: "action" | "verification" | "judgment" | "arbitration" | undefined;
203
+ output_hash?: string | null | undefined;
204
+ environment?: "production" | "staging" | "test" | undefined;
205
+ parent_receipt_id?: string | null | undefined;
206
+ output_summary?: string | null | undefined;
207
+ model?: string | null | undefined;
208
+ tokens_in?: number | null | undefined;
209
+ tokens_out?: number | null | undefined;
210
+ cost_usd?: number | null | undefined;
211
+ latency_ms?: number | null | undefined;
212
+ tool_calls?: string[] | null | undefined;
213
+ tags?: string[] | null | undefined;
214
+ callback_verified?: boolean | null | undefined;
215
+ confidence?: number | null | undefined;
216
+ metadata?: Record<string, unknown> | undefined;
217
+ }>;
218
+ type CreateReceiptInput = z.infer<typeof CreateReceiptInput>;
219
+ /**
220
+ * What the client sends to PATCH /api/v1/receipts/:id/complete.
221
+ */
222
+ declare const CompleteReceiptInput: z.ZodObject<{
223
+ status: z.ZodEnum<["completed", "failed", "timeout"]>;
224
+ output_hash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
225
+ output_summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
226
+ model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
227
+ tokens_in: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
228
+ tokens_out: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
229
+ cost_usd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
230
+ latency_ms: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
231
+ tool_calls: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
232
+ confidence: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
233
+ callback_verified: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
234
+ error: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
235
+ }, "strip", z.ZodTypeAny, {
236
+ status: "completed" | "failed" | "timeout";
237
+ output_hash?: string | null | undefined;
238
+ output_summary?: string | null | undefined;
239
+ model?: string | null | undefined;
240
+ tokens_in?: number | null | undefined;
241
+ tokens_out?: number | null | undefined;
242
+ cost_usd?: number | null | undefined;
243
+ latency_ms?: number | null | undefined;
244
+ tool_calls?: string[] | null | undefined;
245
+ error?: Record<string, unknown> | null | undefined;
246
+ callback_verified?: boolean | null | undefined;
247
+ confidence?: number | null | undefined;
248
+ }, {
249
+ status: "completed" | "failed" | "timeout";
250
+ output_hash?: string | null | undefined;
251
+ output_summary?: string | null | undefined;
252
+ model?: string | null | undefined;
253
+ tokens_in?: number | null | undefined;
254
+ tokens_out?: number | null | undefined;
255
+ cost_usd?: number | null | undefined;
256
+ latency_ms?: number | null | undefined;
257
+ tool_calls?: string[] | null | undefined;
258
+ error?: Record<string, unknown> | null | undefined;
259
+ callback_verified?: boolean | null | undefined;
260
+ confidence?: number | null | undefined;
261
+ }>;
262
+ type CompleteReceiptInput = z.infer<typeof CompleteReceiptInput>;
263
+ /**
264
+ * What GET /api/v1/verify/:id returns.
265
+ * Note: Does NOT include org_id, metadata, tags, or output_summary (org-private).
266
+ */
267
+ declare const VerifyResponse: z.ZodObject<{
268
+ verified: z.ZodBoolean;
269
+ receipt: z.ZodObject<{
270
+ receipt_id: z.ZodString;
271
+ chain_id: z.ZodString;
272
+ receipt_type: z.ZodEnum<["action", "verification", "judgment", "arbitration"]>;
273
+ agent_id: z.ZodString;
274
+ action: z.ZodString;
275
+ status: z.ZodEnum<["pending", "completed", "failed", "timeout"]>;
276
+ input_hash: z.ZodString;
277
+ output_hash: z.ZodNullable<z.ZodString>;
278
+ signature: z.ZodString;
279
+ timestamp: z.ZodString;
280
+ completed_at: z.ZodNullable<z.ZodString>;
281
+ environment: z.ZodEnum<["production", "staging", "test"]>;
282
+ latency_ms: z.ZodNullable<z.ZodNumber>;
283
+ }, "strip", z.ZodTypeAny, {
284
+ status: "pending" | "completed" | "failed" | "timeout";
285
+ action: string;
286
+ receipt_id: string;
287
+ chain_id: string;
288
+ receipt_type: "action" | "verification" | "judgment" | "arbitration";
289
+ agent_id: string;
290
+ input_hash: string;
291
+ output_hash: string | null;
292
+ timestamp: string;
293
+ completed_at: string | null;
294
+ environment: "production" | "staging" | "test";
295
+ latency_ms: number | null;
296
+ signature: string;
297
+ }, {
298
+ status: "pending" | "completed" | "failed" | "timeout";
299
+ action: string;
300
+ receipt_id: string;
301
+ chain_id: string;
302
+ receipt_type: "action" | "verification" | "judgment" | "arbitration";
303
+ agent_id: string;
304
+ input_hash: string;
305
+ output_hash: string | null;
306
+ timestamp: string;
307
+ completed_at: string | null;
308
+ environment: "production" | "staging" | "test";
309
+ latency_ms: number | null;
310
+ signature: string;
311
+ }>;
312
+ signature_valid: z.ZodBoolean;
313
+ chain_length: z.ZodNumber;
314
+ public_key_url: z.ZodString;
315
+ }, "strip", z.ZodTypeAny, {
316
+ verified: boolean;
317
+ receipt: {
318
+ status: "pending" | "completed" | "failed" | "timeout";
319
+ action: string;
320
+ receipt_id: string;
321
+ chain_id: string;
322
+ receipt_type: "action" | "verification" | "judgment" | "arbitration";
323
+ agent_id: string;
324
+ input_hash: string;
325
+ output_hash: string | null;
326
+ timestamp: string;
327
+ completed_at: string | null;
328
+ environment: "production" | "staging" | "test";
329
+ latency_ms: number | null;
330
+ signature: string;
331
+ };
332
+ signature_valid: boolean;
333
+ chain_length: number;
334
+ public_key_url: string;
335
+ }, {
336
+ verified: boolean;
337
+ receipt: {
338
+ status: "pending" | "completed" | "failed" | "timeout";
339
+ action: string;
340
+ receipt_id: string;
341
+ chain_id: string;
342
+ receipt_type: "action" | "verification" | "judgment" | "arbitration";
343
+ agent_id: string;
344
+ input_hash: string;
345
+ output_hash: string | null;
346
+ timestamp: string;
347
+ completed_at: string | null;
348
+ environment: "production" | "staging" | "test";
349
+ latency_ms: number | null;
350
+ signature: string;
351
+ };
352
+ signature_valid: boolean;
353
+ chain_length: number;
354
+ public_key_url: string;
355
+ }>;
356
+ type VerifyResponse = z.infer<typeof VerifyResponse>;
357
+ /**
358
+ * Query parameters for GET /api/v1/receipts.
359
+ */
360
+ declare const ListReceiptsQuery: z.ZodObject<{
361
+ page: z.ZodDefault<z.ZodNumber>;
362
+ limit: z.ZodDefault<z.ZodNumber>;
363
+ agent_id: z.ZodOptional<z.ZodString>;
364
+ action: z.ZodOptional<z.ZodString>;
365
+ status: z.ZodOptional<z.ZodEnum<["pending", "completed", "failed", "timeout"]>>;
366
+ environment: z.ZodOptional<z.ZodEnum<["production", "staging", "test"]>>;
367
+ receipt_type: z.ZodOptional<z.ZodEnum<["action", "verification", "judgment", "arbitration"]>>;
368
+ chain_id: z.ZodOptional<z.ZodString>;
369
+ tag: z.ZodOptional<z.ZodString>;
370
+ from: z.ZodOptional<z.ZodString>;
371
+ to: z.ZodOptional<z.ZodString>;
372
+ sort: z.ZodDefault<z.ZodString>;
373
+ }, "strip", z.ZodTypeAny, {
374
+ sort: string;
375
+ page: number;
376
+ limit: number;
377
+ status?: "pending" | "completed" | "failed" | "timeout" | undefined;
378
+ action?: string | undefined;
379
+ chain_id?: string | undefined;
380
+ receipt_type?: "action" | "verification" | "judgment" | "arbitration" | undefined;
381
+ agent_id?: string | undefined;
382
+ environment?: "production" | "staging" | "test" | undefined;
383
+ tag?: string | undefined;
384
+ from?: string | undefined;
385
+ to?: string | undefined;
386
+ }, {
387
+ sort?: string | undefined;
388
+ status?: "pending" | "completed" | "failed" | "timeout" | undefined;
389
+ action?: string | undefined;
390
+ chain_id?: string | undefined;
391
+ receipt_type?: "action" | "verification" | "judgment" | "arbitration" | undefined;
392
+ agent_id?: string | undefined;
393
+ environment?: "production" | "staging" | "test" | undefined;
394
+ page?: number | undefined;
395
+ limit?: number | undefined;
396
+ tag?: string | undefined;
397
+ from?: string | undefined;
398
+ to?: string | undefined;
399
+ }>;
400
+ type ListReceiptsQuery = z.infer<typeof ListReceiptsQuery>;
401
+ /**
402
+ * Pagination metadata included in list responses.
403
+ */
404
+ declare const PaginationMeta: z.ZodObject<{
405
+ page: z.ZodNumber;
406
+ limit: z.ZodNumber;
407
+ total: z.ZodNumber;
408
+ total_pages: z.ZodNumber;
409
+ has_next: z.ZodBoolean;
410
+ has_prev: z.ZodBoolean;
411
+ }, "strip", z.ZodTypeAny, {
412
+ page: number;
413
+ limit: number;
414
+ total: number;
415
+ total_pages: number;
416
+ has_next: boolean;
417
+ has_prev: boolean;
418
+ }, {
419
+ page: number;
420
+ limit: number;
421
+ total: number;
422
+ total_pages: number;
423
+ has_next: boolean;
424
+ has_prev: boolean;
425
+ }>;
426
+ type PaginationMeta = z.infer<typeof PaginationMeta>;
427
+ /**
428
+ * Standard error response format.
429
+ */
430
+ declare const ErrorResponse: z.ZodObject<{
431
+ error: z.ZodObject<{
432
+ code: z.ZodEnum<["UNAUTHORIZED", "KEY_REVOKED", "FORBIDDEN", "RECEIPT_NOT_FOUND", "CHAIN_NOT_FOUND", "AGENT_NOT_FOUND", "RECEIPT_NOT_PENDING", "RECEIPT_IMMUTABLE", "RATE_LIMIT_EXCEEDED", "VALIDATION_ERROR", "INTERNAL_ERROR"]>;
433
+ message: z.ZodString;
434
+ status: z.ZodNumber;
435
+ }, "strip", z.ZodTypeAny, {
436
+ code: "UNAUTHORIZED" | "KEY_REVOKED" | "FORBIDDEN" | "RECEIPT_NOT_FOUND" | "CHAIN_NOT_FOUND" | "AGENT_NOT_FOUND" | "RECEIPT_NOT_PENDING" | "RECEIPT_IMMUTABLE" | "RATE_LIMIT_EXCEEDED" | "VALIDATION_ERROR" | "INTERNAL_ERROR";
437
+ message: string;
438
+ status: number;
439
+ }, {
440
+ code: "UNAUTHORIZED" | "KEY_REVOKED" | "FORBIDDEN" | "RECEIPT_NOT_FOUND" | "CHAIN_NOT_FOUND" | "AGENT_NOT_FOUND" | "RECEIPT_NOT_PENDING" | "RECEIPT_IMMUTABLE" | "RATE_LIMIT_EXCEEDED" | "VALIDATION_ERROR" | "INTERNAL_ERROR";
441
+ message: string;
442
+ status: number;
443
+ }>;
444
+ }, "strip", z.ZodTypeAny, {
445
+ error: {
446
+ code: "UNAUTHORIZED" | "KEY_REVOKED" | "FORBIDDEN" | "RECEIPT_NOT_FOUND" | "CHAIN_NOT_FOUND" | "AGENT_NOT_FOUND" | "RECEIPT_NOT_PENDING" | "RECEIPT_IMMUTABLE" | "RATE_LIMIT_EXCEEDED" | "VALIDATION_ERROR" | "INTERNAL_ERROR";
447
+ message: string;
448
+ status: number;
449
+ };
450
+ }, {
451
+ error: {
452
+ code: "UNAUTHORIZED" | "KEY_REVOKED" | "FORBIDDEN" | "RECEIPT_NOT_FOUND" | "CHAIN_NOT_FOUND" | "AGENT_NOT_FOUND" | "RECEIPT_NOT_PENDING" | "RECEIPT_IMMUTABLE" | "RATE_LIMIT_EXCEEDED" | "VALIDATION_ERROR" | "INTERNAL_ERROR";
453
+ message: string;
454
+ status: number;
455
+ };
456
+ }>;
457
+ type ErrorResponse = z.infer<typeof ErrorResponse>;
458
+
459
+ /**
460
+ * Validate data against a Zod schema.
461
+ * Returns { success: true, data } or { success: false, error: ErrorResponse }
462
+ */
463
+ declare function validate<T extends z.ZodSchema>(schema: T, data: unknown): {
464
+ success: true;
465
+ data: z.infer<T>;
466
+ } | {
467
+ success: false;
468
+ error: ErrorResponse;
469
+ };
470
+ /**
471
+ * Format Zod errors into a human-readable message.
472
+ */
473
+ declare function formatZodError(error: z.ZodError): string;
474
+ /**
475
+ * Create a standard error response object.
476
+ */
477
+ declare function createErrorResponse(code: string, message: string, status: number): ErrorResponse;
478
+
479
+ export { ActionReceipt, CompleteReceiptInput, CreateReceiptInput, Environment, Environment as EnvironmentType, ErrorCode, ErrorCode as ErrorCodeType, ErrorResponse, ListReceiptsQuery, PaginationMeta, ReceiptStatus, ReceiptStatus as ReceiptStatusType, ReceiptType, ReceiptType as ReceiptTypeType, SignablePayload, VerifyResponse, createErrorResponse, formatZodError, validate };