@anuragpal02/zcl-contracts 0.29.0 → 0.30.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/dist/generation.d.ts +95 -0
- package/dist/generation.d.ts.map +1 -1
- package/dist/generation.js +59 -1
- package/package.json +1 -1
package/dist/generation.d.ts
CHANGED
|
@@ -255,6 +255,40 @@ export declare const panelVideoDescriptorSchema: z.ZodDiscriminatedUnion<[z.ZodO
|
|
|
255
255
|
nativeH: z.ZodNumber;
|
|
256
256
|
mode: z.ZodLiteral<"mirror">;
|
|
257
257
|
}, z.core.$strip>], "mode">;
|
|
258
|
+
/**
|
|
259
|
+
* Why a job failed, in a form a client may map to human copy.
|
|
260
|
+
*
|
|
261
|
+
* A CLOSED set, deliberately. The server stores its failure reasons in two
|
|
262
|
+
* places and neither is safe to forward verbatim:
|
|
263
|
+
* - `generation_job_events.data.reason` — written by EVERY failure path, but
|
|
264
|
+
* heterogeneous: the image paths store short codes, while the video paths
|
|
265
|
+
* store `err.message.slice(0, 200)`, an arbitrary provider exception that
|
|
266
|
+
* can carry an endpoint URL or a request id.
|
|
267
|
+
* - `generation_job_steps.error` — short codes, but the IMAGE paths only; it
|
|
268
|
+
* covers no video failure and no reconciler-reaped job.
|
|
269
|
+
*
|
|
270
|
+
* Because something must map either way, the mapping lives at the API boundary
|
|
271
|
+
* and this enum makes it total: a value nobody mapped cannot reach a client, it
|
|
272
|
+
* degrades to `unknown`. That containment is structural rather than a matter of
|
|
273
|
+
* reviewer discipline — the next person to add a workflow cannot leak by
|
|
274
|
+
* default.
|
|
275
|
+
*
|
|
276
|
+
* Members name the USER'S SITUATION, not the system's fault, so client copy
|
|
277
|
+
* falls out of the code almost mechanically. The test: if a member's best copy
|
|
278
|
+
* is "something went wrong", it belongs in `internal_error`.
|
|
279
|
+
*/
|
|
280
|
+
export declare const generationFailureReasonSchema: z.ZodEnum<{
|
|
281
|
+
internal_error: "internal_error";
|
|
282
|
+
unknown: "unknown";
|
|
283
|
+
prompt_blocked: "prompt_blocked";
|
|
284
|
+
content_blocked: "content_blocked";
|
|
285
|
+
no_image: "no_image";
|
|
286
|
+
invalid_request: "invalid_request";
|
|
287
|
+
provider_unavailable: "provider_unavailable";
|
|
288
|
+
source_missing: "source_missing";
|
|
289
|
+
panel_geometry_missing: "panel_geometry_missing";
|
|
290
|
+
timed_out: "timed_out";
|
|
291
|
+
}>;
|
|
258
292
|
export declare const generationJobSchema: z.ZodObject<{
|
|
259
293
|
id: z.ZodString;
|
|
260
294
|
workspaceId: z.ZodString;
|
|
@@ -291,6 +325,18 @@ export declare const generationJobSchema: z.ZodObject<{
|
|
|
291
325
|
sourceAssetIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
292
326
|
parentJobId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
293
327
|
variantGroupId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
328
|
+
failureReason: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
329
|
+
internal_error: "internal_error";
|
|
330
|
+
unknown: "unknown";
|
|
331
|
+
prompt_blocked: "prompt_blocked";
|
|
332
|
+
content_blocked: "content_blocked";
|
|
333
|
+
no_image: "no_image";
|
|
334
|
+
invalid_request: "invalid_request";
|
|
335
|
+
provider_unavailable: "provider_unavailable";
|
|
336
|
+
source_missing: "source_missing";
|
|
337
|
+
panel_geometry_missing: "panel_geometry_missing";
|
|
338
|
+
timed_out: "timed_out";
|
|
339
|
+
}>>>;
|
|
294
340
|
}, z.core.$strip>;
|
|
295
341
|
export declare const createGenerationJobRequestSchema: z.ZodObject<{
|
|
296
342
|
prompt: z.ZodString;
|
|
@@ -343,6 +389,18 @@ export declare const generationJobResponseSchema: z.ZodObject<{
|
|
|
343
389
|
sourceAssetIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
344
390
|
parentJobId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
345
391
|
variantGroupId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
392
|
+
failureReason: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
393
|
+
internal_error: "internal_error";
|
|
394
|
+
unknown: "unknown";
|
|
395
|
+
prompt_blocked: "prompt_blocked";
|
|
396
|
+
content_blocked: "content_blocked";
|
|
397
|
+
no_image: "no_image";
|
|
398
|
+
invalid_request: "invalid_request";
|
|
399
|
+
provider_unavailable: "provider_unavailable";
|
|
400
|
+
source_missing: "source_missing";
|
|
401
|
+
panel_geometry_missing: "panel_geometry_missing";
|
|
402
|
+
timed_out: "timed_out";
|
|
403
|
+
}>>>;
|
|
346
404
|
}, z.core.$strip>;
|
|
347
405
|
}, z.core.$strip>;
|
|
348
406
|
export declare const createSmartVideoResponseSchema: z.ZodObject<{
|
|
@@ -383,6 +441,18 @@ export declare const createSmartVideoResponseSchema: z.ZodObject<{
|
|
|
383
441
|
sourceAssetIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
384
442
|
parentJobId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
385
443
|
variantGroupId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
444
|
+
failureReason: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
445
|
+
internal_error: "internal_error";
|
|
446
|
+
unknown: "unknown";
|
|
447
|
+
prompt_blocked: "prompt_blocked";
|
|
448
|
+
content_blocked: "content_blocked";
|
|
449
|
+
no_image: "no_image";
|
|
450
|
+
invalid_request: "invalid_request";
|
|
451
|
+
provider_unavailable: "provider_unavailable";
|
|
452
|
+
source_missing: "source_missing";
|
|
453
|
+
panel_geometry_missing: "panel_geometry_missing";
|
|
454
|
+
timed_out: "timed_out";
|
|
455
|
+
}>>>;
|
|
386
456
|
}, z.core.$strip>;
|
|
387
457
|
videoPlan: z.ZodObject<{
|
|
388
458
|
jobs: z.ZodArray<z.ZodObject<{
|
|
@@ -502,6 +572,18 @@ export declare const createPanelSetResponseSchema: z.ZodObject<{
|
|
|
502
572
|
sourceAssetIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
503
573
|
parentJobId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
504
574
|
variantGroupId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
575
|
+
failureReason: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
576
|
+
internal_error: "internal_error";
|
|
577
|
+
unknown: "unknown";
|
|
578
|
+
prompt_blocked: "prompt_blocked";
|
|
579
|
+
content_blocked: "content_blocked";
|
|
580
|
+
no_image: "no_image";
|
|
581
|
+
invalid_request: "invalid_request";
|
|
582
|
+
provider_unavailable: "provider_unavailable";
|
|
583
|
+
source_missing: "source_missing";
|
|
584
|
+
panel_geometry_missing: "panel_geometry_missing";
|
|
585
|
+
timed_out: "timed_out";
|
|
586
|
+
}>>>;
|
|
505
587
|
}, z.core.$strip>;
|
|
506
588
|
panels: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
507
589
|
jobId: z.ZodString;
|
|
@@ -579,6 +661,18 @@ export declare const listGenerationJobsResponseSchema: z.ZodObject<{
|
|
|
579
661
|
sourceAssetIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
580
662
|
parentJobId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
581
663
|
variantGroupId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
664
|
+
failureReason: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
665
|
+
internal_error: "internal_error";
|
|
666
|
+
unknown: "unknown";
|
|
667
|
+
prompt_blocked: "prompt_blocked";
|
|
668
|
+
content_blocked: "content_blocked";
|
|
669
|
+
no_image: "no_image";
|
|
670
|
+
invalid_request: "invalid_request";
|
|
671
|
+
provider_unavailable: "provider_unavailable";
|
|
672
|
+
source_missing: "source_missing";
|
|
673
|
+
panel_geometry_missing: "panel_geometry_missing";
|
|
674
|
+
timed_out: "timed_out";
|
|
675
|
+
}>>>;
|
|
582
676
|
}, z.core.$strip>>;
|
|
583
677
|
pagination: z.ZodObject<{
|
|
584
678
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
@@ -602,6 +696,7 @@ export type PanelPlanEntry = z.infer<typeof panelPlanEntrySchema>;
|
|
|
602
696
|
export type VideoPlan = z.infer<typeof videoPlanSchema>;
|
|
603
697
|
export type PanelVideoDescriptor = z.infer<typeof panelVideoDescriptorSchema>;
|
|
604
698
|
export type CreateSmartVideoResponse = z.infer<typeof createSmartVideoResponseSchema>;
|
|
699
|
+
export type GenerationFailureReason = z.infer<typeof generationFailureReasonSchema>;
|
|
605
700
|
export type GenerationJob = z.infer<typeof generationJobSchema>;
|
|
606
701
|
export type CreateGenerationJobRequest = z.input<typeof createGenerationJobRequestSchema>;
|
|
607
702
|
export type ListGenerationJobsQuery = z.input<typeof listGenerationJobsQuerySchema>;
|
package/dist/generation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generation.d.ts","sourceRoot":"","sources":["../src/generation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,yBAAyB;;;;;;EAAmE,CAAA;AAEzG,eAAO,MAAM,uBAAuB;;;;;;;;;;;EAWlC,CAAA;AAKF,eAAO,MAAM,iBAAiB;;;EAA2B,CAAA;AAEzD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;iBAoBpC,CAAA;AAEF,eAAO,MAAM,8BAA8B;;;;;iBAKzC,CAAA;AAEF,eAAO,MAAM,2BAA2B;;;;iBAItC,CAAA;AAEF,eAAO,MAAM,mBAAmB;;;;;iBAK9B,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;iBAWvC,CAAA;AAKF,eAAO,MAAM,+BAA+B;;;iBAG1C,CAAA;AAKF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;iBAUxC,CAAA;AAKF,eAAO,MAAM,eAAe;;;EAA0B,C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,CAAA;AACvD,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAC7E,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAA;AACrF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAA;AACnF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAC/D,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAA;AACzF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAA;AACnF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAC/E,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAA;AACzF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AACnE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA"}
|
package/dist/generation.js
CHANGED
|
@@ -153,6 +153,55 @@ export const panelVideoDescriptorSchema = z.discriminatedUnion('mode', [
|
|
|
153
153
|
z.object({ mode: z.literal('reuse'), ...panelVideoDescriptorBase, assetId: idSchema }),
|
|
154
154
|
z.object({ mode: z.literal('mirror'), ...panelVideoDescriptorBase, sourcePanelId: ledPanelIdSchema })
|
|
155
155
|
]);
|
|
156
|
+
/**
|
|
157
|
+
* Why a job failed, in a form a client may map to human copy.
|
|
158
|
+
*
|
|
159
|
+
* A CLOSED set, deliberately. The server stores its failure reasons in two
|
|
160
|
+
* places and neither is safe to forward verbatim:
|
|
161
|
+
* - `generation_job_events.data.reason` — written by EVERY failure path, but
|
|
162
|
+
* heterogeneous: the image paths store short codes, while the video paths
|
|
163
|
+
* store `err.message.slice(0, 200)`, an arbitrary provider exception that
|
|
164
|
+
* can carry an endpoint URL or a request id.
|
|
165
|
+
* - `generation_job_steps.error` — short codes, but the IMAGE paths only; it
|
|
166
|
+
* covers no video failure and no reconciler-reaped job.
|
|
167
|
+
*
|
|
168
|
+
* Because something must map either way, the mapping lives at the API boundary
|
|
169
|
+
* and this enum makes it total: a value nobody mapped cannot reach a client, it
|
|
170
|
+
* degrades to `unknown`. That containment is structural rather than a matter of
|
|
171
|
+
* reviewer discipline — the next person to add a workflow cannot leak by
|
|
172
|
+
* default.
|
|
173
|
+
*
|
|
174
|
+
* Members name the USER'S SITUATION, not the system's fault, so client copy
|
|
175
|
+
* falls out of the code almost mechanically. The test: if a member's best copy
|
|
176
|
+
* is "something went wrong", it belongs in `internal_error`.
|
|
177
|
+
*/
|
|
178
|
+
export const generationFailureReasonSchema = z.enum([
|
|
179
|
+
/** The prompt tripped a safety filter. Actionable: reword it. */
|
|
180
|
+
'prompt_blocked',
|
|
181
|
+
/** The OUTPUT tripped a safety filter. Actionable: reword or retry. */
|
|
182
|
+
'content_blocked',
|
|
183
|
+
/** The model answered without an image. Actionable: retry or reword. */
|
|
184
|
+
'no_image',
|
|
185
|
+
/** The request itself was rejected as invalid. Rarely user-actionable. */
|
|
186
|
+
'invalid_request',
|
|
187
|
+
/** Provider down / rate-limited / unreachable. Actionable: just retry. */
|
|
188
|
+
'provider_unavailable',
|
|
189
|
+
/** A required source image (edit parent, panel master) could not be read. */
|
|
190
|
+
'source_missing',
|
|
191
|
+
/**
|
|
192
|
+
* A panel job carried no pinned geometry. Kept DISTINCT from internal_error
|
|
193
|
+
* because the user can act on it — re-run the LED map step — and telling
|
|
194
|
+
* someone "something went wrong" when the fix is one click away is precisely
|
|
195
|
+
* the failure this field exists to end.
|
|
196
|
+
*/
|
|
197
|
+
'panel_geometry_missing',
|
|
198
|
+
/** Ours, and nothing the user can do. Misconfiguration, bugs, bad state. */
|
|
199
|
+
'internal_error',
|
|
200
|
+
/** Reaped for exceeding its budget without finishing. Actionable: retry. */
|
|
201
|
+
'timed_out',
|
|
202
|
+
/** Unmapped. The fallback that makes the set total; never leaks a raw value. */
|
|
203
|
+
'unknown'
|
|
204
|
+
]);
|
|
156
205
|
export const generationJobSchema = z.object({
|
|
157
206
|
id: idSchema,
|
|
158
207
|
workspaceId: idSchema,
|
|
@@ -180,7 +229,16 @@ export const generationJobSchema = z.object({
|
|
|
180
229
|
runId: idSchema.nullable().default(null),
|
|
181
230
|
sourceAssetIds: z.array(idSchema).default([]),
|
|
182
231
|
parentJobId: idSchema.nullable().default(null),
|
|
183
|
-
variantGroupId: idSchema.nullable().default(null)
|
|
232
|
+
variantGroupId: idSchema.nullable().default(null),
|
|
233
|
+
/**
|
|
234
|
+
* Why this job failed. Null on every non-failed job, and null on a failed job
|
|
235
|
+
* whose reason could not be determined. Defaults so pre-0.30 payloads parse —
|
|
236
|
+
* which, per the `z.infer` note above, makes it a REQUIRED output field and so
|
|
237
|
+
* a compile error in `mapJob` and the fixtures until they are updated. That is
|
|
238
|
+
* the point: the alternative is another field silently emitting null for
|
|
239
|
+
* months, as `ledMapId` did.
|
|
240
|
+
*/
|
|
241
|
+
failureReason: generationFailureReasonSchema.nullable().default(null)
|
|
184
242
|
});
|
|
185
243
|
export const createGenerationJobRequestSchema = imageGenerateParamsSchema;
|
|
186
244
|
export const generationJobResponseSchema = apiSuccessSchema(generationJobSchema);
|