@cat-factory/contracts 0.284.0 → 0.286.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/agent-presentation.d.ts +32 -2
- package/dist/agent-presentation.d.ts.map +1 -1
- package/dist/agent-presentation.js +15 -0
- package/dist/agent-presentation.js.map +1 -1
- package/dist/binary-candidates.d.ts +261 -0
- package/dist/binary-candidates.d.ts.map +1 -0
- package/dist/binary-candidates.js +202 -0
- package/dist/binary-candidates.js.map +1 -0
- package/dist/binary-capabilities.d.ts +393 -0
- package/dist/binary-capabilities.d.ts.map +1 -0
- package/dist/binary-capabilities.js +465 -0
- package/dist/binary-capabilities.js.map +1 -0
- package/dist/binary-generators.d.ts +27 -0
- package/dist/binary-generators.d.ts.map +1 -1
- package/dist/binary-generators.js +28 -0
- package/dist/binary-generators.js.map +1 -1
- package/dist/binary-modalities.d.ts +18 -0
- package/dist/binary-modalities.d.ts.map +1 -1
- package/dist/binary-modalities.js +28 -0
- package/dist/binary-modalities.js.map +1 -1
- package/dist/binary-outputs.d.ts +69 -0
- package/dist/binary-outputs.d.ts.map +1 -1
- package/dist/binary-outputs.js +46 -0
- package/dist/binary-outputs.js.map +1 -1
- package/dist/build-ladder.d.ts +37 -0
- package/dist/build-ladder.d.ts.map +1 -0
- package/dist/build-ladder.js +46 -0
- package/dist/build-ladder.js.map +1 -0
- package/dist/entities.d.ts +49 -0
- package/dist/entities.d.ts.map +1 -1
- package/dist/entities.js +26 -0
- package/dist/entities.js.map +1 -1
- package/dist/execution.d.ts +136 -6
- package/dist/execution.d.ts.map +1 -1
- package/dist/execution.js +30 -3
- package/dist/execution.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/platform-agent-kinds.d.ts +19 -0
- package/dist/platform-agent-kinds.d.ts.map +1 -0
- package/dist/platform-agent-kinds.js +30 -0
- package/dist/platform-agent-kinds.js.map +1 -0
- package/dist/requests.d.ts +27 -0
- package/dist/requests.d.ts.map +1 -1
- package/dist/requests.js +10 -0
- package/dist/requests.js.map +1 -1
- package/dist/result-views.d.ts +1 -1
- package/dist/result-views.d.ts.map +1 -1
- package/dist/result-views.js +1 -0
- package/dist/result-views.js.map +1 -1
- package/dist/routes/agent-runs.d.ts +84 -0
- package/dist/routes/agent-runs.d.ts.map +1 -1
- package/dist/routes/binaryCandidates.d.ts +139 -0
- package/dist/routes/binaryCandidates.d.ts.map +1 -0
- package/dist/routes/binaryCandidates.js +31 -0
- package/dist/routes/binaryCandidates.js.map +1 -0
- package/dist/routes/bug-hunt.d.ts +84 -0
- package/dist/routes/bug-hunt.d.ts.map +1 -1
- package/dist/routes/execution.d.ts +1523 -0
- package/dist/routes/execution.d.ts.map +1 -1
- package/dist/routes/execution.js +13 -1
- package/dist/routes/execution.js.map +1 -1
- package/dist/routes/human-review.d.ts +42 -0
- package/dist/routes/human-review.d.ts.map +1 -1
- package/dist/routes/human-test.d.ts +210 -0
- package/dist/routes/human-test.d.ts.map +1 -1
- package/dist/routes/index.d.ts +1 -0
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +1 -0
- package/dist/routes/index.js.map +1 -1
- package/dist/routes/pipelines.d.ts +70 -0
- package/dist/routes/pipelines.d.ts.map +1 -1
- package/dist/routes/visual-confirm.d.ts +126 -0
- package/dist/routes/visual-confirm.d.ts.map +1 -1
- package/dist/routes/workspaces.d.ts +108 -2
- package/dist/routes/workspaces.d.ts.map +1 -1
- package/dist/snapshot.d.ts +72 -9
- package/dist/snapshot.d.ts.map +1 -1
- package/dist/snapshot.js +18 -8
- package/dist/snapshot.js.map +1 -1
- package/dist/step-conditions.d.ts +98 -0
- package/dist/step-conditions.d.ts.map +1 -0
- package/dist/step-conditions.js +109 -0
- package/dist/step-conditions.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,465 @@
|
|
|
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
|
+
/**
|
|
83
|
+
* Accepts an explicit aspect SHAPE: a ratio (`16:9`), or a fixed set of size buckets it
|
|
84
|
+
* rounds to. Unlocks `generation.aspectRatio`.
|
|
85
|
+
*
|
|
86
|
+
* Deliberately NOT "a ratio or an output size", which is what this member said while it was
|
|
87
|
+
* the only one on the axis. A bucketed API (`image_size: square | portrait | landscape`,
|
|
88
|
+
* `resolution: 1k | 2k`) honours a ratio exactly and an exact pixel size not at all, so one
|
|
89
|
+
* member covering both made the two integrations that CAN be handed dimensions
|
|
90
|
+
* indistinguishable from the two that cannot — see {@link 'exact-size'}.
|
|
91
|
+
*/
|
|
92
|
+
'aspect-ratio',
|
|
93
|
+
/**
|
|
94
|
+
* Accepts exact output DIMENSIONS in pixels: a width and a height it renders at natively,
|
|
95
|
+
* rather than a shape it rounds to. Unlocks `generation.outputSize`.
|
|
96
|
+
*
|
|
97
|
+
* Its own member rather than a refinement of `aspect-ratio`, because the two partition
|
|
98
|
+
* differently and the difference is the whole deliverable for anything rendered to a fixed
|
|
99
|
+
* grid. A 96x96 inventory icon asked of a bucketed endpoint does not come back slightly
|
|
100
|
+
* wrong: it comes back as a 1K render downscaled 4x, which on pixel art is not the same asset
|
|
101
|
+
* at any level of care, and every check downstream passes (the modality is covered, the
|
|
102
|
+
* format is covered, the upload succeeded). The consumer that rejects it is the game, weeks
|
|
103
|
+
* later.
|
|
104
|
+
*
|
|
105
|
+
* The vocabulary stays FLAT: an API taking width and height can honour any ratio, so it
|
|
106
|
+
* declares BOTH members rather than this one implying the other. That is the same shape
|
|
107
|
+
* `reference-image` / `multi-reference` already has, and it is chosen for the same reason —
|
|
108
|
+
* an implication table is an ordering over a picklist that every future member would then
|
|
109
|
+
* have to be placed in, to save a deployment one word in its own registration, and the cost
|
|
110
|
+
* of forgetting that word is a loud refusal naming the capability rather than a silent
|
|
111
|
+
* mis-render.
|
|
112
|
+
*
|
|
113
|
+
* What this does NOT do is state which sizes an endpoint supports. Flux caps at 4 MP and
|
|
114
|
+
* wants multiples of 32; Retro Diffusion's range moves with the style. A per-integration size
|
|
115
|
+
* TABLE is refused on the design record's own grounds (it is the `resolutionRange`
|
|
116
|
+
* discriminator wearing a new name, and it goes stale in this repo while the vendor changes
|
|
117
|
+
* it in theirs). This member answers only the question that is a durable fact about the
|
|
118
|
+
* endpoint's REQUEST SHAPE: can it be handed dimensions at all. The rest is the integration's
|
|
119
|
+
* own `guidance`, where a sentence can say what the limits are.
|
|
120
|
+
*/
|
|
121
|
+
'exact-size',
|
|
122
|
+
/**
|
|
123
|
+
* Returns SEVERAL candidates for one prompt in ONE call. Exposes no control of its own: it
|
|
124
|
+
* changes what the candidate brief ASKS FOR (request `n` in a single call, rather than
|
|
125
|
+
* repeating the call with a different seed), and a brief that got that wrong would either
|
|
126
|
+
* multiply the bill or ask for a parameter the endpoint rejects.
|
|
127
|
+
*/
|
|
128
|
+
'candidate-batch',
|
|
129
|
+
/** Can upscale its own output to a larger render. Unlocks `generation.upscale`. */
|
|
130
|
+
'upscale',
|
|
131
|
+
/**
|
|
132
|
+
* Can return an alpha channel / cut-out subject. Unlocks
|
|
133
|
+
* `generation.transparentBackground`, which is a requirement rather than a preference for
|
|
134
|
+
* anything composited (a sprite, an icon, a product cut-out).
|
|
135
|
+
*/
|
|
136
|
+
'transparent-background',
|
|
137
|
+
/**
|
|
138
|
+
* Can produce a SEAMLESSLY TILING image. Unlocks `generation.tileable`. A tile that does not
|
|
139
|
+
* tile is not a lesser tile: it is unusable for the one job it exists for, which is what puts
|
|
140
|
+
* this on the axis with a predicate rather than in a description.
|
|
141
|
+
*/
|
|
142
|
+
'tileable',
|
|
143
|
+
]);
|
|
144
|
+
const BINARY_CAPABILITY_SET = new Set(binaryGeneratorCapabilitySchema.options);
|
|
145
|
+
/**
|
|
146
|
+
* Whether a value is still a member of the vocabulary, DERIVED from the picklist.
|
|
147
|
+
*
|
|
148
|
+
* Unlike {@link isBinaryModality} this vocabulary is not persisted on a step: capabilities are
|
|
149
|
+
* declared in a deployment's own code, so a build that retires a member also stops emitting it.
|
|
150
|
+
* The guard exists for the ONE seam where that is not true: a MOTHERSHIP-MODE node resolves its
|
|
151
|
+
* integrations from a process that may be a build AHEAD of it, so a capability this build has
|
|
152
|
+
* never heard of can arrive over `/internal/binary-generators` and reach a `Record` lookup or a
|
|
153
|
+
* `switch`. Narrow with this first and describe the negative case as the unknown value it is.
|
|
154
|
+
*/
|
|
155
|
+
export function isBinaryGeneratorCapability(value) {
|
|
156
|
+
return BINARY_CAPABILITY_SET.has(value);
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Where an artifact the step points a generator AT already lives: a reference image, the source
|
|
160
|
+
* of an edit, a mask.
|
|
161
|
+
*
|
|
162
|
+
* The platform deliberately does NOT fetch it. It is named to the agent in the brief, and the
|
|
163
|
+
* agent reads it exactly as it calls the generation API itself, which is the same division of
|
|
164
|
+
* labour the rest of this feature runs on: the platform states, the agent acts, and nothing here
|
|
165
|
+
* touches bytes. `service` names one of the step's own foundational services when the artifact
|
|
166
|
+
* lives in the org's estate rather than at a URL, so a private object store needs no public link.
|
|
167
|
+
*/
|
|
168
|
+
export const binaryAssetRefSchema = v.object({
|
|
169
|
+
/** Where it lives, in `service`'s addressing when one is named, else an absolute URL. */
|
|
170
|
+
location: v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(2048)),
|
|
171
|
+
/**
|
|
172
|
+
* The foundational service the location is addressed in. Absent ⇒ `location` is a URL the
|
|
173
|
+
* agent can fetch directly. Not validated against the step's own selection: a reference can
|
|
174
|
+
* legitimately live in a service the step does not otherwise use, and the brief names whatever
|
|
175
|
+
* is here so a wrong id is visible rather than silently dropped.
|
|
176
|
+
*/
|
|
177
|
+
service: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(64), v.regex(/^[a-z0-9][a-z0-9-]*$/))),
|
|
178
|
+
/** What this is, in the step author's words, folded into the brief verbatim. */
|
|
179
|
+
note: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(500))),
|
|
180
|
+
});
|
|
181
|
+
/**
|
|
182
|
+
* A reference image plus the ROLE it plays, because "here is an image" is not an instruction.
|
|
183
|
+
* The same file means "match this palette", "this is the character" or "start from this and
|
|
184
|
+
* change it" depending on the answer, and every one of the four reference-capable APIs takes a
|
|
185
|
+
* different parameter for each.
|
|
186
|
+
*/
|
|
187
|
+
export const binaryReferenceImageSchema = v.object({
|
|
188
|
+
// Spelled out rather than spread from {@link binaryAssetRefSchema}'s entries. A spread composes
|
|
189
|
+
// the two schemas' inference at every use site, and this shape sits four levels down inside the
|
|
190
|
+
// workspace snapshot (`WorkspaceSnapshot` → pipeline → step options → binary output →
|
|
191
|
+
// generation → here), which is deep enough that the extra level tips `tsc` into "type
|
|
192
|
+
// instantiation is excessively deep" in a consumer several packages away. Three duplicated
|
|
193
|
+
// fields is a cheaper price than a build that fails somewhere with no visible connection to
|
|
194
|
+
// this file; the two are kept in step by the shared doc note above.
|
|
195
|
+
location: v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(2048)),
|
|
196
|
+
service: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(64), v.regex(/^[a-z0-9][a-z0-9-]*$/))),
|
|
197
|
+
note: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(500))),
|
|
198
|
+
role: v.picklist([
|
|
199
|
+
/** Match its look: palette, rendering, line weight. */
|
|
200
|
+
'style',
|
|
201
|
+
/** This is the thing depicted: the character, the product, the prop. */
|
|
202
|
+
'subject',
|
|
203
|
+
/** Match its layout: framing, pose, camera. */
|
|
204
|
+
'composition',
|
|
205
|
+
/** Start FROM this image and change it (image-to-image at low strength). */
|
|
206
|
+
'base',
|
|
207
|
+
]),
|
|
208
|
+
});
|
|
209
|
+
/**
|
|
210
|
+
* The step REVISES existing artifacts rather than making new ones.
|
|
211
|
+
*
|
|
212
|
+
* A named schema rather than an inline object inside the options bag below, for the reason the
|
|
213
|
+
* reference-image shape is spelled out: this nests two more object levels under an already-deep
|
|
214
|
+
* chain, and a named const is where `tsc` can stop re-instantiating it.
|
|
215
|
+
*/
|
|
216
|
+
export const binaryEditRequestSchema = v.object({
|
|
217
|
+
/**
|
|
218
|
+
* `instruction` rewrites a whole artifact from a sentence; `mask` repaints only the region a
|
|
219
|
+
* mask names. Two capabilities, because almost no integration has both.
|
|
220
|
+
*/
|
|
221
|
+
mode: v.picklist(['instruction', 'mask']),
|
|
222
|
+
/** What to change, folded into the brief verbatim. */
|
|
223
|
+
instruction: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(2000))),
|
|
224
|
+
/**
|
|
225
|
+
* The artifact to revise. Absent ⇒ the step's scope services say which existing asset each
|
|
226
|
+
* generation revises, which is the ordinary case for a step that re-renders an inventory.
|
|
227
|
+
*/
|
|
228
|
+
source: v.optional(binaryAssetRefSchema),
|
|
229
|
+
/** The mask, for `mask` mode. Absent in `mask` mode is a gap the brief STATES. */
|
|
230
|
+
mask: v.optional(binaryAssetRefSchema),
|
|
231
|
+
});
|
|
232
|
+
/**
|
|
233
|
+
* The largest pixel extent either axis may carry: a SANITY ceiling on the field, never a claim
|
|
234
|
+
* about what any endpoint supports.
|
|
235
|
+
*
|
|
236
|
+
* Nothing here knows Flux's 4 MP cap or Retro Diffusion's per-style range, and by design nothing
|
|
237
|
+
* will: the platform checks that a step CAN be asked for dimensions (the `exact-size` capability)
|
|
238
|
+
* and states the number to the agent, which is the party holding the vendor's contract when it
|
|
239
|
+
* writes the call. Exported so the read-back that re-checks a reported dimension bounds it against
|
|
240
|
+
* the same number the write boundary does.
|
|
241
|
+
*/
|
|
242
|
+
export const MAX_BINARY_PIXEL_EXTENT = 16384;
|
|
243
|
+
/**
|
|
244
|
+
* Exact output DIMENSIONS in pixels, for the deliverables where the size IS the requirement.
|
|
245
|
+
*
|
|
246
|
+
* A named schema rather than an inline object, for the reason {@link binaryEditRequestSchema} is
|
|
247
|
+
* one: this nests another object level under an already-deep chain and a named const is where
|
|
248
|
+
* `tsc` stops re-instantiating it.
|
|
249
|
+
*
|
|
250
|
+
* Both members are required together: a width with no height describes no deliverable, and half a
|
|
251
|
+
* pair would let a size comparison downstream read one axis as matching.
|
|
252
|
+
*/
|
|
253
|
+
export const binaryOutputSizeSchema = v.object({
|
|
254
|
+
width: v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(MAX_BINARY_PIXEL_EXTENT)),
|
|
255
|
+
height: v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(MAX_BINARY_PIXEL_EXTENT)),
|
|
256
|
+
});
|
|
257
|
+
/**
|
|
258
|
+
* The per-step GENERATION OPTIONS: the parameters a step wants every generation to carry, each
|
|
259
|
+
* gated by the capability that makes it answerable ({@link BINARY_OPTION_CAPABILITIES}).
|
|
260
|
+
*
|
|
261
|
+
* They are a statement about the WORK, exactly like `modalities` and `mediaTypes` beside them,
|
|
262
|
+
* and they are checked the same way: a step asking for something nothing it selected can do is
|
|
263
|
+
* refused at admission rather than discovering it at the end of a paid run. What they are NOT is
|
|
264
|
+
* a passthrough of any vendor's request body. Everything here is a fact about the deliverable
|
|
265
|
+
* that more than one of the registered APIs can express in its own parameters, and the agent
|
|
266
|
+
* translates it on the call it writes; a knob only one vendor has (`prompt_upsampling`,
|
|
267
|
+
* `safety_tolerance`, a sampler name) stays in that integration's `guidance`, where it can say
|
|
268
|
+
* what it means, rather than becoming a field every other integration ignores.
|
|
269
|
+
*/
|
|
270
|
+
/**
|
|
271
|
+
* The raw object schema. Exported ONLY so the drift guard in `binary-capabilities.test.ts` can
|
|
272
|
+
* infer its output type and compare it against the hand-written {@link BinaryGenerationOptions};
|
|
273
|
+
* every other consumer takes {@link binaryGenerationOptionsSchema}, whose whole purpose is to
|
|
274
|
+
* stop that inference from happening at each use site. See the interface's note for why.
|
|
275
|
+
*/
|
|
276
|
+
export const binaryGenerationOptionsObject = v.object({
|
|
277
|
+
/**
|
|
278
|
+
* Images every generation is conditioned on. Needs `reference-image`; more than one also needs
|
|
279
|
+
* `multi-reference`, since an API that takes a single input image cannot compose two.
|
|
280
|
+
*/
|
|
281
|
+
referenceImages: v.optional(v.pipe(v.array(binaryReferenceImageSchema), v.maxLength(8))),
|
|
282
|
+
/**
|
|
283
|
+
* The step REVISES existing artifacts rather than making new ones. Needs `instruction-edit` or
|
|
284
|
+
* `mask-edit` depending on `mode`.
|
|
285
|
+
*/
|
|
286
|
+
edit: v.optional(binaryEditRequestSchema),
|
|
287
|
+
/** What to keep out. Needs `negative-prompt`. */
|
|
288
|
+
negativePrompt: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(2000))),
|
|
289
|
+
/**
|
|
290
|
+
* A fixed seed, so the run is reproducible. Needs `seed`.
|
|
291
|
+
*
|
|
292
|
+
* A step comparing candidates deliberately does NOT get its seed varied for it: a fixed seed
|
|
293
|
+
* across integrations is how two renders of one subject are told apart by the integration
|
|
294
|
+
* rather than by luck, and the brief says so.
|
|
295
|
+
*/
|
|
296
|
+
seed: v.optional(v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(4294967295))),
|
|
297
|
+
/** `16:9`, `1:1`, `3:2`. Needs `aspect-ratio`. */
|
|
298
|
+
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'))),
|
|
299
|
+
/**
|
|
300
|
+
* Exact pixel dimensions every artifact must be delivered at. Needs `exact-size`.
|
|
301
|
+
*
|
|
302
|
+
* Mutually exclusive with `aspectRatio` and `upscale`, refused structurally at pipeline save
|
|
303
|
+
* (`assertUnambiguousOutputSize`): each of those states the final dimensions in a second,
|
|
304
|
+
* possibly disagreeing way, and the party who would reconcile them is the agent writing the
|
|
305
|
+
* call — the one with the least basis for deciding, which is the same argument that keeps
|
|
306
|
+
* `mediaTypes` from meaning "any of these".
|
|
307
|
+
*/
|
|
308
|
+
outputSize: v.optional(binaryOutputSizeSchema),
|
|
309
|
+
/** Render at this multiple of the integration's native size. Needs `upscale`. */
|
|
310
|
+
upscale: v.optional(v.pipe(v.number(), v.integer(), v.minValue(2), v.maxValue(8))),
|
|
311
|
+
/** Deliver an alpha channel rather than a background. Needs `transparent-background`. */
|
|
312
|
+
transparentBackground: v.optional(v.literal(true)),
|
|
313
|
+
/** Deliver a seamlessly tiling image. Needs `tileable`. */
|
|
314
|
+
tileable: v.optional(v.literal(true)),
|
|
315
|
+
});
|
|
316
|
+
/**
|
|
317
|
+
* The generation options as a SCHEMA, typed against the interface above so consumers stop
|
|
318
|
+
* re-inferring it. `unknown` on the input side is what a parser accepts anyway, and nothing in
|
|
319
|
+
* this repo reads `InferInput` of a step's options.
|
|
320
|
+
*/
|
|
321
|
+
export const binaryGenerationOptionsSchema = binaryGenerationOptionsObject;
|
|
322
|
+
/**
|
|
323
|
+
* Which option needs which capability, as the ONE table both sides read.
|
|
324
|
+
*
|
|
325
|
+
* A `Record` over the option keys rather than a chain of `if`s at each reader, so an option added
|
|
326
|
+
* to the schema without a capability fails the typecheck here instead of shipping as a control
|
|
327
|
+
* nothing checks. `referenceImages` maps to a LIST because its requirement grows with its length,
|
|
328
|
+
* and `edit` maps to one of two by its mode, which is why the derivation below is a function and
|
|
329
|
+
* not a lookup.
|
|
330
|
+
*/
|
|
331
|
+
export const BINARY_OPTION_CAPABILITIES = {
|
|
332
|
+
referenceImages: ['reference-image', 'multi-reference'],
|
|
333
|
+
edit: ['instruction-edit', 'mask-edit'],
|
|
334
|
+
negativePrompt: ['negative-prompt'],
|
|
335
|
+
seed: ['seed'],
|
|
336
|
+
aspectRatio: ['aspect-ratio'],
|
|
337
|
+
outputSize: ['exact-size'],
|
|
338
|
+
upscale: ['upscale'],
|
|
339
|
+
transparentBackground: ['transparent-background'],
|
|
340
|
+
tileable: ['tileable'],
|
|
341
|
+
};
|
|
342
|
+
/**
|
|
343
|
+
* The capabilities a step's generation options actually REQUIRE, in a stable order.
|
|
344
|
+
*
|
|
345
|
+
* Derived rather than declared, so a step never carries a requirement it does not exercise: a
|
|
346
|
+
* `referenceImages` list of one needs `reference-image` and NOT `multi-reference`, and an `edit`
|
|
347
|
+
* needs exactly the one capability its mode names. Deriving it is also what keeps the refusal
|
|
348
|
+
* honest in the other direction, since a requirement nobody stated cannot be silently dropped by
|
|
349
|
+
* an integration that does not declare it.
|
|
350
|
+
*
|
|
351
|
+
* Deliberately NOT extended with `candidate-batch` for a comparison step: an integration without
|
|
352
|
+
* it can still produce several candidates by repeating the call, so a refusal there would reject
|
|
353
|
+
* a selection that works. The brief states which of the two the agent should do.
|
|
354
|
+
*/
|
|
355
|
+
export function requiredBinaryCapabilities(options) {
|
|
356
|
+
if (!options)
|
|
357
|
+
return [];
|
|
358
|
+
const required = [];
|
|
359
|
+
const references = options.referenceImages ?? [];
|
|
360
|
+
if (references.length > 0)
|
|
361
|
+
required.push('reference-image');
|
|
362
|
+
if (references.length > 1)
|
|
363
|
+
required.push('multi-reference');
|
|
364
|
+
if (options.edit) {
|
|
365
|
+
required.push(options.edit.mode === 'mask' ? 'mask-edit' : 'instruction-edit');
|
|
366
|
+
}
|
|
367
|
+
if (options.negativePrompt)
|
|
368
|
+
required.push('negative-prompt');
|
|
369
|
+
if (options.seed !== undefined)
|
|
370
|
+
required.push('seed');
|
|
371
|
+
if (options.aspectRatio)
|
|
372
|
+
required.push('aspect-ratio');
|
|
373
|
+
if (options.outputSize)
|
|
374
|
+
required.push('exact-size');
|
|
375
|
+
if (options.upscale !== undefined)
|
|
376
|
+
required.push('upscale');
|
|
377
|
+
if (options.transparentBackground)
|
|
378
|
+
required.push('transparent-background');
|
|
379
|
+
if (options.tileable)
|
|
380
|
+
required.push('tileable');
|
|
381
|
+
return required;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* The options that restate the delivered dimensions beside an exact {@link BinaryOutputSize}, in a
|
|
385
|
+
* stable order. Empty when the step asks for no exact size, which stays the ordinary case.
|
|
386
|
+
*
|
|
387
|
+
* `aspectRatio` states the shape the size already fixes, and `upscale` states a multiple of
|
|
388
|
+
* whatever the integration renders natively, so either one held beside a size leaves the
|
|
389
|
+
* deliverable's actual dimensions undetermined at exactly the point the step went to the trouble of
|
|
390
|
+
* determining them. The platform refuses that rather than resolving it by precedence: the party a
|
|
391
|
+
* precedence rule hands the leftover decision to is the AGENT writing the vendor call, which reads
|
|
392
|
+
* "96x96" and "16:9" in one brief and picks. Two contradicting statements of one fact is a
|
|
393
|
+
* mis-configured step and the fix (delete one) is unambiguous, which is what makes refusing it the
|
|
394
|
+
* cheap option.
|
|
395
|
+
*
|
|
396
|
+
* Shared rather than restated on each side, like {@link binaryFormatCoverage} one axis over: the
|
|
397
|
+
* backend REFUSES the save with it and the SPA has to state the same refusal in the builder, where
|
|
398
|
+
* it is fixable without a round trip. A rule with a home on only one side becomes a hand-kept copy
|
|
399
|
+
* on the other, and the two then disagree about which selection is legal.
|
|
400
|
+
*/
|
|
401
|
+
export function conflictingOutputSizeOptions(options) {
|
|
402
|
+
if (!options?.outputSize)
|
|
403
|
+
return [];
|
|
404
|
+
const conflicts = [];
|
|
405
|
+
if (options.aspectRatio)
|
|
406
|
+
conflicts.push('aspectRatio');
|
|
407
|
+
if (options.upscale !== undefined)
|
|
408
|
+
conflicts.push('upscale');
|
|
409
|
+
return conflicts;
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Judge `required` against what `selected` declares it can do.
|
|
413
|
+
*
|
|
414
|
+
* The same THREE outcomes as {@link binaryFormatCoverage}, and deliberately the same rule, because
|
|
415
|
+
* the two axes are in the same position: a declaration that pins nothing down is an explicit
|
|
416
|
+
* documented state ("only the coarse facts are known") rather than a denial. That reading is what
|
|
417
|
+
* lets this ship without breaking a single integration registered before capabilities existed:
|
|
418
|
+
* they declare none, so every requirement against them is UNVERIFIABLE, the run is admitted, and
|
|
419
|
+
* the gap is stated to the agent in its brief and to the composer in the picker. Refusing there
|
|
420
|
+
* would retroactively invalidate every registration in existence; calling it covered would be a
|
|
421
|
+
* clean bill of health nobody issued on the surface that decides whether the run may start.
|
|
422
|
+
*
|
|
423
|
+
* Kept as its own function rather than a generic over the format one: they read different fields
|
|
424
|
+
* of different shapes, and a shared generic would be a parameterised `some`/`has` that saves four
|
|
425
|
+
* lines and hides which axis a caller is asking about.
|
|
426
|
+
*/
|
|
427
|
+
export function binaryCapabilityCoverage(required, selected) {
|
|
428
|
+
const declared = new Set(selected.flatMap((generator) => generator.capabilities ?? []));
|
|
429
|
+
// An EMPTY selection declares nothing and hides nothing: with no integration to be silent, a
|
|
430
|
+
// capability requirement is uncovered outright, exactly as a format requirement already is.
|
|
431
|
+
const undeclared = selected.some((generator) => (generator.capabilities ?? []).length === 0);
|
|
432
|
+
const uncovered = [];
|
|
433
|
+
const unverifiable = [];
|
|
434
|
+
for (const capability of required) {
|
|
435
|
+
if (declared.has(capability))
|
|
436
|
+
continue;
|
|
437
|
+
if (undeclared)
|
|
438
|
+
unverifiable.push(capability);
|
|
439
|
+
else
|
|
440
|
+
uncovered.push(capability);
|
|
441
|
+
}
|
|
442
|
+
return { uncovered, unverifiable };
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* The integrations that declare each required capability, so a surface can say WHICH of a
|
|
446
|
+
* step's selection will actually honour an option rather than only that something will.
|
|
447
|
+
*
|
|
448
|
+
* The question a person asks the moment a step holds two producers of one modality and one
|
|
449
|
+
* option: an aspect ratio honoured by one of them and ignored by the other is not a covered
|
|
450
|
+
* requirement in any useful sense, and coverage alone cannot say so. Ids come out in selection
|
|
451
|
+
* order and a capability with no declarer is absent, never an empty list, so "nobody" and "not
|
|
452
|
+
* asked" stay different answers.
|
|
453
|
+
*/
|
|
454
|
+
export function binaryCapabilityProviders(required, selected) {
|
|
455
|
+
const out = [];
|
|
456
|
+
for (const capability of required) {
|
|
457
|
+
const generatorIds = selected
|
|
458
|
+
.filter((generator) => (generator.capabilities ?? []).includes(capability))
|
|
459
|
+
.map((generator) => generator.id);
|
|
460
|
+
if (generatorIds.length > 0)
|
|
461
|
+
out.push({ capability, generatorIds });
|
|
462
|
+
}
|
|
463
|
+
return out;
|
|
464
|
+
}
|
|
465
|
+
//# 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;AACjG,8FAA8F;AAC9F,6FAA6F;AAC7F,yBAAyB;AACzB,EAAE;AACF,gGAAgG;AAChG,gGAAgG;AAChG,4FAA4F;AAC5F,gGAAgG;AAChG,+FAA+F;AAC/F,oEAAoE;AACpE,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,QAAQ,CAAC;IACxD;;;OAGG;IACH,iBAAiB;IACjB;;;;;OAKG;IACH,iBAAiB;IACjB;;;OAGG;IACH,kBAAkB;IAClB;;;;;OAKG;IACH,WAAW;IACX,yF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QAAQ,EAAE,CAAC;QAClC,IAAI,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC;YAAE,SAAQ;QACtC,IAAI,UAAU;YAAE,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;;YACxC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IACjC,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA;AACpC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,yBAAyB,CACvC,QAA8C,EAC9C,QAAwF;IAExF,MAAM,GAAG,GAAwE,EAAE,CAAA;IACnF,KAAK,MAAM,UAAU,IAAI,QAAQ,EAAE,CAAC;QAClC,MAAM,YAAY,GAAG,QAAQ;aAC1B,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;aAC1E,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QACnC,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC;YAAE,GAAG,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC,CAAA;IACrE,CAAC;IACD,OAAO,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", "exact-size", "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", "exact-size", "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;
|
|
1
|
+
{"version":3,"file":"binary-generators.d.ts","sourceRoot":"","sources":["../src/binary-generators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAuC5B;;;;;;;;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;;;;;;;;;;;;;;OAcG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;;QAxHH;;;;;;;;;;;;;WAaG;;QAYH;;;;;;;;;WASG;;QAcH;;;;WAIG;;QAEH;;;;;WAKG;;;IAgEH;;;;OAIG;;;;;;;aAEH,CAAA;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,+BAA+B,CAAC,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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,CAAC,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"}
|
|
@@ -46,6 +46,24 @@ export type BinaryModality = v.InferOutput<typeof binaryModalitySchema>;
|
|
|
46
46
|
* that the split exists to make someone restate.
|
|
47
47
|
*/
|
|
48
48
|
export declare function isBinaryModality(value: string): value is BinaryModality;
|
|
49
|
+
/**
|
|
50
|
+
* Whether artifacts of this content type are MEASURED in pixels, so an exact
|
|
51
|
+
* `generation.outputSize` is a statement about them at all.
|
|
52
|
+
*
|
|
53
|
+
* An exhaustive `Record` rather than a set membership test, so a new member of the vocabulary
|
|
54
|
+
* fails the build until someone decides which side of this it falls on. The answers are facts
|
|
55
|
+
* about the media, not preferences: an image and a video frame have a width and a height, while
|
|
56
|
+
* audio has a duration, a 3D asset has model units a renderer scales, and a document has a page
|
|
57
|
+
* size in millimetres. None of the last three becomes measurable by asking harder.
|
|
58
|
+
*
|
|
59
|
+
* It exists because a size requirement on a MIXED step is not a requirement on every artifact.
|
|
60
|
+
* A step selecting an image generator and an audio generator states one size, means it about the
|
|
61
|
+
* images, and a reader that judged the audio against it would report a permanent failure about a
|
|
62
|
+
* step that delivered exactly what was asked. Shared rather than restated in the SPA for the
|
|
63
|
+
* standing reason: the surface that COUNTS a size failure and the layer that states the
|
|
64
|
+
* requirement must not be able to disagree about which artifacts it covers.
|
|
65
|
+
*/
|
|
66
|
+
export declare function modalityCarriesPixelDimensions(modality: BinaryModality): boolean;
|
|
49
67
|
/** A content type that more than one of a step's selected integrations produces. */
|
|
50
68
|
export interface BinaryModalityOverlap {
|
|
51
69
|
/** The content type they share. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binary-modalities.d.ts","sourceRoot":"","sources":["../src/binary-modalities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAoB5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,oBAAoB,8FAqB/B,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEvE;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,cAAc,CAEvE;AAID,oFAAoF;AACpF,MAAM,WAAW,qBAAqB;IACpC,mCAAmC;IACnC,QAAQ,EAAE,cAAc,CAAA;IACxB,iFAAiF;IACjF,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;CAChC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,SAAS,cAAc,EAAE,CAAA;CAAE,EAAE,GAC3E,qBAAqB,EAAE,CAiBzB;AAED,gGAAgG;AAChG,MAAM,WAAW,oBAAoB;IACnC;wCACoC;IACpC,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB;kGAC8F;IAC9F,YAAY,EAAE,MAAM,EAAE,CAAA;CACvB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,QAAQ,EAAE,SAAS;IAAE,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,EAAE,GACtD,oBAAoB,CAatB;AAKD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB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