@pushwoosh/rpc-gateway-ai-assistant 0.1.142 → 0.1.144

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/data.js CHANGED
@@ -58,6 +58,36 @@ export const data = {
58
58
  "CARD_IMAGE_FIT_FILL"
59
59
  ]
60
60
  },
61
+ "pushwoosh.aibuilder.v1.CardImageSizeUnit": {
62
+ "type": "E",
63
+ "values": [
64
+ "CARD_IMAGE_SIZE_UNIT_UNSPECIFIED",
65
+ "CARD_IMAGE_SIZE_UNIT_PX",
66
+ "CARD_IMAGE_SIZE_UNIT_PERCENT"
67
+ ]
68
+ },
69
+ "pushwoosh.aibuilder.v1.CardImageSize": {
70
+ "type": "I",
71
+ "fields": {
72
+ "value": {
73
+ "type": "number"
74
+ },
75
+ "unit": {
76
+ "type": "pushwoosh.aibuilder.v1.CardImageSizeUnit"
77
+ }
78
+ }
79
+ },
80
+ "pushwoosh.aibuilder.v1.CardImagePosition": {
81
+ "type": "I",
82
+ "fields": {
83
+ "x": {
84
+ "type": "number"
85
+ },
86
+ "y": {
87
+ "type": "number"
88
+ }
89
+ }
90
+ },
61
91
  "pushwoosh.aibuilder.v1.TextVariantStyle": {
62
92
  "type": "I",
63
93
  "fields": {
@@ -145,10 +175,6 @@ export const data = {
145
175
  "pushwoosh.aibuilder.v1.CardStyles": {
146
176
  "type": "I",
147
177
  "fields": {
148
- "accentFitPadding": {
149
- "type": "pushwoosh.aibuilder.v1.EdgeInsets",
150
- "optional": true
151
- },
152
178
  "contentPadding": {
153
179
  "type": "pushwoosh.aibuilder.v1.EdgeInsets",
154
180
  "optional": true
@@ -406,8 +432,13 @@ export const data = {
406
432
  "imageFit": {
407
433
  "type": "pushwoosh.aibuilder.v1.CardImageFit"
408
434
  },
409
- "accentFit": {
410
- "type": "boolean"
435
+ "imageSize": {
436
+ "type": "pushwoosh.aibuilder.v1.CardImageSize",
437
+ "optional": true
438
+ },
439
+ "imagePosition": {
440
+ "type": "pushwoosh.aibuilder.v1.CardImagePosition",
441
+ "optional": true
411
442
  }
412
443
  }
413
444
  },
@@ -704,24 +735,16 @@ export const data = {
704
735
  "generateImages": {
705
736
  "type": "boolean"
706
737
  },
707
- "settings": {
708
- "type": "pushwoosh.aibuilder.v1.DocumentSettings",
709
- "optional": true
710
- },
711
- "textVariants": {
712
- "type": "pushwoosh.aibuilder.v1.TextVariantStyle",
713
- "mapKeyType": "string"
714
- },
715
- "colorScheme": {
716
- "type": "pushwoosh.aibuilder.v1.ColorSchemeItem",
717
- "mapKeyType": "string"
718
- },
719
738
  "addBlock": {
720
739
  "type": "pushwoosh.aigen.v1.AiGenAddBlock",
721
740
  "optional": true
722
741
  },
723
742
  "mode": {
724
743
  "type": "pushwoosh.aigen.v1.AiGenMode"
744
+ },
745
+ "template": {
746
+ "type": "pushwoosh.aibuilder.v1.AiBuilderDocument",
747
+ "optional": true
725
748
  }
726
749
  }
727
750
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-gateway-ai-assistant",
3
- "version": "0.1.142",
3
+ "version": "0.1.144",
4
4
  "description": "AI Assistant api gateway HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -83,8 +83,51 @@ export type CardImageFit = 'CARD_IMAGE_FIT_UNSPECIFIED'
83
83
  * and other assets that must not be cropped.
84
84
  */
85
85
  | 'CARD_IMAGE_FIT_CONTAIN'
86
- /** Stretch to fit, distorting aspect ratio. Rarely useful. */
86
+ /**
87
+ * Stretch to fit, distorting aspect ratio. Deprecated — no longer
88
+ * offered in the editor and dropped from the LLM schema; kept only for
89
+ * wire compatibility.
90
+ */
87
91
  | 'CARD_IMAGE_FIT_FILL';
92
+ /** Unit for CardImageSize.value. */
93
+ export type CardImageSizeUnit =
94
+ /** value ignored → client default */
95
+ 'CARD_IMAGE_SIZE_UNIT_UNSPECIFIED'
96
+ /** absolute pixels */
97
+ | 'CARD_IMAGE_SIZE_UNIT_PX'
98
+ /** % of the card content-box width */
99
+ | 'CARD_IMAGE_SIZE_UNIT_PERCENT';
100
+ /**
101
+ * CardImageSize sizes the image slot. Which dimension it drives depends on
102
+ * AiBuilderCard.layout:
103
+ * LEFT / RIGHT → width of the image column
104
+ * TOP → height of the image
105
+ * BACKGROUND → height of the card (width is always 100%)
106
+ * NO → no image, ignored
107
+ * PERCENT is always measured against the card content-box WIDTH, so a
108
+ * percentage height yields a stable aspect ratio regardless of card width.
109
+ * Client-managed: the LLM never sets this; the backend round-trips it
110
+ * verbatim. value <= 0 (or unit UNSPECIFIED) is treated as unset → the
111
+ * client falls back to its default.
112
+ */
113
+ export type CardImageSize = {
114
+ value: number;
115
+ unit: CardImageSizeUnit;
116
+ };
117
+ /**
118
+ * CardImagePosition is the focus / anchor of the image within its slot
119
+ * (CSS object-position). One field serves both UI modes:
120
+ * CONTAIN → "set position" (where the fitted image sits)
121
+ * COVER → "focal point" (which point stays in frame when cropped)
122
+ * Percentages 0..100; (0,0) = top-left, (50,50) = centre. Client-managed:
123
+ * the LLM never sets this; the backend round-trips it verbatim.
124
+ */
125
+ export type CardImagePosition = {
126
+ /** horizontal, % (left) */
127
+ x: number;
128
+ /** vertical, % (top) */
129
+ y: number;
130
+ };
88
131
  export type TextVariantStyle = {
89
132
  fontSize: number;
90
133
  fontWeight: number;
@@ -165,11 +208,6 @@ export type ColumnsStyles = {
165
208
  padding?: EdgeInsets;
166
209
  };
167
210
  export type CardStyles = {
168
- /**
169
- * Padding applied to the image column when accent_fit is enabled on
170
- * the card (see AiBuilderCard.accent_fit). Ignored otherwise.
171
- */
172
- accentFitPadding?: EdgeInsets;
173
211
  /**
174
212
  * Padding applied to the card's content (text) area on top of any
175
213
  * document-level default. Applies to all layouts that have a content
@@ -313,11 +351,17 @@ export type AiBuilderCard = {
313
351
  */
314
352
  imageFit: CardImageFit;
315
353
  /**
316
- * Apply only to LEFT / RIGHT layouts: render the image as a side
317
- * accent that fits the height of the text column. Ignored for other
318
- * layouts.
354
+ * Size of the image slot (width for LEFT/RIGHT, height for TOP, card
355
+ * height for BACKGROUND; ignored for NO). Client-managed: the LLM never
356
+ * sets it, the backend round-trips it. Unset → client default.
357
+ */
358
+ imageSize?: CardImageSize;
359
+ /**
360
+ * Focus / anchor of the image within its slot (object-position).
361
+ * Client-managed: the LLM never sets it, the backend round-trips it.
362
+ * Unset → centre (50/50). Applies to the image layouts only.
319
363
  */
320
- accentFit: boolean;
364
+ imagePosition?: CardImagePosition;
321
365
  };
322
366
  export type AiBuilderColumns = {
323
367
  columns: AiBuilderColumn[];
@@ -6,7 +6,7 @@ import { AiBuilderBlock as pushwoosh_aibuilder_v1_AiBuilderBlock } from './pushw
6
6
  /**
7
7
  * AiGenService unifies document create / edit / per-block regeneration and
8
8
  * targeted block insertion into a single streaming RPC. Dispatch rules:
9
- * - document empty → create a new document
9
+ * - document empty (template required) → create a new document from the template
10
10
  * - document set → edit existing document (diff planner)
11
11
  * - document set + block_path → regenerate only that block; planner
12
12
  * skipped, structure_diff NOT emitted
@@ -78,7 +78,12 @@ export type AiGenBlockPath = {
78
78
  };
79
79
  export type AiGenRequest = {
80
80
  prompt: string;
81
- /** Empty → create a new document. Set → edit. */
81
+ /**
82
+ * Edit mode: the existing document to mutate. Empty on create — use
83
+ * `template` instead. Mutually exclusive with `template`. On edit the
84
+ * document's styling (settings, text_variants, color_scheme) is read
85
+ * from here.
86
+ */
82
87
  document?: pushwoosh_aibuilder_v1_AiBuilderDocument;
83
88
  /**
84
89
  * Bypass mode: path `[page_id, block_id]` of the block to regenerate.
@@ -88,10 +93,6 @@ export type AiGenRequest = {
88
93
  blockPath: string[];
89
94
  application: string;
90
95
  generateImages: boolean;
91
- /** Used on create; in edit taken from document. */
92
- settings?: pushwoosh_aibuilder_v1_DocumentSettings;
93
- textVariants: Record<string, pushwoosh_aibuilder_v1_TextVariantStyle>;
94
- colorScheme: Record<string, pushwoosh_aibuilder_v1_ColorSchemeItem>;
95
96
  /**
96
97
  * Set → add-block mode: insert a single new block into `document` at a
97
98
  * client-specified position, skipping the planner. Mutually exclusive
@@ -103,6 +104,16 @@ export type AiGenRequest = {
103
104
  * rejects UNSPECIFIED with InvalidArgument.
104
105
  */
105
106
  mode: AiGenMode;
107
+ /**
108
+ * Create mode: the prototype document the new document is generated
109
+ * from. Required when `document` is empty; mutually exclusive with
110
+ * `document`. The generator preserves the template's styling (settings,
111
+ * text_variants, color_scheme are read from here on create) and
112
+ * imitates the layout / tone of its blocks while writing fresh content
113
+ * for the user's prompt. A template with no blocks degenerates to a
114
+ * free create (styling only, no structural reference).
115
+ */
116
+ template?: pushwoosh_aibuilder_v1_AiBuilderDocument;
106
117
  };
107
118
  /**
108
119
  * AiGenAddBlock triggers add-block mode on Generate. The server emits a