@redocly/replay 0.23.0-next.3 → 0.23.0-next.4

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
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./replay-index-BIn_L-wL.js");async function a(t={}){return typeof t=="object"&&Object.freeze(t),await i.invoke("plugin:dialog|open",{options:t})}async function o(t={}){return typeof t=="object"&&Object.freeze(t),await i.invoke("plugin:dialog|save",{options:t})}async function l(t,n){const e=typeof n=="string"?{title:n}:n;await i.invoke("plugin:dialog|message",{message:t.toString(),title:e?.title?.toString(),kind:e?.kind,okButtonLabel:e?.okLabel?.toString()})}async function r(t,n){const e=typeof n=="string"?{title:n}:n;return await i.invoke("plugin:dialog|ask",{message:t.toString(),title:e?.title?.toString(),kind:e?.kind,okButtonLabel:e?.okLabel?.toString()??"Yes",cancelButtonLabel:e?.cancelLabel?.toString()??"No"})}async function c(t,n){const e=typeof n=="string"?{title:n}:n;return await i.invoke("plugin:dialog|confirm",{message:t.toString(),title:e?.title?.toString(),kind:e?.kind,okButtonLabel:e?.okLabel?.toString()??"Ok",cancelButtonLabel:e?.cancelLabel?.toString()??"Cancel"})}exports.ask=r;exports.confirm=c;exports.message=l;exports.open=a;exports.save=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./replay-index-B-DxC-Su.js");async function a(t={}){return typeof t=="object"&&Object.freeze(t),await i.invoke("plugin:dialog|open",{options:t})}async function o(t={}){return typeof t=="object"&&Object.freeze(t),await i.invoke("plugin:dialog|save",{options:t})}async function l(t,n){const e=typeof n=="string"?{title:n}:n;await i.invoke("plugin:dialog|message",{message:t.toString(),title:e?.title?.toString(),kind:e?.kind,okButtonLabel:e?.okLabel?.toString()})}async function r(t,n){const e=typeof n=="string"?{title:n}:n;return await i.invoke("plugin:dialog|ask",{message:t.toString(),title:e?.title?.toString(),kind:e?.kind,okButtonLabel:e?.okLabel?.toString()??"Yes",cancelButtonLabel:e?.cancelLabel?.toString()??"No"})}async function c(t,n){const e=typeof n=="string"?{title:n}:n;return await i.invoke("plugin:dialog|confirm",{message:t.toString(),title:e?.title?.toString(),kind:e?.kind,okButtonLabel:e?.okLabel?.toString()??"Ok",cancelButtonLabel:e?.cancelLabel?.toString()??"Cancel"})}exports.ask=r;exports.confirm=c;exports.message=l;exports.open=a;exports.save=o;
@@ -1,4 +1,4 @@
1
- import { t as Ro, b as ou, p as ju, J as Uu, c as Ho, f as Ii, B as Go, g as j0, h as Na, k as Ra, m as Vo, l as _o, n as Jo, o as $o, q as Io, u as Oo, A as Oi, v as $e } from "./replay-index-BZey8T6L.js";
1
+ import { t as Ro, b as ou, p as ju, J as Uu, c as Ho, f as Ii, B as Go, g as j0, h as Na, k as Ra, m as Vo, l as _o, n as Jo, o as $o, q as Io, u as Oo, A as Oi, v as $e } from "./replay-index-DmiNhCXD.js";
2
2
  const {
3
3
  env: D0 = {},
4
4
  argv: Wi = [],
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("./replay-index-BIn_L-wL.js"),{env:l0={},argv:Hi=[],platform:Mo=""}=typeof process>"u"?{}:process,jo="NO_COLOR"in l0||Hi.includes("--no-color"),Po="FORCE_COLOR"in l0||Hi.includes("--color"),wo=Mo==="win32",Ko=l0.TERM==="dumb",To=T.tty&&void 0,Lo="CI"in l0&&("GITHUB_ACTIONS"in l0||"GITLAB_CI"in l0||"CIRCLECI"in l0),No=!jo&&(Po||wo&&!Ko||To||Lo),Gi=(u,a,e,i,r=a.substring(0,u)+i,o=a.substring(u+e.length),n=o.indexOf(e))=>r+(n<0?o:Gi(n,o,e,i)),Ro=(u,a,e,i,r)=>u<0?e+a+i:e+Gi(u,a,i,r)+i,Ho=(u,a,e=u,i=u.length+1)=>r=>r||!(r===""||r===void 0)?Ro((""+r).indexOf(a,i),r,u,a,e):"",I=(u,a,e)=>Ho(`\x1B[${u}m`,`\x1B[${a}m`,e),wa={reset:I(0,0),bold:I(1,22,"\x1B[22m\x1B[1m"),dim:I(2,22,"\x1B[22m\x1B[2m"),italic:I(3,23),underline:I(4,24),inverse:I(7,27),hidden:I(8,28),strikethrough:I(9,29),black:I(30,39),red:I(31,39),green:I(32,39),yellow:I(33,39),blue:I(34,39),magenta:I(35,39),cyan:I(36,39),white:I(37,39),gray:I(90,39),bgBlack:I(40,49),bgRed:I(41,49),bgGreen:I(42,49),bgYellow:I(43,49),bgBlue:I(44,49),bgMagenta:I(45,49),bgCyan:I(46,49),bgWhite:I(47,49),blackBright:I(90,39),redBright:I(91,39),greenBright:I(92,39),yellowBright:I(93,39),blueBright:I(94,39),magentaBright:I(95,39),cyanBright:I(96,39),whiteBright:I(97,39),bgBlackBright:I(100,49),bgRedBright:I(101,49),bgGreenBright:I(102,49),bgYellowBright:I(103,49),bgBlueBright:I(104,49),bgMagentaBright:I(105,49),bgCyanBright:I(106,49),bgWhiteBright:I(107,49)},Go=({useColor:u=No}={})=>u?wa:Object.keys(wa).reduce((a,e)=>({...a,[e]:String}),{}),{reset:HU,bold:Zu,dim:Vo,italic:GU,underline:_o,inverse:Vi,hidden:VU,strikethrough:_U,black:JU,red:iu,green:m0,yellow:Uu,blue:Du,magenta:$U,cyan:IU,white:Ka,gray:du,bgBlack:OU,bgRed:q0,bgGreen:WU,bgYellow:qU,bgBlue:ZU,bgMagenta:UU,bgCyan:YU,bgWhite:QU,blackBright:XU,redBright:uY,greenBright:eY,yellowBright:aY,blueBright:iY,magentaBright:rY,cyanBright:nY,whiteBright:oY,bgBlackBright:tY,bgRedBright:sY,bgGreenBright:lY,bgYellowBright:EY,bgBlueBright:DY,bgMagentaBright:xY,bgCyanBright:cY,bgWhiteBright:dY}=Go(),Jo=u=>/\{.*?\}/.test(u);function Hu({value:u,ctx:a,logger:e}){if(!u)return u;if(T.isPlainObject(u)){const i={};for(const r in u)i[r]=Hu({value:u[r],ctx:a,logger:e});return i}else if(Array.isArray(u))return u.map(i=>Hu({value:i,ctx:a,logger:e}));return typeof u!="string"?u:u.startsWith("$faker.")?P0({pointer:u.slice(1),ctx:a,logger:e}):Jo(u)?Oo(u,a,e):qo(u,a,e)}function $o(u,a,e){const i=u.indexOf("{");if(i!==-1){const o=u.substring(i+1).slice(0,-1),n=P0({pointer:o.slice(1),ctx:a,logger:e});return n&&u.replace(/{(.*)}/,n)}else return u}function Io(u,a){const e=Object.keys(a),i=Object.values(a);return new Function(...e,`return ${u}`)(...i)}function Oo(u,a,e){const i=/\{\$(\{[^{}]*\}|[^{}])*\}/g;let r=u;return r=r.replace(i,(o,n)=>Wo(o,a,e)),r}function Wo(u,a,e){if(!u.includes("$"))return u;if(u.includes("$faker."))return $o(u,a,e);const i=S0(a)(Zo(u));return i!==void 0?i:""}const qo=(u,a,e)=>{if(!u)return u;const i=u.toString();if(!i.includes("$"))return u;if(i.startsWith("$file(")&&i.endsWith(")"))return i.slice(7,-2);if(i.startsWith("$sourceDescriptions.")&&i.includes(".workflows.")){const r=i.split("."),o=r[1],n=r[3];if(!o||!n)return;const s=S0(a)("$sourceDescriptions");return s[o]?s[o].workflows.find(l=>l.workflowId===n):void 0}return i&&i.trim().startsWith("faker.")?P0({pointer:i,ctx:a,logger:e}):i?S0(a)(Ta(i)):i.replace(/\$\{([^}]+)}/g,(r,o)=>S0(a)(Ta(o)))};function Zo(u){return u.replace(/\{(.*)\}/,"$1")}function Ta(u){return u.replace(/\['(.*?)'\]/g,".$1")}const S0=(u,a="")=>e=>{if(a||(a=e),!e)return u;const[i,...r]=e.split(".");if(!u)throw Error(`Cannot get ${iu(i)} from ${iu(a)}`);if(u?.[i]===void 0){const o=` Undefined ${iu(i)} at ${iu(a)}.`,n=Object.keys(u).length?`Did you mean to use another key? Available keys:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("./replay-index-B-DxC-Su.js"),{env:l0={},argv:Hi=[],platform:Mo=""}=typeof process>"u"?{}:process,jo="NO_COLOR"in l0||Hi.includes("--no-color"),Po="FORCE_COLOR"in l0||Hi.includes("--color"),wo=Mo==="win32",Ko=l0.TERM==="dumb",To=T.tty&&void 0,Lo="CI"in l0&&("GITHUB_ACTIONS"in l0||"GITLAB_CI"in l0||"CIRCLECI"in l0),No=!jo&&(Po||wo&&!Ko||To||Lo),Gi=(u,a,e,i,r=a.substring(0,u)+i,o=a.substring(u+e.length),n=o.indexOf(e))=>r+(n<0?o:Gi(n,o,e,i)),Ro=(u,a,e,i,r)=>u<0?e+a+i:e+Gi(u,a,i,r)+i,Ho=(u,a,e=u,i=u.length+1)=>r=>r||!(r===""||r===void 0)?Ro((""+r).indexOf(a,i),r,u,a,e):"",I=(u,a,e)=>Ho(`\x1B[${u}m`,`\x1B[${a}m`,e),wa={reset:I(0,0),bold:I(1,22,"\x1B[22m\x1B[1m"),dim:I(2,22,"\x1B[22m\x1B[2m"),italic:I(3,23),underline:I(4,24),inverse:I(7,27),hidden:I(8,28),strikethrough:I(9,29),black:I(30,39),red:I(31,39),green:I(32,39),yellow:I(33,39),blue:I(34,39),magenta:I(35,39),cyan:I(36,39),white:I(37,39),gray:I(90,39),bgBlack:I(40,49),bgRed:I(41,49),bgGreen:I(42,49),bgYellow:I(43,49),bgBlue:I(44,49),bgMagenta:I(45,49),bgCyan:I(46,49),bgWhite:I(47,49),blackBright:I(90,39),redBright:I(91,39),greenBright:I(92,39),yellowBright:I(93,39),blueBright:I(94,39),magentaBright:I(95,39),cyanBright:I(96,39),whiteBright:I(97,39),bgBlackBright:I(100,49),bgRedBright:I(101,49),bgGreenBright:I(102,49),bgYellowBright:I(103,49),bgBlueBright:I(104,49),bgMagentaBright:I(105,49),bgCyanBright:I(106,49),bgWhiteBright:I(107,49)},Go=({useColor:u=No}={})=>u?wa:Object.keys(wa).reduce((a,e)=>({...a,[e]:String}),{}),{reset:HU,bold:Zu,dim:Vo,italic:GU,underline:_o,inverse:Vi,hidden:VU,strikethrough:_U,black:JU,red:iu,green:m0,yellow:Uu,blue:Du,magenta:$U,cyan:IU,white:Ka,gray:du,bgBlack:OU,bgRed:q0,bgGreen:WU,bgYellow:qU,bgBlue:ZU,bgMagenta:UU,bgCyan:YU,bgWhite:QU,blackBright:XU,redBright:uY,greenBright:eY,yellowBright:aY,blueBright:iY,magentaBright:rY,cyanBright:nY,whiteBright:oY,bgBlackBright:tY,bgRedBright:sY,bgGreenBright:lY,bgYellowBright:EY,bgBlueBright:DY,bgMagentaBright:xY,bgCyanBright:cY,bgWhiteBright:dY}=Go(),Jo=u=>/\{.*?\}/.test(u);function Hu({value:u,ctx:a,logger:e}){if(!u)return u;if(T.isPlainObject(u)){const i={};for(const r in u)i[r]=Hu({value:u[r],ctx:a,logger:e});return i}else if(Array.isArray(u))return u.map(i=>Hu({value:i,ctx:a,logger:e}));return typeof u!="string"?u:u.startsWith("$faker.")?P0({pointer:u.slice(1),ctx:a,logger:e}):Jo(u)?Oo(u,a,e):qo(u,a,e)}function $o(u,a,e){const i=u.indexOf("{");if(i!==-1){const o=u.substring(i+1).slice(0,-1),n=P0({pointer:o.slice(1),ctx:a,logger:e});return n&&u.replace(/{(.*)}/,n)}else return u}function Io(u,a){const e=Object.keys(a),i=Object.values(a);return new Function(...e,`return ${u}`)(...i)}function Oo(u,a,e){const i=/\{\$(\{[^{}]*\}|[^{}])*\}/g;let r=u;return r=r.replace(i,(o,n)=>Wo(o,a,e)),r}function Wo(u,a,e){if(!u.includes("$"))return u;if(u.includes("$faker."))return $o(u,a,e);const i=S0(a)(Zo(u));return i!==void 0?i:""}const qo=(u,a,e)=>{if(!u)return u;const i=u.toString();if(!i.includes("$"))return u;if(i.startsWith("$file(")&&i.endsWith(")"))return i.slice(7,-2);if(i.startsWith("$sourceDescriptions.")&&i.includes(".workflows.")){const r=i.split("."),o=r[1],n=r[3];if(!o||!n)return;const s=S0(a)("$sourceDescriptions");return s[o]?s[o].workflows.find(l=>l.workflowId===n):void 0}return i&&i.trim().startsWith("faker.")?P0({pointer:i,ctx:a,logger:e}):i?S0(a)(Ta(i)):i.replace(/\$\{([^}]+)}/g,(r,o)=>S0(a)(Ta(o)))};function Zo(u){return u.replace(/\{(.*)\}/,"$1")}function Ta(u){return u.replace(/\['(.*?)'\]/g,".$1")}const S0=(u,a="")=>e=>{if(a||(a=e),!e)return u;const[i,...r]=e.split(".");if(!u)throw Error(`Cannot get ${iu(i)} from ${iu(a)}`);if(u?.[i]===void 0){const o=` Undefined ${iu(i)} at ${iu(a)}.`,n=Object.keys(u).length?`Did you mean to use another key? Available keys:
2
2
  ${Object.keys(u).join(", ")}.
3
3
  `:"",s=`${o} ${n}`;throw Error(s)}return S0(u[i],a)(r.join("."))};function P0({pointer:u,ctx:a,logger:e}){const i=u.split("."),r={ctx:{faker:a.$faker}};try{const o=i.map(n=>n.trim()).map((n,s)=>n.endsWith(")")?`${s==0?"":"."}${n}`:`["${n}"]`).join("");return Io(`ctx${o}`,r)}catch(o){e.error(iu(o.toString()));return}}function _i(u,a,e){if(typeof u=="string"&&u)return Hu({value:u,ctx:a,logger:e});if(!(typeof u=="string"||typeof u=="number"||typeof u=="boolean"||typeof u>"u"||u instanceof Blob||u===null))for(const i in u)typeof u[i]=="string"?u[i]&&(u[i]=Hu({value:u[i],ctx:a,logger:e})):_i(u[i],a,e)}function La(u,a,e){return _i(u,a,e)||u}function Na(u,a){if(!u)return;const e={};for(const i in a)e[`{${i}}`]=String(a[i]);return u.split(/(\{[a-zA-Z0-9_.-]+\}+)/g).map(i=>e[i]?e[i]:i).join("")}function Uo(u){return T.isPlainObject(u)&&"name"in u&&"value"in u&&!("in"in u)}function Ve(u){return T.isPlainObject(u)&&"in"in u&&typeof u.in=="string"&&["header","query","path","cookie"].includes(u.in)}const Yo=/^image\/(png|jpeg|gif|bmp|webp|svg\+xml)|application\/pdf$/;function Ji(u){return u.startsWith("$file(")&&u.endsWith(")")?u.substring(7,u.length-2):u}const Ra=async(u,a,e,i,r)=>{const o=T.pathBrowserifyExports.dirname(i),n=T.pathBrowserifyExports.resolve(o,Ji(e));u.append(a,await r.options.requestFileLoader.getFileBody(n))},$i=(u,a,e,i,r,o)=>{Object.entries(e).forEach(([n,s])=>{const l=o?`${o}[${n}]`:n;typeof s=="string"&&s.startsWith("$file(")&&s.endsWith(")")?u.push(Ra(a,l,s,i,r)):Array.isArray(s)?s.forEach(E=>{typeof E=="string"&&E.startsWith("$file(")&&E.endsWith(")")?u.push(Ra(a,l,E,i,r)):a.append(l,E.toString())}):T.isPlainObject(s)?$i(u,a,s,i,r,l):(typeof s=="string"||typeof s=="number"||typeof s=="boolean")&&a.append(l,s.toString())})},Qo=async(u,a,e,i)=>{if(T.isPlainObject(u)){const r=[];$i(r,a,u,e,i),await Promise.all(r)}},Xo=async(u,a)=>{if(typeof u=="string"&&u.startsWith("$file(")&&u.endsWith(")")){const e=T.pathBrowserifyExports.resolve(T.pathBrowserifyExports.dirname(a.options.filePath),Ji(u));return a.options.requestFileLoader.getFileBody(e)}else return u};async function u4(u,a){if(!u)return{payload:void 0,contentType:void 0,encoding:void 0,replacements:void 0};const{payload:e,contentType:i}=u;if(i==="multipart/form-data"){const r=new FormData,o=T.pathBrowserifyExports.resolve(a.options.filePath);return await Qo(e,r,o,a),{...u,payload:r}}else{if(i==="application/octet-stream"||typeof i=="string"&&Yo.test(i))return{...u,payload:await Xo(e,a),contentType:"application/octet-stream"};if(i==="application/x-www-form-urlencoded"&&typeof e=="string")return{...u,payload:Object.fromEntries(new URLSearchParams(e).entries()),contentType:"application/x-www-form-urlencoded"}}return u}function e4({payload:u,replacements:a,expressionContext:e,logger:i}){for(const r of a){const{target:o,value:n}=r;if(typeof o!="string")throw new Error(`Invalid JSON Pointer: ${o}`);try{const s=T.JsonPointerLib.get(u,o),l=Ku({payload:n,context:e,logger:i});s!==void 0&&T.JsonPointerLib.set(u,o,l)}catch{throw new Error(`Invalid JSON Pointer: ${o}`)}}}const a4=["parameters","failureActions","successActions"];function i4(u,a){const{reference:e,value:i}=u;if(!a4.some(o=>e.includes(`$components.${o}`)))throw new Error("Invalid reference: available components are $components.parameters, $components.failureActions, or $components.successActions");const r=Hu({value:e,ctx:a,logger:a.options.logger});return T.isPlainObject(r)&&"value"in r&&i?{...r,value:i}:r}function f0(u,a){return"reference"in u?i4(u,a):u}function r4(u){try{return T.parseRuntimeExpression(u)}catch{throw new Error(`Runtime expression is not valid: ${u}`)}}function n4(u,a){const e=[{pattern:/\$response\.body#\/([\w/-]+)/g,ctxFunction:(r,o)=>v0(a.$response?.body,o,r)},{pattern:/\$request\.body#\/([\w/-]+)/g,ctxFunction:(r,o)=>v0(a.$request?.body,o,r)},{pattern:/\$outputs\.([\w-]+)#\/([\w/-]+)/g,ctxFunction:(r,o,n)=>v0(a.$outputs?.[o],n,r)},{pattern:/\$workflows\.([\w-]+)\.outputs\.([\w-]+)#\/([\w/-]+)/g,ctxFunction:(r,o,n,s)=>v0(a.$workflows?.[o]?.outputs?.[n],s,r)},{pattern:/\$steps\.([\w-]+)\.outputs\.([\w-]+)#\/([\w/-]+)/g,ctxFunction:(r,o,n,s)=>v0(a.$steps?.[o]?.outputs?.[n],s,r)}];let i=u;for(const{pattern:r,ctxFunction:o}of e)i=i.replaceAll(r,o);return i}function v0(u,a,e){if(u)try{const i=T.JsonPointerLib.get(u,`/${a}`);return typeof i=="string"||Array.isArray(i)||T.isPlainObject(i)?JSON.stringify(i):i!==void 0?i:e}catch{return e}return e}function Ku({payload:u,context:a,contentType:e,logger:i}){if(e?.includes("application/octet-stream"))return La(u,a,i);if(e?.includes("multipart/form-data")){if(u instanceof FormData){const r=new FormData;for(const[o,n]of u.entries())if(n instanceof File)r.append(o,n);else{const s=Ku({payload:n,context:a,logger:i});r.append(o,s)}return r}return La(u,a,i)}return typeof u=="string"?c4(u)?E0(u,a,i):x4(u,a,i):T.isPlainObject(u)?Object.entries(u).reduce((r,[o,n])=>(r[o]=Ku({payload:n,context:a,logger:i}),r),{}):Array.isArray(u)?u.map(r=>Ku({payload:r,context:a,logger:i})):u}function E0(u,a,e){return typeof u=="string"?o4(u,a,e):T.isPlainObject(u)?Object.entries(u).reduce((i,[r,o])=>(i[r]=o&&E0(o,a,e),i),{}):Array.isArray(u)?u.map(i=>E0(i,a,e)):u}function o4(u,a,e){if(/^\$faker\.[a-zA-Z0-9._-]+(\([^\\)]*\))?$/.test(u))return P0({pointer:u.slice(1),ctx:a,logger:e});if(u.includes("$faker.")){const o=/\$faker\.[a-zA-Z0-9._-]+(\([^\\)]*\))?/g;u=u.replace(o,n=>P0({pointer:n.slice(1),ctx:a,logger:e})).replace(/{(.*?)}/g,"$1")}if(!u.includes("$")&&!/[=<>]/.test(u))return u;r4(u);const i=s4(u,a),r=l4(a);try{return new Function(...Object.keys(r),`return ${i};`)(...Object.values(r))}catch{throw new Error(`Error in resolving runtime expression '${u}'.
4
4
  This could be because the expression references a value from a previous failed step, or is trying to reference a variable that hasn't been set.`)}}function t4(u){return u.replace(/\$([a-zA-Z0-9._-]+)/g,(a,e)=>`$${e.replace(/-/g,"_")}`)}function s4(u,a){const e=n4(u,a);let r=t4(e);if(r.startsWith("{")&&r.endsWith("}")){const l=r.slice(1,-1);!l.trim().startsWith("{")&&!l.trim().startsWith("[")&&(r=l)}const o=D4(r),n=/\.header\.([a-zA-Z0-9._-]+)/g;return o.replace(n,(l,E)=>`.header.${E.toLowerCase()}`)}function l4(u){const a={};for(const[e,i]of Object.entries(u)){const r=e.replace(/-/g,"_");a[r]=Ii(i)}return a}function Ii(u){return Array.isArray(u)?u:T.isPlainObject(u)?E4(u):u}function E4(u){return Object.keys(u).reduce((a,e)=>{const i=e.replace(/-/g,"_");return a[i]=Ii(u[e]),a},{})}function D4(u){return u.replace(/\.(\d+)/g,(a,e,i,r)=>{const o=r[i-1];return/\d/.test(o)?a:`[${e}]`})}function x4(u,a,e){const i=/\{(?:[^{}]|\{[^{}]*\})*\}|\$[^\s{}]+(?:\([^()]*\))*/g;return u.replace(i,r=>{const o=r.trim(),n=E0(o,a,e);return n!==void 0?n:r})}function c4(u){return/^\$[^\s{}]+(\([^)]*\))?$|^\{[^{}]*\}$/.test(u.trim())}const su={SUCCESS_CRITERIA_CHECK:"success criteria check",STATUS_CODE_CHECK:"status code check",SCHEMA_CHECK:"schema check",CONTENT_TYPE_CHECK:"content-type check",GLOBAL_TIMEOUT_ERROR:"global timeout error",MAX_STEPS_REACHED_ERROR:"maximum steps reached",NETWORK_ERROR:"failed network request",UNEXPECTED_ERROR:"unexpected error"};class Oi extends Error{}class Wi extends Oi{}class qi extends Oi{}async function d4(u){const{descriptionPath:a,externalRefResolver:e,base:i}=u,r=await T.bundle({base:i,ref:a,config:u.config,dereference:!0,externalRefResolver:e});if(!r)throw new Error(`Could not find source description file '${a}'.`);return r.bundle.parsed}const m4={title:"[REPLACE WITH API title]",version:"[REPLACE WITH API version]"},we=Symbol("skip");function b0(u){return u<10?"0"+u:u}function F4(u,a,e,i){var r=e?"":u.getUTCFullYear()+"-"+b0(u.getUTCMonth()+1)+"-"+b0(u.getUTCDate());return a||(r+="T"+b0(u.getUTCHours())+":"+b0(u.getUTCMinutes())+":"+b0(u.getUTCSeconds())+"Z"),r}function Zi(u,a){return a>u.length?u.repeat(Math.trunc(a/u.length)+1).substring(0,a):u}function X0(...u){const a=e=>e&&typeof e=="object";return u.reduce((e,i)=>(Object.keys(i||{}).forEach(r=>{const o=e[r],n=i[r];a(o)&&a(n)?e[r]=X0(o,n):e[r]=n}),e),Array.isArray(u[u.length-1])?[]:{})}function k4(u){var a=g4(u),e=p4(a,a,a,a),i="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{var o=e()*16%16|0;return(r=="x"?o:o&3|8).toString(16)});return i}function Ce(u){return{value:u==="object"?{}:u==="array"?[]:void 0}}function Ou(u,a){a&&u.pop()}function C4(u){return{name:u?.xml?.name||"",prefix:u?.xml?.prefix||"",namespace:u?.xml?.namespace||null,attribute:u?.xml?.attribute??!1,wrapped:u?.xml?.wrapped??!1}}function h4(u){const a=u?.xml;return a?.nodeType?a.nodeType:a?.attribute===!0?"attribute":a?.wrapped===!0&&u?.type==="array"?"element":u?.$ref||u?.$dynamicRef||u?.type==="array"||u?.oneOf||u?.anyOf||u?.allOf?"none":"element"}function ue(u,a={},e={}){const{value:i}=u,{propertyName:r}=e,{name:o,prefix:n,namespace:s}=C4(a),l=h4(a);let E=o||r?`${n?n+":":""}${o||r}`:null,D=typeof i=="object"?Array.isArray(i)?[...i]:{...i}:i;switch(l){case"attribute":E&&(E=`$${E}`);break;case"text":E="#text";break;case"cdata":E="#cdata";break;case"none":a.type==="array"?(E=null,a.example!==void 0&&(E=a.items?.xml?.name||E)):E=null;break;default:a.type==="array"&&Array.isArray(D)&&(D={[E]:[...D]});break}return s&&l!=="text"&&l!=="cdata"&&l!=="none"&&(typeof D=="object"?D[`$xmlns${n?":"+n:""}`]=s:D={[`$xmlns${n?":"+n:""}`]:s,"#text":D}),{propertyName:E,value:D}}function g4(u){var a=0;if(u.length==0)return a;for(var e=0;e<u.length;e++){var i=u.charCodeAt(e);a=(a<<5)-a+i,a=a&a}return a}function p4(u,a,e,i){return function(){u|=0,a|=0,e|=0,i|=0;var r=u-(a<<27|a>>>5)|0;return u=a^(e<<17|e>>>15),a=e+i|0,e=i+r|0,i=u+r|0,(i>>>0)/4294967296}}function v4(u,a,e,i,r){let o=wu(u,e,i);const n=[];for(let s of a){const{type:l,readOnly:E,writeOnly:D,value:d}=wu({type:o.type,...s},e,i,{...r,isAllOfChild:!0});o.type&&l&&l!==o.type&&(console.warn("allOf: schemas with different types can't be merged"),o.type=l),o.type=o.type||l,o.readOnly=o.readOnly||E,o.writeOnly=o.writeOnly||D,d!=null&&n.push(d)}if(o.type==="object"){o.value=X0(o.value||{},...n.filter(s=>typeof s=="object"));for(const s in o.value)o.value[s]===we&&delete o.value[s];return o}else{o.type==="array"&&(e.quiet||console.warn('OpenAPI Sampler: found allOf with "array" type. Result may be incorrect'));const s=n[n.length-1];return o.value=s??o.value,o}}const Ha={multipleOf:"number",maximum:"number",exclusiveMaximum:"number",minimum:"number",exclusiveMinimum:"number",maxLength:"string",minLength:"string",pattern:"string",items:"array",maxItems:"array",minItems:"array",uniqueItems:"array",additionalItems:"array",maxProperties:"object",minProperties:"object",required:"object",additionalProperties:"object",properties:"object",patternProperties:"object",dependencies:"object"};function H0(u){if(u.type!==void 0)return Array.isArray(u.type)?u.type.length===0?null:u.type[0]:u.type;const a=Object.keys(Ha);for(var e=0;e<a.length;e++){let i=a[e],r=Ha[i];if(u[i]!==void 0)return r}return null}let Z0={},Pu=[];function b4(){Z0={},Pu=[]}function Ui(u){let a;return u.const!==void 0?a=u.const:u.examples!==void 0&&u.examples.length?a=u.examples[0]:u.enum!==void 0&&u.enum.length?a=u.enum[0]:u.default!==void 0&&(a=u.default),a}function Ga(u){const a=Ui(u);if(a!==void 0)return{value:a,readOnly:u.readOnly,writeOnly:u.writeOnly,type:null}}function wu(u,a,e,i){if(i){if(Pu.includes(u))return Ce(H0(u));Pu.push(u)}if(i&&i.depth>a.maxSampleDepth)return Ou(Pu,i),Ce(H0(u));if(u.$ref){if(!e)throw new Error("Your schema contains $ref. You must provide full specification in the third parameter.");let s=decodeURIComponent(u.$ref);s.startsWith("#")&&(s=s.substring(1));const l=T.JsonPointerLib.get(e,s);let E;if(Z0[s]!==!0){Z0[s]=!0;const D=wu(l,a,e,i);if(a.format==="xml"){const d=s.split("/").pop(),F={...i,propertyName:i?.propertyName||d},{propertyName:k,value:b}=ue(D,l,F);E={...D,value:{[k||"root"]:b}}}else E=D;Z0[s]=!1}else{const D=H0(l);E=Ce(D)}return Ou(Pu,i),E}if(u.example!==void 0)return Ou(Pu,i),{value:u.example,readOnly:u.readOnly,writeOnly:u.writeOnly,type:u.type};if(u.allOf!==void 0)return Ou(Pu,i),Ga(u)||v4({...u,allOf:void 0},u.allOf,a,e,i);if(u.oneOf&&u.oneOf.length){u.anyOf&&(a.quiet||console.warn("oneOf and anyOf are not supported on the same level. Skipping anyOf")),Ou(Pu,i);const s=Object.assign({readOnly:u.readOnly,writeOnly:u.writeOnly},u.oneOf[0]);return n(u,s)}if(u.anyOf&&u.anyOf.length){Ou(Pu,i);const s=Object.assign({readOnly:u.readOnly,writeOnly:u.writeOnly},u.anyOf[0]);return n(u,s)}if(u.if&&u.then){Ou(Pu,i);const{if:s,then:l,...E}=u;return wu(X0(E,s,l),a,e,i)}let r=Ui(u),o=null;if(r===void 0){r=null,o=u.type,Array.isArray(o)&&u.type.length>0&&(o=u.type[0]),o||(o=H0(u));let s=Xi[o];s&&(r=s(u,a,e,i))}return Ou(Pu,i),{value:r,readOnly:u.readOnly,writeOnly:u.writeOnly,type:o};function n(s,l){const E=Ga(s);if(E!==void 0)return E;const D=wu({...s,oneOf:void 0,anyOf:void 0},a,e,i),d=wu(l,a,e,i);if(typeof D.value=="object"&&typeof d.value=="object"){const F=X0(D.value,d.value);return{...d,value:F}}return d}}function B4(u,a={},e,i){const r=i&&i.depth||1;let o=Math.min(u.maxItems!=null?u.maxItems:1/0,u.minItems||1);const n=u.prefixItems||u.items||u.contains;Array.isArray(n)&&(o=Math.max(o,n.length));let s=E=>Array.isArray(n)?n[E]||{}:n||{},l=[];if(!n)return l;for(let E=0;E<o;E++){let D=s(E),{value:d}=wu(D,a,e,{depth:r+1});if(a?.format==="xml"){const{value:F,propertyName:k}=ue({value:d},D,i);k?(l?.[k]||(l={...l,[k]:[]}),l[k].push(F)):l={...l,...F}}else l.push(d)}if(a?.format==="xml"&&r===1){const{value:E,propertyName:D}=ue({value:null},u,i);D&&(E?l=Array.isArray(l)?{[D]:{...E,...l.map(d=>({"#text":{...d}}))}}:{[D]:{...l,...E}}:l={[D]:l})}return l}function A4(u){return!0}function Yi(u){let a=0;if(u.type==="number"&&(u.format==="float"||u.format==="double")&&(a=.1),typeof u.exclusiveMinimum=="boolean"||typeof u.exclusiveMaximum=="boolean"){if(u.maximum&&u.minimum)return a=u.exclusiveMinimum?Math.floor(u.minimum)+1:u.minimum,(u.exclusiveMaximum&&a>=u.maximum||!u.exclusiveMaximum&&a>u.maximum)&&(a=(u.maximum+u.minimum)/2),a;if(u.minimum)return u.exclusiveMinimum?Math.floor(u.minimum)+1:u.minimum;if(u.maximum)return u.exclusiveMaximum?u.maximum>0?0:Math.floor(u.maximum)-1:u.maximum>0?0:u.maximum}else{if(u.minimum)return u.minimum;u.exclusiveMinimum?(a=Math.floor(u.exclusiveMinimum)+1,a===u.exclusiveMaximum&&(a=(a+Math.floor(u.exclusiveMaximum)-1)/2)):u.exclusiveMaximum?a=Math.floor(u.exclusiveMaximum)-1:u.maximum&&(a=u.maximum)}return a}function y4(u,a={},e,i){let r={};const o=i&&i.depth||1;if(u&&typeof u.properties=="object"){const n=Array.isArray(u.required)?u.required:[],s={};for(const l of n)s[l]=!0;Object.keys(u.properties).forEach(l=>{if(a.skipNonRequired&&!s.hasOwnProperty(l))return;const E=wu(u.properties[l],a,e,{propertyName:l,depth:o+1});if(a.skipReadOnly&&E.readOnly){i?.isAllOfChild&&(r[l]=we);return}if(a.skipWriteOnly&&E.writeOnly){i?.isAllOfChild&&(r[l]=we);return}if(a?.format==="xml"){const{propertyName:D,value:d}=ue(E,u.properties[l],{propertyName:l});D?r[D]=d:d!==null&&typeof d=="object"&&(r={...r,...d})}else r[l]=E.value})}if(u&&typeof u.additionalProperties=="object"){const n=u.additionalProperties["x-additionalPropertiesName"]||"property";r[`${String(n)}1`]=wu(u.additionalProperties,a,e,{depth:o+1}).value,r[`${String(n)}2`]=wu(u.additionalProperties,a,e,{depth:o+1}).value}if(u&&typeof u.properties=="object"&&u.maxProperties!==void 0&&Object.keys(r).length>u.maxProperties){const n={};let s=0;(Array.isArray(u.required)?u.required:[]).forEach(E=>{r[E]!==void 0&&(n[E]=r[E],s++)}),Object.keys(r).forEach(E=>{s<u.maxProperties&&!n.hasOwnProperty(E)&&(n[E]=r[E],s++)}),r=n}return r}function M0(u,a){return u}function Va(u,a,e){let i=1;if(u)switch(u){case"?":{i=0;break}case"*":{i=M0(0);break}case"+":{i=M0(1);break}default:throw new Error("Unknown quantifier symbol provided.")}else a!=null&&e!=null?i=M0(parseInt(a)):a!=null&&e==null&&(i=parseInt(a));return i}function f4(u){let a=!1;u instanceof RegExp&&(a=u.flags.includes("i"),u=u.toString(),u=u.match(/\/(.+?)\//)?.[1]??""),u=u.replace(/^(\^)?(.*?)(\$)?$/,"$2");let e,i,r;const o=/([.A-Za-z0-9])(?:\{(\d+)(?:\,(\d+)|)\}|(\?|\*|\+))(?![^[]*]|[^{]*})/;let n=u.match(o);for(;n!=null;){const d=n[2],F=n[3],k=n[4];r=Va(k,d,F),u=u.slice(0,n.index)+n[1].repeat(r)+u.slice(n.index+n[0].length),n=u.match(o)}const s=/(\d-\d|\w-\w|\d|\w|[-!@#$&()`.+,/"])/,l=/\[(\^|)(-|)(.+?)\](?:\{(\d+)(?:\,(\d+)|)\}|(\?|\*|\+)|)/;for(n=u.match(l);n!=null;){const d=n[1]==="^",F=n[2]==="-",k=n[4],b=n[5],y=n[6],M=[];let J=n[3],N=J.match(s);for(F&&M.push(45);N!=null;){if(N[0].indexOf("-")===-1)a&&isNaN(Number(N[0]))?(M.push(N[0].toUpperCase().charCodeAt(0)),M.push(N[0].toLowerCase().charCodeAt(0))):M.push(N[0].charCodeAt(0));else{const p=N[0].split("-").map(h=>h.charCodeAt(0));if(e=p[0],i=p[1],e>i)throw new Error("Character range provided is out of order.");for(let h=e;h<=i;h++)if(a&&isNaN(Number(String.fromCharCode(h)))){const B=String.fromCharCode(h);M.push(B.toUpperCase().charCodeAt(0)),M.push(B.toLowerCase().charCodeAt(0))}else M.push(h)}J=J.substring(N[0].length),N=J.match(s)}if(r=Va(y,k,b),d){let p=-1;for(let h=48;h<=57;h++){if(p=M.indexOf(h),p>-1){M.splice(p,1);continue}M.push(h)}for(let h=65;h<=90;h++){if(p=M.indexOf(h),p>-1){M.splice(p,1);continue}M.push(h)}for(let h=97;h<=122;h++){if(p=M.indexOf(h),p>-1){M.splice(p,1);continue}M.push(h)}}const $=Array.from({length:r},()=>String.fromCharCode(M[M0(0)])).join("");u=u.slice(0,n.index)+$+u.slice(n.index+n[0].length),n=u.match(l)}const E=/(.)\{(\d+)\,(\d+)\}/;for(n=u.match(E);n!=null;){if(e=parseInt(n[2]),i=parseInt(n[3]),e>i)throw new Error("Numbers out of order in {} quantifier.");r=M0(e),u=u.slice(0,n.index)+n[1].repeat(r)+u.slice(n.index+n[0].length),n=u.match(E)}const D=/(.)\{(\d+)\}/;for(n=u.match(D);n!=null;)r=parseInt(n[2]),u=u.slice(0,n.index)+n[1].repeat(r)+u.slice(n.index+n[0].length),n=u.match(D);return u}const z4="qwerty!@#$%^123456";function S4(){return"user@example.com"}function M4(){return"пошта@укр.нет"}function j4(u,a){let e="pa$$word";return u>e.length&&(e+="_",e+=Zi(z4,u-e.length).substring(0,u-e.length)),e}function _e({min:u,max:a,omitTime:e,omitDate:i}){let r=F4(new Date("2019-08-24T14:15:22.123Z"),e,i);return r.length<u&&console.warn(`Using minLength = ${u} is incorrect with format "date-time"`),a&&r.length>a&&console.warn(`Using maxLength = ${a} is incorrect with format "date-time"`),r}function P4(u,a){return _e({min:u,max:a,omitTime:!1,omitDate:!1})}function w4(u,a){return _e({min:u,max:a,omitTime:!0,omitDate:!1})}function K4(u,a){return _e({min:u,max:a,omitTime:!1,omitDate:!0}).slice(1)}function Qi(u,a,e,i,r=!1){if(i&&r)return f4(i);let o=Zi("string",u);return a&&o.length>a&&(o=o.substring(0,a)),o}function T4(){return"192.168.0.1"}function L4(){return"2001:0db8:85a3:0000:0000:8a2e:0370:7334"}function N4(){return"example.com"}function R4(){return"приклад.укр"}function H4(){return"http://example.com"}function G4(){return"../dictionary"}function V4(){return"http://example.com/{endpoint}"}function _4(){return"http://example.com/entity/1"}function J4(){return"/entity/1"}function $4(u,a,e){return k4(e||"id")}function I4(){return"/json/pointer"}function O4(){return"1/relative/json/pointer"}function W4(){return"/regex/"}const q4={email:S4,"idn-email":M4,password:j4,"date-time":P4,date:w4,time:K4,ipv4:T4,ipv6:L4,hostname:N4,"idn-hostname":R4,iri:_4,"iri-reference":J4,uri:H4,"uri-reference":G4,"uri-template":V4,uuid:$4,default:Qi,"json-pointer":I4,"relative-json-pointer":O4,regex:W4};function Z4(u,a,e,i){let r=u.format||"default",o=q4[r]||Qi,n=i&&i.propertyName;return o(u.minLength||0,u.maxLength,n,u.pattern,a?.enablePatterns)}var Xi={};const U4={skipReadOnly:!1,maxSampleDepth:15};function Y4(u,a){if(!u)throw new Error("Unknown format output for building XML.");return(Array.isArray(u)||Object.keys(u).length>1)&&(u={[a?.xml?.name||"root"]:u}),new T.Builder({ignoreAttributes:!1,format:!0,attributeNamePrefix:"$",textNodeName:"#text",cdataPropName:"#cdata"}).build(u)}function Q4(u,a,e){let i=Object.assign({},U4,a);b4();let r=wu(u,i,e).value;return i?.format==="xml"?Y4(r,u):r}function C0(u,a){Xi[u]=a}C0("array",B4);C0("boolean",A4);C0("integer",Yi);C0("number",Yi);C0("object",y4);C0("string",Z4);function ur(u,a){if(u)try{return Q4(u,{skipReadOnly:!0,skipNonRequired:!1,quiet:!0})}catch(e){a.error(q0(" Error while generating test data from JSON Schema ")+`
@@ -1,5 +1,5 @@
1
- import { e as h, s as x, r as i } from "./replay-index-BZey8T6L.js";
2
- import { d as j, a as b, j as d } from "./replay-index-BZey8T6L.js";
1
+ import { e as h, s as x, r as i } from "./replay-index-DmiNhCXD.js";
2
+ import { d as j, a as b, j as d } from "./replay-index-DmiNhCXD.js";
3
3
  async function u(n, e) {
4
4
  const t = x(), l = await i(n), c = await i(e), o = l.replace(new RegExp(`^${t}+`), "").split(t).filter(Boolean), r = c.replace(new RegExp(`^${t}+`), "").split(t).filter(Boolean), m = Math.min(o.length, r.length);
5
5
  let s = 0;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-BIn_L-wL.js");async function u(r,n){const t=e.sep(),l=await e.resolve(r),c=await e.resolve(n),a=l.replace(new RegExp(`^${t}+`),"").split(t).filter(Boolean),i=c.replace(new RegExp(`^${t}+`),"").split(t).filter(Boolean),m=Math.min(a.length,i.length);let s=0;for(let o=0;o<m&&a[o]===i[o];o++)s++;const p=a.slice(s).map(()=>".."),f=i.slice(s);return[...p,...f].join(t)}async function g(r){const n=await e.extname(r);return n?`.${n}`:""}exports.dirname=e.dirname;exports.isAbsolute=e.isAbsolute;exports.join=e.join;exports.resolve=e.resolve;exports.extname=g;exports.relative=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-B-DxC-Su.js");async function u(r,n){const t=e.sep(),l=await e.resolve(r),c=await e.resolve(n),a=l.replace(new RegExp(`^${t}+`),"").split(t).filter(Boolean),i=c.replace(new RegExp(`^${t}+`),"").split(t).filter(Boolean),m=Math.min(a.length,i.length);let s=0;for(let o=0;o<m&&a[o]===i[o];o++)s++;const p=a.slice(s).map(()=>".."),f=i.slice(s);return[...p,...f].join(t)}async function g(r){const n=await e.extname(r);return n?`.${n}`:""}exports.dirname=e.dirname;exports.isAbsolute=e.isAbsolute;exports.join=e.join;exports.resolve=e.resolve;exports.extname=g;exports.relative=u;
package/dist/replay.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-BIn_L-wL.js"),t=require("./replay-oauth2-redirect-handler-Bqw5UUvl.js");exports.AgentLoop=e.AgentLoop;exports.AiPanelContext=e.AiPanelContext;exports.EmbeddedReplay=e.EmbeddedReplay;exports.Modal=e.Modal;exports.Replay=e.Replay;exports.ReplayOverlay=e.ReplayOverlay;Object.defineProperty(exports,"SpanStatusCode",{enumerable:!0,get:()=>e.SpanStatusCode});exports.TelemetryClient=e.TelemetryClient;exports.applyThemeToDOM=e.applyThemeToDOM;exports.getCurrentTheme=e.getCurrentTheme;exports.resolveTheme=e.resolveTheme;exports.useAiPanel=e.useAiPanel;exports.useTelemetry=e.useTelemetry;exports.useTelemetryClient=e.useTelemetryClient;exports.OAuth2Error=t.OAuth2Error;exports.handleOAuth2Redirect=t.handleOAuth2Redirect;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-B-DxC-Su.js"),t=require("./replay-oauth2-redirect-handler-Bqw5UUvl.js");exports.AgentLoop=e.AgentLoop;exports.AiPanelContext=e.AiPanelContext;exports.EmbeddedReplay=e.EmbeddedReplay;exports.Modal=e.Modal;exports.Replay=e.Replay;exports.ReplayOverlay=e.ReplayOverlay;Object.defineProperty(exports,"SpanStatusCode",{enumerable:!0,get:()=>e.SpanStatusCode});exports.TelemetryClient=e.TelemetryClient;exports.applyThemeToDOM=e.applyThemeToDOM;exports.getCurrentTheme=e.getCurrentTheme;exports.resolveTheme=e.resolveTheme;exports.useAiPanel=e.useAiPanel;exports.useTelemetry=e.useTelemetry;exports.useTelemetryClient=e.useTelemetryClient;exports.OAuth2Error=t.OAuth2Error;exports.handleOAuth2Redirect=t.handleOAuth2Redirect;
package/dist/replay.d.ts CHANGED
@@ -19,20 +19,25 @@ export declare class AgentLoop {
19
19
  private readonly toolLoopAgent;
20
20
  private readonly maxHistoryMessages;
21
21
  private readonly maxHistoryChars;
22
+ private readonly maxSteps;
22
23
  private readonly context;
23
24
  private readonly systemInstructions;
25
+ private readonly model;
24
26
  private tools;
25
27
  constructor(config: AgentRuntimeConfig);
26
28
  getAgent(): ToolLoopAgent<never, ReplayToolSet, never>;
27
29
  addContext(context: SystemModelMessage[]): void;
28
30
  registerTools(tools: ReplayToolSet): void;
31
+ generateTitle(prompt: string, abortSignal?: AbortSignal): Promise<string>;
29
32
  private prepareMessages;
30
33
  private preparePrompt;
31
34
  }
32
35
 
33
36
  declare type AgentRuntimeConfig = {
37
+ activeConversationId: string;
34
38
  model: Model;
35
39
  tools: ReplayToolSet;
40
+ sendEvent: AiChatTelemetrySendEvent;
36
41
  maxSteps?: number;
37
42
  maxOutputTokens?: ToolLoopAgentConfig['maxOutputTokens'];
38
43
  maxRetries?: ToolLoopAgentConfig['maxRetries'];
@@ -42,6 +47,8 @@ declare type AgentRuntimeConfig = {
42
47
  maxHistoryChars?: number;
43
48
  };
44
49
 
50
+ declare type AiChatTelemetrySendEvent = <T extends AsyncApiReplay.EventType>(event: T, data: AsyncApiReplay.GetEventData<T>) => void;
51
+
45
52
  export declare const AiPanelContext: Context<AiPanelContextValue>;
46
53
 
47
54
  export declare type AiPanelContextValue = {
@@ -104,10 +111,10 @@ declare const definitions: {
104
111
  open_tab: Tool< {
105
112
  action: "focus_tab" | "open_operation" | "open_collection" | "open_workflow" | "open_step" | "open_workflow_run";
106
113
  tabIndex?: number | undefined;
107
- collectionId?: string | undefined;
108
114
  workflowId?: string | undefined;
109
115
  stepId?: string | undefined;
110
116
  operationId?: string | undefined;
117
+ collectionId?: string | undefined;
111
118
  }, {
112
119
  error: {
113
120
  message: string;
@@ -117,18 +124,18 @@ declare const definitions: {
117
124
  data?: undefined;
118
125
  } | {
119
126
  data: {
120
- tabId: string;
121
127
  outcome: "focused" | "opened";
122
128
  activeTabIndex: number;
129
+ tabId: string;
123
130
  tabType: TabDataType;
124
131
  };
125
132
  isError: false;
126
133
  error?: undefined;
127
134
  }>;
128
135
  run_request: Tool< {
129
- collectionId: string;
130
136
  workflowId: string;
131
137
  stepId: string;
138
+ collectionId: string;
132
139
  }, {
133
140
  error: {
134
141
  message: string;
@@ -142,15 +149,15 @@ declare const definitions: {
142
149
  url?: string | undefined;
143
150
  status?: number | undefined;
144
151
  size?: number | undefined;
152
+ duration?: number | undefined;
145
153
  headers?: [string, string][] | undefined;
146
154
  cookies?: [string, string][] | undefined;
147
- duration?: number | undefined;
148
155
  };
149
156
  isError: false;
150
157
  error?: undefined;
151
158
  }>;
152
159
  get_current_tab: Tool< {
153
- sections: ("security" | "result" | "info" | "workflows" | "sourceDescriptions" | "inputs" | "steps" | "parameters" | "outputs" | "successCriteria" | "requestBody" | "response" | "severity")[];
160
+ sections: ("security" | "result" | "info" | "workflows" | "sourceDescriptions" | "inputs" | "steps" | "parameters" | "outputs" | "successCriteria" | "requestBody" | "severity" | "response")[];
154
161
  }, {
155
162
  error: {
156
163
  message: string;
@@ -169,57 +176,173 @@ declare const definitions: {
169
176
  path?: string | undefined;
170
177
  type?: "workflow" | "collection" | "step" | "api" | "api_operation" | undefined;
171
178
  method?: string | undefined;
172
- collectionId?: string | undefined;
179
+ query?: string | undefined;
180
+ apiId?: string | undefined;
173
181
  workflowId?: string | undefined;
174
182
  stepId?: string | undefined;
175
- apiId?: string | undefined;
176
183
  operationId?: string | undefined;
177
- query?: string | undefined;
184
+ collectionId?: string | undefined;
178
185
  }, unknown>;
179
- update_step: Tool< {
180
- collectionId: string;
186
+ update_security: Tool< {
181
187
  workflowId: string;
182
188
  stepId: string;
183
- body?: {
184
- content: string;
185
- contentType?: string | undefined;
189
+ collectionId: string;
190
+ changes: ({
191
+ type: import("../../../../types/security").SecurityTypes.BasicAuth;
192
+ action: "add" | "update";
193
+ approved: boolean;
194
+ data?: {
195
+ password?: string | undefined;
196
+ username?: string | undefined;
186
197
  } | undefined;
187
- security?: ({
188
- values: Record<string, unknown>;
189
- schemeName: string;
198
+ index?: number | undefined;
199
+ schemeId?: string | undefined;
190
200
  } | {
191
- values: Record<string, unknown>;
192
- scheme: {
193
- type: "http";
194
- scheme: "basic" | "digest" | "bearer";
195
- bearerFormat?: string | undefined;
201
+ type: import("../../../../types/security").SecurityTypes.DigestAuth;
202
+ action: "add" | "update";
203
+ approved: boolean;
204
+ data?: {
205
+ password?: string | undefined;
206
+ username?: string | undefined;
207
+ } | undefined;
208
+ index?: number | undefined;
209
+ schemeId?: string | undefined;
196
210
  } | {
197
- type: "apiKey";
198
- name: string;
199
- in: "header" | "query" | "cookie";
211
+ type: import("../../../../types/security").SecurityTypes.JWT;
212
+ action: "add" | "update";
213
+ approved: boolean;
214
+ data?: {
215
+ token?: string | undefined;
216
+ } | undefined;
217
+ index?: number | undefined;
218
+ schemeId?: string | undefined;
200
219
  } | {
201
- type: "oauth2";
202
- flows: Record<string, unknown>;
220
+ type: import("../../../../types/security").SecurityTypes.APIKey;
221
+ action: "add" | "update";
222
+ approved: boolean;
223
+ data?: {
224
+ key?: string | undefined;
225
+ name?: string | undefined;
226
+ location?: "header" | "query" | "cookie" | undefined;
227
+ } | undefined;
228
+ index?: number | undefined;
229
+ schemeId?: string | undefined;
203
230
  } | {
204
- type: "openIdConnect";
205
- flows?: Record<string, unknown> | undefined;
231
+ type: import("../../../../types/security").SecurityTypes.OAuth2;
232
+ action: "add" | "update";
233
+ approved: boolean;
234
+ data?: {
235
+ password?: string | undefined;
236
+ username?: string | undefined;
237
+ clientId?: string | undefined;
238
+ clientSecret?: string | undefined;
239
+ grantType?: "password" | "implicit" | "clientCredentials" | "authorizationCode" | "clientCredentialsWithJwtAssertion" | "authorizationCodeWithPkce" | undefined;
240
+ tokenUrl?: string | undefined;
241
+ accessToken?: string | undefined;
242
+ authorizationUrl?: string | undefined;
243
+ callbackUrl?: string | undefined;
244
+ } | undefined;
245
+ index?: number | undefined;
246
+ schemeId?: string | undefined;
247
+ } | {
248
+ type: import("../../../../types/security").SecurityTypes.OpenIDConnect;
249
+ action: "add" | "update";
250
+ approved: boolean;
251
+ data?: {
252
+ password?: string | undefined;
253
+ username?: string | undefined;
254
+ clientId?: string | undefined;
255
+ clientSecret?: string | undefined;
206
256
  openIdConnectUrl?: string | undefined;
257
+ grantType?: "password" | "implicit" | "clientCredentials" | "authorizationCode" | "clientCredentialsWithJwtAssertion" | "authorizationCodeWithPkce" | undefined;
258
+ tokenUrl?: string | undefined;
259
+ accessToken?: string | undefined;
260
+ authorizationUrl?: string | undefined;
261
+ callbackUrl?: string | undefined;
262
+ userInfoUrl?: string | undefined;
263
+ } | undefined;
264
+ index?: number | undefined;
265
+ schemeId?: string | undefined;
266
+ } | {
267
+ action: "remove";
268
+ approved: boolean;
269
+ index: number;
270
+ })[];
271
+ }, {
272
+ error: {
273
+ message: string;
274
+ details?: unknown;
207
275
  };
208
- })[] | undefined;
209
- description?: string | undefined;
210
- url?: string | undefined;
211
- method?: string | undefined;
212
- parameters?: {
276
+ isError: true;
277
+ data?: undefined;
278
+ } | {
279
+ data: {
280
+ changedCount: number;
281
+ };
282
+ isError: false;
283
+ error?: undefined;
284
+ }>;
285
+ update_step: Tool< {
286
+ workflowId: string;
287
+ stepId: string;
288
+ collectionId: string;
289
+ changes: ({
290
+ data: string;
291
+ field: "url";
292
+ action: "add" | "remove" | "update";
293
+ approved: boolean;
294
+ id?: string | undefined;
295
+ } | {
296
+ data: string;
297
+ field: "description";
298
+ action: "add" | "remove" | "update";
299
+ approved: boolean;
300
+ id?: string | undefined;
301
+ } | {
302
+ data: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS";
303
+ field: "method";
304
+ action: "add" | "remove" | "update";
305
+ approved: boolean;
306
+ id?: string | undefined;
307
+ } | {
308
+ field: "parameters";
309
+ action: "add" | "remove" | "update";
310
+ approved: boolean;
311
+ data?: {
213
312
  name: string;
214
313
  in: "header" | "path" | "query" | "cookie";
215
314
  value: string;
216
- }[] | undefined;
217
- outputs?: Record<string, string> | undefined;
218
- successCriteria?: {
315
+ } | undefined;
316
+ id?: string | undefined;
317
+ } | {
318
+ field: "outputs";
319
+ action: "add" | "remove" | "update";
320
+ approved: boolean;
321
+ data?: {
322
+ name: string;
323
+ expression: string;
324
+ } | undefined;
325
+ id?: string | undefined;
326
+ } | {
327
+ field: "successCriteria";
328
+ action: "add" | "remove" | "update";
329
+ approved: boolean;
330
+ data?: {
219
331
  condition: string;
220
- type?: "simple" | "regex" | "jsonpath" | "xpath" | undefined;
332
+ type?: "regex" | "simple" | "jsonpath" | "xpath" | undefined;
221
333
  context?: string | undefined;
222
- }[] | undefined;
334
+ } | undefined;
335
+ id?: string | undefined;
336
+ } | {
337
+ data: {
338
+ content: string;
339
+ contentType?: string | undefined;
340
+ };
341
+ field: "body";
342
+ action: "add" | "remove" | "update";
343
+ approved: boolean;
344
+ id?: string | undefined;
345
+ })[];
223
346
  }, {
224
347
  error: {
225
348
  message: string;
@@ -234,6 +357,62 @@ declare const definitions: {
234
357
  isError: false;
235
358
  error?: undefined;
236
359
  }>;
360
+ manage_collection: Tool< {
361
+ title: string;
362
+ action: "create_collection";
363
+ } | {
364
+ collectionId: string;
365
+ action: "delete_collection";
366
+ } | {
367
+ name: string;
368
+ collectionId: string;
369
+ action: "create_workflow";
370
+ } | {
371
+ workflowId: string;
372
+ collectionId: string;
373
+ action: "delete_workflow";
374
+ } | {
375
+ workflowId: string;
376
+ collectionId: string;
377
+ action: "create_step";
378
+ operation?: {
379
+ path: string;
380
+ method: string;
381
+ apiId: string;
382
+ operationId?: string | undefined;
383
+ } | undefined;
384
+ xOperation?: {
385
+ url: string;
386
+ method: string;
387
+ } | undefined;
388
+ stepName?: string | undefined;
389
+ } | {
390
+ workflowId: string;
391
+ stepId: string;
392
+ collectionId: string;
393
+ action: "delete_step";
394
+ } | {
395
+ action: "save_tab_to_collection";
396
+ targetCollectionId: string;
397
+ targetWorkflowId: string;
398
+ newStepName: string;
399
+ }, {
400
+ error: {
401
+ message: string;
402
+ details?: unknown;
403
+ };
404
+ isError: true;
405
+ data?: undefined;
406
+ } | {
407
+ data: {
408
+ summary: string;
409
+ workflowId?: string | undefined;
410
+ stepId?: string | undefined;
411
+ collectionId?: string | undefined;
412
+ };
413
+ isError: false;
414
+ error?: undefined;
415
+ }>;
237
416
  };
238
417
 
239
418
  export declare function EmbeddedReplay(props: ReplayAppProps): JSX.Element;
package/dist/replay.js CHANGED
@@ -1,4 +1,4 @@
1
- import { w as s, x as t, E as l, M as r, R as o, y as m, S as n, T as p, z as y, C as T, D as d, F as h, G as u, H as C } from "./replay-index-BZey8T6L.js";
1
+ import { w as s, x as t, E as l, M as r, R as o, y as m, S as n, T as p, z as y, C as T, D as d, F as h, G as u, H as C } from "./replay-index-DmiNhCXD.js";
2
2
  import { O as A, h as O } from "./replay-oauth2-redirect-handler-CqKZB3aV.js";
3
3
  export {
4
4
  s as AgentLoop,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/replay",
3
- "version": "0.23.0-next.3",
3
+ "version": "0.23.0-next.4",
4
4
  "type": "module",
5
5
  "main": "./dist/replay.cjs",
6
6
  "module": "./dist/replay.js",
@@ -20,7 +20,7 @@
20
20
  "react-dom": "^19.2.4",
21
21
  "react-router-dom": "^6.30.3",
22
22
  "styled-components": "^5.3.11",
23
- "@redocly/theme": "0.64.0-next.3"
23
+ "@redocly/theme": "0.64.0-next.4"
24
24
  },
25
25
  "dependencies": {
26
26
  "@ai-sdk/google": "3.0.1",