@pushwoosh/rpc-gateway-ai-assistant 0.1.240 → 0.1.242

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
@@ -1040,6 +1040,20 @@ export const data = {
1040
1040
  }
1041
1041
  }
1042
1042
  },
1043
+ "pushwoosh.aibuilder.v1.SyncedBlockRef": {
1044
+ "type": "I",
1045
+ "fields": {
1046
+ "templateCode": {
1047
+ "type": "string"
1048
+ },
1049
+ "sourceUpdatedAt": {
1050
+ "type": "string"
1051
+ },
1052
+ "fragmentCode": {
1053
+ "type": "string"
1054
+ }
1055
+ }
1056
+ },
1043
1057
  "pushwoosh.aibuilder.v1.AiBuilderBlock": {
1044
1058
  "type": "I",
1045
1059
  "fields": {
@@ -1068,6 +1082,10 @@ export const data = {
1068
1082
  "type": "pushwoosh.aibuilder.v1.BlockStyles",
1069
1083
  "optional": true
1070
1084
  },
1085
+ "syncedRef": {
1086
+ "type": "pushwoosh.aibuilder.v1.SyncedBlockRef",
1087
+ "optional": true
1088
+ },
1071
1089
  "parentId": {
1072
1090
  "type": "string"
1073
1091
  }
@@ -1414,6 +1432,30 @@ export const data = {
1414
1432
  "response": "pushwoosh.aigen.v1.AiGenConvertUnlayerResponse",
1415
1433
  "method": "post",
1416
1434
  "path": "/api/v1/aigen/convert-unlayer"
1435
+ },
1436
+ "GenerateMediaImage": {
1437
+ "request": "pushwoosh.aigen.v1.AiGenMediaImageRequest",
1438
+ "response": "pushwoosh.aigen.v1.AiGenMediaImageResponse",
1439
+ "method": "post",
1440
+ "path": "/api/v1/aigen/media-image"
1441
+ },
1442
+ "SearchStockPhotos": {
1443
+ "request": "pushwoosh.aigen.v1.AiGenStockSearchRequest",
1444
+ "response": "pushwoosh.aigen.v1.AiGenStockSearchResponse",
1445
+ "method": "post",
1446
+ "path": "/api/v1/aigen/stock-search"
1447
+ },
1448
+ "ImportStockPhoto": {
1449
+ "request": "pushwoosh.aigen.v1.AiGenStockImportRequest",
1450
+ "response": "pushwoosh.aigen.v1.AiGenStockImportResponse",
1451
+ "method": "post",
1452
+ "path": "/api/v1/aigen/stock-import"
1453
+ },
1454
+ "GenerateImageAlt": {
1455
+ "request": "pushwoosh.aigen.v1.AiGenImageAltRequest",
1456
+ "response": "pushwoosh.aigen.v1.AiGenImageAltResponse",
1457
+ "method": "post",
1458
+ "path": "/api/v1/aigen/image-alt"
1417
1459
  }
1418
1460
  }
1419
1461
  },
@@ -1882,6 +1924,172 @@ export const data = {
1882
1924
  }
1883
1925
  }
1884
1926
  },
1927
+ "pushwoosh.aigen.v1.AiGenMediaImageRequest": {
1928
+ "type": "I",
1929
+ "fields": {
1930
+ "application": {
1931
+ "type": "string"
1932
+ },
1933
+ "prompt": {
1934
+ "type": "string"
1935
+ },
1936
+ "aspectRatio": {
1937
+ "type": "string"
1938
+ }
1939
+ }
1940
+ },
1941
+ "pushwoosh.aigen.v1.AiGenMediaImageResponse": {
1942
+ "type": "I",
1943
+ "fields": {
1944
+ "url": {
1945
+ "type": "string"
1946
+ },
1947
+ "mediaUuid": {
1948
+ "type": "string"
1949
+ },
1950
+ "width": {
1951
+ "type": "number"
1952
+ },
1953
+ "height": {
1954
+ "type": "number"
1955
+ }
1956
+ }
1957
+ },
1958
+ "pushwoosh.aigen.v1.StockProvider": {
1959
+ "type": "E",
1960
+ "values": [
1961
+ "STOCK_PROVIDER_UNSPECIFIED",
1962
+ "STOCK_PROVIDER_PEXELS"
1963
+ ]
1964
+ },
1965
+ "pushwoosh.aigen.v1.AiGenStockSearchRequest": {
1966
+ "type": "I",
1967
+ "fields": {
1968
+ "application": {
1969
+ "type": "string"
1970
+ },
1971
+ "query": {
1972
+ "type": "string"
1973
+ },
1974
+ "page": {
1975
+ "type": "number"
1976
+ },
1977
+ "provider": {
1978
+ "type": "pushwoosh.aigen.v1.StockProvider"
1979
+ }
1980
+ }
1981
+ },
1982
+ "pushwoosh.aigen.v1.StockPhoto": {
1983
+ "type": "I",
1984
+ "fields": {
1985
+ "id": {
1986
+ "type": "string"
1987
+ },
1988
+ "thumbUrl": {
1989
+ "type": "string"
1990
+ },
1991
+ "width": {
1992
+ "type": "number"
1993
+ },
1994
+ "height": {
1995
+ "type": "number"
1996
+ },
1997
+ "photographer": {
1998
+ "type": "string"
1999
+ },
2000
+ "photographerUrl": {
2001
+ "type": "string"
2002
+ },
2003
+ "avgColor": {
2004
+ "type": "string"
2005
+ },
2006
+ "alt": {
2007
+ "type": "string"
2008
+ }
2009
+ }
2010
+ },
2011
+ "pushwoosh.aigen.v1.AiGenStockSearchResponse": {
2012
+ "type": "I",
2013
+ "fields": {
2014
+ "photos": {
2015
+ "type": "pushwoosh.aigen.v1.StockPhoto",
2016
+ "array": true
2017
+ },
2018
+ "total": {
2019
+ "type": "number"
2020
+ },
2021
+ "page": {
2022
+ "type": "number"
2023
+ },
2024
+ "provider": {
2025
+ "type": "pushwoosh.aigen.v1.StockProvider"
2026
+ }
2027
+ }
2028
+ },
2029
+ "pushwoosh.aigen.v1.AiGenStockImportRequest": {
2030
+ "type": "I",
2031
+ "fields": {
2032
+ "application": {
2033
+ "type": "string"
2034
+ },
2035
+ "provider": {
2036
+ "type": "pushwoosh.aigen.v1.StockProvider"
2037
+ },
2038
+ "photoId": {
2039
+ "type": "string"
2040
+ }
2041
+ }
2042
+ },
2043
+ "pushwoosh.aigen.v1.AiGenStockImportResponse": {
2044
+ "type": "I",
2045
+ "fields": {
2046
+ "url": {
2047
+ "type": "string"
2048
+ },
2049
+ "mediaUuid": {
2050
+ "type": "string"
2051
+ },
2052
+ "width": {
2053
+ "type": "number"
2054
+ },
2055
+ "height": {
2056
+ "type": "number"
2057
+ },
2058
+ "alt": {
2059
+ "type": "string"
2060
+ }
2061
+ }
2062
+ },
2063
+ "pushwoosh.aigen.v1.AiGenImageAltRequest": {
2064
+ "type": "I",
2065
+ "fields": {
2066
+ "application": {
2067
+ "type": "string"
2068
+ },
2069
+ "imageUrl": {
2070
+ "type": "string"
2071
+ },
2072
+ "llmProvider": {
2073
+ "type": "string",
2074
+ "optional": true
2075
+ },
2076
+ "llmModel": {
2077
+ "type": "string",
2078
+ "optional": true
2079
+ },
2080
+ "language": {
2081
+ "type": "string"
2082
+ }
2083
+ }
2084
+ },
2085
+ "pushwoosh.aigen.v1.AiGenImageAltResponse": {
2086
+ "type": "I",
2087
+ "fields": {
2088
+ "alt": {
2089
+ "type": "string"
2090
+ }
2091
+ }
2092
+ },
1885
2093
  "pushwoosh.accounts.assistant.v1.Role": {
1886
2094
  "type": "E",
1887
2095
  "values": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-gateway-ai-assistant",
3
- "version": "0.1.240",
3
+ "version": "0.1.242",
4
4
  "description": "AI Assistant api gateway HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -926,6 +926,28 @@ export type Divider = {
926
926
  style: DividerStyle;
927
927
  widthPercent: number;
928
928
  };
929
+ /**
930
+ * SyncedBlockRef links a block subtree root back to the saved-block template it was inserted from.
931
+ * Client-managed end to end: the client refreshes the subtree from the template on load,
932
+ * pushes edits back via TemplatesService, and re-applies the link after AI edits.
933
+ */
934
+ export type SyncedBlockRef = {
935
+ /** TemplatesService code of the source template. */
936
+ templateCode: string;
937
+ /**
938
+ * RFC3339 updated_at of the source template at last sync — the staleness check on load.
939
+ * A string, not google.protobuf.Timestamp, on purpose: the value is client-opaque and lives in
940
+ * documents stored as raw JSON (rpc-v2 smartcards content), where a Timestamp's generated
941
+ * Date type would lie after a plain JSON revival; only the client ever parses it.
942
+ */
943
+ sourceUpdatedAt: string;
944
+ /**
945
+ * Companion email template holding the block's rendered fragment. The email
946
+ * emitter writes `{% email_content "<code>" %}` instead of the baked block,
947
+ * so the sending pipeline inlines the CURRENT fragment at send time.
948
+ */
949
+ fragmentCode: string;
950
+ };
929
951
  export type AiBuilderBlock_block_card = {
930
952
  type: 'card';
931
953
  data: AiBuilderCard;
@@ -954,6 +976,8 @@ export type AiBuilderBlock_block = AiBuilderBlock_block_card | AiBuilderBlock_bl
954
976
  export type AiBuilderBlock = {
955
977
  id: string;
956
978
  styles?: BlockStyles;
979
+ /** Synced-block link; present only on the root of an instance's subtree. */
980
+ syncedRef?: SyncedBlockRef;
957
981
  /**
958
982
  * Id of the block-of-this-page that contains this one. Empty string
959
983
  * marks a top-level block. The parent (if set) must be a container
@@ -6,6 +6,10 @@ import { ColorSchemeItem as pushwoosh_aibuilder_v1_ColorSchemeItem } from './pus
6
6
  import { AiBuilderBlock as pushwoosh_aibuilder_v1_AiBuilderBlock } from './pushwoosh_aibuilder_v1';
7
7
  export type AiGenService_ExtractStyle = RpcMethod<AiGenExtractStyleRequest, AiGenExtractStyleResponse>;
8
8
  export type AiGenService_ConvertUnlayer = RpcMethod<AiGenConvertUnlayerRequest, AiGenConvertUnlayerResponse>;
9
+ export type AiGenService_GenerateMediaImage = RpcMethod<AiGenMediaImageRequest, AiGenMediaImageResponse>;
10
+ export type AiGenService_SearchStockPhotos = RpcMethod<AiGenStockSearchRequest, AiGenStockSearchResponse>;
11
+ export type AiGenService_ImportStockPhoto = RpcMethod<AiGenStockImportRequest, AiGenStockImportResponse>;
12
+ export type AiGenService_GenerateImageAlt = RpcMethod<AiGenImageAltRequest, AiGenImageAltResponse>;
9
13
  /**
10
14
  * AiGenService unifies document create / edit / per-block regeneration and
11
15
  * targeted block insertion into a single streaming RPC. Dispatch rules:
@@ -73,6 +77,34 @@ export interface AiGenService {
73
77
  * document validation. Unary; the result is document-sized.
74
78
  */
75
79
  ConvertUnlayer: AiGenService_ConvertUnlayer;
80
+ /**
81
+ * GenerateMediaImage generates ONE image from a prompt and stores it in
82
+ * the application's media library — the media-gallery "Generate" tab.
83
+ * Same generator the streaming pipeline uses (Gemini image model, cheap
84
+ * quality tier); the response carries the stored file's URL and uuid,
85
+ * ready to insert as ContentImage.src / media_uuid.
86
+ */
87
+ GenerateMediaImage: AiGenService_GenerateMediaImage;
88
+ /**
89
+ * SearchStockPhotos proxies a stock-photo search (Pexels) — the API key
90
+ * stays server-side and the browser never talks to the provider. Results
91
+ * are preview-only: thumbnails for the picker plus the attribution the
92
+ * provider requires. Inserting a photo goes through ImportStockPhoto.
93
+ */
94
+ SearchStockPhotos: AiGenService_SearchStockPhotos;
95
+ /**
96
+ * ImportStockPhoto copies one stock photo into the application's media
97
+ * library: the server resolves the photo by id at the provider, downloads
98
+ * the bytes itself (never a client-supplied URL — SSRF stays impossible)
99
+ * and uploads them to media storage with a provenance description.
100
+ */
101
+ ImportStockPhoto: AiGenService_ImportStockPhoto;
102
+ /**
103
+ * GenerateImageAlt writes alt text for an existing image: the server
104
+ * fetches the image (media-library / stock hosts only), shows it to a
105
+ * vision-capable model and returns one concise accessibility-grade alt.
106
+ */
107
+ GenerateImageAlt: AiGenService_GenerateImageAlt;
76
108
  }
77
109
  export type AiGenBlockTypeHint = 'AI_GEN_BLOCK_TYPE_HINT_UNSPECIFIED' | 'AI_GEN_BLOCK_TYPE_HINT_CARD' | 'AI_GEN_BLOCK_TYPE_HINT_COLUMNS'
78
110
  /** Top-level free-form Content block. Allowed in WEB_POPUP only. */
@@ -621,3 +653,90 @@ export type AiGenConvertUnlayerResponse = {
621
653
  */
622
654
  warnings: string[];
623
655
  };
656
+ export type AiGenMediaImageRequest = {
657
+ application: string;
658
+ /** Image generation prompt; required, capped server-side. */
659
+ prompt: string;
660
+ /**
661
+ * Gemini ImageConfig aspect ratio ("1:1", "16:9", "21:9", "3:4", ...).
662
+ * Empty = the generator default.
663
+ */
664
+ aspectRatio: string;
665
+ };
666
+ export type AiGenMediaImageResponse = {
667
+ /** The stored media file, ready for ContentImage.src / media_uuid. */
668
+ url: string;
669
+ mediaUuid: string;
670
+ width: number;
671
+ height: number;
672
+ };
673
+ /**
674
+ * StockProvider names the upstream catalog. Only Pexels for now; the enum
675
+ * exists so a second provider (Pixabay) is a value, not a schema break.
676
+ */
677
+ export type StockProvider =
678
+ /** treated as PEXELS */
679
+ 'STOCK_PROVIDER_UNSPECIFIED' | 'STOCK_PROVIDER_PEXELS';
680
+ export type AiGenStockSearchRequest = {
681
+ application: string;
682
+ query: string;
683
+ /** 1-based page, provider-side pagination; 0 = first page. */
684
+ page: number;
685
+ provider: StockProvider;
686
+ };
687
+ /**
688
+ * One search hit: enough for the picker tile + the provider's required
689
+ * attribution. No full-size URLs — the import round-trips by id.
690
+ */
691
+ export type StockPhoto = {
692
+ id: string;
693
+ /** Preview for the picker grid (provider CDN, display-only). */
694
+ thumbUrl: string;
695
+ width: number;
696
+ height: number;
697
+ photographer: string;
698
+ /** Photographer / photo page at the provider — the attribution link. */
699
+ photographerUrl: string;
700
+ /** Average color for grid placeholders ("#aabbcc"); may be empty. */
701
+ avgColor: string;
702
+ alt: string;
703
+ };
704
+ export type AiGenStockSearchResponse = {
705
+ photos: StockPhoto[];
706
+ total: number;
707
+ page: number;
708
+ provider: StockProvider;
709
+ };
710
+ export type AiGenStockImportRequest = {
711
+ application: string;
712
+ provider: StockProvider;
713
+ /** Provider photo id from a SearchStockPhotos hit. */
714
+ photoId: string;
715
+ };
716
+ export type AiGenStockImportResponse = {
717
+ url: string;
718
+ mediaUuid: string;
719
+ width: number;
720
+ height: number;
721
+ /** Alt suggested by the provider's metadata; may be empty. */
722
+ alt: string;
723
+ };
724
+ export type AiGenImageAltRequest = {
725
+ application: string;
726
+ /**
727
+ * Image to describe. Must live on an allowlisted host (the application's
728
+ * media storage or a stock CDN) — the server refuses to fetch elsewhere.
729
+ */
730
+ imageUrl: string;
731
+ /** Dev-only LLM override, same semantics as AiGenRequest.llm_provider. */
732
+ llmProvider?: string;
733
+ llmModel?: string;
734
+ /**
735
+ * Optional language for the alt text (ISO code); empty = the image's
736
+ * dominant/default language, typically English.
737
+ */
738
+ language: string;
739
+ };
740
+ export type AiGenImageAltResponse = {
741
+ alt: string;
742
+ };