@orangecatai/adgen-canvas 0.0.35 → 0.0.37

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.
@@ -1 +1 @@
1
- import{a,b,c,d}from"./chunk-Z5NKEFVG.js";import"./chunk-TE4JIU3E.js";import"./chunk-SRAX5OIU.js";export{a as Commands,b as subsetToBase64,c as subsetToBinary,d as toBase64};
1
+ import{a,b,c,d}from"./chunk-Z5NKEFVG.js";import"./chunk-AE7ZZTR5.js";import"./chunk-SRAX5OIU.js";export{a as Commands,b as subsetToBase64,c as subsetToBinary,d as toBase64};
@@ -1 +1 @@
1
- import{a as r,c as t}from"./chunk-Z5NKEFVG.js";import"./chunk-TE4JIU3E.js";import"./chunk-SRAX5OIU.js";var s=import.meta.url?new URL(import.meta.url):void 0;typeof window>"u"&&typeof self<"u"&&(self.onmessage=async e=>{switch(e.data.command){case r.Subset:let a=await t(e.data.arrayBuffer,e.data.codePoints);self.postMessage(a,{transfer:[a]});break}});export{s as WorkerUrl};
1
+ import{a as r,c as t}from"./chunk-Z5NKEFVG.js";import"./chunk-AE7ZZTR5.js";import"./chunk-SRAX5OIU.js";var s=import.meta.url?new URL(import.meta.url):void 0;typeof window>"u"&&typeof self<"u"&&(self.onmessage=async e=>{switch(e.data.command){case r.Subset:let a=await t(e.data.arrayBuffer,e.data.codePoints);self.postMessage(a,{transfer:[a]});break}});export{s as WorkerUrl};
@@ -160,15 +160,19 @@ export type AIChatPanelProps = {
160
160
  blobUrl: string;
161
161
  previewDataUrl?: string;
162
162
  }>>;
163
- onListBrandTemplates?: (keywords?: string[]) => Promise<Array<{
163
+ onListBrandTemplates?: (brief?: string) => Promise<Array<{
164
164
  id: string;
165
165
  name: string;
166
166
  campaignTag?: string;
167
167
  label?: string;
168
168
  width?: number;
169
169
  height?: number;
170
- thumbnailBlobUrl?: string;
171
- thumbnailDataUrl?: string;
170
+ visualMetadata?: {
171
+ caption?: string;
172
+ useCases?: string[];
173
+ visualStyle?: string[];
174
+ layout?: string;
175
+ } | null;
172
176
  }>>;
173
177
  onGetTemplateVariant?: (variantId: string) => Promise<{
174
178
  canvasJson: string;
@@ -755,19 +755,16 @@ export declare const BANNER_TOOLS: readonly [...({
755
755
  readonly type: "function";
756
756
  readonly function: {
757
757
  readonly name: "list_brand_templates";
758
- readonly description: "List available brand templates by keyword search across template names, campaign tags, and labels.\n\nMANDATORY SEARCH PROTOCOL — follow exactly, no shortcuts:\n\nATTEMPT 1: Generate TWO sets of 10 keywords each from the user's request:\n - Set A (campaign tag variations): 10 synonyms/abbreviations/phrasings of the campaign topic (e.g. for \"noida datacenter\": [\"datacenter\", \"data center\", \"dc\", \"noida dc\", \"noida datacenter\", \"data centre\", \"server farm\", \"cloud infra\", \"hyperscale\", \"colocation\"])\n - Set B (template name variations): 10 different name keywords the template might have (e.g. [\"noida\", \"datacenter campaign\", \"new datacenter\", \"dc launch\", \"infrastructure\", \"cloud\", \"enterprise\", \"b2b\", \"tech\", \"facility\"])\n Merge all 20 into the keywords array. Call list_brand_templates with all 20.\n\nIF templates returned is empty → ATTEMPT 2 (MANDATORY — do NOT skip):\n Generate a completely DIFFERENT set of 20 keywords — do not reuse any from attempt 1. Think laterally: different synonyms, related industry terms, the city name, brand-adjacent words, seasonal terms. Call list_brand_templates again with the new 20.\n\nONLY after both attempts return empty → tell the user no matching template was found.\n\nIf no search context exists, call with an empty keywords array to list all templates.";
758
+ readonly description: "Search saved brand templates semantically against the full ad brief. Results are ranked from captions generated from the actual template frame. Use the returned visual description, campaign fit, dimensions, and ID to decide whether to use a template.";
759
759
  readonly parameters: {
760
760
  readonly type: "object";
761
761
  readonly properties: {
762
- readonly keywords: {
763
- readonly type: "array";
764
- readonly items: {
765
- readonly type: "string";
766
- };
767
- readonly description: "Up to 20 keyword variations to search across template names, campaign tags, and labels. All are OR-matched case-insensitively. Generate 10 tag synonyms + 10 name variations from the user's request.";
762
+ readonly brief: {
763
+ readonly type: "string";
764
+ readonly description: "The user's complete ad brief, including campaign, subject, style, copy, and requested dimensions when known.";
768
765
  };
769
766
  };
770
- readonly required: readonly [];
767
+ readonly required: readonly ["brief"];
771
768
  readonly additionalProperties: false;
772
769
  };
773
770
  };
@@ -1032,15 +1029,19 @@ export type ToolExecutionContext = {
1032
1029
  blobUrl: string;
1033
1030
  previewDataUrl?: string;
1034
1031
  }>>;
1035
- onListBrandTemplates?: (keywords?: string[]) => Promise<Array<{
1032
+ onListBrandTemplates?: (brief?: string) => Promise<Array<{
1036
1033
  id: string;
1037
1034
  name: string;
1038
1035
  campaignTag?: string;
1039
1036
  label?: string;
1040
1037
  width?: number;
1041
1038
  height?: number;
1042
- thumbnailBlobUrl?: string;
1043
- thumbnailDataUrl?: string;
1039
+ visualMetadata?: {
1040
+ caption?: string;
1041
+ useCases?: string[];
1042
+ visualStyle?: string[];
1043
+ layout?: string;
1044
+ } | null;
1044
1045
  }>>;
1045
1046
  onGetTemplateVariant?: (variantId: string) => Promise<{
1046
1047
  canvasJson: string;
@@ -567,7 +567,7 @@ export interface ExcalidrawProps {
567
567
  };
568
568
  button: "down" | "up";
569
569
  pointersMap: Gesture["pointers"];
570
- }) => void;
570
+ }) => void | Promise<void>;
571
571
  onPaste?: (data: ClipboardData, event: ClipboardEvent | null) => Promise<boolean> | boolean;
572
572
  /**
573
573
  * Called when element(s) are duplicated so you can listen or modify as
@@ -843,16 +843,21 @@ export interface ExcalidrawProps {
843
843
  blobUrl: string;
844
844
  }>>;
845
845
  /**
846
- * List brand templates, optionally filtered by campaignTag.
846
+ * Semantically search captioned brand templates against the full ad brief.
847
847
  */
848
- onListBrandTemplates?: (keywords?: string[]) => Promise<Array<{
848
+ onListBrandTemplates?: (brief?: string) => Promise<Array<{
849
849
  id: string;
850
850
  name: string;
851
851
  campaignTag?: string;
852
852
  label?: string;
853
853
  width?: number;
854
854
  height?: number;
855
- thumbnailBlobUrl?: string;
855
+ visualMetadata?: {
856
+ caption?: string;
857
+ useCases?: string[];
858
+ visualStyle?: string[];
859
+ layout?: string;
860
+ } | null;
856
861
  }>>;
857
862
  /**
858
863
  * Fetch the full canvas JSON for a specific template by ID.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orangecatai/adgen-canvas",
3
- "version": "0.0.35",
3
+ "version": "0.0.37",
4
4
  "type": "module",
5
5
  "types": "./dist/types/excalidraw/index.d.ts",
6
6
  "main": "./dist/prod/index.js",
@@ -85,7 +85,7 @@
85
85
  "@excalidraw/mermaid-to-excalidraw": "2.0.0-rfc3",
86
86
  "@excalidraw/random-username": "1.1.0",
87
87
  "@orangecatai/common": "0.0.4",
88
- "@orangecatai/element": "0.0.4",
88
+ "@orangecatai/element": "0.0.5",
89
89
  "@orangecatai/math": "0.0.2",
90
90
  "@radix-ui/react-avatar": "1.1.11",
91
91
  "@radix-ui/react-select": "2.2.6",
@@ -1 +0,0 @@
1
- import{S as a,T as b,U as c}from"../chunk-R3CESCMK.js";import"../chunk-TE4JIU3E.js";import"../chunk-SRAX5OIU.js";export{c as decodePngMetadata,b as encodePngMetadata,a as getTEXtChunk};