@pushwoosh/rpc-gateway-ai-assistant 0.1.277 → 0.1.278

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
@@ -2084,6 +2084,18 @@ export const data = {
2084
2084
  "method": "post",
2085
2085
  "path": "/api/v1/aigen/extract-style"
2086
2086
  },
2087
+ "ExtractTheme": {
2088
+ "request": "pushwoosh.aigen.v1.AiGenExtractThemeRequest",
2089
+ "response": "pushwoosh.aigen.v1.AiGenExtractThemeResponse",
2090
+ "method": "post",
2091
+ "path": "/api/v1/aigen/extract-theme"
2092
+ },
2093
+ "Translate": {
2094
+ "request": "pushwoosh.aigen.v1.AiGenTranslateRequest",
2095
+ "response": "pushwoosh.aigen.v1.AiGenTranslateResponse",
2096
+ "method": "post",
2097
+ "path": "/api/v1/aigen/translate"
2098
+ },
2087
2099
  "ConvertUnlayer": {
2088
2100
  "request": "pushwoosh.aigen.v1.AiGenConvertUnlayerRequest",
2089
2101
  "response": "pushwoosh.aigen.v1.AiGenConvertUnlayerResponse",
@@ -2570,6 +2582,134 @@ export const data = {
2570
2582
  }
2571
2583
  }
2572
2584
  },
2585
+ "pushwoosh.aigen.v1.AiGenSourceFormat": {
2586
+ "type": "E",
2587
+ "values": [
2588
+ "AI_GEN_SOURCE_FORMAT_UNSPECIFIED",
2589
+ "AI_GEN_SOURCE_FORMAT_TEXT",
2590
+ "AI_GEN_SOURCE_FORMAT_MARKDOWN",
2591
+ "AI_GEN_SOURCE_FORMAT_HTML",
2592
+ "AI_GEN_SOURCE_FORMAT_PDF"
2593
+ ]
2594
+ },
2595
+ "pushwoosh.aigen.v1.AiGenSource": {
2596
+ "type": "I",
2597
+ "fields": {
2598
+ "format": {
2599
+ "type": "pushwoosh.aigen.v1.AiGenSourceFormat"
2600
+ },
2601
+ "content": {
2602
+ "type": "string"
2603
+ },
2604
+ "name": {
2605
+ "type": "string"
2606
+ }
2607
+ }
2608
+ },
2609
+ "pushwoosh.aigen.v1.AiGenTheme": {
2610
+ "type": "I",
2611
+ "fields": {
2612
+ "colors": {
2613
+ "type": "string",
2614
+ "mapKeyType": "string"
2615
+ },
2616
+ "fontFamily": {
2617
+ "type": "string"
2618
+ },
2619
+ "headingFontFamily": {
2620
+ "type": "string"
2621
+ }
2622
+ }
2623
+ },
2624
+ "pushwoosh.aigen.v1.AiGenExtractThemeRequest": {
2625
+ "type": "I",
2626
+ "fields": {
2627
+ "image": {
2628
+ "type": "pushwoosh.aigen.v1.AiGenReferenceImage",
2629
+ "optional": true
2630
+ },
2631
+ "application": {
2632
+ "type": "string"
2633
+ },
2634
+ "llmProvider": {
2635
+ "type": "string",
2636
+ "optional": true
2637
+ },
2638
+ "llmModel": {
2639
+ "type": "string",
2640
+ "optional": true
2641
+ },
2642
+ "sources": {
2643
+ "type": "pushwoosh.aigen.v1.AiGenSource",
2644
+ "array": true
2645
+ },
2646
+ "description": {
2647
+ "type": "string"
2648
+ },
2649
+ "siteUrl": {
2650
+ "type": "string"
2651
+ }
2652
+ }
2653
+ },
2654
+ "pushwoosh.aigen.v1.AiGenExtractThemeResponse": {
2655
+ "type": "I",
2656
+ "fields": {
2657
+ "theme": {
2658
+ "type": "pushwoosh.aigen.v1.AiGenTheme"
2659
+ },
2660
+ "logoUrl": {
2661
+ "type": "string"
2662
+ },
2663
+ "brandVoice": {
2664
+ "type": "string"
2665
+ }
2666
+ }
2667
+ },
2668
+ "pushwoosh.aigen.v1.AiGenTranslateRequest": {
2669
+ "type": "I",
2670
+ "fields": {
2671
+ "application": {
2672
+ "type": "string"
2673
+ },
2674
+ "texts": {
2675
+ "type": "string",
2676
+ "array": true
2677
+ },
2678
+ "targetLanguages": {
2679
+ "type": "string",
2680
+ "array": true
2681
+ },
2682
+ "context": {
2683
+ "type": "string"
2684
+ },
2685
+ "llmProvider": {
2686
+ "type": "string",
2687
+ "optional": true
2688
+ },
2689
+ "llmModel": {
2690
+ "type": "string",
2691
+ "optional": true
2692
+ }
2693
+ }
2694
+ },
2695
+ "pushwoosh.aigen.v1.AiGenTranslatedTexts": {
2696
+ "type": "I",
2697
+ "fields": {
2698
+ "texts": {
2699
+ "type": "string",
2700
+ "array": true
2701
+ }
2702
+ }
2703
+ },
2704
+ "pushwoosh.aigen.v1.AiGenTranslateResponse": {
2705
+ "type": "I",
2706
+ "fields": {
2707
+ "translations": {
2708
+ "type": "pushwoosh.aigen.v1.AiGenTranslatedTexts",
2709
+ "mapKeyType": "string"
2710
+ }
2711
+ }
2712
+ },
2573
2713
  "pushwoosh.aigen.v1.AiGenConvertUnlayerRequest": {
2574
2714
  "type": "I",
2575
2715
  "fields": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-gateway-ai-assistant",
3
- "version": "0.1.277",
3
+ "version": "0.1.278",
4
4
  "description": "AI Assistant api gateway HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -6,6 +6,8 @@ import { ColorSchemeItem as pushwoosh_aibuilder_v1_ColorSchemeItem } from './pus
6
6
  import { AiBuilderBlock as pushwoosh_aibuilder_v1_AiBuilderBlock } from './pushwoosh_aibuilder_v1';
7
7
  import { EdgeInsets as pushwoosh_aibuilder_v1_EdgeInsets } from './pushwoosh_aibuilder_v1';
8
8
  export type AiGenService_ExtractStyle = RpcMethod<AiGenExtractStyleRequest, AiGenExtractStyleResponse>;
9
+ export type AiGenService_ExtractTheme = RpcMethod<AiGenExtractThemeRequest, AiGenExtractThemeResponse>;
10
+ export type AiGenService_Translate = RpcMethod<AiGenTranslateRequest, AiGenTranslateResponse>;
9
11
  export type AiGenService_ConvertUnlayer = RpcMethod<AiGenConvertUnlayerRequest, AiGenConvertUnlayerResponse>;
10
12
  export type AiGenService_DocumentToHtml = RpcMethod<AiGenDocumentToHtmlRequest, AiGenDocumentToHtmlResponse>;
11
13
  export type AiGenService_DocumentToPageHtml = RpcMethod<AiGenDocumentToPageHtmlRequest, AiGenDocumentToPageHtmlResponse>;
@@ -69,6 +71,16 @@ export interface AiGenService {
69
71
  * design screenshot. Unary; the result is small.
70
72
  */
71
73
  ExtractStyle: AiGenService_ExtractStyle;
74
+ /**
75
+ * ExtractTheme samples a full brand theme (every palette role + both font stacks) and
76
+ * the brand voice from any mix of materials. See documents/vibeml-architecture.md.
77
+ */
78
+ ExtractTheme: AiGenService_ExtractTheme;
79
+ /**
80
+ * Translate renders a batch of email texts into the target languages, one call per
81
+ * language. Markup and dynamic syntax survive verbatim; responses are index-aligned.
82
+ */
83
+ Translate: AiGenService_Translate;
72
84
  /**
73
85
  * ConvertUnlayer deterministically converts an Unlayer email-template
74
86
  * design (the `editorConfig` JSON stored in EmailContent.Unlayer) into
@@ -647,6 +659,95 @@ export type AiGenExtractStyleResponse = {
647
659
  */
648
660
  typographyNotes: string;
649
661
  };
662
+ /**
663
+ * AiGenSourceFormat tags a source's content type; it decides how the server feeds it to
664
+ * the model. PDF needs a document-capable provider, else FailedPrecondition.
665
+ */
666
+ export type AiGenSourceFormat = 'AI_GEN_SOURCE_FORMAT_UNSPECIFIED' | 'AI_GEN_SOURCE_FORMAT_TEXT' | 'AI_GEN_SOURCE_FORMAT_MARKDOWN'
667
+ /** Fed as text: the model reads the content, it does not re-emit the markup. */
668
+ | 'AI_GEN_SOURCE_FORMAT_HTML'
669
+ /** content is base64 PDF bytes (no data: prefix), forwarded as a native document. */
670
+ | 'AI_GEN_SOURCE_FORMAT_PDF';
671
+ /**
672
+ * AiGenSource is reference material the model works off instead of inventing from the
673
+ * prompt. Factual source material, never instructions.
674
+ */
675
+ export type AiGenSource = {
676
+ /** Required; UNSPECIFIED is InvalidArgument. */
677
+ format: AiGenSourceFormat;
678
+ /** UTF-8 text, or base64 bytes for PDF. Required; capped at 200 KB (PDF ~12 MB base64). */
679
+ content: string;
680
+ /** Optional label distinguishing multiple sources ("product brief"). */
681
+ name: string;
682
+ };
683
+ /**
684
+ * AiGenTheme is a role-keyed palette plus the two font stacks — the extractor's own
685
+ * output shape, not a document's color_scheme.
686
+ */
687
+ export type AiGenTheme = {
688
+ /**
689
+ * Keyed by semantic role, values strictly hex. ExtractTheme fills every role:
690
+ * background, surface, text, heading, text-secondary, accent, text-on-accent, border, link.
691
+ */
692
+ colors: Record<string, string>;
693
+ /** CSS font-family chain for body text, e.g. "Inter, system-ui, sans-serif". */
694
+ fontFamily: string;
695
+ /** Headings; may equal font_family. */
696
+ headingFontFamily: string;
697
+ };
698
+ /** At least one of image / sources / description / site_url is required; any mix is allowed. */
699
+ export type AiGenExtractThemeRequest = {
700
+ /** Screenshot, logo or moodboard. Optional; needs a vision-capable model. */
701
+ image?: AiGenReferenceImage;
702
+ /** Application code, for account/app scoping middleware and logging. */
703
+ application: string;
704
+ /** Dev-only LLM override, same semantics as AiGenRequest.llm_provider: empty = the default. */
705
+ llmProvider?: string;
706
+ llmModel?: string;
707
+ /** Brand materials: brand-book PDF, HTML page, markdown or plain text. Optional. */
708
+ sources: AiGenSource[];
709
+ /** Written brand description ("dark green, minimalist, premium outdoor brand"). Optional. */
710
+ description: string;
711
+ /**
712
+ * Public site to read the brand off ("acme.com"). The server distils its colours, fonts
713
+ * and meta into one source and adopts the logo it finds as the image. Optional.
714
+ */
715
+ siteUrl: string;
716
+ };
717
+ export type AiGenExtractThemeResponse = {
718
+ theme: AiGenTheme;
719
+ /** The logo found on site_url; empty without a site or a find. The client decides. */
720
+ logoUrl: string;
721
+ /** How the brand talks, 1-3 sentences, for a copywriter to imitate. Empty without copy. */
722
+ brandVoice: string;
723
+ };
724
+ export type AiGenTranslateRequest = {
725
+ /** Application code, for account/app scoping middleware and logging. */
726
+ application: string;
727
+ /**
728
+ * Source texts: plain, inline HTML, merge tags / Liquid / %%macros%% (all kept verbatim).
729
+ * Capped at 300 texts and 60 000 characters in total.
730
+ */
731
+ texts: string[];
732
+ /**
733
+ * Language codes as the editor names them ("es", "pt-BR"), without the source language.
734
+ * Capped at 20.
735
+ */
736
+ targetLanguages: string[];
737
+ /** Optional hint steering tone and terminology (campaign topic, brand voice). */
738
+ context: string;
739
+ /** Dev-only LLM override, same semantics as AiGenRequest.llm_provider: empty = the default. */
740
+ llmProvider?: string;
741
+ llmModel?: string;
742
+ };
743
+ export type AiGenTranslatedTexts = {
744
+ /** Index-aligned with AiGenTranslateRequest.texts. */
745
+ texts: string[];
746
+ };
747
+ export type AiGenTranslateResponse = {
748
+ /** Exactly the requested languages: all-or-nothing, a failed language fails the call. */
749
+ translations: Record<string, AiGenTranslatedTexts>;
750
+ };
650
751
  export type AiGenConvertUnlayerRequest = {
651
752
  /**
652
753
  * The Unlayer design JSON (EmailContent.Unlayer.editor_config): the