@yuktishaalaa/yuktai 5.3.8 → 5.3.10

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.
@@ -10,7 +10,7 @@ The page has form fields the user may need to fill.`:""}
10
10
 
11
11
  User task: ${a}
12
12
 
13
- Action plan:`,i=await c.prompt(r);return c.destroy(),i?.trim()||""}async function H(n,a){let{askPageWithTransformers:t}=await import("./transformers-rag-HW4QKA5T.mjs");return(await t(`How do I: ${a}`)).answer||"I could not create a plan for this task."}async function S(n,a,t){if(!n.trim())return{success:!1,steps:[],error:"Please tell me what you want to do."};if(!a)return{success:!1,steps:[],error:"No AI engine available on this device."};let o=[],l=(c,e="info")=>{let r={text:c,type:e};o.push(r),t(r)};try{l("\u{1F4D6} Reading page content...","info");let c=T(),e=x(),r=e.length>0;c.length<50&&l("\u26A0\uFE0F Page content is very limited. This may be a static image page.","error"),l(r?`\u{1F4CB} Found ${e.length} form field${e.length!==1?"s":""} on this page`:"\u{1F4C4} No form fields found \u2014 this appears to be a content page","info"),l("\u{1F916} Creating action plan...","info");let i="";try{a==="gemini"?i=await M(c,n,r):i=await H(c,n)}catch{i=r?`1. Locate the form on this page
13
+ Action plan:`,i=await c.prompt(r);return c.destroy(),i?.trim()||""}async function H(n,a){let{askPageWithTransformers:t}=await import("./transformers-rag-MQZRMFTG.mjs");return(await t(`How do I: ${a}`)).answer||"I could not create a plan for this task."}async function S(n,a,t){if(!n.trim())return{success:!1,steps:[],error:"Please tell me what you want to do."};if(!a)return{success:!1,steps:[],error:"No AI engine available on this device."};let o=[],l=(c,e="info")=>{let r={text:c,type:e};o.push(r),t(r)};try{l("\u{1F4D6} Reading page content...","info");let c=T(),e=x(),r=e.length>0;c.length<50&&l("\u26A0\uFE0F Page content is very limited. This may be a static image page.","error"),l(r?`\u{1F4CB} Found ${e.length} form field${e.length!==1?"s":""} on this page`:"\u{1F4C4} No form fields found \u2014 this appears to be a content page","info"),l("\u{1F916} Creating action plan...","info");let i="";try{a==="gemini"?i=await M(c,n,r):i=await H(c,n)}catch{i=r?`1. Locate the form on this page
14
14
  2. Fill each required field
15
15
  3. Review your answers
16
16
  4. Submit the form`:`1. Read the page carefully
@@ -0,0 +1,11 @@
1
+ function i(){return new Promise(t=>{let r=setTimeout(t,1500),e=new MutationObserver(()=>{clearTimeout(r),r=setTimeout(()=>{e.disconnect(),t()},500)});e.observe(document.body,{childList:!0,subtree:!0})})}function c(){let t=[],r=document.querySelectorAll("*");for(let e of r){if(e.closest("[data-yuktai-panel]"))continue;let s=e.innerText?.trim();s&&s.length>30&&t.push(s);let n=e.getAttribute("aria-label");if(n&&n.length>10&&t.push(n),(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&(e.placeholder&&t.push(e.placeholder),e.value&&t.push(e.value)),e instanceof HTMLButtonElement){let a=e.innerText||e.getAttribute("aria-label");a&&t.push(a)}}return t.join(" ").slice(0,3500)}async function l(t){if(!t.trim())return{success:!1,answer:"",error:"Please type a question."};try{let r=window,e=r.LanguageModel||r.ai?.languageModel;if(!e)return{success:!1,answer:"",error:"Gemini Nano not available."};await i();let s=c();if(!s||s.length<100)return{success:!1,answer:"",error:"Page content not readable."};let n;try{n=await e.create({systemPrompt:`Answer ONLY using page content.
2
+ Keep answer short (2\u20133 sentences).
3
+ If not found say: "I could not find that on this page."`,outputLanguage:"en"})}catch{n=await e.create()}let a=`Page:
4
+ ${s}
5
+
6
+ Q: ${t}`,o=await n.prompt(a);return n?.destroy&&n.destroy(),{success:!0,answer:o?.trim()||"No answer found."}}catch(r){return{success:!1,answer:"",error:r instanceof Error?r.message:"Error occurred"}}}async function f(t,r){if(!t.trim()||!r.trim())return{success:!1,answer:"",error:"Nothing to answer from."};try{let e=window,s=e.LanguageModel||e.ai?.languageModel;if(!s)return{success:!1,answer:"",error:"Gemini Nano not available."};let n;try{n=await s.create({systemPrompt:`Answer ONLY using page content.
7
+ Keep answer short (2\u20133 sentences).
8
+ If not found say: "I could not find that on this page."`,outputLanguage:"en"})}catch{n=await s.create()}let a=await n.prompt(`Page:
9
+ ${r.slice(0,3500)}
10
+
11
+ Q: ${t}`);return n?.destroy&&n.destroy(),{success:!0,answer:a?.trim()||"No answer found."}}catch(e){return{success:!1,answer:"",error:e instanceof Error?e.message:"Error occurred"}}}export{l as a,f as b};
@@ -0,0 +1,13 @@
1
+ var g=null,m=null,l=!1,f=!1;function h(){return typeof navigator>"u"?!1:/Android|iPhone|iPad|iPod|Mobile|Tablet/i.test(navigator.userAgent)}function p(){if(h())return"wasm";try{if(typeof navigator<"u"&&"gpu"in navigator&&navigator.gpu!==void 0)return"webgpu"}catch{}return"wasm"}async function w(){if(!f){if(l){for(;l;)await new Promise(e=>setTimeout(e,200));return}l=!0;try{let{pipeline:e,env:t}=await import("@huggingface/transformers");t.allowRemoteModels=!0,t.allowLocalModels=!1,typeof window<"u"&&typeof caches<"u"&&(t.useWasmCache=!0);let n=p(),s=h();console.log(`yuktai: Transformers.js \u2014 device: ${n}, mobile: ${s}`),g=await e("feature-extraction","Xenova/all-MiniLM-L6-v2",{device:n,dtype:s?"q4":"fp32"}),m=await e("text2text-generation","Xenova/flan-t5-small",{device:n,dtype:s?"q4":"fp32"}),f=!0,l=!1,console.log("yuktai: Transformers.js models loaded \u2705")}catch(e){throw l=!1,console.error("yuktai: Transformers.js model load failed",e),e}}}function y(){return new Promise(e=>{let t=setTimeout(e,1500),n=new MutationObserver(()=>{clearTimeout(t),t=setTimeout(()=>{n.disconnect(),e()},500)});n.observe(document.body,{childList:!0,subtree:!0})})}function b(){let e=[],t=new Set,n=document.querySelectorAll("p, h1, h2, h3, h4, h5, h6, li, td, th, label, figcaption, blockquote, span, a, button, div");for(let i of n){if(i.closest("[data-yuktai-panel]")||i.querySelector("p, h1, h2, h3, h4, li, td, div"))continue;let a=i.innerText?.trim();if(!a||a.length<15||t.has(a))continue;t.add(a),e.push(a);let c=i.getAttribute("aria-label")?.trim();c&&c.length>8&&!t.has(c)&&(t.add(c),e.push(c))}let s=document.title?.trim();s&&!t.has(s)&&e.unshift(s);let r=document.querySelector('meta[name="description"]')?.getAttribute("content")?.trim();return r&&!t.has(r)&&e.unshift(r),e.join(" ").slice(0,8e3)}function v(e,t=150,n=30){if(typeof e!="string")try{e=String(e??"")}catch{return[]}let s=e.trim();if(!s)return[];let o=Math.min(n,Math.floor(t/2)),r=s.split(/\s+/),i=[],u=t-o;for(let a=0;a<r.length;a+=u){let c=r.slice(a,a+t).join(" ");c.trim().length>20&&i.push(c)}return i}function k(e,t){let n=0,s=0,o=0;for(let r=0;r<e.length;r++)n+=e[r]*t[r],s+=e[r]*e[r],o+=t[r]*t[r];return n/(Math.sqrt(s)*Math.sqrt(o)+1e-8)}async function d(e){let t=await g(e,{pooling:"mean",normalize:!0}),n=t?.data??t;return Array.from(n)}async function x(e,t,n=3){let s=await d(e),o=await Promise.all(t.map(async r=>{let i=await d(r),u=k(s,i);return{chunk:r,score:u}}));return o.sort((r,i)=>i.score-r.score),o.slice(0,n).map(r=>r.chunk)}async function M(e){if(!e.trim())return{success:!1,answer:"",error:"Please type a question."};try{await w(),await y();let t=b();if(!t||t.length<50)return{success:!1,answer:"",error:"Not enough content on this page."};let n=v(t);if(n.length===0)return{success:!1,answer:"",error:"Could not process page content."};let r=`Answer the question based on the context. Give a complete answer in 2-3 sentences.
2
+
3
+ Context: ${(await x(e,n,3)).join(" ").slice(0,1200)}
4
+
5
+ Question: ${e}
6
+
7
+ Answer:`,u=(await m(r,{max_new_tokens:120,min_new_tokens:10}))?.[0]?.generated_text?.trim()||"";return u?{success:!0,answer:u}:{success:!0,answer:"I could not find a specific answer on this page."}}catch(t){console.error("yuktai: Transformers RAG error",t);let n=t instanceof Error?t.message:"";return n.includes("Out of memory")||n.includes("memory")?{success:!1,answer:"",error:"Not enough device memory. Try on a device with more RAM or use desktop Chrome with Gemini Nano."}:{success:!1,answer:"",error:n||"Transformers.js error."}}}async function P(e,t){if(!e.trim()||!t.trim())return{success:!1,answer:"",error:"Nothing to answer from."};try{await w();let n=`Answer the question based on the context. Give a complete answer in 2-3 sentences.
8
+
9
+ Context: ${t.slice(0,1200)}
10
+
11
+ Question: ${e}
12
+
13
+ Answer:`,o=(await m(n,{max_new_tokens:120,min_new_tokens:10}))?.[0]?.generated_text?.trim()||"";return o?{success:!0,answer:o}:{success:!1,answer:"",error:"No answer generated."}}catch(n){return{success:!1,answer:"",error:n instanceof Error?n.message:"Transformers.js error."}}}function A(){try{return typeof WebAssembly<"u"&&typeof Worker<"u"}catch{return!1}}function C(){return f?"ready":l?"loading":"idle"}export{M as a,P as b,A as c,C as d};
package/dist/icons.d.mts CHANGED
@@ -564,4 +564,5 @@ declare const StarIcon: (props: IconProps) => react.JSX.Element;
564
564
  /** Safe / verified */
565
565
  declare const ShieldCheckIcon: (props: IconProps) => react.JSX.Element;
566
566
 
567
- export { AbcIcon, AccessibilityIcon, AdminIcon, AlertIcon, AlignCenterIcon, AlignJustifyIcon, AlignLeftIcon, AlignRightIcon, ApiIcon, ArchitectureIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, BarChartIcon, BoldIcon, BookIcon, BookmarkIcon, BrainIcon, BugReportIcon, BulbIcon, CakeIcon, CalendarIcon, CardsIcon, ChatIcon, CheckIcon, ChevronLeftIcon, ChevronRightIcon, ChevronsIcon, CleaningIcon, ClockIcon, CloseIcon, CloudIcon, CodeIcon, ComputerIcon, ContrastIcon, CopyIcon, DashboardIcon, DataObjectIcon, DeleteIcon, DocumentScannerIcon, DownloadIcon, DragHandleIcon, ExploreIcon, ExternalIcon, EyeIcon, EyeOffIcon, FactCheckIcon, FileIcon, FilterIcon, FirstIcon, FontIcon, FormIcon, FullscreenExitIcon, FullscreenIcon, GavelIcon, GiftIcon, GlobeIcon, GridIcon, HeadphonesIcon, HeartFilledIcon, HeartIcon, HelpIcon, HomeIcon, HubIcon, ICON_MIN_CONTRAST, ICON_NAMES, ICON_PATHS, IconBase, type IconName, type IconProps, type IconShape, type IconSvgOptions, type IconVariant, ImageIcon, ImageSearchIcon, InfoIcon, InsightsIcon, InstallIcon, IntegrationIcon, ItalicIcon, JoinIcon, KeyIcon, KeyboardIcon, LabelIcon, LampIcon, LastIcon, LayoutIcon, LinkIcon, LoaderIcon, LockIcon, LoginIcon, LogoutIcon, MapIcon, MeditateIcon, MenuIcon, MergeIcon, MicIcon, MinusIcon, MoonIcon, MotionIcon, MovieIcon, MusicIcon, MusicOffIcon, MusicVideoIcon, NamaskarIcon, PageBreakIcon, PaletteIcon, PauseIcon, PenIcon, PersonIcon, PhoneIcon, PinIcon, PlayIcon, PlugIcon, PlusIcon, QuoteIcon, RadioCheckedIcon, RadioIcon, ReadingIcon, RedoIcon, RepeatIcon, ResetIcon, RobotIcon, SaveIcon, SchoolIcon, SearchIcon, SearchOffIcon, SendIcon, SentimentSadIcon, ShareIcon, ShieldCheckIcon, ShuffleIcon, SkipIcon, SlideshowIcon, SortDownIcon, SortIcon, SortUpIcon, SparkIcon, SpeakerIcon, SpeedIcon, SpellcheckIcon, StarIcon, StopIcon, StorageIcon, StyleIcon, SunIcon, SunriseIcon, SunsetIcon, SwapIcon, TargetIcon, TempleIcon, TextIcon, TitleIcon, ToolsIcon, TouchIcon, TrendingDownIcon, TrendingUpIcon, TrophyIcon, UnderlineIcon, UndoIcon, UnlockIcon, UploadIcon, UsersIcon, VolumeOffIcon, VolunteerIcon, WalletIcon, WandIcon, WifiIcon, WifiOffIcon, YuktaiIcon, type YuktaiIconProps, ZoomInIcon, ZoomOutIcon, iconContrast, iconSvg, pickGlyphColor, resolveIconColours };
567
+ export { AbcIcon, AccessibilityIcon, AdminIcon, AlertIcon, AlignCenterIcon, AlignJustifyIcon, AlignLeftIcon, AlignRightIcon, ApiIcon, ArchitectureIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, BarChartIcon, BoldIcon, BookIcon, BookmarkIcon, BrainIcon, BugReportIcon, BulbIcon, CakeIcon, CalendarIcon, CardsIcon, ChatIcon, CheckIcon, ChevronLeftIcon, ChevronRightIcon, ChevronsIcon, CleaningIcon, ClockIcon, CloseIcon, CloudIcon, CodeIcon, ComputerIcon, ContrastIcon, CopyIcon, DashboardIcon, DataObjectIcon, DeleteIcon, DocumentScannerIcon, DownloadIcon, DragHandleIcon, ExploreIcon, ExternalIcon, EyeIcon, EyeOffIcon, FactCheckIcon, FileIcon, FilterIcon, FirstIcon, FontIcon, FormIcon, FullscreenExitIcon, FullscreenIcon, GavelIcon, GiftIcon, GlobeIcon, GridIcon, HeadphonesIcon, HeartFilledIcon, HeartIcon, HelpIcon, HomeIcon, HubIcon, ICON_MIN_CONTRAST, ICON_NAMES, ICON_PATHS, IconBase, ImageIcon, ImageSearchIcon, InfoIcon, InsightsIcon, InstallIcon, IntegrationIcon, ItalicIcon, JoinIcon, KeyIcon, KeyboardIcon, LabelIcon, LampIcon, LastIcon, LayoutIcon, LinkIcon, LoaderIcon, LockIcon, LoginIcon, LogoutIcon, MapIcon, MeditateIcon, MenuIcon, MergeIcon, MicIcon, MinusIcon, MoonIcon, MotionIcon, MovieIcon, MusicIcon, MusicOffIcon, MusicVideoIcon, NamaskarIcon, PageBreakIcon, PaletteIcon, PauseIcon, PenIcon, PersonIcon, PhoneIcon, PinIcon, PlayIcon, PlugIcon, PlusIcon, QuoteIcon, RadioCheckedIcon, RadioIcon, ReadingIcon, RedoIcon, RepeatIcon, ResetIcon, RobotIcon, SaveIcon, SchoolIcon, SearchIcon, SearchOffIcon, SendIcon, SentimentSadIcon, ShareIcon, ShieldCheckIcon, ShuffleIcon, SkipIcon, SlideshowIcon, SortDownIcon, SortIcon, SortUpIcon, SparkIcon, SpeakerIcon, SpeedIcon, SpellcheckIcon, StarIcon, StopIcon, StorageIcon, StyleIcon, SunIcon, SunriseIcon, SunsetIcon, SwapIcon, TargetIcon, TempleIcon, TextIcon, TitleIcon, ToolsIcon, TouchIcon, TrendingDownIcon, TrendingUpIcon, TrophyIcon, UnderlineIcon, UndoIcon, UnlockIcon, UploadIcon, UsersIcon, VolumeOffIcon, VolunteerIcon, WalletIcon, WandIcon, WifiIcon, WifiOffIcon, YuktaiIcon, ZoomInIcon, ZoomOutIcon, iconContrast, iconSvg, pickGlyphColor, resolveIconColours };
568
+ export type { IconName, IconProps, IconShape, IconSvgOptions, IconVariant, YuktaiIconProps };
package/dist/icons.d.ts CHANGED
@@ -564,4 +564,5 @@ declare const StarIcon: (props: IconProps) => react.JSX.Element;
564
564
  /** Safe / verified */
565
565
  declare const ShieldCheckIcon: (props: IconProps) => react.JSX.Element;
566
566
 
567
- export { AbcIcon, AccessibilityIcon, AdminIcon, AlertIcon, AlignCenterIcon, AlignJustifyIcon, AlignLeftIcon, AlignRightIcon, ApiIcon, ArchitectureIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, BarChartIcon, BoldIcon, BookIcon, BookmarkIcon, BrainIcon, BugReportIcon, BulbIcon, CakeIcon, CalendarIcon, CardsIcon, ChatIcon, CheckIcon, ChevronLeftIcon, ChevronRightIcon, ChevronsIcon, CleaningIcon, ClockIcon, CloseIcon, CloudIcon, CodeIcon, ComputerIcon, ContrastIcon, CopyIcon, DashboardIcon, DataObjectIcon, DeleteIcon, DocumentScannerIcon, DownloadIcon, DragHandleIcon, ExploreIcon, ExternalIcon, EyeIcon, EyeOffIcon, FactCheckIcon, FileIcon, FilterIcon, FirstIcon, FontIcon, FormIcon, FullscreenExitIcon, FullscreenIcon, GavelIcon, GiftIcon, GlobeIcon, GridIcon, HeadphonesIcon, HeartFilledIcon, HeartIcon, HelpIcon, HomeIcon, HubIcon, ICON_MIN_CONTRAST, ICON_NAMES, ICON_PATHS, IconBase, type IconName, type IconProps, type IconShape, type IconSvgOptions, type IconVariant, ImageIcon, ImageSearchIcon, InfoIcon, InsightsIcon, InstallIcon, IntegrationIcon, ItalicIcon, JoinIcon, KeyIcon, KeyboardIcon, LabelIcon, LampIcon, LastIcon, LayoutIcon, LinkIcon, LoaderIcon, LockIcon, LoginIcon, LogoutIcon, MapIcon, MeditateIcon, MenuIcon, MergeIcon, MicIcon, MinusIcon, MoonIcon, MotionIcon, MovieIcon, MusicIcon, MusicOffIcon, MusicVideoIcon, NamaskarIcon, PageBreakIcon, PaletteIcon, PauseIcon, PenIcon, PersonIcon, PhoneIcon, PinIcon, PlayIcon, PlugIcon, PlusIcon, QuoteIcon, RadioCheckedIcon, RadioIcon, ReadingIcon, RedoIcon, RepeatIcon, ResetIcon, RobotIcon, SaveIcon, SchoolIcon, SearchIcon, SearchOffIcon, SendIcon, SentimentSadIcon, ShareIcon, ShieldCheckIcon, ShuffleIcon, SkipIcon, SlideshowIcon, SortDownIcon, SortIcon, SortUpIcon, SparkIcon, SpeakerIcon, SpeedIcon, SpellcheckIcon, StarIcon, StopIcon, StorageIcon, StyleIcon, SunIcon, SunriseIcon, SunsetIcon, SwapIcon, TargetIcon, TempleIcon, TextIcon, TitleIcon, ToolsIcon, TouchIcon, TrendingDownIcon, TrendingUpIcon, TrophyIcon, UnderlineIcon, UndoIcon, UnlockIcon, UploadIcon, UsersIcon, VolumeOffIcon, VolunteerIcon, WalletIcon, WandIcon, WifiIcon, WifiOffIcon, YuktaiIcon, type YuktaiIconProps, ZoomInIcon, ZoomOutIcon, iconContrast, iconSvg, pickGlyphColor, resolveIconColours };
567
+ export { AbcIcon, AccessibilityIcon, AdminIcon, AlertIcon, AlignCenterIcon, AlignJustifyIcon, AlignLeftIcon, AlignRightIcon, ApiIcon, ArchitectureIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, BarChartIcon, BoldIcon, BookIcon, BookmarkIcon, BrainIcon, BugReportIcon, BulbIcon, CakeIcon, CalendarIcon, CardsIcon, ChatIcon, CheckIcon, ChevronLeftIcon, ChevronRightIcon, ChevronsIcon, CleaningIcon, ClockIcon, CloseIcon, CloudIcon, CodeIcon, ComputerIcon, ContrastIcon, CopyIcon, DashboardIcon, DataObjectIcon, DeleteIcon, DocumentScannerIcon, DownloadIcon, DragHandleIcon, ExploreIcon, ExternalIcon, EyeIcon, EyeOffIcon, FactCheckIcon, FileIcon, FilterIcon, FirstIcon, FontIcon, FormIcon, FullscreenExitIcon, FullscreenIcon, GavelIcon, GiftIcon, GlobeIcon, GridIcon, HeadphonesIcon, HeartFilledIcon, HeartIcon, HelpIcon, HomeIcon, HubIcon, ICON_MIN_CONTRAST, ICON_NAMES, ICON_PATHS, IconBase, ImageIcon, ImageSearchIcon, InfoIcon, InsightsIcon, InstallIcon, IntegrationIcon, ItalicIcon, JoinIcon, KeyIcon, KeyboardIcon, LabelIcon, LampIcon, LastIcon, LayoutIcon, LinkIcon, LoaderIcon, LockIcon, LoginIcon, LogoutIcon, MapIcon, MeditateIcon, MenuIcon, MergeIcon, MicIcon, MinusIcon, MoonIcon, MotionIcon, MovieIcon, MusicIcon, MusicOffIcon, MusicVideoIcon, NamaskarIcon, PageBreakIcon, PaletteIcon, PauseIcon, PenIcon, PersonIcon, PhoneIcon, PinIcon, PlayIcon, PlugIcon, PlusIcon, QuoteIcon, RadioCheckedIcon, RadioIcon, ReadingIcon, RedoIcon, RepeatIcon, ResetIcon, RobotIcon, SaveIcon, SchoolIcon, SearchIcon, SearchOffIcon, SendIcon, SentimentSadIcon, ShareIcon, ShieldCheckIcon, ShuffleIcon, SkipIcon, SlideshowIcon, SortDownIcon, SortIcon, SortUpIcon, SparkIcon, SpeakerIcon, SpeedIcon, SpellcheckIcon, StarIcon, StopIcon, StorageIcon, StyleIcon, SunIcon, SunriseIcon, SunsetIcon, SwapIcon, TargetIcon, TempleIcon, TextIcon, TitleIcon, ToolsIcon, TouchIcon, TrendingDownIcon, TrendingUpIcon, TrophyIcon, UnderlineIcon, UndoIcon, UnlockIcon, UploadIcon, UsersIcon, VolumeOffIcon, VolunteerIcon, WalletIcon, WandIcon, WifiIcon, WifiOffIcon, YuktaiIcon, ZoomInIcon, ZoomOutIcon, iconContrast, iconSvg, pickGlyphColor, resolveIconColours };
568
+ export type { IconName, IconProps, IconShape, IconSvgOptions, IconVariant, YuktaiIconProps };
package/dist/index.d.mts CHANGED
@@ -93,25 +93,6 @@ declare const wcagPlugin: {
93
93
  }[];
94
94
  };
95
95
 
96
- interface YuktAIWrapperProps {
97
- position?: "left" | "right";
98
- children: ReactNode;
99
- config?: Partial<A11yConfig>;
100
- showRag?: boolean;
101
- showAgent?: boolean;
102
- }
103
- declare function YuktAIWrapper({ position, children, config: configOverrides, showRag, showAgent, }: YuktAIWrapperProps): react__default.JSX.Element;
104
-
105
- declare const aiPlugin: {
106
- name: string;
107
- execute(input: string): Promise<string>;
108
- };
109
-
110
- declare const voicePlugin: {
111
- name: string;
112
- execute(input: string): Promise<string>;
113
- };
114
-
115
96
  /** Which engine sorts and searches the grid. */
116
97
  type GridEngine = "ts" | "rust" | "auto";
117
98
  /** `engine: "auto"` switches to Rust from this many rows. */
@@ -158,6 +139,38 @@ declare class GridCore {
158
139
  sortByKeys(keys: Float64Array, desc: boolean): Uint32Array | null;
159
140
  }
160
141
 
142
+ interface YuktAIWrapperProps {
143
+ position?: "left" | "right";
144
+ children: ReactNode;
145
+ config?: Partial<A11yConfig>;
146
+ showRag?: boolean;
147
+ showAgent?: boolean;
148
+ /** v5.3.9 — show ♿ Accessibility. Setting this (or showVibeCoder/launcher) switches every button to opt-in. */
149
+ showAccessibility?: boolean;
150
+ /** v5.3.9 — show ⚡ Vibe Coder (a developer tool; in legacy mode it follows showAgent). */
151
+ showVibeCoder?: boolean;
152
+ /** v5.3.9 — one ✨ button that shows/hides the others; remembers the choice; Esc closes. */
153
+ launcher?: boolean;
154
+ /**
155
+ * v5.3.9 — 💬 Ask page finds passages first with the page RAG ("rust",
156
+ * "auto" or "ts"), shows them at once, then lets Gemini Nano /
157
+ * Transformers.js write the answer from only those passages.
158
+ * Not set: 💬 works exactly as before.
159
+ */
160
+ engine?: GridEngine;
161
+ }
162
+ declare function YuktAIWrapper({ position, children, config: configOverrides, showRag, showAgent, showAccessibility, showVibeCoder, launcher, engine, }: YuktAIWrapperProps): react__default.JSX.Element;
163
+
164
+ declare const aiPlugin: {
165
+ name: string;
166
+ execute(input: string): Promise<string>;
167
+ };
168
+
169
+ declare const voicePlugin: {
170
+ name: string;
171
+ execute(input: string): Promise<string>;
172
+ };
173
+
161
174
  /** One search/sort run: what was searched, how long it took, which engine answered. */
162
175
  interface GridSearchTime {
163
176
  /** The search text ("" when only sorting) */
@@ -1114,7 +1127,7 @@ declare function createContextIndex<T>(options?: ContextIndexOptions<T>): {
1114
1127
  /** "rust" when the Rust engine answers searches for this index, else "ts". */
1115
1128
  readonly engine: "rust" | "ts";
1116
1129
  /** Resolves "rust" or "ts" once the engine is loaded (or not wanted). */
1117
- whenEngineReady: () => Promise<"ts" | "rust">;
1130
+ whenEngineReady: () => Promise<"rust" | "ts">;
1118
1131
  };
1119
1132
 
1120
1133
  type TaskAction = "filter" | "highlight" | "sort" | "clear" | "count" | "summarize" | "anomalies" | "open" | "select";
@@ -1320,4 +1333,5 @@ declare const YuktAI: {
1320
1333
  scan(): A11yReport;
1321
1334
  };
1322
1335
 
1323
- export { type A11yConfig, type A11yCopilot, type A11yCopilotOptions, type A11yFix, type A11yReport, type AIFeatures, AUDIT_RULES, type AgenticAnswerKind, AgenticGridBar, AgenticPanel, type AgenticPanelProps, type Aggregation, type AuditCheck, type AuditIssue, type AuditOptions, type AuditReport, type AuditRoot, type AuditRuleId, type AuditSeverity, type ColorBlindMode, type ComparePeriodsOptions, type ContextAnswer, type ContextHit, type ContextIndexOptions, type ContextPassage, type CopilotFixResult, type CopilotState, type CreateGridToolsOptions, DEFAULT_A11Y_SETTINGS, type DesignCategory, type DesignFinding, type DesignReview, type DesignReviewOptions, FONT_MAX, FONT_MIN, FONT_STEP, type FilterConfig, type FilterOperator, type FormField, type FormFinding, type FormFindingLevel, type FormReview, type FormReviewOptions, type GridAgentErrorCode, type GridAgentResult, type GridAgentStep, type GridAgentTool, type GridAnomaly, type GridAnswer, type GridColumn, GridCore, type GridEngine, type GridInputLanguage, type GridIntent, type GridIntentContext, type GridLocale, type GridNavAction, type GridQueryResult, type GridSearchTime, type GridTheme, type GridTool, type GridToolColumn, type GridToolContext, type GridToolErrorCode, type GridToolFilter, type GridToolFilterOperator, type GridToolId, type GridToolLocale, type GridToolResult, type GridToolSort, type GridTranslations, type GroupResult, type IndicLanguageLocale, type InsightAnswer, type PageAnswer, type PageIntent, type PageOutline, type PaginationConfig, type ParseOptions, type ParsedGridQuery, type Period, type PeriodChange, type PeriodComparison, type PlannedStep, type RGBA, RUST_AUTO_MIN_ROWS, type RunTasksOptions, Runtime, type Severity, type SortConfig, type SortDirection, type StepResult, type TaskAction, type TaskRunResult, type UseAgenticGridOptions, type UseGridOptions, type UseGridReturn, type ViewMode, type VoiceA11yCommand, type VoiceA11yControllerOptions, type VoiceFeatures, type WebMCPState, type WebMCPStatus, YuktAI, YuktAIWrapper, type YuktAIWrapperProps, YuktaiGrid, YuktaiGridAI, type YuktaiGridAIProps, useYuktaiGridAgent as YuktaiGridAgent, type YuktaiGridAgentProps, type YuktaiGridProps, type YuktaiGridRule, type YuktaiGridRuleContext, YuktaiGridWebMCP, type YuktaiGridWebMCPProps, accessibleName, addPeriods, aggregate, aiPlugin, analyzePage, answerGridQuestion, applyGridFilters, askAboutPage, askInsight, auditToJSON, auditToMarkdown, clearFilters, clearSort, comparePeriods, contrastRatio, countGrid, createA11yCopilot, createContextIndex, createGridTools, createVoiceA11yController, YuktAIWrapper as default, detectAnomalies, detectPageIntent, executeGridQuery, filterGrid, findMentionedColumn, getColumns, getRow, getRowId, gridPassages, groupBy, highlightRows, loadGridCore, moveGridRowFocus, openRow, pagePassages, parseAmount, parseColor, parseGridIntent, parseGridQuery, parseVoiceA11yCommand, planTasks, readFormFields, relativeLuminance, reviewDesign, reviewForm, reviewForms, runGridQuery, runQaAudit, runTasks, searchGrid, selectRow, sortGrid, startOfPeriod, summarizeRows, toGridToolColumns, tokenize, trend, useAgenticGrid, useGrid, useYuktaiGridAgent, voicePlugin, wantsRustEngine, wcagPlugin as wcag, wcagPlugin };
1336
+ export { AUDIT_RULES, AgenticGridBar, AgenticPanel, DEFAULT_A11Y_SETTINGS, FONT_MAX, FONT_MIN, FONT_STEP, GridCore, RUST_AUTO_MIN_ROWS, Runtime, YuktAI, YuktAIWrapper, YuktaiGrid, YuktaiGridAI, useYuktaiGridAgent as YuktaiGridAgent, YuktaiGridWebMCP, accessibleName, addPeriods, aggregate, aiPlugin, analyzePage, answerGridQuestion, applyGridFilters, askAboutPage, askInsight, auditToJSON, auditToMarkdown, clearFilters, clearSort, comparePeriods, contrastRatio, countGrid, createA11yCopilot, createContextIndex, createGridTools, createVoiceA11yController, YuktAIWrapper as default, detectAnomalies, detectPageIntent, executeGridQuery, filterGrid, findMentionedColumn, getColumns, getRow, getRowId, gridPassages, groupBy, highlightRows, loadGridCore, moveGridRowFocus, openRow, pagePassages, parseAmount, parseColor, parseGridIntent, parseGridQuery, parseVoiceA11yCommand, planTasks, readFormFields, relativeLuminance, reviewDesign, reviewForm, reviewForms, runGridQuery, runQaAudit, runTasks, searchGrid, selectRow, sortGrid, startOfPeriod, summarizeRows, toGridToolColumns, tokenize, trend, useAgenticGrid, useGrid, useYuktaiGridAgent, voicePlugin, wantsRustEngine, wcagPlugin as wcag, wcagPlugin };
1337
+ export type { A11yConfig, A11yCopilot, A11yCopilotOptions, A11yFix, A11yReport, AIFeatures, AgenticAnswerKind, AgenticPanelProps, Aggregation, AuditCheck, AuditIssue, AuditOptions, AuditReport, AuditRoot, AuditRuleId, AuditSeverity, ColorBlindMode, ComparePeriodsOptions, ContextAnswer, ContextHit, ContextIndexOptions, ContextPassage, CopilotFixResult, CopilotState, CreateGridToolsOptions, DesignCategory, DesignFinding, DesignReview, DesignReviewOptions, FilterConfig, FilterOperator, FormField, FormFinding, FormFindingLevel, FormReview, FormReviewOptions, GridAgentErrorCode, GridAgentResult, GridAgentStep, GridAgentTool, GridAnomaly, GridAnswer, GridColumn, GridEngine, GridInputLanguage, GridIntent, GridIntentContext, GridLocale, GridNavAction, GridQueryResult, GridSearchTime, GridTheme, GridTool, GridToolColumn, GridToolContext, GridToolErrorCode, GridToolFilter, GridToolFilterOperator, GridToolId, GridToolLocale, GridToolResult, GridToolSort, GridTranslations, GroupResult, IndicLanguageLocale, InsightAnswer, PageAnswer, PageIntent, PageOutline, PaginationConfig, ParseOptions, ParsedGridQuery, Period, PeriodChange, PeriodComparison, PlannedStep, RGBA, RunTasksOptions, Severity, SortConfig, SortDirection, StepResult, TaskAction, TaskRunResult, UseAgenticGridOptions, UseGridOptions, UseGridReturn, ViewMode, VoiceA11yCommand, VoiceA11yControllerOptions, VoiceFeatures, WebMCPState, WebMCPStatus, YuktAIWrapperProps, YuktaiGridAIProps, YuktaiGridAgentProps, YuktaiGridProps, YuktaiGridRule, YuktaiGridRuleContext, YuktaiGridWebMCPProps };
package/dist/index.d.ts CHANGED
@@ -93,25 +93,6 @@ declare const wcagPlugin: {
93
93
  }[];
94
94
  };
95
95
 
96
- interface YuktAIWrapperProps {
97
- position?: "left" | "right";
98
- children: ReactNode;
99
- config?: Partial<A11yConfig>;
100
- showRag?: boolean;
101
- showAgent?: boolean;
102
- }
103
- declare function YuktAIWrapper({ position, children, config: configOverrides, showRag, showAgent, }: YuktAIWrapperProps): react__default.JSX.Element;
104
-
105
- declare const aiPlugin: {
106
- name: string;
107
- execute(input: string): Promise<string>;
108
- };
109
-
110
- declare const voicePlugin: {
111
- name: string;
112
- execute(input: string): Promise<string>;
113
- };
114
-
115
96
  /** Which engine sorts and searches the grid. */
116
97
  type GridEngine = "ts" | "rust" | "auto";
117
98
  /** `engine: "auto"` switches to Rust from this many rows. */
@@ -158,6 +139,38 @@ declare class GridCore {
158
139
  sortByKeys(keys: Float64Array, desc: boolean): Uint32Array | null;
159
140
  }
160
141
 
142
+ interface YuktAIWrapperProps {
143
+ position?: "left" | "right";
144
+ children: ReactNode;
145
+ config?: Partial<A11yConfig>;
146
+ showRag?: boolean;
147
+ showAgent?: boolean;
148
+ /** v5.3.9 — show ♿ Accessibility. Setting this (or showVibeCoder/launcher) switches every button to opt-in. */
149
+ showAccessibility?: boolean;
150
+ /** v5.3.9 — show ⚡ Vibe Coder (a developer tool; in legacy mode it follows showAgent). */
151
+ showVibeCoder?: boolean;
152
+ /** v5.3.9 — one ✨ button that shows/hides the others; remembers the choice; Esc closes. */
153
+ launcher?: boolean;
154
+ /**
155
+ * v5.3.9 — 💬 Ask page finds passages first with the page RAG ("rust",
156
+ * "auto" or "ts"), shows them at once, then lets Gemini Nano /
157
+ * Transformers.js write the answer from only those passages.
158
+ * Not set: 💬 works exactly as before.
159
+ */
160
+ engine?: GridEngine;
161
+ }
162
+ declare function YuktAIWrapper({ position, children, config: configOverrides, showRag, showAgent, showAccessibility, showVibeCoder, launcher, engine, }: YuktAIWrapperProps): react__default.JSX.Element;
163
+
164
+ declare const aiPlugin: {
165
+ name: string;
166
+ execute(input: string): Promise<string>;
167
+ };
168
+
169
+ declare const voicePlugin: {
170
+ name: string;
171
+ execute(input: string): Promise<string>;
172
+ };
173
+
161
174
  /** One search/sort run: what was searched, how long it took, which engine answered. */
162
175
  interface GridSearchTime {
163
176
  /** The search text ("" when only sorting) */
@@ -1114,7 +1127,7 @@ declare function createContextIndex<T>(options?: ContextIndexOptions<T>): {
1114
1127
  /** "rust" when the Rust engine answers searches for this index, else "ts". */
1115
1128
  readonly engine: "rust" | "ts";
1116
1129
  /** Resolves "rust" or "ts" once the engine is loaded (or not wanted). */
1117
- whenEngineReady: () => Promise<"ts" | "rust">;
1130
+ whenEngineReady: () => Promise<"rust" | "ts">;
1118
1131
  };
1119
1132
 
1120
1133
  type TaskAction = "filter" | "highlight" | "sort" | "clear" | "count" | "summarize" | "anomalies" | "open" | "select";
@@ -1320,4 +1333,5 @@ declare const YuktAI: {
1320
1333
  scan(): A11yReport;
1321
1334
  };
1322
1335
 
1323
- export { type A11yConfig, type A11yCopilot, type A11yCopilotOptions, type A11yFix, type A11yReport, type AIFeatures, AUDIT_RULES, type AgenticAnswerKind, AgenticGridBar, AgenticPanel, type AgenticPanelProps, type Aggregation, type AuditCheck, type AuditIssue, type AuditOptions, type AuditReport, type AuditRoot, type AuditRuleId, type AuditSeverity, type ColorBlindMode, type ComparePeriodsOptions, type ContextAnswer, type ContextHit, type ContextIndexOptions, type ContextPassage, type CopilotFixResult, type CopilotState, type CreateGridToolsOptions, DEFAULT_A11Y_SETTINGS, type DesignCategory, type DesignFinding, type DesignReview, type DesignReviewOptions, FONT_MAX, FONT_MIN, FONT_STEP, type FilterConfig, type FilterOperator, type FormField, type FormFinding, type FormFindingLevel, type FormReview, type FormReviewOptions, type GridAgentErrorCode, type GridAgentResult, type GridAgentStep, type GridAgentTool, type GridAnomaly, type GridAnswer, type GridColumn, GridCore, type GridEngine, type GridInputLanguage, type GridIntent, type GridIntentContext, type GridLocale, type GridNavAction, type GridQueryResult, type GridSearchTime, type GridTheme, type GridTool, type GridToolColumn, type GridToolContext, type GridToolErrorCode, type GridToolFilter, type GridToolFilterOperator, type GridToolId, type GridToolLocale, type GridToolResult, type GridToolSort, type GridTranslations, type GroupResult, type IndicLanguageLocale, type InsightAnswer, type PageAnswer, type PageIntent, type PageOutline, type PaginationConfig, type ParseOptions, type ParsedGridQuery, type Period, type PeriodChange, type PeriodComparison, type PlannedStep, type RGBA, RUST_AUTO_MIN_ROWS, type RunTasksOptions, Runtime, type Severity, type SortConfig, type SortDirection, type StepResult, type TaskAction, type TaskRunResult, type UseAgenticGridOptions, type UseGridOptions, type UseGridReturn, type ViewMode, type VoiceA11yCommand, type VoiceA11yControllerOptions, type VoiceFeatures, type WebMCPState, type WebMCPStatus, YuktAI, YuktAIWrapper, type YuktAIWrapperProps, YuktaiGrid, YuktaiGridAI, type YuktaiGridAIProps, useYuktaiGridAgent as YuktaiGridAgent, type YuktaiGridAgentProps, type YuktaiGridProps, type YuktaiGridRule, type YuktaiGridRuleContext, YuktaiGridWebMCP, type YuktaiGridWebMCPProps, accessibleName, addPeriods, aggregate, aiPlugin, analyzePage, answerGridQuestion, applyGridFilters, askAboutPage, askInsight, auditToJSON, auditToMarkdown, clearFilters, clearSort, comparePeriods, contrastRatio, countGrid, createA11yCopilot, createContextIndex, createGridTools, createVoiceA11yController, YuktAIWrapper as default, detectAnomalies, detectPageIntent, executeGridQuery, filterGrid, findMentionedColumn, getColumns, getRow, getRowId, gridPassages, groupBy, highlightRows, loadGridCore, moveGridRowFocus, openRow, pagePassages, parseAmount, parseColor, parseGridIntent, parseGridQuery, parseVoiceA11yCommand, planTasks, readFormFields, relativeLuminance, reviewDesign, reviewForm, reviewForms, runGridQuery, runQaAudit, runTasks, searchGrid, selectRow, sortGrid, startOfPeriod, summarizeRows, toGridToolColumns, tokenize, trend, useAgenticGrid, useGrid, useYuktaiGridAgent, voicePlugin, wantsRustEngine, wcagPlugin as wcag, wcagPlugin };
1336
+ export { AUDIT_RULES, AgenticGridBar, AgenticPanel, DEFAULT_A11Y_SETTINGS, FONT_MAX, FONT_MIN, FONT_STEP, GridCore, RUST_AUTO_MIN_ROWS, Runtime, YuktAI, YuktAIWrapper, YuktaiGrid, YuktaiGridAI, useYuktaiGridAgent as YuktaiGridAgent, YuktaiGridWebMCP, accessibleName, addPeriods, aggregate, aiPlugin, analyzePage, answerGridQuestion, applyGridFilters, askAboutPage, askInsight, auditToJSON, auditToMarkdown, clearFilters, clearSort, comparePeriods, contrastRatio, countGrid, createA11yCopilot, createContextIndex, createGridTools, createVoiceA11yController, YuktAIWrapper as default, detectAnomalies, detectPageIntent, executeGridQuery, filterGrid, findMentionedColumn, getColumns, getRow, getRowId, gridPassages, groupBy, highlightRows, loadGridCore, moveGridRowFocus, openRow, pagePassages, parseAmount, parseColor, parseGridIntent, parseGridQuery, parseVoiceA11yCommand, planTasks, readFormFields, relativeLuminance, reviewDesign, reviewForm, reviewForms, runGridQuery, runQaAudit, runTasks, searchGrid, selectRow, sortGrid, startOfPeriod, summarizeRows, toGridToolColumns, tokenize, trend, useAgenticGrid, useGrid, useYuktaiGridAgent, voicePlugin, wantsRustEngine, wcagPlugin as wcag, wcagPlugin };
1337
+ export type { A11yConfig, A11yCopilot, A11yCopilotOptions, A11yFix, A11yReport, AIFeatures, AgenticAnswerKind, AgenticPanelProps, Aggregation, AuditCheck, AuditIssue, AuditOptions, AuditReport, AuditRoot, AuditRuleId, AuditSeverity, ColorBlindMode, ComparePeriodsOptions, ContextAnswer, ContextHit, ContextIndexOptions, ContextPassage, CopilotFixResult, CopilotState, CreateGridToolsOptions, DesignCategory, DesignFinding, DesignReview, DesignReviewOptions, FilterConfig, FilterOperator, FormField, FormFinding, FormFindingLevel, FormReview, FormReviewOptions, GridAgentErrorCode, GridAgentResult, GridAgentStep, GridAgentTool, GridAnomaly, GridAnswer, GridColumn, GridEngine, GridInputLanguage, GridIntent, GridIntentContext, GridLocale, GridNavAction, GridQueryResult, GridSearchTime, GridTheme, GridTool, GridToolColumn, GridToolContext, GridToolErrorCode, GridToolFilter, GridToolFilterOperator, GridToolId, GridToolLocale, GridToolResult, GridToolSort, GridTranslations, GroupResult, IndicLanguageLocale, InsightAnswer, PageAnswer, PageIntent, PageOutline, PaginationConfig, ParseOptions, ParsedGridQuery, Period, PeriodChange, PeriodComparison, PlannedStep, RGBA, RunTasksOptions, Severity, SortConfig, SortDirection, StepResult, TaskAction, TaskRunResult, UseAgenticGridOptions, UseGridOptions, UseGridReturn, ViewMode, VoiceA11yCommand, VoiceA11yControllerOptions, VoiceFeatures, WebMCPState, WebMCPStatus, YuktAIWrapperProps, YuktaiGridAIProps, YuktaiGridAgentProps, YuktaiGridProps, YuktaiGridRule, YuktaiGridRuleContext, YuktaiGridWebMCPProps };