@cat-factory/contracts 0.284.0 → 0.285.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/agent-presentation.d.ts +2 -2
  2. package/dist/binary-candidates.d.ts +261 -0
  3. package/dist/binary-candidates.d.ts.map +1 -0
  4. package/dist/binary-candidates.js +202 -0
  5. package/dist/binary-candidates.js.map +1 -0
  6. package/dist/binary-capabilities.d.ts +328 -0
  7. package/dist/binary-capabilities.d.ts.map +1 -0
  8. package/dist/binary-capabilities.js +361 -0
  9. package/dist/binary-capabilities.js.map +1 -0
  10. package/dist/binary-generators.d.ts +27 -0
  11. package/dist/binary-generators.d.ts.map +1 -1
  12. package/dist/binary-generators.js +28 -0
  13. package/dist/binary-generators.js.map +1 -1
  14. package/dist/binary-outputs.d.ts +31 -0
  15. package/dist/binary-outputs.d.ts.map +1 -1
  16. package/dist/binary-outputs.js +30 -0
  17. package/dist/binary-outputs.js.map +1 -1
  18. package/dist/entities.d.ts +10 -0
  19. package/dist/entities.d.ts.map +1 -1
  20. package/dist/execution.d.ts +90 -0
  21. package/dist/execution.d.ts.map +1 -1
  22. package/dist/execution.js +13 -0
  23. package/dist/execution.js.map +1 -1
  24. package/dist/index.d.ts +2 -0
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +2 -0
  27. package/dist/index.js.map +1 -1
  28. package/dist/requests.d.ts +10 -0
  29. package/dist/requests.d.ts.map +1 -1
  30. package/dist/result-views.d.ts +1 -1
  31. package/dist/result-views.d.ts.map +1 -1
  32. package/dist/result-views.js +1 -0
  33. package/dist/result-views.js.map +1 -1
  34. package/dist/routes/agent-runs.d.ts +68 -0
  35. package/dist/routes/agent-runs.d.ts.map +1 -1
  36. package/dist/routes/binaryCandidates.d.ts +139 -0
  37. package/dist/routes/binaryCandidates.d.ts.map +1 -0
  38. package/dist/routes/binaryCandidates.js +31 -0
  39. package/dist/routes/binaryCandidates.js.map +1 -0
  40. package/dist/routes/bug-hunt.d.ts +68 -0
  41. package/dist/routes/bug-hunt.d.ts.map +1 -1
  42. package/dist/routes/execution.d.ts +272 -0
  43. package/dist/routes/execution.d.ts.map +1 -1
  44. package/dist/routes/human-review.d.ts +34 -0
  45. package/dist/routes/human-review.d.ts.map +1 -1
  46. package/dist/routes/human-test.d.ts +170 -0
  47. package/dist/routes/human-test.d.ts.map +1 -1
  48. package/dist/routes/index.d.ts +1 -0
  49. package/dist/routes/index.d.ts.map +1 -1
  50. package/dist/routes/index.js +1 -0
  51. package/dist/routes/index.js.map +1 -1
  52. package/dist/routes/pipelines.d.ts +40 -0
  53. package/dist/routes/pipelines.d.ts.map +1 -1
  54. package/dist/routes/visual-confirm.d.ts +102 -0
  55. package/dist/routes/visual-confirm.d.ts.map +1 -1
  56. package/dist/routes/workspaces.d.ts +82 -2
  57. package/dist/routes/workspaces.d.ts.map +1 -1
  58. package/dist/snapshot.d.ts +41 -1
  59. package/dist/snapshot.d.ts.map +1 -1
  60. package/package.json +1 -1
@@ -0,0 +1,361 @@
1
+ import * as v from 'valibot';
2
+ // ---------------------------------------------------------------------------
3
+ // What a generative binary integration can DO beyond producing a content type, and the per-step
4
+ // GENERATION OPTIONS each of those abilities unlocks.
5
+ //
6
+ // `binary-modalities.ts` answers what an integration makes. This module answers what it can be
7
+ // ASKED FOR while making it: a reference image to condition on, an edit of something that already
8
+ // exists, a seed, a negative prompt, a transparent background. The four image APIs a deployment
9
+ // is most likely to register (Flux, Nano Banana, Grok Imagine, Retro Diffusion) agree on almost
10
+ // none of that, and the disagreement is not a quality difference a description can carry: a step
11
+ // that hands a reference image to an integration with no image input does not produce a worse
12
+ // picture, it produces an error at the end of a paid run, or (worse) a picture that silently
13
+ // ignored the reference.
14
+ //
15
+ // Its own leaf module, imported by both `binary-generators.ts` (what a definition DECLARES) and
16
+ // `binary-outputs.ts` (what a step ASKS FOR), for the reason `binary-modalities.ts` is one: the
17
+ // two import each other's neighbours and a vocabulary this small has no business creating a
18
+ // cycle. It is read by the backend, which admits the run and composes the agent's brief, and by
19
+ // the SPA, which offers the controls in the first place, so the coverage rule lives here where
20
+ // both import the same implementation rather than agreeing by hand.
21
+ // ---------------------------------------------------------------------------
22
+ /**
23
+ * A CAPABILITY a generative binary integration declares, as a closed vocabulary.
24
+ *
25
+ * Closed for the same reason {@link binaryModalitySchema} is: it decides things. A capability
26
+ * gates a per-step generation option (a control the builder shows, a paragraph the brief writes,
27
+ * a requirement admission refuses), so `referenceImage` and `reference-image` would be two
28
+ * capabilities that look identical to a reader and silently never match.
29
+ *
30
+ * **A member earns its place only when the PLATFORM exposes something because of it.** That is a
31
+ * higher bar than "the providers differ", and it is what keeps this from becoming the
32
+ * discriminator field the design record refuses (`style`, `resolutionRange`, `intendedUse`).
33
+ * Those were refused because they do not PARTITION a deliverable, so no predicate could be
34
+ * computed from them and a rule built on one would refuse correctly-configured steps by the taste
35
+ * of whoever wrote the picklist. A capability partitions exactly: an API either accepts an input
36
+ * image or it does not, either takes a mask or it does not, and the answer is a fact about the
37
+ * endpoint rather than an opinion about the art. So `covered` / `uncovered` is computable here,
38
+ * which is the same property that lets `modalities` and `mediaTypes` carry admission rules.
39
+ *
40
+ * It also decides nothing about WHICH of two integrations to call. That question stays exactly
41
+ * where the design record put it (the step's `generatorIds`, its format requirement, and its own
42
+ * prompt); this only says what may be ASKED of whichever one is called. A capability that told
43
+ * two producers of one modality apart without unlocking an option would be the refused
44
+ * discriminator wearing a new name.
45
+ *
46
+ * Anything that does not clear the bar stays prose in `description` / `guidance`, which is where
47
+ * "good at pixel art", "expensive above 2K" and "rate limited to 5/min" belong.
48
+ */
49
+ export const binaryGeneratorCapabilitySchema = v.picklist([
50
+ /**
51
+ * Accepts an input image the generation is conditioned on: image-to-image, a style reference,
52
+ * a character reference. Unlocks `generation.referenceImages`.
53
+ */
54
+ 'reference-image',
55
+ /**
56
+ * Composes SEVERAL reference images in ONE call (subject plus style, or two subjects fused).
57
+ * Its own member rather than a count on the one above, because the difference is structural:
58
+ * an integration that takes exactly one input image cannot be asked twice and have the results
59
+ * combined, so a step handing it three references is not degraded, it is unserved.
60
+ */
61
+ 'multi-reference',
62
+ /**
63
+ * Revises a supplied artifact from a natural-language instruction, with no mask. Unlocks
64
+ * `generation.edit` in `instruction` mode.
65
+ */
66
+ 'instruction-edit',
67
+ /**
68
+ * Revises the REGION of a supplied artifact named by a mask (inpainting / outpainting).
69
+ * Unlocks `generation.edit` in `mask` mode. Kept apart from the instruction edit above because
70
+ * the two need different inputs and almost no integration has both: a step that must repaint
71
+ * one corner cannot be served by an API that only rewrites whole images from a sentence.
72
+ */
73
+ 'mask-edit',
74
+ /** Accepts a NEGATIVE prompt (what to keep out). Unlocks `generation.negativePrompt`. */
75
+ 'negative-prompt',
76
+ /**
77
+ * Accepts a SEED, so a generation can be reproduced or deliberately varied. Unlocks
78
+ * `generation.seed`, and it is what makes several candidates from ONE integration comparable
79
+ * rather than accidental.
80
+ */
81
+ 'seed',
82
+ /** Accepts an explicit aspect ratio or output size. Unlocks `generation.aspectRatio`. */
83
+ 'aspect-ratio',
84
+ /**
85
+ * Returns SEVERAL candidates for one prompt in ONE call. Exposes no control of its own: it
86
+ * changes what the candidate brief ASKS FOR (request `n` in a single call, rather than
87
+ * repeating the call with a different seed), and a brief that got that wrong would either
88
+ * multiply the bill or ask for a parameter the endpoint rejects.
89
+ */
90
+ 'candidate-batch',
91
+ /** Can upscale its own output to a larger render. Unlocks `generation.upscale`. */
92
+ 'upscale',
93
+ /**
94
+ * Can return an alpha channel / cut-out subject. Unlocks
95
+ * `generation.transparentBackground`, which is a requirement rather than a preference for
96
+ * anything composited (a sprite, an icon, a product cut-out).
97
+ */
98
+ 'transparent-background',
99
+ /**
100
+ * Can produce a SEAMLESSLY TILING image. Unlocks `generation.tileable`. A tile that does not
101
+ * tile is not a lesser tile: it is unusable for the one job it exists for, which is what puts
102
+ * this on the axis with a predicate rather than in a description.
103
+ */
104
+ 'tileable',
105
+ ]);
106
+ const BINARY_CAPABILITY_SET = new Set(binaryGeneratorCapabilitySchema.options);
107
+ /**
108
+ * Whether a value is still a member of the vocabulary, DERIVED from the picklist.
109
+ *
110
+ * Unlike {@link isBinaryModality} this vocabulary is not persisted on a step: capabilities are
111
+ * declared in a deployment's own code, so a build that retires a member also stops emitting it.
112
+ * The guard exists for the ONE seam where that is not true: a MOTHERSHIP-MODE node resolves its
113
+ * integrations from a process that may be a build AHEAD of it, so a capability this build has
114
+ * never heard of can arrive over `/internal/binary-generators` and reach a `Record` lookup or a
115
+ * `switch`. Narrow with this first and describe the negative case as the unknown value it is.
116
+ */
117
+ export function isBinaryGeneratorCapability(value) {
118
+ return BINARY_CAPABILITY_SET.has(value);
119
+ }
120
+ /**
121
+ * Where an artifact the step points a generator AT already lives: a reference image, the source
122
+ * of an edit, a mask.
123
+ *
124
+ * The platform deliberately does NOT fetch it. It is named to the agent in the brief, and the
125
+ * agent reads it exactly as it calls the generation API itself, which is the same division of
126
+ * labour the rest of this feature runs on: the platform states, the agent acts, and nothing here
127
+ * touches bytes. `service` names one of the step's own foundational services when the artifact
128
+ * lives in the org's estate rather than at a URL, so a private object store needs no public link.
129
+ */
130
+ export const binaryAssetRefSchema = v.object({
131
+ /** Where it lives, in `service`'s addressing when one is named, else an absolute URL. */
132
+ location: v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(2048)),
133
+ /**
134
+ * The foundational service the location is addressed in. Absent ⇒ `location` is a URL the
135
+ * agent can fetch directly. Not validated against the step's own selection: a reference can
136
+ * legitimately live in a service the step does not otherwise use, and the brief names whatever
137
+ * is here so a wrong id is visible rather than silently dropped.
138
+ */
139
+ service: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(64), v.regex(/^[a-z0-9][a-z0-9-]*$/))),
140
+ /** What this is, in the step author's words, folded into the brief verbatim. */
141
+ note: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(500))),
142
+ });
143
+ /**
144
+ * A reference image plus the ROLE it plays, because "here is an image" is not an instruction.
145
+ * The same file means "match this palette", "this is the character" or "start from this and
146
+ * change it" depending on the answer, and every one of the four reference-capable APIs takes a
147
+ * different parameter for each.
148
+ */
149
+ export const binaryReferenceImageSchema = v.object({
150
+ // Spelled out rather than spread from {@link binaryAssetRefSchema}'s entries. A spread composes
151
+ // the two schemas' inference at every use site, and this shape sits four levels down inside the
152
+ // workspace snapshot (`WorkspaceSnapshot` → pipeline → step options → binary output →
153
+ // generation → here), which is deep enough that the extra level tips `tsc` into "type
154
+ // instantiation is excessively deep" in a consumer several packages away. Three duplicated
155
+ // fields is a cheaper price than a build that fails somewhere with no visible connection to
156
+ // this file; the two are kept in step by the shared doc note above.
157
+ location: v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(2048)),
158
+ service: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(64), v.regex(/^[a-z0-9][a-z0-9-]*$/))),
159
+ note: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(500))),
160
+ role: v.picklist([
161
+ /** Match its look: palette, rendering, line weight. */
162
+ 'style',
163
+ /** This is the thing depicted: the character, the product, the prop. */
164
+ 'subject',
165
+ /** Match its layout: framing, pose, camera. */
166
+ 'composition',
167
+ /** Start FROM this image and change it (image-to-image at low strength). */
168
+ 'base',
169
+ ]),
170
+ });
171
+ /**
172
+ * The step REVISES existing artifacts rather than making new ones.
173
+ *
174
+ * A named schema rather than an inline object inside the options bag below, for the reason the
175
+ * reference-image shape is spelled out: this nests two more object levels under an already-deep
176
+ * chain, and a named const is where `tsc` can stop re-instantiating it.
177
+ */
178
+ export const binaryEditRequestSchema = v.object({
179
+ /**
180
+ * `instruction` rewrites a whole artifact from a sentence; `mask` repaints only the region a
181
+ * mask names. Two capabilities, because almost no integration has both.
182
+ */
183
+ mode: v.picklist(['instruction', 'mask']),
184
+ /** What to change, folded into the brief verbatim. */
185
+ instruction: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(2000))),
186
+ /**
187
+ * The artifact to revise. Absent ⇒ the step's scope services say which existing asset each
188
+ * generation revises, which is the ordinary case for a step that re-renders an inventory.
189
+ */
190
+ source: v.optional(binaryAssetRefSchema),
191
+ /** The mask, for `mask` mode. Absent in `mask` mode is a gap the brief STATES. */
192
+ mask: v.optional(binaryAssetRefSchema),
193
+ });
194
+ /**
195
+ * The per-step GENERATION OPTIONS: the parameters a step wants every generation to carry, each
196
+ * gated by the capability that makes it answerable ({@link BINARY_OPTION_CAPABILITIES}).
197
+ *
198
+ * They are a statement about the WORK, exactly like `modalities` and `mediaTypes` beside them,
199
+ * and they are checked the same way: a step asking for something nothing it selected can do is
200
+ * refused at admission rather than discovering it at the end of a paid run. What they are NOT is
201
+ * a passthrough of any vendor's request body. Everything here is a fact about the deliverable
202
+ * that more than one of the registered APIs can express in its own parameters, and the agent
203
+ * translates it on the call it writes; a knob only one vendor has (`prompt_upsampling`,
204
+ * `safety_tolerance`, a sampler name) stays in that integration's `guidance`, where it can say
205
+ * what it means, rather than becoming a field every other integration ignores.
206
+ */
207
+ /**
208
+ * The raw object schema. Exported ONLY so the drift guard in `binary-capabilities.test.ts` can
209
+ * infer its output type and compare it against the hand-written {@link BinaryGenerationOptions};
210
+ * every other consumer takes {@link binaryGenerationOptionsSchema}, whose whole purpose is to
211
+ * stop that inference from happening at each use site. See the interface's note for why.
212
+ */
213
+ export const binaryGenerationOptionsObject = v.object({
214
+ /**
215
+ * Images every generation is conditioned on. Needs `reference-image`; more than one also needs
216
+ * `multi-reference`, since an API that takes a single input image cannot compose two.
217
+ */
218
+ referenceImages: v.optional(v.pipe(v.array(binaryReferenceImageSchema), v.maxLength(8))),
219
+ /**
220
+ * The step REVISES existing artifacts rather than making new ones. Needs `instruction-edit` or
221
+ * `mask-edit` depending on `mode`.
222
+ */
223
+ edit: v.optional(binaryEditRequestSchema),
224
+ /** What to keep out. Needs `negative-prompt`. */
225
+ negativePrompt: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(2000))),
226
+ /**
227
+ * A fixed seed, so the run is reproducible. Needs `seed`.
228
+ *
229
+ * A step comparing candidates deliberately does NOT get its seed varied for it: a fixed seed
230
+ * across integrations is how two renders of one subject are told apart by the integration
231
+ * rather than by luck, and the brief says so.
232
+ */
233
+ seed: v.optional(v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(4294967295))),
234
+ /** `16:9`, `1:1`, `3:2`. Needs `aspect-ratio`. */
235
+ aspectRatio: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(16), v.regex(/^[1-9][0-9]{0,3}:[1-9][0-9]{0,3}$/, 'must be an aspect ratio of the form W:H'))),
236
+ /** Render at this multiple of the integration's native size. Needs `upscale`. */
237
+ upscale: v.optional(v.pipe(v.number(), v.integer(), v.minValue(2), v.maxValue(8))),
238
+ /** Deliver an alpha channel rather than a background. Needs `transparent-background`. */
239
+ transparentBackground: v.optional(v.literal(true)),
240
+ /** Deliver a seamlessly tiling image. Needs `tileable`. */
241
+ tileable: v.optional(v.literal(true)),
242
+ });
243
+ /**
244
+ * The generation options as a SCHEMA, typed against the interface above so consumers stop
245
+ * re-inferring it. `unknown` on the input side is what a parser accepts anyway, and nothing in
246
+ * this repo reads `InferInput` of a step's options.
247
+ */
248
+ export const binaryGenerationOptionsSchema = binaryGenerationOptionsObject;
249
+ /**
250
+ * Which option needs which capability, as the ONE table both sides read.
251
+ *
252
+ * A `Record` over the option keys rather than a chain of `if`s at each reader, so an option added
253
+ * to the schema without a capability fails the typecheck here instead of shipping as a control
254
+ * nothing checks. `referenceImages` maps to a LIST because its requirement grows with its length,
255
+ * and `edit` maps to one of two by its mode, which is why the derivation below is a function and
256
+ * not a lookup.
257
+ */
258
+ export const BINARY_OPTION_CAPABILITIES = {
259
+ referenceImages: ['reference-image', 'multi-reference'],
260
+ edit: ['instruction-edit', 'mask-edit'],
261
+ negativePrompt: ['negative-prompt'],
262
+ seed: ['seed'],
263
+ aspectRatio: ['aspect-ratio'],
264
+ upscale: ['upscale'],
265
+ transparentBackground: ['transparent-background'],
266
+ tileable: ['tileable'],
267
+ };
268
+ /**
269
+ * The capabilities a step's generation options actually REQUIRE, in a stable order.
270
+ *
271
+ * Derived rather than declared, so a step never carries a requirement it does not exercise: a
272
+ * `referenceImages` list of one needs `reference-image` and NOT `multi-reference`, and an `edit`
273
+ * needs exactly the one capability its mode names. Deriving it is also what keeps the refusal
274
+ * honest in the other direction, since a requirement nobody stated cannot be silently dropped by
275
+ * an integration that does not declare it.
276
+ *
277
+ * Deliberately NOT extended with `candidate-batch` for a comparison step: an integration without
278
+ * it can still produce several candidates by repeating the call, so a refusal there would reject
279
+ * a selection that works. The brief states which of the two the agent should do.
280
+ */
281
+ export function requiredBinaryCapabilities(options) {
282
+ if (!options)
283
+ return [];
284
+ const required = [];
285
+ const references = options.referenceImages ?? [];
286
+ if (references.length > 0)
287
+ required.push('reference-image');
288
+ if (references.length > 1)
289
+ required.push('multi-reference');
290
+ if (options.edit) {
291
+ required.push(options.edit.mode === 'mask' ? 'mask-edit' : 'instruction-edit');
292
+ }
293
+ if (options.negativePrompt)
294
+ required.push('negative-prompt');
295
+ if (options.seed !== undefined)
296
+ required.push('seed');
297
+ if (options.aspectRatio)
298
+ required.push('aspect-ratio');
299
+ if (options.upscale !== undefined)
300
+ required.push('upscale');
301
+ if (options.transparentBackground)
302
+ required.push('transparent-background');
303
+ if (options.tileable)
304
+ required.push('tileable');
305
+ return required;
306
+ }
307
+ /**
308
+ * Judge `required` against what `selected` declares it can do.
309
+ *
310
+ * The same THREE outcomes as {@link binaryFormatCoverage}, and deliberately the same rule, because
311
+ * the two axes are in the same position: a declaration that pins nothing down is an explicit
312
+ * documented state ("only the coarse facts are known") rather than a denial. That reading is what
313
+ * lets this ship without breaking a single integration registered before capabilities existed:
314
+ * they declare none, so every requirement against them is UNVERIFIABLE, the run is admitted, and
315
+ * the gap is stated to the agent in its brief and to the composer in the picker. Refusing there
316
+ * would retroactively invalidate every registration in existence; calling it covered would be a
317
+ * clean bill of health nobody issued on the surface that decides whether the run may start.
318
+ *
319
+ * Kept as its own function rather than a generic over the format one: they read different fields
320
+ * of different shapes, and a shared generic would be a parameterised `some`/`has` that saves four
321
+ * lines and hides which axis a caller is asking about.
322
+ */
323
+ export function binaryCapabilityCoverage(required, selected) {
324
+ const declared = new Set(selected.flatMap((generator) => generator.capabilities ?? []));
325
+ // An EMPTY selection declares nothing and hides nothing: with no integration to be silent, a
326
+ // capability requirement is uncovered outright, exactly as a format requirement already is.
327
+ const undeclared = selected.some((generator) => (generator.capabilities ?? []).length === 0);
328
+ const uncovered = [];
329
+ const unverifiable = [];
330
+ for (const capability of required) {
331
+ if (declared.has(capability))
332
+ continue;
333
+ if (undeclared)
334
+ unverifiable.push(capability);
335
+ else
336
+ uncovered.push(capability);
337
+ }
338
+ return { uncovered, unverifiable };
339
+ }
340
+ /**
341
+ * The integrations that declare each required capability, so a surface can say WHICH of a
342
+ * step's selection will actually honour an option rather than only that something will.
343
+ *
344
+ * The question a person asks the moment a step holds two producers of one modality and one
345
+ * option: an aspect ratio honoured by one of them and ignored by the other is not a covered
346
+ * requirement in any useful sense, and coverage alone cannot say so. Ids come out in selection
347
+ * order and a capability with no declarer is absent, never an empty list, so "nobody" and "not
348
+ * asked" stay different answers.
349
+ */
350
+ export function binaryCapabilityProviders(required, selected) {
351
+ const out = [];
352
+ for (const capability of required) {
353
+ const generatorIds = selected
354
+ .filter((generator) => (generator.capabilities ?? []).includes(capability))
355
+ .map((generator) => generator.id);
356
+ if (generatorIds.length > 0)
357
+ out.push({ capability, generatorIds });
358
+ }
359
+ return out;
360
+ }
361
+ //# sourceMappingURL=binary-capabilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binary-capabilities.js","sourceRoot":"","sources":["../src/binary-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,8EAA8E;AAC9E,gGAAgG;AAChG,sDAAsD;AACtD,EAAE;AACF,+FAA+F;AAC/F,kGAAkG;AAClG,gGAAgG;AAChG,gGAAgG;AAChG,iGAAiG;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AO,GAAG,CAAA;AACZ,CAAC"}
@@ -80,6 +80,22 @@ export declare const binaryGeneratorDefinitionSchema: v.ObjectSchema<{
80
80
  * states as such rather than implying every format of that modality is available.
81
81
  */
82
82
  readonly mediaTypes: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.ToLowerCaseAction, v.MinLengthAction<string, 3, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "must be a media type of the form type/subtype">]>, undefined>, undefined>;
83
+ /**
84
+ * What it can be ASKED FOR while generating: a reference image, a mask edit, a seed, a
85
+ * transparent background (see `binary-capabilities.ts`). This is what decides which per-step
86
+ * generation options the builder offers, what the brief tells the agent it may send, and which
87
+ * option requirements admission refuses.
88
+ *
89
+ * Absent is a DOCUMENTED state and the honest default for a definition nobody has audited: it
90
+ * means "only the coarse facts are known", exactly as an absent {@link mediaTypes} does, so
91
+ * every option requirement against it is reported as unverifiable rather than refused. Declare
92
+ * it once the endpoint's parameters are actually known, and the step gains a real check.
93
+ *
94
+ * The vocabulary is closed and deliberately narrow: a capability belongs here only when the
95
+ * platform exposes something because of it. A vendor knob nobody else has stays in
96
+ * {@link guidance}, where a sentence can say what it does.
97
+ */
98
+ readonly capabilities: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["reference-image", "multi-reference", "instruction-edit", "mask-edit", "negative-prompt", "seed", "aspect-ratio", "candidate-batch", "upscale", "transparent-background", "tileable"], undefined>, undefined>, undefined>;
83
99
  /**
84
100
  * The API's base URL. Stated to the agent so it does not have to infer one from the contract,
85
101
  * and refused at registration unless it is `https` (or loopback) — the credential above rides
@@ -174,6 +190,17 @@ export declare const registeredBinaryGeneratorSchema: v.ObjectSchema<{
174
190
  readonly modalities: v.ArraySchema<v.PicklistSchema<["image", "audio", "video", "3d-model", "3d-scene", "document"], undefined>, undefined>;
175
191
  /** The concrete formats it pins down, when it declares any. Shown as detail, never a filter. */
176
192
  readonly mediaTypes: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.ToLowerCaseAction, v.MinLengthAction<string, 3, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "must be a media type of the form type/subtype">]>, undefined>, undefined>;
193
+ /**
194
+ * What it can be asked for while generating. Unlike the two fields above this one does more
195
+ * than label a candidate: the builder shows a step's generation options against it, so a
196
+ * projection that omitted it would leave the SPA offering a reference-image field for an
197
+ * endpoint that takes no image, and the refusal would arrive at run start.
198
+ *
199
+ * Still identity-grade, so it stays inside the rule the omissions here follow: it is what the
200
+ * integration IS, not how to reach it. The credential key name, the endpoint and the contracts
201
+ * remain absent, because a workspace viewer has no business learning them.
202
+ */
203
+ readonly capabilities: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["reference-image", "multi-reference", "instruction-edit", "mask-edit", "negative-prompt", "seed", "aspect-ratio", "candidate-batch", "upscale", "transparent-background", "tileable"], undefined>, undefined>, undefined>;
177
204
  }, undefined>;
178
205
  export type RegisteredBinaryGenerator = v.InferOutput<typeof registeredBinaryGeneratorSchema>;
179
206
  export declare function binaryGeneratorDefinitionIssues(definition: unknown): string[];
@@ -1 +1 @@
1
- {"version":3,"file":"binary-generators.d.ts","sourceRoot":"","sources":["../src/binary-generators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAsC5B;;;;;;;;GAQG;AACH,eAAO,MAAM,+BAA+B;IAC1C;;;;;;;;;;;;;OAaG;;IAYH;;;;;;;;;OASG;;IAcH;;;;OAIG;;IAEH;;;;;OAKG;;aAEH,CAAA;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,+BAA+B,CAAC,CAAA;AAE7F;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B;IAC1C,iFAAiF;;;IAGjF,2DAA2D;;IAE3D;;;OAGG;;IAEH;;;OAGG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;I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C,CAAA;AAE7F;;;;;;;;GAQG;AACH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,+BAA+B;;;;IAI1C,0FAA0F;;IAE1F,gGAAgG;;IAEhG;;;;;;;;;OASG;;aAEH,CAAA;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,+BAA+B,CAAC,CAAA;AAE7F,wBAAgB,+BAA+B,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM,EAAE,CAO7E"}
@@ -1,4 +1,5 @@
1
1
  import * as v from 'valibot';
2
+ import { binaryGeneratorCapabilitySchema } from './binary-capabilities.js';
2
3
  import { binaryModalitySchema, mediaTypeSchema } from './binary-modalities.js';
3
4
  import { uploadApiContractSchema } from './foundational-services.js';
4
5
  import { isReservedPlatformEnvKey, isToolchainEnvName, reservedEnvKeyMessage, toolchainEnvNameMessage, } from './reserved-env-keys.js';
@@ -102,6 +103,22 @@ export const binaryGeneratorDefinitionSchema = v.object({
102
103
  * states as such rather than implying every format of that modality is available.
103
104
  */
104
105
  mediaTypes: v.optional(v.array(mediaTypeSchema)),
106
+ /**
107
+ * What it can be ASKED FOR while generating: a reference image, a mask edit, a seed, a
108
+ * transparent background (see `binary-capabilities.ts`). This is what decides which per-step
109
+ * generation options the builder offers, what the brief tells the agent it may send, and which
110
+ * option requirements admission refuses.
111
+ *
112
+ * Absent is a DOCUMENTED state and the honest default for a definition nobody has audited: it
113
+ * means "only the coarse facts are known", exactly as an absent {@link mediaTypes} does, so
114
+ * every option requirement against it is reported as unverifiable rather than refused. Declare
115
+ * it once the endpoint's parameters are actually known, and the step gains a real check.
116
+ *
117
+ * The vocabulary is closed and deliberately narrow: a capability belongs here only when the
118
+ * platform exposes something because of it. A vendor knob nobody else has stays in
119
+ * {@link guidance}, where a sentence can say what it does.
120
+ */
121
+ capabilities: v.optional(v.array(binaryGeneratorCapabilitySchema)),
105
122
  /**
106
123
  * The API's base URL. Stated to the agent so it does not have to infer one from the contract,
107
124
  * and refused at registration unless it is `https` (or loopback) — the credential above rides
@@ -150,6 +167,17 @@ export const registeredBinaryGeneratorSchema = v.object({
150
167
  modalities: v.array(binaryModalitySchema),
151
168
  /** The concrete formats it pins down, when it declares any. Shown as detail, never a filter. */
152
169
  mediaTypes: v.optional(v.array(mediaTypeSchema)),
170
+ /**
171
+ * What it can be asked for while generating. Unlike the two fields above this one does more
172
+ * than label a candidate: the builder shows a step's generation options against it, so a
173
+ * projection that omitted it would leave the SPA offering a reference-image field for an
174
+ * endpoint that takes no image, and the refusal would arrive at run start.
175
+ *
176
+ * Still identity-grade, so it stays inside the rule the omissions here follow: it is what the
177
+ * integration IS, not how to reach it. The credential key name, the endpoint and the contracts
178
+ * remain absent, because a workspace viewer has no business learning them.
179
+ */
180
+ capabilities: v.optional(v.array(binaryGeneratorCapabilitySchema)),
153
181
  });
154
182
  export function binaryGeneratorDefinitionIssues(definition) {
155
183
  const parsed = v.safeParse(binaryGeneratorDefinitionSchema, definition);
@@ -1 +1 @@
1
- {"version":3,"file":"binary-generators.js","sourceRoot":"","sources":["../src/binary-generators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,wBAAwB,CAAA;AAE/B,8EAA8E;AAC9E,4FAA4F;AAC5F,uFAAuF;AACvF,6CAA6C;AAC7C,EAAE;AACF,+FAA+F;AAC/F,+FAA+F;AAC/F,8FAA8F;AAC9F,8FAA8F;AAC9F,8FAA8F;AAC9F,6FAA6F;AAC7F,+FAA+F;AAC/F,iCAAiC;AACjC,EAAE;AACF,+FAA+F;AAC/F,+FAA+F;AAC/F,uFAAuF;AACvF,2CAA2C;AAC3C,8EAA8E;AA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AC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACjC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACxE,OAAO,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAA;IAC3D,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -80,6 +80,37 @@ export declare const binaryOutputConfigSchema: v.ObjectSchema<{
80
80
  * generator look like a change of requirements rather than a break.
81
81
  */
82
82
  readonly mediaTypes: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.ToLowerCaseAction, v.MinLengthAction<string, 3, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "must be a media type of the form type/subtype">]>, undefined>, undefined>;
83
+ /**
84
+ * The parameters every generation on this step carries: a reference image, an edit
85
+ * instruction, a seed, a negative prompt, a transparent background (see
86
+ * `binary-capabilities.ts`).
87
+ *
88
+ * A THIRD axis beside the two above, and the one that says what to ask FOR rather than what
89
+ * must come back. Each option is gated by the capability that makes it answerable, and the
90
+ * gate has the same three outcomes the format check does: an option nothing selected can do is
91
+ * refused at admission, an option nothing has DECLARED either way is admitted with the gap
92
+ * stated. That third state is what lets this exist at all without invalidating every
93
+ * integration registered before capabilities did.
94
+ *
95
+ * Absent ⇒ the step's prompt is the whole instruction, which stays the ordinary case. These
96
+ * are for the facts a prompt cannot carry: an agent told "match the reference" with no
97
+ * reference, or told to seed a run by an API that takes no seed, has been told nothing.
98
+ */
99
+ readonly generation: v.OptionalSchema<v.GenericSchema<unknown, import("./binary-capabilities.js").BinaryGenerationOptions>, undefined>;
100
+ /**
101
+ * This step generates COMPARABLE CANDIDATES and parks for a human to keep one (or several
102
+ * under distinct ids) rather than letting the agent commit to one producer unobserved. See
103
+ * `binary-candidates.ts`.
104
+ *
105
+ * Absent ⇒ the step generates its deliverables directly, which is the ordinary case and stays
106
+ * it: a comparison costs a human interrupt and at least one extra generation per subject, and
107
+ * it is worth that exactly where the choice between two producers of one content type is a
108
+ * judgement somebody wants to make with the pictures in front of them.
109
+ */
110
+ readonly comparison: v.OptionalSchema<v.ObjectSchema<{
111
+ readonly perGenerator: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 4, undefined>]>, undefined>;
112
+ readonly multiSelect: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
113
+ }, undefined>, undefined>;
83
114
  }, undefined>;
84
115
  export type BinaryOutputConfig = v.InferOutput<typeof binaryOutputConfigSchema>;
85
116
  /** One stored artifact a binary-generating step declared in its reply's machine-read block. */
@@ -1 +1 @@
1
- {"version":3,"file":"binary-outputs.d.ts","sourceRoot":"","sources":["../src/binary-outputs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAmB5B;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB;IACnC;;;;OAIG;;IAEH;;;;;;OAMG;;IAEH;;;;;;;;;OASG;;IAEH;;;;;;;;;;OAUG;;IAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;;aAEH,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E,+FAA+F;AAC/F,eAAO,MAAM,0BAA0B;IACrC;;;;;OAKG;;IAEH;;;OAGG;;IAEH,8FAA8F;;IAE9F,uEAAuE;;IAEvE,oDAAoD;;IAEpD;;;;;;OAMG;;IAEH;;;;;OAKG;;aAEH,CAAA;AACF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,WAAW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;;QAEH,8FAA8F;;QAE9F,uEAAuE;;QAEvE,oDAAoD;;QAEpD;;;;;;WAMG;;QAEH;;;;;WAKG;;;IAsBH,0FAA0F;;IAE1F;;;;;;OAMG;;IAEH;;;;;;;;OAQG;;IAEH,2FAA2F;;IAE3F,qDAAqD;;IAErD,0FAA0F;;IAE1F,qEAAqE;;aAErE,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,wBAAwB,CAAC,CAAA"}
@@ -1,4 +1,6 @@
1
1
  import * as v from 'valibot';
2
+ import { binaryGenerationOptionsSchema } from './binary-capabilities.js';
3
+ import { binaryCandidateComparisonSchema } from './binary-candidates.js';
2
4
  import { binaryModalitySchema, mediaTypeSchema } from './binary-modalities.js';
3
5
  // Wire vocabulary for BINARY-OUTPUT agent steps (docs/initiatives/binary-output-foundational-storage.md):
4
6
  // a step whose kind GENERATES binary artifacts (image generation is the canonical example) and
@@ -89,6 +91,34 @@ export const binaryOutputConfigSchema = v.object({
89
91
  * generator look like a change of requirements rather than a break.
90
92
  */
91
93
  mediaTypes: v.optional(v.array(mediaTypeSchema)),
94
+ /**
95
+ * The parameters every generation on this step carries: a reference image, an edit
96
+ * instruction, a seed, a negative prompt, a transparent background (see
97
+ * `binary-capabilities.ts`).
98
+ *
99
+ * A THIRD axis beside the two above, and the one that says what to ask FOR rather than what
100
+ * must come back. Each option is gated by the capability that makes it answerable, and the
101
+ * gate has the same three outcomes the format check does: an option nothing selected can do is
102
+ * refused at admission, an option nothing has DECLARED either way is admitted with the gap
103
+ * stated. That third state is what lets this exist at all without invalidating every
104
+ * integration registered before capabilities did.
105
+ *
106
+ * Absent ⇒ the step's prompt is the whole instruction, which stays the ordinary case. These
107
+ * are for the facts a prompt cannot carry: an agent told "match the reference" with no
108
+ * reference, or told to seed a run by an API that takes no seed, has been told nothing.
109
+ */
110
+ generation: v.optional(binaryGenerationOptionsSchema),
111
+ /**
112
+ * This step generates COMPARABLE CANDIDATES and parks for a human to keep one (or several
113
+ * under distinct ids) rather than letting the agent commit to one producer unobserved. See
114
+ * `binary-candidates.ts`.
115
+ *
116
+ * Absent ⇒ the step generates its deliverables directly, which is the ordinary case and stays
117
+ * it: a comparison costs a human interrupt and at least one extra generation per subject, and
118
+ * it is worth that exactly where the choice between two producers of one content type is a
119
+ * judgement somebody wants to make with the pictures in front of them.
120
+ */
121
+ comparison: v.optional(binaryCandidateComparisonSchema),
92
122
  });
93
123
  /** One stored artifact a binary-generating step declared in its reply's machine-read block. */
94
124
  export const binaryOutputArtifactSchema = v.object({
@@ -1 +1 @@
1
- {"version":3,"file":"binary-outputs.js","sourceRoot":"","sources":["../src/binary-outputs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAE9E,0GAA0G;AAC1G,+FAA+F;AAC/F,8FAA8F;AAC9F,+FAA+F;AAC/F,gGAAgG;AAChG,gGAAgG;AAChG,6EAA6E;AAE7E,MAAM,SAAS,GAAG,CAAC,CAAC,IAAI,CACtB,CAAC,CAAC,MAAM,EAAE,EACV,CAAC,CAAC,IAAI,EAAE,EACR,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EACd,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,EACf,CAAC,CAAC,KAAK,CAAC,sBAAsB,EAAE,4BAA4B,CAAC,CAC9D,CAAA;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C;;;;OAIG;IACH,gBAAgB,EAAE,SAAS;IAC3B;;;;;;OAMG;IACH,iBAAiB,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACjD;;;;;;;;;OASG;IACH,YAAY,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,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AC;CAC3C,CAAC,CAAA;AAGF;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,0BAA0B,CAAC;IAC3C,0FAA0F;IAC1F,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACpC;;;;;;OAMG;IACH,iBAAiB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACtC;;;;;;;;OAQG;IACH,oBAAoB,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,2FAA2F;IAC3F,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,qDAAqD;IACrD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,0FAA0F;IAC1F,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IACpC,qEAAqE;IACrE,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;CACpC,CAAC,CAAA"}
@@ -1233,6 +1233,11 @@ export declare const stepOptionsSchema: v.ObjectSchema<{
1233
1233
  readonly generatorIds: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.RegexAction<string, "must be a lower-kebab slug">]>, undefined>, undefined>;
1234
1234
  readonly modalities: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["image", "audio", "video", "3d-model", "3d-scene", "document"], undefined>, undefined>, undefined>;
1235
1235
  readonly mediaTypes: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.ToLowerCaseAction, v.MinLengthAction<string, 3, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "must be a media type of the form type/subtype">]>, undefined>, undefined>;
1236
+ readonly generation: v.OptionalSchema<v.GenericSchema<unknown, import("./binary-capabilities.js").BinaryGenerationOptions>, undefined>;
1237
+ readonly comparison: v.OptionalSchema<v.ObjectSchema<{
1238
+ readonly perGenerator: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 4, undefined>]>, undefined>;
1239
+ readonly multiSelect: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
1240
+ }, undefined>, undefined>;
1236
1241
  }, undefined>, undefined>;
1237
1242
  /**
1238
1243
  * `deployer` steps only. Declares that the environments THIS step provisions are meant to
@@ -1455,6 +1460,11 @@ export declare const pipelineSchema: v.ObjectSchema<{
1455
1460
  readonly generatorIds: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.RegexAction<string, "must be a lower-kebab slug">]>, undefined>, undefined>;
1456
1461
  readonly modalities: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<["image", "audio", "video", "3d-model", "3d-scene", "document"], undefined>, undefined>, undefined>;
1457
1462
  readonly mediaTypes: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.ToLowerCaseAction, v.MinLengthAction<string, 3, undefined>, v.MaxLengthAction<string, 128, undefined>, v.RegexAction<string, "must be a media type of the form type/subtype">]>, undefined>, undefined>;
1463
+ readonly generation: v.OptionalSchema<v.GenericSchema<unknown, import("./binary-capabilities.js").BinaryGenerationOptions>, undefined>;
1464
+ readonly comparison: v.OptionalSchema<v.ObjectSchema<{
1465
+ readonly perGenerator: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 4, undefined>]>, undefined>;
1466
+ readonly multiSelect: v.OptionalSchema<v.LiteralSchema<true, undefined>, undefined>;
1467
+ }, undefined>, undefined>;
1458
1468
  }, undefined>, undefined>;
1459
1469
  /**
1460
1470
  * `deployer` steps only. Declares that the environments THIS step provisions are meant to