@pixerate/editor 0.134.0 → 0.136.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/animation-editor/index.cjs +58 -55
- package/dist/animation-editor/index.cjs.map +1 -1
- package/dist/animation-editor/index.d.cts +8 -5
- package/dist/animation-editor/index.d.ts +8 -5
- package/dist/animation-editor/index.js +5 -2
- package/dist/animation-editor/index.js.map +1 -1
- package/dist/{bezier-J8i4uqSH.d.cts → bezier-CdccFsF8.d.cts} +1 -1
- package/dist/{bezier-lNEOp0Jx.d.ts → bezier-DG9qNZQV.d.ts} +1 -1
- package/dist/canvas/index.d.cts +10 -7
- package/dist/canvas/index.d.ts +10 -7
- package/dist/{chunk-Z2H7KECK.cjs → chunk-2R3UW57U.cjs} +13 -2
- package/dist/chunk-2R3UW57U.cjs.map +1 -0
- package/dist/{chunk-ESIWZMMK.js → chunk-6QQR4LKE.js} +2 -2
- package/dist/chunk-A3BVTI3G.js +150 -0
- package/dist/chunk-A3BVTI3G.js.map +1 -0
- package/dist/{chunk-T6TV6HY6.cjs → chunk-B2CUCM7Y.cjs} +36 -36
- package/dist/{chunk-T6TV6HY6.cjs.map → chunk-B2CUCM7Y.cjs.map} +1 -1
- package/dist/chunk-ECCXGELC.cjs +727 -0
- package/dist/chunk-ECCXGELC.cjs.map +1 -0
- package/dist/{chunk-OXSV64JX.js → chunk-G6IKY6PL.js} +4 -4
- package/dist/chunk-I52DRGGJ.js +727 -0
- package/dist/chunk-I52DRGGJ.js.map +1 -0
- package/dist/{chunk-6CTZAGZ2.js → chunk-ILYFOJUN.js} +56 -1
- package/dist/chunk-ILYFOJUN.js.map +1 -0
- package/dist/{chunk-YAFS2QFZ.cjs → chunk-JLGNZMUV.cjs} +82 -82
- package/dist/{chunk-YAFS2QFZ.cjs.map → chunk-JLGNZMUV.cjs.map} +1 -1
- package/dist/{chunk-7RJ6P7MI.js → chunk-KZXLZCQ7.js} +2 -2
- package/dist/{chunk-HHTCDFZC.js → chunk-MAHQC3SK.js} +13 -2
- package/dist/chunk-MAHQC3SK.js.map +1 -0
- package/dist/{chunk-FWEO3HSL.js → chunk-PQQF5KOW.js} +8 -8
- package/dist/chunk-Q6OUXEK3.cjs +150 -0
- package/dist/chunk-Q6OUXEK3.cjs.map +1 -0
- package/dist/{chunk-P3RQ5UJE.cjs → chunk-UTQKC66X.cjs} +4 -4
- package/dist/{chunk-P3RQ5UJE.cjs.map → chunk-UTQKC66X.cjs.map} +1 -1
- package/dist/{chunk-J3B45HTA.cjs → chunk-XB25WOC2.cjs} +6 -6
- package/dist/{chunk-J3B45HTA.cjs.map → chunk-XB25WOC2.cjs.map} +1 -1
- package/dist/{chunk-NVTHUPJ6.cjs → chunk-YT3JL7YM.cjs} +71 -16
- package/dist/chunk-YT3JL7YM.cjs.map +1 -0
- package/dist/effects/index.d.cts +7 -4
- package/dist/effects/index.d.ts +7 -4
- package/dist/{export-BGdT02aL.d.cts → export-BOheWw2R.d.cts} +13 -5
- package/dist/{export-Dng22YB8.d.ts → export-ByKKIA2S.d.ts} +13 -5
- package/dist/{export-KzubBKo7.d.cts → export-CEYeRQXH.d.cts} +1 -1
- package/dist/{export-DMeG6E06.d.ts → export-Ds7zgGD8.d.ts} +1 -1
- package/dist/extensions/index.cjs +3 -3
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.js +2 -2
- package/dist/generation/index.cjs +150 -945
- package/dist/generation/index.cjs.map +1 -1
- package/dist/generation/index.d.cts +3 -423
- package/dist/generation/index.d.ts +3 -423
- package/dist/generation/index.js +59 -854
- package/dist/generation/index.js.map +1 -1
- package/dist/grammar/index.cjs +3 -3
- package/dist/grammar/index.cjs.map +1 -1
- package/dist/grammar/index.js +2 -2
- package/dist/{helpers-Coa4e2j_.d.ts → helpers--ns3W2D7.d.ts} +7 -1
- package/dist/{helpers-DHl28yLO.d.cts → helpers-BVkU4oUi.d.cts} +7 -1
- package/dist/image-editor/index.cjs +742 -647
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +29 -11
- package/dist/image-editor/index.d.ts +29 -11
- package/dist/image-editor/index.js +107 -12
- package/dist/image-editor/index.js.map +1 -1
- package/dist/index.cjs +28 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +36 -36
- package/dist/{opentype-Dfcx6wFx.d.ts → opentype-DfoVYgmG.d.ts} +1 -1
- package/dist/{opentype-BWR7Qv8W.d.cts → opentype-yi-Kz4ND.d.cts} +1 -1
- package/dist/paint/index.cjs +10 -2
- package/dist/paint/index.cjs.map +1 -1
- package/dist/paint/index.d.cts +2 -2
- package/dist/paint/index.d.ts +2 -2
- package/dist/paint/index.js +9 -1
- package/dist/paint-editor/index.cjs +10 -7
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +10 -7
- package/dist/paint-editor/index.d.ts +10 -7
- package/dist/paint-editor/index.js +5 -2
- package/dist/paint-editor/index.js.map +1 -1
- package/dist/{pathfinder-D8KQ6blQ.d.cts → pathfinder-7JkMwYvC.d.cts} +1 -1
- package/dist/{pathfinder-Celbi3e6.d.ts → pathfinder-GM3UWdBZ.d.ts} +1 -1
- package/dist/{pool-BfuxBKTd.d.cts → pool-04qp8iW4.d.cts} +1 -1
- package/dist/{pool-8JZGWHvR.d.ts → pool-CkTxlLMC.d.ts} +1 -1
- package/dist/provenance-DmlcgdzT.d.cts +426 -0
- package/dist/provenance-uh5r2TQ8.d.ts +426 -0
- package/dist/{rand-BaqEOs1Y.d.ts → rand-BszBST4s.d.ts} +31 -1
- package/dist/{rand-DdpFzCo6.d.cts → rand-DOH_aMvm.d.cts} +31 -1
- package/dist/{svg-pwXWq6s2.d.cts → svg-BDDKvWWY.d.cts} +2 -2
- package/dist/{svg-CxxqG3_W.d.ts → svg-rV6_HPmn.d.ts} +2 -2
- package/dist/{tools-3EBjR91b.d.cts → tools-BAjSbTdY.d.cts} +1 -1
- package/dist/{tools-y1M6O3UT.d.ts → tools-DPYerqeR.d.ts} +1 -1
- package/dist/vector/index.cjs +2684 -1860
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +313 -71
- package/dist/vector/index.d.ts +313 -71
- package/dist/vector/index.js +4700 -3876
- package/dist/vector/index.js.map +1 -1
- package/dist/video-editor/index.d.cts +7 -4
- package/dist/video-editor/index.d.ts +7 -4
- package/dist/{warp-Ceqdz7kj.d.cts → warp-DQh9R7Ie.d.cts} +1 -1
- package/dist/{warp-C1gwu2G_.d.ts → warp-XVL6SpSh.d.ts} +1 -1
- package/package.json +1 -1
- package/skills/pixerate-image-editor/SKILL.md +4 -4
- package/skills/pixerate-vector/SKILL.md +20 -1
- package/dist/chunk-6CTZAGZ2.js.map +0 -1
- package/dist/chunk-HHTCDFZC.js.map +0 -1
- package/dist/chunk-NVTHUPJ6.cjs.map +0 -1
- package/dist/chunk-Z2H7KECK.cjs.map +0 -1
- /package/dist/{chunk-ESIWZMMK.js.map → chunk-6QQR4LKE.js.map} +0 -0
- /package/dist/{chunk-OXSV64JX.js.map → chunk-G6IKY6PL.js.map} +0 -0
- /package/dist/{chunk-7RJ6P7MI.js.map → chunk-KZXLZCQ7.js.map} +0 -0
- /package/dist/{chunk-FWEO3HSL.js.map → chunk-PQQF5KOW.js.map} +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { M as ModelCapabilities, a as GenerationPlan, b as GenerationRequest, P as PlanStrategy, R as ReferenceRole, c as PlanAssetMention, C as CreateProvenanceOptions, G as GenerationProvenance, d as GenerationReference } from '../provenance-DmlcgdzT.cjs';
|
|
2
|
+
export { B as BooleanParamSpec, e as BuiltinReferenceRole, f as CapabilityOverlay, g as CapabilityPresentation, h as CountCapability, D as DurationCapability, E as EnumCapability, i as EnumParamSpec, j as ExtraParamSpec, k as GENERATION_REQUEST_FIELDS, l as GenerationMediaKind, m as GenerationMode, n as GenerationParamValue, N as NumberParamSpec, o as PROVENANCE_FORMAT, p as PROVENANCE_VERSION, q as PinnedTemplate, r as PlanAdjustment, s as PlanAdjustmentKind, t as PlanError, u as PlanOptions, v as PromptCapability, w as ProvenanceParseError, Q as QUALITY_LADDER, x as REFERENCE_ROLES, y as REFERENCE_ROLE_ALIASES, z as REFERENCE_ROLE_LABELS, A as REFERENCE_ROLE_NAME_REGEX, F as ReferenceCapability, H as ReferenceRoleCapability, S as SeedCapability, T as TextFieldCapability, I as TimingCapability, J as aspectRatioRank, K as createProvenance, L as isReferenceRoleName, O as mediaTypeMatches, U as mergeCapabilities, V as normalizeReferenceRole, W as parseProvenance, X as pinnedTemplatesToTemplates, Y as planGenerationRequest, Z as qualityRank, _ as referenceRoleLabel, $ as replayProvenancePrompt, a0 as resolutionMegapixels, a1 as resolutionRank, a2 as seedCapability, a3 as serializeProvenance, a4 as snapToOption, a5 as supportedModes, a6 as supportedReferenceRoles, a7 as textFieldCapability } from '../provenance-DmlcgdzT.cjs';
|
|
1
3
|
import { J as JsonSchema } from '../schema-Di0CS6Pe.cjs';
|
|
2
4
|
export { S as SchemaValidationError, v as validateJsonSchema } from '../schema-Di0CS6Pe.cjs';
|
|
3
5
|
import { a as AgentToolProvider } from '../registry-BqA1AZt0.cjs';
|
|
@@ -7,341 +9,6 @@ import { S as StorageAdapter } from '../storage-BpFfspHm.cjs';
|
|
|
7
9
|
import { S as SourceMapSegment } from '../sourcemap-C8AH3MBQ.cjs';
|
|
8
10
|
export { a as MentionRoleSyntax, T as TextMention, f as findTextMentions, b as formatMentionText, s as setMentionRoleInText } from '../mention-text-CDnCFd3c.cjs';
|
|
9
11
|
|
|
10
|
-
/**
|
|
11
|
-
* Declarative descriptions of generative models (what a model accepts) and of
|
|
12
|
-
* the requests sent to them. Everything here is plain data so capabilities can
|
|
13
|
-
* come from a server, be merged with local presentation overlays, and be
|
|
14
|
-
* turned into JSON Schema for agents.
|
|
15
|
-
*/
|
|
16
|
-
type GenerationMediaKind = 'image' | 'video' | 'audio' | 'text';
|
|
17
|
-
/** The reference roles this library knows by name (labels, aliases, schema order). */
|
|
18
|
-
type BuiltinReferenceRole = 'start_frame' | 'end_frame' | 'style_ref' | 'character_ref' | 'background_ref' | 'mask' | 'image_ref' | 'video_ref' | 'audio_ref';
|
|
19
|
-
/**
|
|
20
|
-
* What a reference input (an asset) is used for. The built-in roles are
|
|
21
|
-
* listed in {@link REFERENCE_ROLES}; models may declare any other role name
|
|
22
|
-
* (e.g. `subject`, `pose`) in `references.roles`, which makes it valid for
|
|
23
|
-
* that model. Role names match {@link REFERENCE_ROLE_NAME_REGEX}.
|
|
24
|
-
*/
|
|
25
|
-
type ReferenceRole = BuiltinReferenceRole | (string & {});
|
|
26
|
-
/** Valid role names: a letter, then letters, digits, `_` or `-`, not ending in `_` or `-`. */
|
|
27
|
-
declare const REFERENCE_ROLE_NAME_REGEX: RegExp;
|
|
28
|
-
/** True for a string usable as a role name. */
|
|
29
|
-
declare function isReferenceRoleName(value: unknown): value is ReferenceRole;
|
|
30
|
-
/** Every built-in reference role, in a stable display order. */
|
|
31
|
-
declare const REFERENCE_ROLES: readonly BuiltinReferenceRole[];
|
|
32
|
-
/** Human-readable default labels for reference roles. */
|
|
33
|
-
declare const REFERENCE_ROLE_LABELS: Readonly<Record<BuiltinReferenceRole, string>>;
|
|
34
|
-
/**
|
|
35
|
-
* Friendly role names accepted wherever a role is written by hand (asset
|
|
36
|
-
* mentions such as `@fox:style`, agent calls). A model that declares the
|
|
37
|
-
* alias itself (e.g. its own `style` role) keeps it; otherwise the alias maps
|
|
38
|
-
* to the built-in role. Keys are lower case.
|
|
39
|
-
*/
|
|
40
|
-
declare const REFERENCE_ROLE_ALIASES: Readonly<Record<string, BuiltinReferenceRole>>;
|
|
41
|
-
/** Display label of a role: the model's label, the built-in label, or the name made readable. */
|
|
42
|
-
declare function referenceRoleLabel(role: ReferenceRole, caps?: ModelCapabilities): string;
|
|
43
|
-
/**
|
|
44
|
-
* Canonical role for a hand-written name: the name itself when the model
|
|
45
|
-
* declares it (or, without a model, when it is built in), else its alias
|
|
46
|
-
* ({@link REFERENCE_ROLE_ALIASES}, case-insensitive), else the trimmed name.
|
|
47
|
-
*/
|
|
48
|
-
declare function normalizeReferenceRole(role: string, caps?: ModelCapabilities): ReferenceRole;
|
|
49
|
-
/**
|
|
50
|
-
* Whether `mediaType` (a MIME type such as `image/png`, or a media kind such
|
|
51
|
-
* as `image`) matches one of `accepts` (`image`, `image/*`, `image/png`).
|
|
52
|
-
* An empty or missing `accepts` accepts everything; an unknown media type
|
|
53
|
-
* only matches a missing `accepts`.
|
|
54
|
-
*/
|
|
55
|
-
declare function mediaTypeMatches(mediaType: string | undefined, accepts: readonly string[] | undefined): boolean;
|
|
56
|
-
/** A choice from a fixed list. `options` order matters (low → high where it applies). */
|
|
57
|
-
interface EnumCapability<T extends string | number = string> {
|
|
58
|
-
options: readonly T[];
|
|
59
|
-
default?: T;
|
|
60
|
-
/** Display labels by option value. */
|
|
61
|
-
labels?: Readonly<Record<string, string>>;
|
|
62
|
-
}
|
|
63
|
-
interface TextFieldCapability {
|
|
64
|
-
maxLength?: number;
|
|
65
|
-
}
|
|
66
|
-
interface PromptCapability extends TextFieldCapability {
|
|
67
|
-
/**
|
|
68
|
-
* Count the resolved prompt (templates expanded, variables substituted)
|
|
69
|
-
* against `maxLength` rather than the raw template text. Default `true`.
|
|
70
|
-
* Pass the resolved text to the planner as `resolvedPrompt`.
|
|
71
|
-
*/
|
|
72
|
-
countResolved?: boolean;
|
|
73
|
-
/** The prompt must be non-empty. */
|
|
74
|
-
required?: boolean;
|
|
75
|
-
}
|
|
76
|
-
interface CountCapability {
|
|
77
|
-
/** Largest number of outputs per request. */
|
|
78
|
-
max: number;
|
|
79
|
-
/** Predefined choices; when given, requests snap to one of them. */
|
|
80
|
-
options?: readonly number[];
|
|
81
|
-
default?: number;
|
|
82
|
-
}
|
|
83
|
-
interface DurationCapability {
|
|
84
|
-
/** Seconds. */
|
|
85
|
-
min?: number;
|
|
86
|
-
max?: number;
|
|
87
|
-
/** Predefined choices; when given, requests snap to one of them. */
|
|
88
|
-
options?: readonly number[];
|
|
89
|
-
default?: number;
|
|
90
|
-
step?: number;
|
|
91
|
-
}
|
|
92
|
-
interface SeedCapability {
|
|
93
|
-
min?: number;
|
|
94
|
-
max?: number;
|
|
95
|
-
}
|
|
96
|
-
interface ReferenceRoleCapability {
|
|
97
|
-
/** Most references of this role. */
|
|
98
|
-
max: number;
|
|
99
|
-
/** Fewest references of this role (e.g. an image-to-video model needs a `start_frame`). */
|
|
100
|
-
min?: number;
|
|
101
|
-
label?: string;
|
|
102
|
-
description?: string;
|
|
103
|
-
/**
|
|
104
|
-
* Media accepted for this role: kinds (`image`), wildcards (`image/*`) or
|
|
105
|
-
* MIME types (`image/png`). Absent: anything. References whose
|
|
106
|
-
* `mediaType` does not match are dropped or rejected by the planner.
|
|
107
|
-
*/
|
|
108
|
-
accepts?: readonly string[];
|
|
109
|
-
}
|
|
110
|
-
interface ReferenceCapability {
|
|
111
|
-
/** Supported roles and their per-role limits. Roles not listed are unsupported. */
|
|
112
|
-
roles: Partial<Readonly<Record<ReferenceRole, ReferenceRoleCapability>>>;
|
|
113
|
-
/** Most references across all roles. */
|
|
114
|
-
maxTotal?: number;
|
|
115
|
-
}
|
|
116
|
-
interface NumberParamSpec {
|
|
117
|
-
type: 'number' | 'integer';
|
|
118
|
-
min?: number;
|
|
119
|
-
max?: number;
|
|
120
|
-
step?: number;
|
|
121
|
-
default?: number;
|
|
122
|
-
label?: string;
|
|
123
|
-
description?: string;
|
|
124
|
-
}
|
|
125
|
-
interface EnumParamSpec {
|
|
126
|
-
type: 'enum';
|
|
127
|
-
options: readonly (string | number)[];
|
|
128
|
-
default?: string | number;
|
|
129
|
-
label?: string;
|
|
130
|
-
description?: string;
|
|
131
|
-
}
|
|
132
|
-
interface BooleanParamSpec {
|
|
133
|
-
type: 'boolean';
|
|
134
|
-
default?: boolean;
|
|
135
|
-
label?: string;
|
|
136
|
-
description?: string;
|
|
137
|
-
}
|
|
138
|
-
/** A model-specific parameter (`guidance`, `motion_strength`, `style`, …). */
|
|
139
|
-
type ExtraParamSpec = NumberParamSpec | EnumParamSpec | BooleanParamSpec;
|
|
140
|
-
/** Rough timing used for progress estimates (`expectedDurationFor`). */
|
|
141
|
-
interface TimingCapability {
|
|
142
|
-
/** Fixed cost of one request in ms. */
|
|
143
|
-
baseMs: number;
|
|
144
|
-
/** Extra ms per output beyond the first. */
|
|
145
|
-
perItemMs?: number;
|
|
146
|
-
/** Extra ms per second of requested duration (video/audio). */
|
|
147
|
-
perSecondMs?: number;
|
|
148
|
-
/** Extra ms per megapixel of the requested resolution. */
|
|
149
|
-
perMegapixelMs?: number;
|
|
150
|
-
}
|
|
151
|
-
/** Presentation-only fields; overlays may set these (see `mergeCapabilities`). */
|
|
152
|
-
interface CapabilityPresentation {
|
|
153
|
-
name?: string;
|
|
154
|
-
description?: string;
|
|
155
|
-
badges?: readonly string[];
|
|
156
|
-
icon?: string;
|
|
157
|
-
group?: string;
|
|
158
|
-
}
|
|
159
|
-
/** Everything a generative model accepts. Absent sections mean "unsupported". */
|
|
160
|
-
interface ModelCapabilities extends CapabilityPresentation {
|
|
161
|
-
id: string;
|
|
162
|
-
media: GenerationMediaKind;
|
|
163
|
-
prompt?: PromptCapability;
|
|
164
|
-
/** Negative prompt support (`true` or limits). */
|
|
165
|
-
negativePrompt?: boolean | TextFieldCapability;
|
|
166
|
-
/** System prompt support (`true` or limits). */
|
|
167
|
-
systemPrompt?: boolean | TextFieldCapability;
|
|
168
|
-
/** E.g. `['1:1', '16:9', '9:16']`. */
|
|
169
|
-
aspectRatios?: EnumCapability<string>;
|
|
170
|
-
/** E.g. `['512x512', '1024x1024']`, `['720p', '1080p']` or `['1k', '2k', '4k']`, low → high. */
|
|
171
|
-
resolutions?: EnumCapability<string>;
|
|
172
|
-
/** Ordered low → high, e.g. `['draft', 'standard', 'high']`. */
|
|
173
|
-
quality?: EnumCapability<string>;
|
|
174
|
-
count?: CountCapability;
|
|
175
|
-
duration?: DurationCapability;
|
|
176
|
-
seed?: boolean | SeedCapability;
|
|
177
|
-
references?: ReferenceCapability;
|
|
178
|
-
/** Accepts a source to edit (`mode: 'edit'`). */
|
|
179
|
-
editing?: boolean;
|
|
180
|
-
/** Accepts a source plus a `mask` reference (`mode: 'inpaint'`). */
|
|
181
|
-
inpainting?: boolean;
|
|
182
|
-
params?: Readonly<Record<string, ExtraParamSpec>>;
|
|
183
|
-
timing?: TimingCapability;
|
|
184
|
-
}
|
|
185
|
-
interface GenerationReference {
|
|
186
|
-
/** Asset id (opaque to this library). */
|
|
187
|
-
id: string;
|
|
188
|
-
role: ReferenceRole;
|
|
189
|
-
url?: string;
|
|
190
|
-
/** MIME type or media kind, checked against the role's `accepts`. */
|
|
191
|
-
mediaType?: string;
|
|
192
|
-
/** Content hash of the asset when it was referenced (used by generation records). */
|
|
193
|
-
contentHash?: string;
|
|
194
|
-
}
|
|
195
|
-
type GenerationMode = 'generate' | 'edit' | 'inpaint';
|
|
196
|
-
type GenerationParamValue = string | number | boolean;
|
|
197
|
-
/** A request for one model. Every field is optional; the planner fills and fixes. */
|
|
198
|
-
interface GenerationRequest {
|
|
199
|
-
model?: string;
|
|
200
|
-
prompt?: string;
|
|
201
|
-
negativePrompt?: string;
|
|
202
|
-
systemPrompt?: string;
|
|
203
|
-
aspectRatio?: string;
|
|
204
|
-
resolution?: string;
|
|
205
|
-
quality?: string;
|
|
206
|
-
count?: number;
|
|
207
|
-
/** Seconds. */
|
|
208
|
-
duration?: number;
|
|
209
|
-
seed?: number;
|
|
210
|
-
mode?: GenerationMode;
|
|
211
|
-
references?: GenerationReference[];
|
|
212
|
-
params?: Record<string, GenerationParamValue>;
|
|
213
|
-
}
|
|
214
|
-
/** Fields of {@link GenerationRequest} the planner knows about, in planning order. */
|
|
215
|
-
declare const GENERATION_REQUEST_FIELDS: readonly ["model", "prompt", "negativePrompt", "systemPrompt", "aspectRatio", "resolution", "quality", "count", "duration", "seed", "mode", "references", "params"];
|
|
216
|
-
/** Text field limits normalized from `boolean | TextFieldCapability`. */
|
|
217
|
-
declare function textFieldCapability(value: boolean | TextFieldCapability | undefined): TextFieldCapability | null;
|
|
218
|
-
/** Seed limits normalized from `boolean | SeedCapability`. */
|
|
219
|
-
declare function seedCapability(value: boolean | SeedCapability | undefined): SeedCapability | null;
|
|
220
|
-
/**
|
|
221
|
-
* Supported reference roles of a model: built-in roles in
|
|
222
|
-
* {@link REFERENCE_ROLES} order, then custom roles in declaration order.
|
|
223
|
-
*/
|
|
224
|
-
declare function supportedReferenceRoles(caps: ModelCapabilities): ReferenceRole[];
|
|
225
|
-
/** Supported generation modes of a model. */
|
|
226
|
-
declare function supportedModes(caps: ModelCapabilities): GenerationMode[];
|
|
227
|
-
/** A partial model entry used to decorate (or add) models locally. */
|
|
228
|
-
type CapabilityOverlay = Partial<ModelCapabilities> & {
|
|
229
|
-
id: string;
|
|
230
|
-
};
|
|
231
|
-
/**
|
|
232
|
-
* Merges server-reported capabilities with a local overlay. For models the
|
|
233
|
-
* server knows, every capability value comes from `remote`; the overlay only
|
|
234
|
-
* contributes presentation fields (`name`, `description`, `badges`, `icon`,
|
|
235
|
-
* `group`), filling in or replacing the remote ones. Overlay entries for
|
|
236
|
-
* models the server does not report are appended when they are complete
|
|
237
|
-
* (have a `media` kind). Remote order is kept; overlay-only models follow in
|
|
238
|
-
* overlay order.
|
|
239
|
-
*/
|
|
240
|
-
declare function mergeCapabilities(remote: readonly ModelCapabilities[], overlay?: readonly CapabilityOverlay[]): ModelCapabilities[];
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* How the planner treats values the model does not support:
|
|
244
|
-
*
|
|
245
|
-
* - `error`: nothing is changed; every mismatch is an error.
|
|
246
|
-
* - `nearest`: snap to the closest supported value (ties go to the higher
|
|
247
|
-
* value), clamp ranges, truncate lists, drop unsupported fields and
|
|
248
|
-
* unsupported references.
|
|
249
|
-
* - `downgrade`: like `nearest`, but ties go to the lower value.
|
|
250
|
-
* - `upgrade`: like `nearest`, but never drops references the model cannot
|
|
251
|
-
* use (that would lose intent), so those are errors.
|
|
252
|
-
*
|
|
253
|
-
* "Lower" means a narrower aspect ratio, fewer pixels, an earlier quality
|
|
254
|
-
* option, a smaller number.
|
|
255
|
-
*/
|
|
256
|
-
type PlanStrategy = 'error' | 'upgrade' | 'downgrade' | 'nearest';
|
|
257
|
-
type PlanAdjustmentKind = 'snapped' | 'clamped' | 'truncated' | 'dropped' | 'defaulted';
|
|
258
|
-
interface PlanAdjustment {
|
|
259
|
-
/** Request path, e.g. `aspectRatio`, `params.guidance`, `references.style_ref`. */
|
|
260
|
-
field: string;
|
|
261
|
-
from: unknown;
|
|
262
|
-
to: unknown;
|
|
263
|
-
reason: string;
|
|
264
|
-
kind: PlanAdjustmentKind;
|
|
265
|
-
}
|
|
266
|
-
interface PlanError {
|
|
267
|
-
field: string;
|
|
268
|
-
value: unknown;
|
|
269
|
-
message: string;
|
|
270
|
-
}
|
|
271
|
-
interface GenerationPlan {
|
|
272
|
-
/** `true` when there are no errors and `request` can be sent. */
|
|
273
|
-
ok: boolean;
|
|
274
|
-
/** The adjusted request (always a copy; the input is never mutated). */
|
|
275
|
-
request: GenerationRequest;
|
|
276
|
-
adjustments: PlanAdjustment[];
|
|
277
|
-
errors: PlanError[];
|
|
278
|
-
/** Model the plan was made for. */
|
|
279
|
-
model: string;
|
|
280
|
-
strategy: PlanStrategy;
|
|
281
|
-
}
|
|
282
|
-
interface PlanOptions {
|
|
283
|
-
/** Default `nearest`. */
|
|
284
|
-
strategy?: PlanStrategy;
|
|
285
|
-
/**
|
|
286
|
-
* The prompt with templates and variables resolved. Measured against
|
|
287
|
-
* `prompt.maxLength` when the model counts resolved text (the default).
|
|
288
|
-
*/
|
|
289
|
-
resolvedPrompt?: string;
|
|
290
|
-
/** Fill missing fields that have a capability `default` (reported as `defaulted`). */
|
|
291
|
-
fillDefaults?: boolean;
|
|
292
|
-
/** Override whether references with unsupported roles may be dropped (default: `nearest` and `downgrade` only). */
|
|
293
|
-
dropUnsupportedReferences?: boolean;
|
|
294
|
-
/**
|
|
295
|
-
* Assets mentioned in the prompt (e.g. from `extractMentions(text, { details: true, roles: true })`
|
|
296
|
-
* joined with your asset library). They are appended to `request.references`
|
|
297
|
-
* and validated per role like any other reference. A mention without a role
|
|
298
|
-
* gets `defaultMentionRole`, or the first role of the model that accepts its
|
|
299
|
-
* media type (reported as `defaulted`).
|
|
300
|
-
*/
|
|
301
|
-
mentions?: readonly PlanAssetMention[];
|
|
302
|
-
/** Role for mentions that have none (see `mentions`). */
|
|
303
|
-
defaultMentionRole?: ReferenceRole;
|
|
304
|
-
}
|
|
305
|
-
/** An asset mention handed to the planner (see {@link PlanOptions.mentions}). */
|
|
306
|
-
interface PlanAssetMention {
|
|
307
|
-
/** Asset id. */
|
|
308
|
-
id: string;
|
|
309
|
-
role?: ReferenceRole | null;
|
|
310
|
-
mediaType?: string;
|
|
311
|
-
contentHash?: string;
|
|
312
|
-
url?: string;
|
|
313
|
-
/** The mention text, used in messages (default: the id). */
|
|
314
|
-
label?: string;
|
|
315
|
-
}
|
|
316
|
-
/** Numeric rank of an aspect ratio such as `16:9` (log of width / height). */
|
|
317
|
-
declare function aspectRatioRank(value: string): number | undefined;
|
|
318
|
-
/**
|
|
319
|
-
* Numeric rank of a resolution: `1024x768` (pixels), `720p` (16:9 pixels at
|
|
320
|
-
* that height) or `2k` (square of that many kibi-pixels). Log scale.
|
|
321
|
-
*/
|
|
322
|
-
declare function resolutionRank(value: string): number | undefined;
|
|
323
|
-
/** Megapixels of a resolution string, when it can be parsed. */
|
|
324
|
-
declare function resolutionMegapixels(value: string): number | undefined;
|
|
325
|
-
/** Common quality names, low → high. Used to compare values missing from a model's options. */
|
|
326
|
-
declare const QUALITY_LADDER: Readonly<Record<string, number>>;
|
|
327
|
-
declare function qualityRank(value: string): number | undefined;
|
|
328
|
-
/**
|
|
329
|
-
* Picks the option closest to `value` by `rank`. Ties go to the lower or
|
|
330
|
-
* higher rank. Returns `undefined` when `value` or no option can be ranked.
|
|
331
|
-
*/
|
|
332
|
-
declare function snapToOption<T>(value: unknown, options: readonly T[], rank: (value: any) => number | undefined, tie: 'lower' | 'higher'): T | undefined;
|
|
333
|
-
/**
|
|
334
|
-
* Plans `request` against a model's capabilities before sending it: snaps
|
|
335
|
-
* enum values (aspect ratio, resolution, quality, count/duration choices) to
|
|
336
|
-
* the nearest supported option, clamps ranges, truncates text and reference
|
|
337
|
-
* lists over their limits, drops unsupported fields, and reports every change
|
|
338
|
-
* in `adjustments` and every unfixable problem in `errors`.
|
|
339
|
-
*
|
|
340
|
-
* Pure and deterministic: the input is not mutated and the same input always
|
|
341
|
-
* gives the same plan.
|
|
342
|
-
*/
|
|
343
|
-
declare function planGenerationRequest(request: GenerationRequest, caps: ModelCapabilities, options?: PlanOptions): GenerationPlan;
|
|
344
|
-
|
|
345
12
|
/**
|
|
346
13
|
* JSON Schema for a request to one model: enums for choices, `minimum` /
|
|
347
14
|
* `maximum` for ranges, `maxItems` for reference lists and `description`s that
|
|
@@ -495,93 +162,6 @@ declare function describeAssetMentions(mentions: readonly {
|
|
|
495
162
|
start?: number;
|
|
496
163
|
}[], assets: readonly AssetInfo[], caps?: ModelCapabilities): AssetMentionChip[];
|
|
497
164
|
|
|
498
|
-
declare const PROVENANCE_FORMAT = "pixerate.generation-provenance";
|
|
499
|
-
declare const PROVENANCE_VERSION = 1;
|
|
500
|
-
/** The exact template body a generation used. */
|
|
501
|
-
interface PinnedTemplate {
|
|
502
|
-
name: string;
|
|
503
|
-
templateId?: string;
|
|
504
|
-
/** Version id or version label the body came from (absent for unversioned templates). */
|
|
505
|
-
versionId?: string;
|
|
506
|
-
version?: string | number;
|
|
507
|
-
body: string;
|
|
508
|
-
}
|
|
509
|
-
/** Everything needed to explain and reproduce one generation. */
|
|
510
|
-
interface GenerationProvenance {
|
|
511
|
-
format: typeof PROVENANCE_FORMAT;
|
|
512
|
-
version: typeof PROVENANCE_VERSION;
|
|
513
|
-
/** Raw prompt as typed, with `{{templates}}` and `{variables}`. */
|
|
514
|
-
rawPrompt: string;
|
|
515
|
-
/** Every template the prompt reached (recursively), pinned to the body used. */
|
|
516
|
-
templates: PinnedTemplate[];
|
|
517
|
-
/** Version bindings in effect (`{ templateName: versionId }`) for every pinned versioned template. */
|
|
518
|
-
bindings: Record<string, string>;
|
|
519
|
-
/** Variable values, or `null` when variables were left unresolved. */
|
|
520
|
-
values: PromptValues | null;
|
|
521
|
-
resolvedPrompt: string;
|
|
522
|
-
sourceMap: SourceMapSegment[];
|
|
523
|
-
modelId: string;
|
|
524
|
-
/** The planned (adjusted) request that was sent. */
|
|
525
|
-
request: GenerationRequest;
|
|
526
|
-
adjustments: PlanAdjustment[];
|
|
527
|
-
references: {
|
|
528
|
-
id: string;
|
|
529
|
-
role: ReferenceRole;
|
|
530
|
-
}[];
|
|
531
|
-
/** ISO timestamps. */
|
|
532
|
-
createdAt: string;
|
|
533
|
-
startedAt?: string;
|
|
534
|
-
completedAt?: string;
|
|
535
|
-
/** Ids of the outputs this generation produced. */
|
|
536
|
-
outputIds?: string[];
|
|
537
|
-
meta?: Record<string, unknown>;
|
|
538
|
-
}
|
|
539
|
-
interface CreateProvenanceOptions {
|
|
540
|
-
rawPrompt: string;
|
|
541
|
-
templates?: Template[];
|
|
542
|
-
/** Template version bindings (`{ templateName: versionIdOrVersion }`). */
|
|
543
|
-
bindings?: Record<string, string>;
|
|
544
|
-
values?: PromptValues;
|
|
545
|
-
model: string | ModelCapabilities;
|
|
546
|
-
/** The plan the request came from (its request and adjustments are recorded) … */
|
|
547
|
-
plan?: GenerationPlan;
|
|
548
|
-
/** … or the request that was sent. */
|
|
549
|
-
request?: GenerationRequest;
|
|
550
|
-
adjustments?: PlanAdjustment[];
|
|
551
|
-
/** Creation time (default `Date.now()`). */
|
|
552
|
-
createdAt?: Date | number | string;
|
|
553
|
-
startedAt?: Date | number | string;
|
|
554
|
-
completedAt?: Date | number | string;
|
|
555
|
-
outputIds?: string[];
|
|
556
|
-
meta?: Record<string, unknown>;
|
|
557
|
-
maxDepth?: number;
|
|
558
|
-
}
|
|
559
|
-
declare class ProvenanceParseError extends Error {
|
|
560
|
-
constructor(message: string);
|
|
561
|
-
}
|
|
562
|
-
/** Templates that reproduce the pinned bodies exactly (one single-version template each). */
|
|
563
|
-
declare function pinnedTemplatesToTemplates(pinned: readonly PinnedTemplate[]): Template[];
|
|
564
|
-
/**
|
|
565
|
-
* Records what produced an output: the raw prompt, the exact template bodies
|
|
566
|
-
* and versions it reached, variable values, the resolved prompt and its
|
|
567
|
-
* source map, the model, the planned settings and adjustments, and the
|
|
568
|
-
* references by role.
|
|
569
|
-
*/
|
|
570
|
-
declare function createProvenance(options: CreateProvenanceOptions): GenerationProvenance;
|
|
571
|
-
/** Versioned JSON for storage next to an output. */
|
|
572
|
-
declare function serializeProvenance(provenance: GenerationProvenance): string;
|
|
573
|
-
/** Parses and checks serialized provenance. Throws {@link ProvenanceParseError}. */
|
|
574
|
-
declare function parseProvenance(input: string | unknown): GenerationProvenance;
|
|
575
|
-
/**
|
|
576
|
-
* Re-resolves the raw prompt against the pinned template bodies and values,
|
|
577
|
-
* e.g. to check a record or to open it in an editor with its source map.
|
|
578
|
-
*/
|
|
579
|
-
declare function replayProvenancePrompt(provenance: GenerationProvenance): {
|
|
580
|
-
text: string;
|
|
581
|
-
map: SourceMapSegment[];
|
|
582
|
-
matches: boolean;
|
|
583
|
-
};
|
|
584
|
-
|
|
585
165
|
declare const GENERATION_RECORD_FORMAT = "pixerate.generation-record";
|
|
586
166
|
declare const GENERATION_RECORD_VERSION = 1;
|
|
587
167
|
/** How a record came about. */
|
|
@@ -1038,4 +618,4 @@ declare function hashValue(value: unknown): string;
|
|
|
1038
618
|
*/
|
|
1039
619
|
declare function hashCapabilities(caps: ModelCapabilities): string;
|
|
1040
620
|
|
|
1041
|
-
export { AgentToolProvider, type AssetInfo, type AssetLookup, type AssetMentionChip, type AssetMentionIssue, type AssetMentionIssueCode, type AssetMentionValidation, type AssetRoleOption, type BatchResolver, type BatchResolverOptions, type
|
|
621
|
+
export { AgentToolProvider, type AssetInfo, type AssetLookup, type AssetMentionChip, type AssetMentionIssue, type AssetMentionIssueCode, type AssetMentionValidation, type AssetRoleOption, type BatchResolver, type BatchResolverOptions, type CreateGenerationRecordOptions, CreateProvenanceOptions, DRIFT_TYPE_LABELS, type DriftItem, type DriftType, type EstimateContext, GENERATION_RECORD_FORMAT, GENERATION_RECORD_VERSION, type GenerateContext, type GenerationControl, type GenerationControlOption, type GenerationHistoryToolProviderOptions, GenerationPlan, GenerationProvenance, type GenerationRecord, type GenerationRecordFilter, type GenerationRecordKind, type GenerationRecordStore, type GenerationRecordStoreOptions, type GenerationRecordSummary, GenerationReference, GenerationRequest, type GenerationToolProvider, type GenerationToolProviderOptions, type JobProgressEstimate, type JobProgressInput, JsonSchema, MAX_PENDING_PERCENT, ModelCapabilities, PlanAssetMention, PlanStrategy, type PruneOptions, type RecordedAsset, type RecordedTemplate, type RecreateMode, type RecreateOptions, type RecreateResult, ReferenceRole, type ReferenceSlot, type VariationOverrides, addReference, blockingDrift, capabilitiesToJsonSchema, completeGenerationRecord, createBatchResolver, createGenerationHistoryToolProvider, createGenerationRecord, createGenerationRecordId, createGenerationRecordStore, createGenerationToolProvider, defaultAssetRoleOptions, describeAssetMentions, estimateJobProgress, expectedDurationFor, formatRemaining, getAssetRoleOptions, getGenerationControls, getReferenceSlots, getRequestValue, hashCapabilities, hashText, hashValue, isGenerationRecord, matchesRecordFilter, parseControlValue, parseGenerationRecord, recreateRequest, removeReference, resolveAssetMentions, serializeGenerationRecord, setRequestValue, stableStringify, summarizeGenerationRecord, toAssetResolver, validateAssetMentions, variationRequest };
|