@paikko/contract 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 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,qFAO7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,kBAAkB,2FAQ7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,SAAS,aAAa,CAAC;AACpC,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAE5C,qEAAqE;AACrE,eAAO,MAAM,aAAa,aAAwB,CAAC;AACnD,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD;;;GAGG;AACH,eAAO,MAAM,aAAa,aAAa,CAAC;AACxC,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAMpD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;IAC7B,oEAAoE;;IAEpE,qEAAqE;;IAErE,iEAAiE;;;;;;;;;;EAEjE,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,kEAAkE;AAClE,eAAO,MAAM,YAAY;IACvB;0EACsE;;IAEtE,wEAAwE;;IAExE,0DA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.js ADDED
@@ -0,0 +1,374 @@
1
+ /**
2
+ * paikko ticket bundle contract.
3
+ *
4
+ * This is THE shared interface. Every module imports from here: the
5
+ * `<ReportButton>` that produces a bundle, the API that persists it, the ticket
6
+ * UI that renders it, and the agent runner that consumes it. Change a shape here
7
+ * and you change it for everyone, so it lives in one file with types and zod
8
+ * schemas side by side.
9
+ *
10
+ * ## Two tiers
11
+ *
12
+ * A ticket is split so the agent's context stays cheap:
13
+ *
14
+ * - TIER 1 - the HEAD ({@link TicketHead}). Small, always loaded into agent
15
+ * context. Carries the user's message, where it happened (route + clicked
16
+ * element provenance), the conversation thread, and an INDEX of artifacts.
17
+ * The index lists each artifact by name with a `ref` (how to fetch it) and a
18
+ * `summary` (one line) plus a few cheap stats, so the agent can decide from
19
+ * the head alone whether it even needs the heavy payload. Most tickets are
20
+ * solved from the head with zero fetches.
21
+ *
22
+ * - TIER 2 - the ARTIFACT PAYLOADS. Heavy, immutable, captured once at report
23
+ * time (a photograph, not a live window). Fetched by ref only when a fix
24
+ * needs them: console, network, client state, storage, DOM snapshot, backend
25
+ * trace. Stored as JSONB rows keyed by ticket+name, served at
26
+ * `GET /tickets/:id/artifacts/:name`.
27
+ *
28
+ * ## The spine: traceId
29
+ *
30
+ * `traceId` stitches the two halves of a single request together. A frontend
31
+ * {@link NetworkEntry} and the backend {@link TraceRequest} it triggered share
32
+ * the same `traceId`. That is how the agent walks from "this fetch on the page"
33
+ * to "this handler + these queries on the server" without guessing.
34
+ *
35
+ * ## Provenance: src
36
+ *
37
+ * `src` ("file:line:col") appears on every layer the user or agent can point at -
38
+ * the clicked element, the API handler, each DB query - so provenance runs end to
39
+ * end. It is injected at build time (see PROVENANCE.md).
40
+ */
41
+ import { z } from "zod";
42
+ /* ------------------------------------------------------------------ */
43
+ /* Shared primitives */
44
+ /* ------------------------------------------------------------------ */
45
+ /**
46
+ * Ticket lifecycle. `status` is persisted as a free `String` in
47
+ * prisma/schema.prisma; this enum is the app-side validator for it.
48
+ *
49
+ * Terminal states are `closed` (accepted: the ticket's branch was merged to main
50
+ * and the live app redeployed) and `rejected` (discarded: the ticket's branch +
51
+ * worktree were dropped, the live app untouched). `reviewing` is the parked state
52
+ * where the fix lives on its own branch with an isolated preview; a user reply on
53
+ * a `reviewing` ticket re-engages the agent (no separate reject needed to request
54
+ * changes).
55
+ */
56
+ export const TicketStatusSchema = z.enum([
57
+ "open",
58
+ "reproducing",
59
+ "needs_info",
60
+ "reviewing",
61
+ "closed",
62
+ "rejected",
63
+ ]);
64
+ /**
65
+ * The canonical names an artifact can have. The artifact index is keyed by these,
66
+ * and `GET /tickets/:id/artifacts/:name` expects one of them.
67
+ */
68
+ export const ArtifactNameSchema = z.enum([
69
+ "console",
70
+ "network",
71
+ "clientState",
72
+ "storage",
73
+ "dom",
74
+ "trace",
75
+ "screenshot",
76
+ ]);
77
+ /**
78
+ * Source provenance, "file:line:col" (e.g. "src/components/Cart.tsx:42:7").
79
+ * Injected at build time onto JSX, attached to handlers and queries.
80
+ */
81
+ export const SrcSchema = z.string();
82
+ /** ISO-8601 timestamp string. Used everywhere a time is recorded. */
83
+ export const IsoTimeSchema = z.string().datetime();
84
+ /**
85
+ * The id that stitches a frontend network entry to its backend request.
86
+ * Generated client-side per request, echoed by the server.
87
+ */
88
+ export const TraceIdSchema = z.string();
89
+ /* ------------------------------------------------------------------ */
90
+ /* TIER 1 - the head */
91
+ /* ------------------------------------------------------------------ */
92
+ /**
93
+ * What the user pointed at when they hit report: the clicked DOM element resolved
94
+ * to a CSS selector, its source location, and the owning component. All optional
95
+ * because a report can be fired without a specific target (e.g. a global "this
96
+ * page is wrong").
97
+ */
98
+ export const ReportTargetSchema = z.object({
99
+ /** CSS selector identifying the clicked element in the live DOM. */
100
+ selector: z.string().nullable(),
101
+ /** Build-time source provenance of the element ("file:line:col"). */
102
+ src: SrcSchema.nullable(),
103
+ /** Display name of the React component that owns the element. */
104
+ component: z.string().nullable(),
105
+ });
106
+ /** The user-authored core of a report: what's wrong and where. */
107
+ export const ReportSchema = z.object({
108
+ /** Free-text description from the reporter. Capped so a single report can't be
109
+ * an unbounded blob (intake has no other size gate on this field). */
110
+ message: z.string().max(16_384),
111
+ /** Report category (e.g. "bug", "visual", "crash"). Free-form in v0. */
112
+ kind: z.string().max(64),
113
+ /** App route the report was fired from (e.g. "/cart"). */
114
+ route: z.string().max(2_048),
115
+ /** The clicked element, resolved to selector + provenance + component. */
116
+ target: ReportTargetSchema,
117
+ });
118
+ /** One message in the ticket's conversation (reporter, agent, or reviewer). */
119
+ export const ThreadMessageSchema = z.object({
120
+ id: z.string(),
121
+ /** Author handle: reporter id, "agent", reviewer id, etc. */
122
+ by: z.string().max(256),
123
+ text: z.string().max(16_384),
124
+ at: IsoTimeSchema,
125
+ });
126
+ /**
127
+ * One entry in the artifact index. Lives in the head so the agent can read the
128
+ * `summary` and stats and decide whether to fetch the heavy payload via `ref`.
129
+ *
130
+ * `count` and `size` are cheap, type-agnostic stats:
131
+ * - `count`: number of records in the payload (console lines, network calls,
132
+ * backend requests, ...). Null for single-object artifacts (clientState).
133
+ * - `size`: serialized payload size in bytes.
134
+ */
135
+ export const ArtifactIndexEntrySchema = z.object({
136
+ /** Fetch handle: `GET /tickets/:id/artifacts/:name`. */
137
+ ref: z.string(),
138
+ /** One-line human/agent summary so the head is decision-complete. */
139
+ summary: z.string(),
140
+ /** Record count for collection artifacts; null for singletons. */
141
+ count: z.number().int().nullable(),
142
+ /** Serialized payload size in bytes. */
143
+ size: z.number().int(),
144
+ });
145
+ /**
146
+ * The artifacts index: a map from artifact name to its index entry. Partial -
147
+ * a ticket only indexes the artifacts that were actually captured.
148
+ */
149
+ export const ArtifactIndexSchema = z.record(ArtifactNameSchema, ArtifactIndexEntrySchema);
150
+ /**
151
+ * TIER 1. The ticket head - always loaded into agent context. Small and
152
+ * self-sufficient: message, where it happened, the thread, and the index of
153
+ * heavy artifacts behind refs.
154
+ */
155
+ export const TicketHeadSchema = z.object({
156
+ id: z.string(),
157
+ status: TicketStatusSchema,
158
+ createdAt: IsoTimeSchema,
159
+ /** Who filed it (user id / handle). */
160
+ reporter: z.string(),
161
+ report: ReportSchema,
162
+ thread: z.array(ThreadMessageSchema),
163
+ artifacts: ArtifactIndexSchema,
164
+ /**
165
+ * Which project/tenant this ticket belongs to (the SaaS seam). Persisted from
166
+ * the `projectKey` the widget sent on the {@link ReportBundle}. Null in the
167
+ * current single-tenant deployment; making multi-tenancy real is a later flip of
168
+ * this value, not a schema rewrite.
169
+ */
170
+ projectKey: z.string().nullable(),
171
+ /**
172
+ * The git branch the fix lives on (e.g. "ticket/{id}"). Branch-isolated review:
173
+ * each ticket is fixed in its own worktree + branch off main, so main stays
174
+ * pristine until Accept. Null until the agent has cut the branch.
175
+ */
176
+ branch: z.string().nullable(),
177
+ /**
178
+ * The isolated preview URL where ONLY this ticket's fix is viewable
179
+ * (e.g. "http://localhost:8788"), distinct from the pristine main app. "View
180
+ * fix" links here, not to the live app. Null until the isolated preview is up.
181
+ */
182
+ previewUrl: z.string().nullable(),
183
+ });
184
+ /* ------------------------------------------------------------------ */
185
+ /* TIER 2 - artifact payloads */
186
+ /* ------------------------------------------------------------------ */
187
+ /* ---- console ---- */
188
+ /** One captured console line from the ring buffer. */
189
+ export const ConsoleEntrySchema = z.object({
190
+ level: z.enum(["log", "info", "warn", "error", "debug"]),
191
+ /** Already-formatted message text. */
192
+ message: z.string(),
193
+ /** Structured args as captured (best-effort serialized). */
194
+ args: z.array(z.unknown()).optional(),
195
+ at: IsoTimeSchema,
196
+ });
197
+ /** Payload for the `console` artifact: the console ring buffer, oldest first.
198
+ * Length-capped so a forged bundle can't ship an unbounded array. */
199
+ export const ConsoleArtifactSchema = z.array(ConsoleEntrySchema).max(5_000);
200
+ /* ---- network ---- */
201
+ /**
202
+ * One captured frontend network call. `traceId` is the spine: it matches the
203
+ * `traceId` on the {@link TraceRequest} the call hit on the backend.
204
+ */
205
+ export const NetworkEntrySchema = z.object({
206
+ /** Spine id linking this call to its backend request. */
207
+ traceId: TraceIdSchema,
208
+ method: z.string(),
209
+ url: z.string(),
210
+ /** HTTP status; null if the request never completed. */
211
+ status: z.number().int().nullable(),
212
+ /** Request body as captured (serialized; null if none). */
213
+ reqBody: z.unknown().nullable(),
214
+ /** Response body as captured (serialized; null if none). */
215
+ resBody: z.unknown().nullable(),
216
+ startedAt: IsoTimeSchema,
217
+ /** Round-trip duration in milliseconds; null if unknown. */
218
+ durationMs: z.number().nullable(),
219
+ });
220
+ /** Payload for the `network` artifact: last N network calls, oldest first.
221
+ * Length-capped so a forged bundle can't ship an unbounded array. */
222
+ export const NetworkArtifactSchema = z.array(NetworkEntrySchema).max(5_000);
223
+ /* ---- client state ---- */
224
+ /**
225
+ * Payload for the `clientState` artifact: a snapshot of the mandated state store
226
+ * at report time. Shape is app-defined, so it's an opaque record.
227
+ */
228
+ export const ClientStateArtifactSchema = z.record(z.string(), z.unknown());
229
+ /* ---- storage ---- */
230
+ /**
231
+ * Payload for the `storage` artifact: localStorage / sessionStorage / cookies
232
+ * captured at report time. Each is a flat string->string map.
233
+ */
234
+ export const StorageArtifactSchema = z.object({
235
+ local: z.record(z.string(), z.string()),
236
+ session: z.record(z.string(), z.string()),
237
+ cookies: z.record(z.string(), z.string()),
238
+ });
239
+ /* ---- dom ---- */
240
+ /**
241
+ * Payload for the `dom` artifact: a snapshot of the DOM at report time. `html` is
242
+ * the serialized document/subtree; `targetSelector` points back at the clicked
243
+ * element within it.
244
+ */
245
+ export const DomArtifactSchema = z.object({
246
+ /** Serialized DOM (full document or relevant subtree). Capped (~8MB) so a
247
+ * crafted bundle can't bloat a D1 row / OOM the worker on intake. */
248
+ html: z.string().max(8_000_000),
249
+ /** Selector of the reported element within `html`. */
250
+ targetSelector: z.string().nullable(),
251
+ /** Viewport size at capture time. */
252
+ viewport: z.object({
253
+ width: z.number().int(),
254
+ height: z.number().int(),
255
+ }),
256
+ });
257
+ /* ---- backend trace ---- */
258
+ /** One database query recorded inside a backend request. */
259
+ export const TraceQuerySchema = z.object({
260
+ /** SQL or query string as executed. */
261
+ sql: z.string(),
262
+ /** Bound parameters, serialized. */
263
+ params: z.array(z.unknown()).optional(),
264
+ /** Execution time in milliseconds. */
265
+ durationMs: z.number().nullable(),
266
+ /** Provenance of the call site issuing the query ("file:line:col"). */
267
+ src: SrcSchema.nullable(),
268
+ });
269
+ /**
270
+ * One backend request captured by the `withCapture()` handler wrapper. Joined to
271
+ * a frontend {@link NetworkEntry} by `traceId`.
272
+ */
273
+ export const TraceRequestSchema = z.object({
274
+ /** Spine id - matches the frontend NetworkEntry that triggered this request. */
275
+ traceId: TraceIdSchema,
276
+ /** Name/identity of the handler that ran. */
277
+ handler: z.string(),
278
+ /** Provenance of the handler ("file:line:col"). */
279
+ src: SrcSchema.nullable(),
280
+ method: z.string(),
281
+ url: z.string(),
282
+ status: z.number().int().nullable(),
283
+ /** Queries issued during this request, in order. */
284
+ queries: z.array(TraceQuerySchema),
285
+ /** Serialized error if the handler threw; null on success. */
286
+ threw: z.unknown().nullable(),
287
+ durationMs: z.number().nullable(),
288
+ });
289
+ /**
290
+ * Payload for the `trace` artifact: the backend side of the report. One capture
291
+ * session containing every backend request that ran during the reported
292
+ * interaction, each stitched to its frontend call by `traceId`.
293
+ */
294
+ export const TraceArtifactSchema = z.object({
295
+ /** Backend capture session id for the reported interaction. */
296
+ sessionId: z.string(),
297
+ requests: z.array(TraceRequestSchema),
298
+ });
299
+ /* ---- screenshot ---- */
300
+ /**
301
+ * Payload for the `screenshot` artifact: an actual rendered image of the page at
302
+ * report time, so the agent (which can see images) and the human reviewer can
303
+ * directly judge "this looks off" / visual reports that a DOM/CSS snapshot can't
304
+ * convey. The widget's own report UI is excluded from the shot.
305
+ *
306
+ * Kept small on purpose: the longest side is capped (~1280px) and the image is
307
+ * JPEG-compressed, so the base64 `dataUrl` typically lands well under ~1MB. `png`
308
+ * is allowed as a fallback but is larger; prefer `jpeg`.
309
+ */
310
+ export const ScreenshotArtifactSchema = z.object({
311
+ /** A `data:` URL holding the base64-encoded image (e.g. `data:image/jpeg;base64,...`).
312
+ * Scheme-locked to an inline image (a remote http(s) src would turn opening
313
+ * the artifact into an outbound request to an attacker host) and size-capped
314
+ * (~12MB) so it can't be used as a DoS payload. */
315
+ dataUrl: z
316
+ .string()
317
+ .max(12_000_000)
318
+ .regex(/^data:image\/(png|jpeg|jpg|gif|webp);base64,/, "must be an inline image data URL"),
319
+ /** Pixel width of the rendered image. */
320
+ width: z.number().int(),
321
+ /** Pixel height of the rendered image. */
322
+ height: z.number().int(),
323
+ /** Encoding of the image embedded in `dataUrl`. */
324
+ format: z.enum(["jpeg", "png"]),
325
+ });
326
+ /* ------------------------------------------------------------------ */
327
+ /* Payload routing */
328
+ /* ------------------------------------------------------------------ */
329
+ /**
330
+ * Maps each artifact name to the zod schema for its payload. Use this to validate
331
+ * a payload before persisting it or after fetching it by ref:
332
+ *
333
+ * ArtifactPayloadSchemas[name].parse(payload)
334
+ */
335
+ export const ArtifactPayloadSchemas = {
336
+ console: ConsoleArtifactSchema,
337
+ network: NetworkArtifactSchema,
338
+ clientState: ClientStateArtifactSchema,
339
+ storage: StorageArtifactSchema,
340
+ dom: DomArtifactSchema,
341
+ trace: TraceArtifactSchema,
342
+ screenshot: ScreenshotArtifactSchema,
343
+ };
344
+ /* ------------------------------------------------------------------ */
345
+ /* Bundle assembly */
346
+ /* ------------------------------------------------------------------ */
347
+ /**
348
+ * What the `<ReportButton>` produces and POSTs to create a ticket: the head's
349
+ * report core plus every captured artifact payload inline. The server splits this
350
+ * into the persisted head (with a built index) and the artifact rows.
351
+ */
352
+ export const ReportBundleSchema = z.object({
353
+ reporter: z.string(),
354
+ /**
355
+ * Which project/tenant this report belongs to (the SaaS seam). The widget is
356
+ * configured with a `projectKey` and stamps it here; the server persists it onto
357
+ * the {@link TicketHead}. Null when the widget is unkeyed (single-tenant); making
358
+ * multi-tenancy real is a later flip, not a schema rewrite.
359
+ */
360
+ projectKey: z.string().nullable(),
361
+ report: ReportSchema,
362
+ artifacts: z
363
+ .object({
364
+ console: ConsoleArtifactSchema.optional(),
365
+ network: NetworkArtifactSchema.optional(),
366
+ clientState: ClientStateArtifactSchema.optional(),
367
+ storage: StorageArtifactSchema.optional(),
368
+ dom: DomArtifactSchema.optional(),
369
+ trace: TraceArtifactSchema.optional(),
370
+ screenshot: ScreenshotArtifactSchema.optional(),
371
+ })
372
+ .partial(),
373
+ });
374
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wEAAwE;AACxE,wEAAwE;AACxE,wEAAwE;AAExE;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC;IACvC,MAAM;IACN,aAAa;IACb,YAAY;IACZ,WAAW;IACX,QAAQ;IACR,UAAU;CACX,CAAC,CAAC;AAGH;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC;IACvC,SAAS;IACT,SAAS;IACT,aAAa;IACb,SAAS;IACT,KAAK;IACL,OAAO;IACP,YAAY;CACb,CAAC,CAAC;AAGH;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;AAGpC,qEAAqE;AACrE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC;AAGnD;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;AAGxC,wEAAwE;AACxE,wEAAwE;AACxE,wEAAwE;AAExE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,o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AC,MAAM,sBAAsB,GAAG;IACpC,OAAO,EAAE,qBAAqB;IAC9B,OAAO,EAAE,qBAAqB;IAC9B,WAAW,EAAE,yBAAyB;IACtC,OAAO,EAAE,qBAAqB;IAC9B,GAAG,EAAE,iBAAiB;IACtB,KAAK,EAAE,mBAAmB;IAC1B,UAAU,EAAE,wBAAwB;CAC5B,CAAC;AAgBX,wEAAwE;AACxE,wEAAwE;AACxE,wEAAwE;AAExE;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB;;;;;OAKG;IACH,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,MAAM,EAAE,YAAY;IACpB,SAAS,EAAE,CAAC;SACT,MAAM,CAAC;QACN,OAAO,EAAE,qBAAqB,CAAC,QAAQ,EAAE;QACzC,OAAO,EAAE,qBAAqB,CAAC,QAAQ,EAAE;QACzC,WAAW,EAAE,yBAAyB,CAAC,QAAQ,EAAE;QACjD,OAAO,EAAE,qBAAqB,CAAC,QAAQ,EAAE;QACzC,GAAG,EAAE,iBAAiB,CAAC,QAAQ,EAAE;QACjC,KAAK,EAAE,mBAAmB,CAAC,QAAQ,EAAE;QACrC,UAAU,EAAE,wBAAwB,CAAC,QAAQ,EAAE;KAChD,CAAC;SACD,OAAO,EAAE;CACb,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@paikko/contract",
3
+ "version": "0.1.0",
4
+ "description": "paikko shared wire contract: TS types + zod schemas. Pure, no React, no prisma.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/willyt3hwhale/paikko.git",
9
+ "directory": "packages/contract"
10
+ },
11
+ "type": "module",
12
+ "main": "./dist/index.js",
13
+ "types": "./dist/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.js"
18
+ }
19
+ },
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "scripts": {
27
+ "build": "tsc -p tsconfig.json",
28
+ "prepare": "tsc -p tsconfig.json"
29
+ },
30
+ "dependencies": {
31
+ "zod": "^3.23.8"
32
+ },
33
+ "devDependencies": {
34
+ "typescript": "^5.6.3"
35
+ }
36
+ }