agentiqa 1.1.5 → 1.1.6-staging.24a6770

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.
Files changed (2) hide show
  1. package/dist/cli.js +1 -1
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -291,7 +291,7 @@ Do NOT tap elements that are partially visible at the screen edge \u2014 scroll
291
291
  `)}catch(n){let s=Date.now()-t;return console.warn(`[MobileElements] Failed to list elements (${s}ms):`,n.message),""}}async callMcpTool(e,t,n,s){if(t==="mobile_type_text"&&typeof n.text=="string"&&/^\d{4,8}$/.test(n.text)){let l=n.text;for(let u=0;u<l.length;u++)await this.mobileMcp.callTool(e,"mobile_type_keys",{text:l[u],submit:!1}),u<l.length-1&&await new Promise(m=>setTimeout(m,150));return n.submit&&await this.mobileMcp.callTool(e,"mobile_press_button",{button:"ENTER"}),`Typed OTP code: ${l}`}if(t==="mobile_restart_app"){let l=s?.mobileConfig?.appIdentifier||"";return await this.mobileMcp.callTool(e,"mobile_terminate_app",{packageName:l}),await this.mobileMcp.callTool(e,"mobile_launch_app",{packageName:l}),`Restarted ${l}.`}let a={mobile_screenshot:{mcpName:"mobile_take_screenshot",buildArgs:()=>({})},mobile_tap:{mcpName:"mobile_click_on_screen_at_coordinates",buildArgs:l=>({x:l.x,y:l.y})},mobile_long_press:{mcpName:"mobile_long_press_on_screen_at_coordinates",buildArgs:l=>({x:l.x,y:l.y})},mobile_swipe:{mcpName:"mobile_swipe_on_screen",buildArgs:l=>({direction:l.direction,...l.from_x!==void 0?{x:l.from_x}:{},...l.from_y!==void 0?{y:l.from_y}:{},...l.distance!==void 0?{distance:l.distance}:{}})},mobile_type_text:{mcpName:"mobile_type_keys",buildArgs:l=>({text:l.text,submit:l.submit??!1})},mobile_press_button:{mcpName:"mobile_press_button",buildArgs:l=>({button:l.button})},mobile_open_url:{mcpName:"mobile_open_url",buildArgs:l=>({url:l.url})},mobile_launch_app:{mcpName:"mobile_launch_app",buildArgs:l=>({packageName:l.packageName})},mobile_install_app:{mcpName:"mobile_install_app",buildArgs:(l,u)=>({path:u?.mobileConfig?.appPath||u?.mobileConfig?.apkPath||""})},mobile_uninstall_app:{mcpName:"mobile_uninstall_app",buildArgs:(l,u)=>({bundle_id:u?.mobileConfig?.appIdentifier||""})},mobile_stop_app:{mcpName:"mobile_terminate_app",buildArgs:(l,u)=>({packageName:u?.mobileConfig?.appIdentifier||""})},mobile_list_installed_apps:{mcpName:"mobile_list_apps",buildArgs:()=>({})}}[t];if(!a)throw new Error(`Unknown mobile action: ${t}`);return(await this.mobileMcp.callTool(e,a.mcpName,a.buildArgs(n,s)))?.content?.find(l=>l.type==="text")?.text}};function gs(r){let e=r.toLowerCase().replace(/[^\w\s]/g,"").split(/\s+/).filter(Boolean);return new Set(e)}function Xa(r,e){if(r.size===0&&e.size===0)return 0;let t=0;for(let s of r)e.has(s)&&t++;let n=r.size+e.size-t;return t/n}var lv=.5;function Qa(r,e,t=lv){let n=gs(r);if(n.size===0)return!1;for(let s of e){let o=gs(s);if(Xa(n,o)>=t)return!0}return!1}var cv={navigation:"Navigation",interaction:"Interaction",data:"Data",auth:"Auth",general:"General"},uv=["navigation","interaction","data","auth","general"];function Kr(r){if(r.length===0)return"";let e={};for(let n of r){let s=n.category||"general";e[s]||(e[s]=[]),e[s].push(n.text)}let t="";for(let n of uv){let s=e[n];if(!(!s||s.length===0)){t+=`
292
292
  **${cv[n]||n}**:
293
293
  `;for(let o of s)t+=`- ${o}
294
- `}}return t}function Za(r,e){let{surfaces:t,entities:n,flows:s}={surfaces:[...r.surfaces],entities:[...r.entities],flows:[...r.flows]};if(e.remove?.length){let o=new Set(e.remove);t=t.filter(a=>!o.has(a.id)),n=n.filter(a=>!o.has(a.id)),s=s.filter(a=>!o.has(a.id))}if(e.add_surfaces?.length)for(let o of e.add_surfaces){if(!o.id)continue;let a=t.findIndex(i=>i.id===o.id);a>=0?t[a]={...t[a],...o}:t.push(o)}if(e.add_entities?.length)for(let o of e.add_entities){if(!o.id)continue;let a=n.findIndex(i=>i.id===o.id);a>=0?n[a]={...n[a],...o}:n.push(o)}if(e.add_flows?.length)for(let o of e.add_flows){if(!o.id)continue;let a=s.findIndex(i=>i.id===o.id);a>=0?s[a]={...s[a],...o}:s.push(o)}if(e.update_entity_states?.length)for(let o of e.update_entity_states){let a=n.find(i=>i.id===o.entityId);if(a)for(let i of o.states)a.states.some(c=>c.name===i.name)||a.states.push(i)}if(e.set_service_endpoints?.length)for(let o of e.set_service_endpoints){let a=n.find(i=>i.id===o.entityId);a&&(a.service_endpoints=o.endpoints)}return{surfaces:t,entities:n,flows:s}}var dv=new Set(["signal_step","wait","wait_5_seconds","screenshot","full_page_screenshot","snapshot","open_web_browser","mobile_screenshot"]),pv=3,mv=5,hv=6,fv=10,gv=3,yv=4,vv=30,ys=class{lastKey=null;consecutiveCount=0;lastUrl=null;lastScreenFingerprint=null;stepSeenScreenSizes=new Set;noProgressCount=0;cumulativeWarnCount=0;actionsSinceProgress=0;drainTimeoutCount=0;drainTimeoutUrl=null;buildKey(e,t){if(e==="click_at"||e==="right_click_at"||e==="hover_at"){if(t.ref)return`${e}:ref=${t.ref}`;let n=Math.round(Number(t.x??0)/50)*50,s=Math.round(Number(t.y??0)/50)*50;return`${e}:${n},${s}`}if(e==="type_text_at"){if(t.ref)return`${e}:ref=${t.ref}`;let n=Math.round(Number(t.x??0)/50)*50,s=Math.round(Number(t.y??0)/50)*50;return`${e}:${n},${s}`}if(e==="mobile_tap"||e==="mobile_long_press"){let n=Math.round(Number(t.x??0)/50)*50,s=Math.round(Number(t.y??0)/50)*50;return`${e}:${n},${s}`}if(e==="mobile_swipe")return`${e}:${String(t.direction??"")}`;if(e==="mobile_type_text")return`${e}:${String(t.text??"")}`;if(e==="mobile_press_button")return`${e}:${String(t.button??"")}`;if(e==="mobile_launch_app")return`${e}:${String(t.packageName??"")}`;if(e==="mobile_open_url")return`${e}:${String(t.url??"")}`;if(e==="wait_for_element")return`${e}:${String(t.textContent??"")}`;if(e==="scroll_document")return`${e}:${String(t.direction??"")}`;if(e==="scroll_at"){if(t.ref)return`${e}:ref=${t.ref},${String(t.direction??"")}`;let n=Math.round(Number(t.x??0)/50)*50,s=Math.round(Number(t.y??0)/50)*50;return`${e}:${n},${s},${String(t.direction??"")}`}return e}resetForNewStep(){this.lastKey=null,this.consecutiveCount=0,this.stepSeenScreenSizes.clear(),this.noProgressCount=0,this.cumulativeWarnCount=0,this.actionsSinceProgress=0}markProgress(){this.actionsSinceProgress=0}updateUrl(e){this.lastUrl!==null&&e!==this.lastUrl&&(this.lastKey=null,this.consecutiveCount=0),this.lastUrl=e}updateScreenContent(e,t){let n=e||String(t??0);this.lastScreenFingerprint!==null&&n!==this.lastScreenFingerprint&&(this.lastKey=null,this.consecutiveCount=0),this.lastScreenFingerprint=n,t!==void 0&&t>0&&(this.stepSeenScreenSizes.has(t)?this.noProgressCount++:(this.stepSeenScreenSizes.add(t),this.noProgressCount=0))}recordDrainResult(e){e.drainTimedOut?this.drainTimeoutUrl===(e.url??null)?this.drainTimeoutCount++:(this.drainTimeoutUrl=e.url??null,this.drainTimeoutCount=1):(this.drainTimeoutCount=0,this.drainTimeoutUrl=null)}check(e,t,n){if(dv.has(e))return{action:"proceed"};if(this.drainTimeoutCount>=gv)return{action:"force_block",message:`backend_unresponsive: ${this.drainTimeoutCount} consecutive drain timeouts on ${this.drainTimeoutUrl??"unknown url"}. The backend is not responding to writes. Auto-stopping.`};if(e==="switch_tab"||e==="close_tab")return this.lastKey=null,this.consecutiveCount=0,{action:"proceed"};if(this.actionsSinceProgress++,this.actionsSinceProgress>=vv)return{action:"force_block",message:`Structural loop: ${this.actionsSinceProgress} substantive actions without a recognised progress milestone. Each action changes the screen but the task is not converging. Auto-stopping.`};let s=this.buildKey(e,t);return s===this.lastKey?this.consecutiveCount++:(this.lastKey=s,this.consecutiveCount=1),this.consecutiveCount>=mv?{action:"force_block",message:`Repeated action "${e}" detected ${this.consecutiveCount} times without progress. Auto-stopping.`}:this.noProgressCount>=fv?{action:"force_block",message:`No screen progress detected after ${this.noProgressCount} actions \u2014 the page keeps cycling between the same states. Auto-stopping.`}:this.cumulativeWarnCount>=yv?{action:"force_block",message:`Cumulative loop warnings: ${this.cumulativeWarnCount} warnings fired this step without the agent recovering. Auto-stopping.`}:this.consecutiveCount>=pv?(this.cumulativeWarnCount++,{action:"warn",message:`Loop detected: "${e}" attempted ${this.consecutiveCount} times on the same target without progress. Do NOT retry this action. Call report_issue to report the problem, then exploration_blocked to request help.`}):this.noProgressCount>=hv?(this.noProgressCount++,this.cumulativeWarnCount++,{action:"warn",message:`No screen progress: the page keeps returning to previously seen states (${this.noProgressCount-1} consecutive). The current action is not having the intended effect. Do NOT retry. Call report_issue to report the problem, then exploration_blocked to request help.`}):{action:"proceed"}}};var vs=class{currentScreen=null;attempts=[];recordTap(e,t,n,s,o){let a=this.detectScreenChange(e,o);if(a!=="none"&&this.attempts.length>=2){let i=a==="name"?this.attempts[this.attempts.length-1]:{x:t,y:n,intent:s,postScreenshotSize:o},c=`On '${this.currentScreen}', '${i.intent}' succeeded at tap coordinates (${i.x}, ${i.y})`;return this.currentScreen=e,this.attempts=[{x:t,y:n,intent:s,postScreenshotSize:o}],{memoryProposal:c}}return a!=="none"?(this.currentScreen=e,this.attempts=[{x:t,y:n,intent:s,postScreenshotSize:o}],{}):(this.currentScreen===null&&(this.currentScreen=e),this.attempts.push({x:t,y:n,intent:s,postScreenshotSize:o}),{})}reset(){this.currentScreen=null,this.attempts=[]}detectScreenChange(e,t){if(this.currentScreen!==null&&e!==this.currentScreen)return"name";if(this.attempts.length===0)return"none";let n=this.attempts[this.attempts.length-1].postScreenshotSize;return n===0&&t>0&&this.attempts.length>=2?"size":n===0||t===0?"none":Math.abs(t-n)/n>=.1?"size":"none"}};var $c="vercel.ai.error",bv=Symbol.for($c),cc,uc,ue=class Lc extends(uc=Error,cc=bv,uc){constructor({name:e,message:t,cause:n}){super(t),this[cc]=!0,this.name=e,this.cause=n}static isInstance(e){return Lc.hasMarker(e,$c)}static hasMarker(e,t){let n=Symbol.for(t);return e!=null&&typeof e=="object"&&n in e&&typeof e[n]=="boolean"&&e[n]===!0}},Uc="AI_APICallError",Fc=`vercel.ai.error.${Uc}`,_v=Symbol.for(Fc),dc,pc,Ge=class extends(pc=ue,dc=_v,pc){constructor({message:r,url:e,requestBodyValues:t,statusCode:n,responseHeaders:s,responseBody:o,cause:a,isRetryable:i=n!=null&&(n===408||n===409||n===429||n>=500),data:c}){super({name:Uc,message:r,cause:a}),this[dc]=!0,this.url=e,this.requestBodyValues=t,this.statusCode=n,this.responseHeaders=s,this.responseBody=o,this.isRetryable=i,this.data=c}static isInstance(r){return ue.hasMarker(r,Fc)}},qc="AI_EmptyResponseBodyError",Bc=`vercel.ai.error.${qc}`,wv=Symbol.for(Bc),mc,hc,Vc=class extends(hc=ue,mc=wv,hc){constructor({message:r="Empty response body"}={}){super({name:qc,message:r}),this[mc]=!0}static isInstance(r){return ue.hasMarker(r,Bc)}};function Cr(r){return r==null?"unknown error":typeof r=="string"?r:r instanceof Error?r.message:JSON.stringify(r)}var Hc="AI_InvalidArgumentError",zc=`vercel.ai.error.${Hc}`,Sv=Symbol.for(zc),fc,gc,Tn=class extends(gc=ue,fc=Sv,gc){constructor({message:r,cause:e,argument:t}){super({name:Hc,message:r,cause:e}),this[fc]=!0,this.argument=t}static isInstance(r){return ue.hasMarker(r,zc)}},Wc="AI_InvalidPromptError",Gc=`vercel.ai.error.${Wc}`,xv=Symbol.for(Gc),yc,vc,Xr=class extends(vc=ue,yc=xv,vc){constructor({prompt:r,message:e,cause:t}){super({name:Wc,message:`Invalid prompt: ${e}`,cause:t}),this[yc]=!0,this.prompt=r}static isInstance(r){return ue.hasMarker(r,Gc)}},Yc="AI_InvalidResponseDataError",Jc=`vercel.ai.error.${Yc}`,Tv=Symbol.for(Jc),bc,_c,EM=class extends(_c=ue,bc=Tv,_c){constructor({data:r,message:e=`Invalid response data: ${JSON.stringify(r)}.`}){super({name:Yc,message:e}),this[bc]=!0,this.data=r}static isInstance(r){return ue.hasMarker(r,Jc)}},Kc="AI_JSONParseError",Xc=`vercel.ai.error.${Kc}`,Iv=Symbol.for(Xc),wc,Sc,bs=class extends(Sc=ue,wc=Iv,Sc){constructor({text:r,cause:e}){super({name:Kc,message:`JSON parsing failed: Text: ${r}.
294
+ `}}return t}function Za(r,e){let{surfaces:t,entities:n,flows:s}={surfaces:[...r.surfaces],entities:[...r.entities],flows:[...r.flows]};if(e.remove?.length){let o=new Set(e.remove);t=t.filter(a=>!o.has(a.id)),n=n.filter(a=>!o.has(a.id)),s=s.filter(a=>!o.has(a.id))}if(e.add_surfaces?.length)for(let o of e.add_surfaces){if(!o.id)continue;let a=t.findIndex(i=>i.id===o.id);a>=0?t[a]={...t[a],...o}:t.push(o)}if(e.add_entities?.length)for(let o of e.add_entities){if(!o.id)continue;let a=n.findIndex(i=>i.id===o.id);a>=0?n[a]={...n[a],...o}:n.push(o)}if(e.add_flows?.length)for(let o of e.add_flows){if(!o.id)continue;let a=s.findIndex(i=>i.id===o.id);a>=0?s[a]={...s[a],...o}:s.push(o)}if(e.update_entity_states?.length)for(let o of e.update_entity_states){let a=n.find(i=>i.id===o.entityId);if(a)for(let i of o.states)a.states.some(c=>c.name===i.name)||a.states.push(i)}if(e.set_service_endpoints?.length)for(let o of e.set_service_endpoints){let a=n.find(i=>i.id===o.entityId);a&&(a.service_endpoints=o.endpoints)}return{surfaces:t,entities:n,flows:s}}var dv=new Set(["signal_step","wait","wait_5_seconds","screenshot","full_page_screenshot","snapshot","open_web_browser","mobile_screenshot"]),pv=3,mv=5,hv=4,fv=6,gv=3,yv=4,vv=30,ys=class{lastKey=null;consecutiveCount=0;lastUrl=null;lastScreenFingerprint=null;stepSeenScreenSizes=new Set;noProgressCount=0;cumulativeWarnCount=0;actionsSinceProgress=0;drainTimeoutCount=0;drainTimeoutUrl=null;buildKey(e,t){if(e==="click_at"||e==="right_click_at"||e==="hover_at"){if(t.ref)return`${e}:ref=${t.ref}`;let n=Math.round(Number(t.x??0)/50)*50,s=Math.round(Number(t.y??0)/50)*50;return`${e}:${n},${s}`}if(e==="type_text_at"){if(t.ref)return`${e}:ref=${t.ref}`;let n=Math.round(Number(t.x??0)/50)*50,s=Math.round(Number(t.y??0)/50)*50;return`${e}:${n},${s}`}if(e==="mobile_tap"||e==="mobile_long_press"){let n=Math.round(Number(t.x??0)/50)*50,s=Math.round(Number(t.y??0)/50)*50;return`${e}:${n},${s}`}if(e==="mobile_swipe")return`${e}:${String(t.direction??"")}`;if(e==="mobile_type_text")return`${e}:${String(t.text??"")}`;if(e==="mobile_press_button")return`${e}:${String(t.button??"")}`;if(e==="mobile_launch_app")return`${e}:${String(t.packageName??"")}`;if(e==="mobile_open_url")return`${e}:${String(t.url??"")}`;if(e==="wait_for_element")return`${e}:${String(t.textContent??"")}`;if(e==="scroll_document")return`${e}:${String(t.direction??"")}`;if(e==="scroll_at"){if(t.ref)return`${e}:ref=${t.ref},${String(t.direction??"")}`;let n=Math.round(Number(t.x??0)/50)*50,s=Math.round(Number(t.y??0)/50)*50;return`${e}:${n},${s},${String(t.direction??"")}`}return e}resetForNewStep(){this.lastKey=null,this.consecutiveCount=0,this.stepSeenScreenSizes.clear(),this.noProgressCount=0,this.cumulativeWarnCount=0,this.actionsSinceProgress=0}markProgress(){this.actionsSinceProgress=0}updateUrl(e){this.lastUrl!==null&&e!==this.lastUrl&&(this.lastKey=null,this.consecutiveCount=0),this.lastUrl=e}updateScreenContent(e,t){let n=e||String(t??0);this.lastScreenFingerprint!==null&&n!==this.lastScreenFingerprint&&(this.lastKey=null,this.consecutiveCount=0),this.lastScreenFingerprint=n,t!==void 0&&t>0&&(this.stepSeenScreenSizes.has(t)?this.noProgressCount++:(this.stepSeenScreenSizes.add(t),this.noProgressCount=0))}recordDrainResult(e){e.drainTimedOut?this.drainTimeoutUrl===(e.url??null)?this.drainTimeoutCount++:(this.drainTimeoutUrl=e.url??null,this.drainTimeoutCount=1):(this.drainTimeoutCount=0,this.drainTimeoutUrl=null)}check(e,t,n){if(dv.has(e))return{action:"proceed"};if(this.drainTimeoutCount>=gv)return{action:"force_block",message:`backend_unresponsive: ${this.drainTimeoutCount} consecutive drain timeouts on ${this.drainTimeoutUrl??"unknown url"}. The backend is not responding to writes. Auto-stopping.`};if(e==="switch_tab"||e==="close_tab")return this.lastKey=null,this.consecutiveCount=0,{action:"proceed"};if(this.actionsSinceProgress++,this.actionsSinceProgress>=vv)return{action:"force_block",message:`Structural loop: ${this.actionsSinceProgress} substantive actions without a recognised progress milestone. Each action changes the screen but the task is not converging. Auto-stopping.`};let s=this.buildKey(e,t);return s===this.lastKey?this.consecutiveCount++:(this.lastKey=s,this.consecutiveCount=1),this.consecutiveCount>=mv?{action:"force_block",message:`Repeated action "${e}" detected ${this.consecutiveCount} times without progress. Auto-stopping.`}:this.noProgressCount>=fv?{action:"force_block",message:`No screen progress detected after ${this.noProgressCount} actions \u2014 the page keeps cycling between the same states. Auto-stopping.`}:this.cumulativeWarnCount>=yv?{action:"force_block",message:`Cumulative loop warnings: ${this.cumulativeWarnCount} warnings fired this step without the agent recovering. Auto-stopping.`}:this.consecutiveCount>=pv?(this.cumulativeWarnCount++,{action:"warn",message:`Loop detected: "${e}" attempted ${this.consecutiveCount} times on the same target without progress. Do NOT retry this action. Call report_issue to report the problem, then exploration_blocked to request help.`}):this.noProgressCount>=hv?(this.noProgressCount++,this.cumulativeWarnCount++,{action:"warn",message:`No screen progress: the page keeps returning to previously seen states (${this.noProgressCount-1} consecutive). The current action is not having the intended effect. Do NOT retry. Call report_issue to report the problem, then exploration_blocked to request help.`}):{action:"proceed"}}};var vs=class{currentScreen=null;attempts=[];recordTap(e,t,n,s,o){let a=this.detectScreenChange(e,o);if(a!=="none"&&this.attempts.length>=2){let i=a==="name"?this.attempts[this.attempts.length-1]:{x:t,y:n,intent:s,postScreenshotSize:o},c=`On '${this.currentScreen}', '${i.intent}' succeeded at tap coordinates (${i.x}, ${i.y})`;return this.currentScreen=e,this.attempts=[{x:t,y:n,intent:s,postScreenshotSize:o}],{memoryProposal:c}}return a!=="none"?(this.currentScreen=e,this.attempts=[{x:t,y:n,intent:s,postScreenshotSize:o}],{}):(this.currentScreen===null&&(this.currentScreen=e),this.attempts.push({x:t,y:n,intent:s,postScreenshotSize:o}),{})}reset(){this.currentScreen=null,this.attempts=[]}detectScreenChange(e,t){if(this.currentScreen!==null&&e!==this.currentScreen)return"name";if(this.attempts.length===0)return"none";let n=this.attempts[this.attempts.length-1].postScreenshotSize;return n===0&&t>0&&this.attempts.length>=2?"size":n===0||t===0?"none":Math.abs(t-n)/n>=.1?"size":"none"}};var $c="vercel.ai.error",bv=Symbol.for($c),cc,uc,ue=class Lc extends(uc=Error,cc=bv,uc){constructor({name:e,message:t,cause:n}){super(t),this[cc]=!0,this.name=e,this.cause=n}static isInstance(e){return Lc.hasMarker(e,$c)}static hasMarker(e,t){let n=Symbol.for(t);return e!=null&&typeof e=="object"&&n in e&&typeof e[n]=="boolean"&&e[n]===!0}},Uc="AI_APICallError",Fc=`vercel.ai.error.${Uc}`,_v=Symbol.for(Fc),dc,pc,Ge=class extends(pc=ue,dc=_v,pc){constructor({message:r,url:e,requestBodyValues:t,statusCode:n,responseHeaders:s,responseBody:o,cause:a,isRetryable:i=n!=null&&(n===408||n===409||n===429||n>=500),data:c}){super({name:Uc,message:r,cause:a}),this[dc]=!0,this.url=e,this.requestBodyValues=t,this.statusCode=n,this.responseHeaders=s,this.responseBody=o,this.isRetryable=i,this.data=c}static isInstance(r){return ue.hasMarker(r,Fc)}},qc="AI_EmptyResponseBodyError",Bc=`vercel.ai.error.${qc}`,wv=Symbol.for(Bc),mc,hc,Vc=class extends(hc=ue,mc=wv,hc){constructor({message:r="Empty response body"}={}){super({name:qc,message:r}),this[mc]=!0}static isInstance(r){return ue.hasMarker(r,Bc)}};function Cr(r){return r==null?"unknown error":typeof r=="string"?r:r instanceof Error?r.message:JSON.stringify(r)}var Hc="AI_InvalidArgumentError",zc=`vercel.ai.error.${Hc}`,Sv=Symbol.for(zc),fc,gc,Tn=class extends(gc=ue,fc=Sv,gc){constructor({message:r,cause:e,argument:t}){super({name:Hc,message:r,cause:e}),this[fc]=!0,this.argument=t}static isInstance(r){return ue.hasMarker(r,zc)}},Wc="AI_InvalidPromptError",Gc=`vercel.ai.error.${Wc}`,xv=Symbol.for(Gc),yc,vc,Xr=class extends(vc=ue,yc=xv,vc){constructor({prompt:r,message:e,cause:t}){super({name:Wc,message:`Invalid prompt: ${e}`,cause:t}),this[yc]=!0,this.prompt=r}static isInstance(r){return ue.hasMarker(r,Gc)}},Yc="AI_InvalidResponseDataError",Jc=`vercel.ai.error.${Yc}`,Tv=Symbol.for(Jc),bc,_c,EM=class extends(_c=ue,bc=Tv,_c){constructor({data:r,message:e=`Invalid response data: ${JSON.stringify(r)}.`}){super({name:Yc,message:e}),this[bc]=!0,this.data=r}static isInstance(r){return ue.hasMarker(r,Jc)}},Kc="AI_JSONParseError",Xc=`vercel.ai.error.${Kc}`,Iv=Symbol.for(Xc),wc,Sc,bs=class extends(Sc=ue,wc=Iv,Sc){constructor({text:r,cause:e}){super({name:Kc,message:`JSON parsing failed: Text: ${r}.
295
295
  Error message: ${Cr(e)}`,cause:e}),this[wc]=!0,this.text=r}static isInstance(r){return ue.hasMarker(r,Xc)}},Qc="AI_LoadAPIKeyError",Zc=`vercel.ai.error.${Qc}`,Ev=Symbol.for(Zc),xc,Tc,_s=class extends(Tc=ue,xc=Ev,Tc){constructor({message:r}){super({name:Qc,message:r}),this[xc]=!0}static isInstance(r){return ue.hasMarker(r,Zc)}},eu="AI_LoadSettingError",tu=`vercel.ai.error.${eu}`,kv=Symbol.for(tu),Ic,Ec,kM=class extends(Ec=ue,Ic=kv,Ec){constructor({message:r}){super({name:eu,message:r}),this[Ic]=!0}static isInstance(r){return ue.hasMarker(r,tu)}},ru="AI_NoContentGeneratedError",nu=`vercel.ai.error.${ru}`,Av=Symbol.for(nu),kc,Ac,AM=class extends(Ac=ue,kc=Av,Ac){constructor({message:r="No content generated."}={}){super({name:ru,message:r}),this[kc]=!0}static isInstance(r){return ue.hasMarker(r,nu)}},su="AI_NoSuchModelError",ou=`vercel.ai.error.${su}`,Rv=Symbol.for(ou),Rc,Cc,ti=class extends(Cc=ue,Rc=Rv,Cc){constructor({errorName:r=su,modelId:e,modelType:t,message:n=`No such ${t}: ${e}`}){super({name:r,message:n}),this[Rc]=!0,this.modelId=e,this.modelType=t}static isInstance(r){return ue.hasMarker(r,ou)}},au="AI_TooManyEmbeddingValuesForCallError",iu=`vercel.ai.error.${au}`,Cv=Symbol.for(iu),Mc,Oc,lu=class extends(Oc=ue,Mc=Cv,Oc){constructor(r){super({name:au,message:`Too many values for a single embedding call. The ${r.provider} model "${r.modelId}" can only embed up to ${r.maxEmbeddingsPerCall} values per call, but ${r.values.length} values were provided.`}),this[Mc]=!0,this.provider=r.provider,this.modelId=r.modelId,this.maxEmbeddingsPerCall=r.maxEmbeddingsPerCall,this.values=r.values}static isInstance(r){return ue.hasMarker(r,iu)}},cu="AI_TypeValidationError",uu=`vercel.ai.error.${cu}`,Mv=Symbol.for(uu),Pc,Nc,Ht=class ei extends(Nc=ue,Pc=Mv,Nc){constructor({value:e,cause:t,context:n}){let s="Type validation failed";if(n?.field&&(s+=` for ${n.field}`),n?.entityName||n?.entityId){s+=" (";let o=[];n.entityName&&o.push(n.entityName),n.entityId&&o.push(`id: "${n.entityId}"`),s+=o.join(", "),s+=")"}super({name:cu,message:`${s}: Value: ${JSON.stringify(e)}.
296
296
  Error message: ${Cr(t)}`,cause:t}),this[Pc]=!0,this.value=e,this.context=n}static isInstance(e){return ue.hasMarker(e,uu)}static wrap({value:e,cause:t,context:n}){var s,o,a;return ei.isInstance(t)&&t.value===e&&((s=t.context)==null?void 0:s.field)===n?.field&&((o=t.context)==null?void 0:o.entityName)===n?.entityName&&((a=t.context)==null?void 0:a.entityId)===n?.entityId?t:new ei({value:e,cause:t,context:n})}},du="AI_UnsupportedFunctionalityError",pu=`vercel.ai.error.${du}`,Ov=Symbol.for(pu),Dc,jc,$t=class extends(jc=ue,Dc=Ov,jc){constructor({functionality:r,message:e=`'${r}' functionality not supported.`}){super({name:du,message:e}),this[Dc]=!0,this.functionality=r}static isInstance(r){return ue.hasMarker(r,pu)}};import*as wo from"zod/v4";import{ZodFirstPartyTypeKind as je}from"zod/v3";import{ZodFirstPartyTypeKind as Gv}from"zod/v3";import{ZodFirstPartyTypeKind as go}from"zod/v3";var ho=class extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}};function ri(r){}function mu(r){if(typeof r=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:e=ri,onError:t=ri,onRetry:n=ri,onComment:s}=r,o="",a=!0,i,c="",l="";function u(p){let y=a?p.replace(/^\xEF\xBB\xBF/,""):p,[v,w]=Pv(`${o}${y}`);for(let b of v)m(b);o=w,a=!1}function m(p){if(p===""){d();return}if(p.startsWith(":")){s&&s(p.slice(p.startsWith(": ")?2:1));return}let y=p.indexOf(":");if(y!==-1){let v=p.slice(0,y),w=p[y+1]===" "?2:1,b=p.slice(y+w);g(v,b,p);return}g(p,"",p)}function g(p,y,v){switch(p){case"event":l=y;break;case"data":c=`${c}${y}
297
297
  `;break;case"id":i=y.includes("\0")?void 0:y;break;case"retry":/^\d+$/.test(y)?n(parseInt(y,10)):t(new ho(`Invalid \`retry\` value: "${y}"`,{type:"invalid-retry",value:y,line:v}));break;default:t(new ho(`Unknown field "${p.length>20?`${p.slice(0,20)}\u2026`:p}"`,{type:"unknown-field",field:p,value:y,line:v}));break}}function d(){c.length>0&&e({id:i,event:l||void 0,data:c.endsWith(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentiqa",
3
- "version": "1.1.5",
3
+ "version": "1.1.6-staging.24a6770",
4
4
  "description": "AI-powered testing for web and mobile apps",
5
5
  "type": "module",
6
6
  "bin": "dist/cli.js",