@redocly/replay 0.28.0-next.8 → 0.28.0-next.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{replay-AiChatProvider--1WugvKf.js → replay-AiChatProvider-B_f9Wn8a.js} +1 -1
- package/dist/{replay-AiChatProvider-BJdxRVOc.js → replay-AiChatProvider-DuTK5g1N.js} +41 -41
- package/dist/{replay-AiChatSqliteDBStorage-DbGtw6xx.js → replay-AiChatSqliteDBStorage-CHfMo6M6.js} +1 -1
- package/dist/{replay-AiChatSqliteDBStorage-D9fgt_9s.js → replay-AiChatSqliteDBStorage-cXsRIQfJ.js} +6 -6
- package/dist/{replay-AiPanel-BU8oG0pD.js → replay-AiPanel-CGbGwIMX.js} +35 -35
- package/dist/{replay-AiPanel-BYOLZjQX.js → replay-AiPanel-C_C52r20.js} +1 -1
- package/dist/replay-FileWatcher-DEOB0_DG.js +1 -0
- package/dist/{replay-FileWatcher-JoqPJECh.js → replay-FileWatcher-Z6eygcBI.js} +4 -5
- package/dist/{replay-HistorySqliteDBStorage-CtF6-vY8.js → replay-HistorySqliteDBStorage-Bi5vBQ2T.js} +2 -2
- package/dist/{replay-SemanticSearchService-DRDdGJkI.js → replay-SemanticSearchService-BLF1oOOu.js} +8 -12
- package/dist/replay-SemanticSearchService-DTc0oxN4.js +1 -0
- package/dist/{replay-SqliteDBStorage-B3zO7RGD.js → replay-SqliteDBStorage-B_kyJ0a3.js} +1 -1
- package/dist/{replay-SqliteDBStorage-D9Oeu_XC.js → replay-SqliteDBStorage-DF9kKplR.js} +49 -49
- package/dist/{replay-StepContextSqliteDBStorage-BfAAKDwA.js → replay-StepContextSqliteDBStorage-BkB2NM27.js} +2 -2
- package/dist/{replay-TauriFileSystemAdapter-CxHFFCmk.js → replay-TauriFileSystemAdapter-CwSMakdJ.js} +1 -1
- package/dist/{replay-TauriFileSystemAdapter-DJETGEY7.js → replay-TauriFileSystemAdapter-DcFBYSUW.js} +8 -8
- package/dist/{replay-TauriRootStorage-BSQQcFgG.js → replay-TauriRootStorage-DEGEIJrz.js} +1 -1
- package/dist/{replay-TauriRootStorage-XIJpsp6_.js → replay-TauriRootStorage-Den8gI4S.js} +85 -85
- package/dist/{replay-agent-loop-DxK1tiVw.js → replay-agent-loop-B8Mjb8DU.js} +9 -9
- package/dist/{replay-agent-loop-IDavXm8f.js → replay-agent-loop-Z_nrrmg_.js} +1 -1
- package/dist/{replay-ai-chat-mappers-B-_eSMi4.js → replay-ai-chat-mappers-D7e8buTk.js} +3 -3
- package/dist/{replay-ai-chat-mappers-BmvAc4xt.js → replay-ai-chat-mappers-aJ_VMb6Z.js} +1 -1
- package/dist/{replay-ai-message-parts.schema-E9u9-nqr.js → replay-ai-message-parts.schema-DKLf0SiG.js} +1 -1
- package/dist/{replay-create-model-CIY7WZ1P.js → replay-create-model-Be3vPVDb.js} +3 -3
- package/dist/{replay-create-model-CscK0cT1.js → replay-create-model-Bw20x80b.js} +3 -3
- package/dist/{replay-db-e_3o5e3f.js → replay-db-BQXljNM0.js} +1 -1
- package/dist/{replay-db-C_cdHXEt.js → replay-db-BmZNrdZM.js} +5 -5
- package/dist/{replay-external-resolver-BmOmF-DG.js → replay-external-resolver-BLzbbtnT.js} +1 -1
- package/dist/{replay-external-resolver-nuL3ajF5.js → replay-external-resolver-BQvSDNfH.js} +7 -7
- package/dist/{replay-history.schema-5ce6X0R1.js → replay-history.schema-B0lLwmdG.js} +3 -3
- package/dist/{replay-index-E3Eu6_jY.js → replay-index-B-uZhXHj.js} +1 -1
- package/dist/{replay-index-DDt4LOBo.js → replay-index-BCz452N6.js} +10475 -10423
- package/dist/{replay-index-DjdDUkfV.js → replay-index-C0kvTxxm.js} +31 -31
- package/dist/{replay-index-etIeWhnn.js → replay-index-C7y4K4Cr.js} +1 -1
- package/dist/replay-index-DAIwC3ls.js +1 -0
- package/dist/{replay-index-B8Zfn7JD.js → replay-index-DYtXcqDk.js} +955 -957
- package/dist/replay-index-gM6vL6iT.js +4 -0
- package/dist/{replay-index-DcbwI4wD.js → replay-index-wBHsAQEV.js} +1 -1
- package/dist/{replay-indexes-CfsvVMi_.js → replay-indexes-B3PJtgeh.js} +43 -43
- package/dist/{replay-lint-DVAifLdU.js → replay-lint-BzkTeXqI.js} +3 -3
- package/dist/{replay-lint-BjrmIhuZ.js → replay-lint-CqDMOMQt.js} +74 -74
- package/dist/{replay-lint-graphql-D1qaeEmu.js → replay-lint-graphql-BDBGJSir.js} +1 -1
- package/dist/{replay-lint-graphql-U_VxwRr1.js → replay-lint-graphql-BZF2eLiZ.js} +1 -1
- package/dist/replay-periodic-revalidation-C7SkB1vs.js +1 -0
- package/dist/{replay-periodic-revalidation-BtEKdEKa.js → replay-periodic-revalidation-orCv_JoF.js} +4 -5
- package/dist/{replay-resolve-BYJosLqD.js → replay-resolve-0e5f8I7b.js} +1 -1
- package/dist/{replay-resolve-C97SfUAB.js → replay-resolve-DZMWoig2.js} +123 -123
- package/dist/{replay-respect-run-3FHTVHvs.js → replay-respect-run-CLW3wGhx.js} +3 -3
- package/dist/{replay-respect-run-CW5xFLKz.js → replay-respect-run-ChP63WzG.js} +1 -1
- package/dist/replay-step-context.schema-BOprzd6Z.js +21 -0
- package/dist/{replay-tauri-path-CMpWmGvW.js → replay-tauri-path-DBt1dqkG.js} +1 -1
- package/dist/replay-tauri-path-DvLF4Z8f.js +22 -0
- package/dist/{replay-useAiChatQueries-CEYDGx9f.js → replay-useAiChatQueries-Bypgnkwa.js} +2 -2
- package/dist/{replay-useAiChatQueries-DhTcllVx.js → replay-useAiChatQueries-S6v5duiJ.js} +131 -137
- package/dist/{replay-validate-key-DJ_1khxq.js → replay-validate-key-CMJODIH6.js} +2 -2
- package/dist/{replay-validate-key-Dj_UT2WG.js → replay-validate-key-CNl7BV_v.js} +1 -1
- package/dist/replay.cjs +1 -1
- package/dist/replay.js +10 -10
- package/package.json +3 -3
- package/dist/replay-FileWatcher-BrhE0AP6.js +0 -1
- package/dist/replay-SemanticSearchService-BgQ1HMcT.js +0 -1
- package/dist/replay-index-C_DfEx-H.js +0 -1
- package/dist/replay-index-Da2H-hpA.js +0 -25
- package/dist/replay-periodic-revalidation-C3eLm7Mw.js +0 -1
- package/dist/replay-step-context.schema-DBk4jufr.js +0 -21
- package/dist/replay-tauri-path-C-vLbl1V.js +0 -22
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./replay-index-B8Zfn7JD.js"),Sa=require("./replay-resolve-BYJosLqD.js"),xe=require("./replay-lint-DVAifLdU.js");function Ls(e){return k.isPlainObject(e)&&"name"in e&&"value"in e&&!("in"in e)}function Fr(e){return k.isPlainObject(e)&&"in"in e&&typeof e.in=="string"&&["header","query","path","cookie"].includes(e.in)}const Ds=/^image\/(png|jpeg|gif|bmp|webp|svg\+xml)|application\/pdf$/;function Bt(e){return e.startsWith("$file(")&&e.endsWith(")")?e.substring(7,e.length-2):e}const Pn=async(e,r,a,n,t)=>{const i=k.pathBrowserifyExports.dirname(n),o=k.pathBrowserifyExports.resolve(i,Bt(a));e.append(r,await t.options.requestFileLoader.getFileBody(o))},Rt=(e,r,a,n,t,i)=>{Object.entries(a).forEach(([o,l])=>{const c=i?`${i}[${o}]`:o;typeof l=="string"&&l.startsWith("$file(")&&l.endsWith(")")?e.push(Pn(r,c,l,n,t)):Array.isArray(l)?l.forEach(u=>{typeof u=="string"&&u.startsWith("$file(")&&u.endsWith(")")?e.push(Pn(r,c,u,n,t)):r.append(c,u.toString())}):k.isPlainObject(l)?Rt(e,r,l,n,t,c):(typeof l=="string"||typeof l=="number"||typeof l=="boolean")&&r.append(c,l.toString())})},Ns=async(e,r,a,n)=>{if(k.isPlainObject(e)){const t=[];Rt(t,r,e,a,n),await Promise.all(t)}},Hs=async(e,r)=>{if(typeof e=="string"&&e.startsWith("$file(")&&e.endsWith(")")){const a=k.pathBrowserifyExports.resolve(k.pathBrowserifyExports.dirname(r.options.filePath),Bt(e));return r.options.requestFileLoader.getFileBody(a)}else return e};async function xs(e,r){if(!e)return{payload:void 0,contentType:void 0,encoding:void 0,replacements:void 0};const{payload:a,contentType:n}=e;if(n==="multipart/form-data"){const t=new FormData,i=k.pathBrowserifyExports.resolve(r.options.filePath);return await Ns(a,t,i,r),{...e,payload:t}}else{if(n==="application/octet-stream"||typeof n=="string"&&Ds.test(n))return{...e,payload:await Hs(a,r),contentType:"application/octet-stream"};if(n==="application/x-www-form-urlencoded"&&typeof a=="string")return{...e,payload:Object.fromEntries(new URLSearchParams(a).entries()),contentType:"application/x-www-form-urlencoded"}}return e}function Ws({payload:e,replacements:r,expressionContext:a,logger:n}){for(const t of r){const{target:i,value:o}=t;if(typeof i!="string")throw new Error(`Invalid JSON Pointer: ${i}`);try{const l=k.JsonPointerLib.get(e,i),c=k.evaluateRuntimeExpressionPayload({payload:o,context:a,logger:n});l!==void 0&&k.JsonPointerLib.set(e,i,c)}catch{throw new Error(`Invalid JSON Pointer: ${i}`)}}}const Gs=["parameters","failureActions","successActions"];function Fs(e,r){const{reference:a,value:n}=e;if(!Gs.some(i=>a.includes(`$components.${i}`)))throw new Error("Invalid reference: available components are $components.parameters, $components.failureActions, or $components.successActions");const t=k.getValueFromContext({value:a,ctx:r,logger:r.options.logger});return k.isPlainObject(t)&&"value"in t&&n?{...t,value:n}:t}function Ca(e,r){return"reference"in e?Fs(e,r):e}const ie={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 Et extends Error{}class Pt extends Et{}class Lt extends Et{}async function Is(e){const{descriptionPath:r,externalRefResolver:a,base:n}=e,t=await xe.bundle({base:n,ref:r,config:e.config,dereference:!0,externalRefResolver:a});if(!t)throw new Error(`Could not find source description file '${r}'.`);return t.bundle.parsed}const Os={title:"[REPLACE WITH API title]",version:"[REPLACE WITH API version]"},Rr=Symbol("skip");function fa(e){return e<10?"0"+e:e}function $s(e,r,a,n){var t=a?"":e.getUTCFullYear()+"-"+fa(e.getUTCMonth()+1)+"-"+fa(e.getUTCDate());return r||(t+="T"+fa(e.getUTCHours())+":"+fa(e.getUTCMinutes())+":"+fa(e.getUTCSeconds())+"Z"),t}function Dt(e,r){return r>e.length?e.repeat(Math.trunc(r/e.length)+1).substring(0,r):e}function Ja(...e){const r=a=>a&&typeof a=="object";return e.reduce((a,n)=>(Object.keys(n||{}).forEach(t=>{const i=a[t],o=n[t];r(i)&&r(o)?a[t]=Ja(i,o):a[t]=o}),a),Array.isArray(e[e.length-1])?[]:{})}function Ks(e){var r=js(e),a=Vs(r,r,r,r),n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{var i=a()*16%16|0;return(t=="x"?i:i&3|8).toString(16)});return n}function cr(e){return{value:e==="object"?{}:e==="array"?[]:void 0}}function Je(e,r){r&&e.pop()}function Js(e){return{name:e?.xml?.name||"",prefix:e?.xml?.prefix||"",namespace:e?.xml?.namespace||null,attribute:e?.xml?.attribute??!1,wrapped:e?.xml?.wrapped??!1}}function zs(e){const r=e?.xml;return r?.nodeType?r.nodeType:r?.attribute===!0?"attribute":r?.wrapped===!0&&e?.type==="array"?"element":e?.$ref||e?.$dynamicRef||e?.type==="array"||e?.oneOf||e?.anyOf||e?.allOf?"none":"element"}function za(e,r={},a={}){const{value:n}=e,{propertyName:t}=a,{name:i,prefix:o,namespace:l}=Js(r),c=zs(r);let u=i||t?`${o?o+":":""}${i||t}`:null,h=typeof n=="object"?Array.isArray(n)?[...n]:{...n}:n;switch(c){case"attribute":u&&(u=`$${u}`);break;case"text":u="#text";break;case"cdata":u="#cdata";break;case"none":r.type==="array"?(u=null,r.example!==void 0&&(u=r.items?.xml?.name||u)):u=null;break;default:r.type==="array"&&Array.isArray(h)&&(h={[u]:[...h]});break}return l&&c!=="text"&&c!=="cdata"&&c!=="none"&&(typeof h=="object"?h[`$xmlns${o?":"+o:""}`]=l:h={[`$xmlns${o?":"+o:""}`]:l,"#text":h}),{propertyName:u,value:h}}function js(e){var r=0;if(e.length==0)return r;for(var a=0;a<e.length;a++){var n=e.charCodeAt(a);r=(r<<5)-r+n,r=r&r}return r}function Vs(e,r,a,n){return function(){e|=0,r|=0,a|=0,n|=0;var t=e-(r<<27|r>>>5)|0;return e=r^(a<<17|a>>>15),r=a+n|0,a=n+t|0,n=e+t|0,(n>>>0)/4294967296}}function _s(e,r,a,n,t){let i=Pe(e,a,n);const o=[];for(let l of r){const{type:c,readOnly:u,writeOnly:h,value:p}=Pe({type:i.type,...l},a,n,{...t,isAllOfChild:!0});i.type&&c&&c!==i.type&&(console.warn("allOf: schemas with different types can't be merged"),i.type=c),i.type=i.type||c,i.readOnly=i.readOnly||u,i.writeOnly=i.writeOnly||h,p!=null&&o.push(p)}if(i.type==="object"){i.value=Ja(i.value||{},...o.filter(l=>typeof l=="object"));for(const l in i.value)i.value[l]===Rr&&delete i.value[l];return i}else{i.type==="array"&&(a.quiet||console.warn('OpenAPI Sampler: found allOf with "array" type. Result may be incorrect'));const l=o[o.length-1];return i.value=l??i.value,i}}const Ln={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 La(e){if(e.type!==void 0)return Array.isArray(e.type)?e.type.length===0?null:e.type[0]:e.type;const r=Object.keys(Ln);for(var a=0;a<r.length;a++){let n=r[a],t=Ln[n];if(e[n]!==void 0)return t}return null}let Ia={},Ee=[];function Us(){Ia={},Ee=[]}function Nt(e){let r;return e.const!==void 0?r=e.const:e.examples!==void 0&&e.examples.length?r=e.examples[0]:e.enum!==void 0&&e.enum.length?r=e.enum[0]:e.default!==void 0&&(r=e.default),r}function Dn(e){const r=Nt(e);if(r!==void 0)return{value:r,readOnly:e.readOnly,writeOnly:e.writeOnly,type:null}}function Pe(e,r,a,n){if(n){if(Ee.includes(e))return cr(La(e));Ee.push(e)}if(n&&n.depth>r.maxSampleDepth)return Je(Ee,n),cr(La(e));if(e.$ref){if(!a)throw new Error("Your schema contains $ref. You must provide full specification in the third parameter.");let l=decodeURIComponent(e.$ref);l.startsWith("#")&&(l=l.substring(1));const c=k.JsonPointerLib.get(a,l);let u;if(Ia[l]!==!0){Ia[l]=!0;const h=Pe(c,r,a,n);if(r.format==="xml"){const p=l.split("/").pop(),y={...n,propertyName:n?.propertyName||p},{propertyName:g,value:A}=za(h,c,y);u={...h,value:{[g||"root"]:A}}}else u=h;Ia[l]=!1}else{const h=La(c);u=cr(h)}return Je(Ee,n),u}if(e.example!==void 0)return Je(Ee,n),{value:e.example,readOnly:e.readOnly,writeOnly:e.writeOnly,type:e.type};if(e.allOf!==void 0)return Je(Ee,n),Dn(e)||_s({...e,allOf:void 0},e.allOf,r,a,n);if(e.oneOf&&e.oneOf.length){e.anyOf&&(r.quiet||console.warn("oneOf and anyOf are not supported on the same level. Skipping anyOf")),Je(Ee,n);const l=Object.assign({readOnly:e.readOnly,writeOnly:e.writeOnly},e.oneOf[0]);return o(e,l)}if(e.anyOf&&e.anyOf.length){Je(Ee,n);const l=Object.assign({readOnly:e.readOnly,writeOnly:e.writeOnly},e.anyOf[0]);return o(e,l)}if(e.if&&e.then){Je(Ee,n);const{if:l,then:c,...u}=e;return Pe(Ja(u,l,c),r,a,n)}let t=Nt(e),i=null;if(t===void 0){t=null,i=e.type,Array.isArray(i)&&e.type.length>0&&(i=e.type[0]),i||(i=La(e));let l=Wt[i];l&&(t=l(e,r,a,n))}return Je(Ee,n),{value:t,readOnly:e.readOnly,writeOnly:e.writeOnly,type:i};function o(l,c){const u=Dn(l);if(u!==void 0)return u;const h=Pe({...l,oneOf:void 0,anyOf:void 0},r,a,n),p=Pe(c,r,a,n);if(typeof h.value=="object"&&typeof p.value=="object"){const y=Ja(h.value,p.value);return{...p,value:y}}return p}}function Ys(e,r={},a,n){const t=n&&n.depth||1;let i=Math.min(e.maxItems!=null?e.maxItems:1/0,e.minItems||1);const o=e.prefixItems||e.items||e.contains;Array.isArray(o)&&(i=Math.max(i,o.length));let l=u=>Array.isArray(o)?o[u]||{}:o||{},c=[];if(!o)return c;for(let u=0;u<i;u++){let h=l(u),{value:p}=Pe(h,r,a,{depth:t+1});if(r?.format==="xml"){const{value:y,propertyName:g}=za({value:p},h,n);g?(c?.[g]||(c={...c,[g]:[]}),c[g].push(y)):c={...c,...y}}else c.push(p)}if(r?.format==="xml"&&t===1){const{value:u,propertyName:h}=za({value:null},e,n);h&&(u?c=Array.isArray(c)?{[h]:{...u,...c.map(p=>({"#text":{...p}}))}}:{[h]:{...c,...u}}:c={[h]:c})}return c}function qs(e){return!0}function Ht(e){let r=0;if(e.type==="number"&&(e.format==="float"||e.format==="double")&&(r=.1),typeof e.exclusiveMinimum=="boolean"||typeof e.exclusiveMaximum=="boolean"){if(Number.isFinite(e.maximum)&&Number.isFinite(e.minimum))return r=e.exclusiveMinimum?Math.floor(e.minimum)+1:e.minimum,(e.exclusiveMaximum&&r>=e.maximum||!e.exclusiveMaximum&&r>e.maximum)&&(r=(e.maximum+e.minimum)/2),r;if(Number.isFinite(e.minimum))return e.exclusiveMinimum?Math.floor(e.minimum)+1:e.minimum;if(Number.isFinite(e.maximum))return e.exclusiveMaximum?e.maximum>0?0:Math.floor(e.maximum)-1:e.maximum>0?0:e.maximum}else{if(Number.isFinite(e.minimum))return e.minimum;Number.isFinite(e.exclusiveMinimum)?(r=Math.floor(e.exclusiveMinimum)+1,r===e.exclusiveMaximum&&(r=(r+Math.floor(e.exclusiveMaximum)-1)/2)):Number.isFinite(e.exclusiveMaximum)?r=Math.floor(e.exclusiveMaximum)-1:Number.isFinite(e.maximum)&&(r=e.maximum)}return r}function Zs(e,r={},a,n){let t={};const i=n&&n.depth||1;if(e&&typeof e.properties=="object"){const o=Array.isArray(e.required)?e.required:[],l={};for(const c of o)l[c]=!0;Object.keys(e.properties).forEach(c=>{if(r.skipNonRequired&&!l.hasOwnProperty(c))return;const u=Pe(e.properties[c],r,a,{propertyName:c,depth:i+1});if(r.skipReadOnly&&u.readOnly){n?.isAllOfChild&&(t[c]=Rr);return}if(r.skipWriteOnly&&u.writeOnly){n?.isAllOfChild&&(t[c]=Rr);return}if(r?.format==="xml"){const{propertyName:h,value:p}=za(u,e.properties[c],{propertyName:c});h?t[h]=p:p!==null&&typeof p=="object"&&(t={...t,...p})}else t[c]=u.value})}if(e&&typeof e.additionalProperties=="object"){const o=e.additionalProperties["x-additionalPropertiesName"]||"property";t[`${String(o)}1`]=Pe(e.additionalProperties,r,a,{depth:i+1}).value,t[`${String(o)}2`]=Pe(e.additionalProperties,r,a,{depth:i+1}).value}if(e&&typeof e.properties=="object"&&e.maxProperties!==void 0&&Object.keys(t).length>e.maxProperties){const o={};let l=0;(Array.isArray(e.required)?e.required:[]).forEach(u=>{t[u]!==void 0&&(o[u]=t[u],l++)}),Object.keys(t).forEach(u=>{l<e.maxProperties&&!o.hasOwnProperty(u)&&(o[u]=t[u],l++)}),t=o}return t}function wa(e,r){return e}function Nn(e,r,a){let n=1;if(e)switch(e){case"?":{n=0;break}case"*":{n=wa(0);break}case"+":{n=wa(1);break}default:throw new Error("Unknown quantifier symbol provided.")}else r!=null&&a!=null?n=wa(parseInt(r)):r!=null&&a==null&&(n=parseInt(r));return n}function Xs(e){let r=!1;e instanceof RegExp&&(r=e.flags.includes("i"),e=e.toString(),e=e.match(/\/(.+?)\//)?.[1]??""),e=e.replace(/^(\^)?(.*?)(\$)?$/,"$2");let a,n,t;const i=/([.A-Za-z0-9])(?:\{(\d+)(?:\,(\d+)|)\}|(\?|\*|\+))(?![^[]*]|[^{]*})/;let o=e.match(i);for(;o!=null;){const p=o[2],y=o[3],g=o[4];t=Nn(g,p,y),e=e.slice(0,o.index)+o[1].repeat(t)+e.slice(o.index+o[0].length),o=e.match(i)}const l=/(\d-\d|\w-\w|\d|\w|[-!@#$&()`.+,/"])/,c=/\[(\^|)(-|)(.+?)\](?:\{(\d+)(?:\,(\d+)|)\}|(\?|\*|\+)|)/;for(o=e.match(c);o!=null;){const p=o[1]==="^",y=o[2]==="-",g=o[4],A=o[5],R=o[6],E=[];let $=o[3],W=$.match(l);for(y&&E.push(45);W!=null;){if(W[0].indexOf("-")===-1)r&&isNaN(Number(W[0]))?(E.push(W[0].toUpperCase().charCodeAt(0)),E.push(W[0].toLowerCase().charCodeAt(0))):E.push(W[0].charCodeAt(0));else{const v=W[0].split("-").map(b=>b.charCodeAt(0));if(a=v[0],n=v[1],a>n)throw new Error("Character range provided is out of order.");for(let b=a;b<=n;b++)if(r&&isNaN(Number(String.fromCharCode(b)))){const T=String.fromCharCode(b);E.push(T.toUpperCase().charCodeAt(0)),E.push(T.toLowerCase().charCodeAt(0))}else E.push(b)}$=$.substring(W[0].length),W=$.match(l)}if(t=Nn(R,g,A),p){let v=-1;for(let b=48;b<=57;b++){if(v=E.indexOf(b),v>-1){E.splice(v,1);continue}E.push(b)}for(let b=65;b<=90;b++){if(v=E.indexOf(b),v>-1){E.splice(v,1);continue}E.push(b)}for(let b=97;b<=122;b++){if(v=E.indexOf(b),v>-1){E.splice(v,1);continue}E.push(b)}}const K=Array.from({length:t},()=>String.fromCharCode(E[wa(0)])).join("");e=e.slice(0,o.index)+K+e.slice(o.index+o[0].length),o=e.match(c)}const u=/(.)\{(\d+)\,(\d+)\}/;for(o=e.match(u);o!=null;){if(a=parseInt(o[2]),n=parseInt(o[3]),a>n)throw new Error("Numbers out of order in {} quantifier.");t=wa(a),e=e.slice(0,o.index)+o[1].repeat(t)+e.slice(o.index+o[0].length),o=e.match(u)}const h=/(.)\{(\d+)\}/;for(o=e.match(h);o!=null;)t=parseInt(o[2]),e=e.slice(0,o.index)+o[1].repeat(t)+e.slice(o.index+o[0].length),o=e.match(h);return e}const Qs="qwerty!@#$%^123456";function el(){return"user@example.com"}function al(){return"пошта@укр.нет"}function rl(e,r){let a="pa$$word";return e>a.length&&(a+="_",a+=Dt(Qs,e-a.length).substring(0,e-a.length)),a}function Ir({min:e,max:r,omitTime:a,omitDate:n}){let t=$s(new Date("2019-08-24T14:15:22.123Z"),a,n);return t.length<e&&console.warn(`Using minLength = ${e} is incorrect with format "date-time"`),r&&t.length>r&&console.warn(`Using maxLength = ${r} is incorrect with format "date-time"`),t}function nl(e,r){return Ir({min:e,max:r,omitTime:!1,omitDate:!1})}function tl(e,r){return Ir({min:e,max:r,omitTime:!0,omitDate:!1})}function il(e,r){return Ir({min:e,max:r,omitTime:!1,omitDate:!0}).slice(1)}function xt(e,r,a,n,t=!1){if(n&&t)return Xs(n);let i=Dt("string",e);return r&&i.length>r&&(i=i.substring(0,r)),i}function ol(){return"192.168.0.1"}function sl(){return"2001:0db8:85a3:0000:0000:8a2e:0370:7334"}function ll(){return"example.com"}function ul(){return"приклад.укр"}function cl(){return"http://example.com"}function dl(){return"../dictionary"}function hl(){return"http://example.com/{endpoint}"}function ml(){return"http://example.com/entity/1"}function pl(){return"/entity/1"}function fl(e,r,a){return Ks(a||"id")}function yl(){return"/json/pointer"}function gl(){return"1/relative/json/pointer"}function bl(){return"/regex/"}const kl={email:el,"idn-email":al,password:rl,"date-time":nl,date:tl,time:il,ipv4:ol,ipv6:sl,hostname:ll,"idn-hostname":ul,iri:ml,"iri-reference":pl,uri:cl,"uri-reference":dl,"uri-template":hl,uuid:fl,default:xt,"json-pointer":yl,"relative-json-pointer":gl,regex:bl};function Cl(e,r,a,n){let t=e.format||"default",i=kl[t]||xt,o=n&&n.propertyName;return i(e.minLength||0,e.maxLength,o,e.pattern,r?.enablePatterns)}var Wt={};const vl={skipReadOnly:!1,maxSampleDepth:15};function Sl(e,r){if(!e)throw new Error("Unknown format output for building XML.");return(Array.isArray(e)||Object.keys(e).length>1)&&(e={[r?.xml?.name||"root"]:e}),new k.Builder({ignoreAttributes:!1,format:!0,attributeNamePrefix:"$",textNodeName:"#text",cdataPropName:"#cdata"}).build(e)}function wl(e,r,a){let n=Object.assign({},vl,r);Us();let t=Pe(e,n,a).value;return n?.format==="xml"?Sl(t,e):t}function da(e,r){Wt[e]=r}da("array",Ys);da("boolean",qs);da("integer",Ht);da("number",Ht);da("object",Zs);da("string",Cl);function Gt(e,r){if(e)try{return wl(e,{skipReadOnly:!0,skipNonRequired:!1,quiet:!0})}catch(a){r.error(k.bgRed(" Error while generating test data from JSON Schema ")+`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./replay-index-DYtXcqDk.js"),Sa=require("./replay-resolve-0e5f8I7b.js"),xe=require("./replay-lint-BzkTeXqI.js");function Ls(e){return k.isPlainObject(e)&&"name"in e&&"value"in e&&!("in"in e)}function Fr(e){return k.isPlainObject(e)&&"in"in e&&typeof e.in=="string"&&["header","query","path","cookie"].includes(e.in)}const Ds=/^image\/(png|jpeg|gif|bmp|webp|svg\+xml)|application\/pdf$/;function Bt(e){return e.startsWith("$file(")&&e.endsWith(")")?e.substring(7,e.length-2):e}const Pn=async(e,r,a,n,t)=>{const i=k.pathBrowserifyExports.dirname(n),o=k.pathBrowserifyExports.resolve(i,Bt(a));e.append(r,await t.options.requestFileLoader.getFileBody(o))},Rt=(e,r,a,n,t,i)=>{Object.entries(a).forEach(([o,l])=>{const c=i?`${i}[${o}]`:o;typeof l=="string"&&l.startsWith("$file(")&&l.endsWith(")")?e.push(Pn(r,c,l,n,t)):Array.isArray(l)?l.forEach(u=>{typeof u=="string"&&u.startsWith("$file(")&&u.endsWith(")")?e.push(Pn(r,c,u,n,t)):r.append(c,u.toString())}):k.isPlainObject(l)?Rt(e,r,l,n,t,c):(typeof l=="string"||typeof l=="number"||typeof l=="boolean")&&r.append(c,l.toString())})},Ns=async(e,r,a,n)=>{if(k.isPlainObject(e)){const t=[];Rt(t,r,e,a,n),await Promise.all(t)}},Hs=async(e,r)=>{if(typeof e=="string"&&e.startsWith("$file(")&&e.endsWith(")")){const a=k.pathBrowserifyExports.resolve(k.pathBrowserifyExports.dirname(r.options.filePath),Bt(e));return r.options.requestFileLoader.getFileBody(a)}else return e};async function xs(e,r){if(!e)return{payload:void 0,contentType:void 0,encoding:void 0,replacements:void 0};const{payload:a,contentType:n}=e;if(n==="multipart/form-data"){const t=new FormData,i=k.pathBrowserifyExports.resolve(r.options.filePath);return await Ns(a,t,i,r),{...e,payload:t}}else{if(n==="application/octet-stream"||typeof n=="string"&&Ds.test(n))return{...e,payload:await Hs(a,r),contentType:"application/octet-stream"};if(n==="application/x-www-form-urlencoded"&&typeof a=="string")return{...e,payload:Object.fromEntries(new URLSearchParams(a).entries()),contentType:"application/x-www-form-urlencoded"}}return e}function Ws({payload:e,replacements:r,expressionContext:a,logger:n}){for(const t of r){const{target:i,value:o}=t;if(typeof i!="string")throw new Error(`Invalid JSON Pointer: ${i}`);try{const l=k.JsonPointerLib.get(e,i),c=k.evaluateRuntimeExpressionPayload({payload:o,context:a,logger:n});l!==void 0&&k.JsonPointerLib.set(e,i,c)}catch{throw new Error(`Invalid JSON Pointer: ${i}`)}}}const Gs=["parameters","failureActions","successActions"];function Fs(e,r){const{reference:a,value:n}=e;if(!Gs.some(i=>a.includes(`$components.${i}`)))throw new Error("Invalid reference: available components are $components.parameters, $components.failureActions, or $components.successActions");const t=k.getValueFromContext({value:a,ctx:r,logger:r.options.logger});return k.isPlainObject(t)&&"value"in t&&n?{...t,value:n}:t}function Ca(e,r){return"reference"in e?Fs(e,r):e}const ie={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 Et extends Error{}class Pt extends Et{}class Lt extends Et{}async function Is(e){const{descriptionPath:r,externalRefResolver:a,base:n}=e,t=await xe.bundle({base:n,ref:r,config:e.config,dereference:!0,externalRefResolver:a});if(!t)throw new Error(`Could not find source description file '${r}'.`);return t.bundle.parsed}const Os={title:"[REPLACE WITH API title]",version:"[REPLACE WITH API version]"},Rr=Symbol("skip");function fa(e){return e<10?"0"+e:e}function $s(e,r,a,n){var t=a?"":e.getUTCFullYear()+"-"+fa(e.getUTCMonth()+1)+"-"+fa(e.getUTCDate());return r||(t+="T"+fa(e.getUTCHours())+":"+fa(e.getUTCMinutes())+":"+fa(e.getUTCSeconds())+"Z"),t}function Dt(e,r){return r>e.length?e.repeat(Math.trunc(r/e.length)+1).substring(0,r):e}function Ja(...e){const r=a=>a&&typeof a=="object";return e.reduce((a,n)=>(Object.keys(n||{}).forEach(t=>{const i=a[t],o=n[t];r(i)&&r(o)?a[t]=Ja(i,o):a[t]=o}),a),Array.isArray(e[e.length-1])?[]:{})}function Ks(e){var r=js(e),a=Vs(r,r,r,r),n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{var i=a()*16%16|0;return(t=="x"?i:i&3|8).toString(16)});return n}function cr(e){return{value:e==="object"?{}:e==="array"?[]:void 0}}function Je(e,r){r&&e.pop()}function Js(e){return{name:e?.xml?.name||"",prefix:e?.xml?.prefix||"",namespace:e?.xml?.namespace||null,attribute:e?.xml?.attribute??!1,wrapped:e?.xml?.wrapped??!1}}function zs(e){const r=e?.xml;return r?.nodeType?r.nodeType:r?.attribute===!0?"attribute":r?.wrapped===!0&&e?.type==="array"?"element":e?.$ref||e?.$dynamicRef||e?.type==="array"||e?.oneOf||e?.anyOf||e?.allOf?"none":"element"}function za(e,r={},a={}){const{value:n}=e,{propertyName:t}=a,{name:i,prefix:o,namespace:l}=Js(r),c=zs(r);let u=i||t?`${o?o+":":""}${i||t}`:null,h=typeof n=="object"?Array.isArray(n)?[...n]:{...n}:n;switch(c){case"attribute":u&&(u=`$${u}`);break;case"text":u="#text";break;case"cdata":u="#cdata";break;case"none":r.type==="array"?(u=null,r.example!==void 0&&(u=r.items?.xml?.name||u)):u=null;break;default:r.type==="array"&&Array.isArray(h)&&(h={[u]:[...h]});break}return l&&c!=="text"&&c!=="cdata"&&c!=="none"&&(typeof h=="object"?h[`$xmlns${o?":"+o:""}`]=l:h={[`$xmlns${o?":"+o:""}`]:l,"#text":h}),{propertyName:u,value:h}}function js(e){var r=0;if(e.length==0)return r;for(var a=0;a<e.length;a++){var n=e.charCodeAt(a);r=(r<<5)-r+n,r=r&r}return r}function Vs(e,r,a,n){return function(){e|=0,r|=0,a|=0,n|=0;var t=e-(r<<27|r>>>5)|0;return e=r^(a<<17|a>>>15),r=a+n|0,a=n+t|0,n=e+t|0,(n>>>0)/4294967296}}function _s(e,r,a,n,t){let i=Pe(e,a,n);const o=[];for(let l of r){const{type:c,readOnly:u,writeOnly:h,value:p}=Pe({type:i.type,...l},a,n,{...t,isAllOfChild:!0});i.type&&c&&c!==i.type&&(console.warn("allOf: schemas with different types can't be merged"),i.type=c),i.type=i.type||c,i.readOnly=i.readOnly||u,i.writeOnly=i.writeOnly||h,p!=null&&o.push(p)}if(i.type==="object"){i.value=Ja(i.value||{},...o.filter(l=>typeof l=="object"));for(const l in i.value)i.value[l]===Rr&&delete i.value[l];return i}else{i.type==="array"&&(a.quiet||console.warn('OpenAPI Sampler: found allOf with "array" type. Result may be incorrect'));const l=o[o.length-1];return i.value=l??i.value,i}}const Ln={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 La(e){if(e.type!==void 0)return Array.isArray(e.type)?e.type.length===0?null:e.type[0]:e.type;const r=Object.keys(Ln);for(var a=0;a<r.length;a++){let n=r[a],t=Ln[n];if(e[n]!==void 0)return t}return null}let Ia={},Ee=[];function Us(){Ia={},Ee=[]}function Nt(e){let r;return e.const!==void 0?r=e.const:e.examples!==void 0&&e.examples.length?r=e.examples[0]:e.enum!==void 0&&e.enum.length?r=e.enum[0]:e.default!==void 0&&(r=e.default),r}function Dn(e){const r=Nt(e);if(r!==void 0)return{value:r,readOnly:e.readOnly,writeOnly:e.writeOnly,type:null}}function Pe(e,r,a,n){if(n){if(Ee.includes(e))return cr(La(e));Ee.push(e)}if(n&&n.depth>r.maxSampleDepth)return Je(Ee,n),cr(La(e));if(e.$ref){if(!a)throw new Error("Your schema contains $ref. You must provide full specification in the third parameter.");let l=decodeURIComponent(e.$ref);l.startsWith("#")&&(l=l.substring(1));const c=k.JsonPointerLib.get(a,l);let u;if(Ia[l]!==!0){Ia[l]=!0;const h=Pe(c,r,a,n);if(r.format==="xml"){const p=l.split("/").pop(),y={...n,propertyName:n?.propertyName||p},{propertyName:g,value:A}=za(h,c,y);u={...h,value:{[g||"root"]:A}}}else u=h;Ia[l]=!1}else{const h=La(c);u=cr(h)}return Je(Ee,n),u}if(e.example!==void 0)return Je(Ee,n),{value:e.example,readOnly:e.readOnly,writeOnly:e.writeOnly,type:e.type};if(e.allOf!==void 0)return Je(Ee,n),Dn(e)||_s({...e,allOf:void 0},e.allOf,r,a,n);if(e.oneOf&&e.oneOf.length){e.anyOf&&(r.quiet||console.warn("oneOf and anyOf are not supported on the same level. Skipping anyOf")),Je(Ee,n);const l=Object.assign({readOnly:e.readOnly,writeOnly:e.writeOnly},e.oneOf[0]);return o(e,l)}if(e.anyOf&&e.anyOf.length){Je(Ee,n);const l=Object.assign({readOnly:e.readOnly,writeOnly:e.writeOnly},e.anyOf[0]);return o(e,l)}if(e.if&&e.then){Je(Ee,n);const{if:l,then:c,...u}=e;return Pe(Ja(u,l,c),r,a,n)}let t=Nt(e),i=null;if(t===void 0){t=null,i=e.type,Array.isArray(i)&&e.type.length>0&&(i=e.type[0]),i||(i=La(e));let l=Wt[i];l&&(t=l(e,r,a,n))}return Je(Ee,n),{value:t,readOnly:e.readOnly,writeOnly:e.writeOnly,type:i};function o(l,c){const u=Dn(l);if(u!==void 0)return u;const h=Pe({...l,oneOf:void 0,anyOf:void 0},r,a,n),p=Pe(c,r,a,n);if(typeof h.value=="object"&&typeof p.value=="object"){const y=Ja(h.value,p.value);return{...p,value:y}}return p}}function Ys(e,r={},a,n){const t=n&&n.depth||1;let i=Math.min(e.maxItems!=null?e.maxItems:1/0,e.minItems||1);const o=e.prefixItems||e.items||e.contains;Array.isArray(o)&&(i=Math.max(i,o.length));let l=u=>Array.isArray(o)?o[u]||{}:o||{},c=[];if(!o)return c;for(let u=0;u<i;u++){let h=l(u),{value:p}=Pe(h,r,a,{depth:t+1});if(r?.format==="xml"){const{value:y,propertyName:g}=za({value:p},h,n);g?(c?.[g]||(c={...c,[g]:[]}),c[g].push(y)):c={...c,...y}}else c.push(p)}if(r?.format==="xml"&&t===1){const{value:u,propertyName:h}=za({value:null},e,n);h&&(u?c=Array.isArray(c)?{[h]:{...u,...c.map(p=>({"#text":{...p}}))}}:{[h]:{...c,...u}}:c={[h]:c})}return c}function qs(e){return!0}function Ht(e){let r=0;if(e.type==="number"&&(e.format==="float"||e.format==="double")&&(r=.1),typeof e.exclusiveMinimum=="boolean"||typeof e.exclusiveMaximum=="boolean"){if(Number.isFinite(e.maximum)&&Number.isFinite(e.minimum))return r=e.exclusiveMinimum?Math.floor(e.minimum)+1:e.minimum,(e.exclusiveMaximum&&r>=e.maximum||!e.exclusiveMaximum&&r>e.maximum)&&(r=(e.maximum+e.minimum)/2),r;if(Number.isFinite(e.minimum))return e.exclusiveMinimum?Math.floor(e.minimum)+1:e.minimum;if(Number.isFinite(e.maximum))return e.exclusiveMaximum?e.maximum>0?0:Math.floor(e.maximum)-1:e.maximum>0?0:e.maximum}else{if(Number.isFinite(e.minimum))return e.minimum;Number.isFinite(e.exclusiveMinimum)?(r=Math.floor(e.exclusiveMinimum)+1,r===e.exclusiveMaximum&&(r=(r+Math.floor(e.exclusiveMaximum)-1)/2)):Number.isFinite(e.exclusiveMaximum)?r=Math.floor(e.exclusiveMaximum)-1:Number.isFinite(e.maximum)&&(r=e.maximum)}return r}function Zs(e,r={},a,n){let t={};const i=n&&n.depth||1;if(e&&typeof e.properties=="object"){const o=Array.isArray(e.required)?e.required:[],l={};for(const c of o)l[c]=!0;Object.keys(e.properties).forEach(c=>{if(r.skipNonRequired&&!l.hasOwnProperty(c))return;const u=Pe(e.properties[c],r,a,{propertyName:c,depth:i+1});if(r.skipReadOnly&&u.readOnly){n?.isAllOfChild&&(t[c]=Rr);return}if(r.skipWriteOnly&&u.writeOnly){n?.isAllOfChild&&(t[c]=Rr);return}if(r?.format==="xml"){const{propertyName:h,value:p}=za(u,e.properties[c],{propertyName:c});h?t[h]=p:p!==null&&typeof p=="object"&&(t={...t,...p})}else t[c]=u.value})}if(e&&typeof e.additionalProperties=="object"){const o=e.additionalProperties["x-additionalPropertiesName"]||"property";t[`${String(o)}1`]=Pe(e.additionalProperties,r,a,{depth:i+1}).value,t[`${String(o)}2`]=Pe(e.additionalProperties,r,a,{depth:i+1}).value}if(e&&typeof e.properties=="object"&&e.maxProperties!==void 0&&Object.keys(t).length>e.maxProperties){const o={};let l=0;(Array.isArray(e.required)?e.required:[]).forEach(u=>{t[u]!==void 0&&(o[u]=t[u],l++)}),Object.keys(t).forEach(u=>{l<e.maxProperties&&!o.hasOwnProperty(u)&&(o[u]=t[u],l++)}),t=o}return t}function wa(e,r){return e}function Nn(e,r,a){let n=1;if(e)switch(e){case"?":{n=0;break}case"*":{n=wa(0);break}case"+":{n=wa(1);break}default:throw new Error("Unknown quantifier symbol provided.")}else r!=null&&a!=null?n=wa(parseInt(r)):r!=null&&a==null&&(n=parseInt(r));return n}function Xs(e){let r=!1;e instanceof RegExp&&(r=e.flags.includes("i"),e=e.toString(),e=e.match(/\/(.+?)\//)?.[1]??""),e=e.replace(/^(\^)?(.*?)(\$)?$/,"$2");let a,n,t;const i=/([.A-Za-z0-9])(?:\{(\d+)(?:\,(\d+)|)\}|(\?|\*|\+))(?![^[]*]|[^{]*})/;let o=e.match(i);for(;o!=null;){const p=o[2],y=o[3],g=o[4];t=Nn(g,p,y),e=e.slice(0,o.index)+o[1].repeat(t)+e.slice(o.index+o[0].length),o=e.match(i)}const l=/(\d-\d|\w-\w|\d|\w|[-!@#$&()`.+,/"])/,c=/\[(\^|)(-|)(.+?)\](?:\{(\d+)(?:\,(\d+)|)\}|(\?|\*|\+)|)/;for(o=e.match(c);o!=null;){const p=o[1]==="^",y=o[2]==="-",g=o[4],A=o[5],R=o[6],E=[];let $=o[3],W=$.match(l);for(y&&E.push(45);W!=null;){if(W[0].indexOf("-")===-1)r&&isNaN(Number(W[0]))?(E.push(W[0].toUpperCase().charCodeAt(0)),E.push(W[0].toLowerCase().charCodeAt(0))):E.push(W[0].charCodeAt(0));else{const v=W[0].split("-").map(b=>b.charCodeAt(0));if(a=v[0],n=v[1],a>n)throw new Error("Character range provided is out of order.");for(let b=a;b<=n;b++)if(r&&isNaN(Number(String.fromCharCode(b)))){const T=String.fromCharCode(b);E.push(T.toUpperCase().charCodeAt(0)),E.push(T.toLowerCase().charCodeAt(0))}else E.push(b)}$=$.substring(W[0].length),W=$.match(l)}if(t=Nn(R,g,A),p){let v=-1;for(let b=48;b<=57;b++){if(v=E.indexOf(b),v>-1){E.splice(v,1);continue}E.push(b)}for(let b=65;b<=90;b++){if(v=E.indexOf(b),v>-1){E.splice(v,1);continue}E.push(b)}for(let b=97;b<=122;b++){if(v=E.indexOf(b),v>-1){E.splice(v,1);continue}E.push(b)}}const K=Array.from({length:t},()=>String.fromCharCode(E[wa(0)])).join("");e=e.slice(0,o.index)+K+e.slice(o.index+o[0].length),o=e.match(c)}const u=/(.)\{(\d+)\,(\d+)\}/;for(o=e.match(u);o!=null;){if(a=parseInt(o[2]),n=parseInt(o[3]),a>n)throw new Error("Numbers out of order in {} quantifier.");t=wa(a),e=e.slice(0,o.index)+o[1].repeat(t)+e.slice(o.index+o[0].length),o=e.match(u)}const h=/(.)\{(\d+)\}/;for(o=e.match(h);o!=null;)t=parseInt(o[2]),e=e.slice(0,o.index)+o[1].repeat(t)+e.slice(o.index+o[0].length),o=e.match(h);return e}const Qs="qwerty!@#$%^123456";function el(){return"user@example.com"}function al(){return"пошта@укр.нет"}function rl(e,r){let a="pa$$word";return e>a.length&&(a+="_",a+=Dt(Qs,e-a.length).substring(0,e-a.length)),a}function Ir({min:e,max:r,omitTime:a,omitDate:n}){let t=$s(new Date("2019-08-24T14:15:22.123Z"),a,n);return t.length<e&&console.warn(`Using minLength = ${e} is incorrect with format "date-time"`),r&&t.length>r&&console.warn(`Using maxLength = ${r} is incorrect with format "date-time"`),t}function nl(e,r){return Ir({min:e,max:r,omitTime:!1,omitDate:!1})}function tl(e,r){return Ir({min:e,max:r,omitTime:!0,omitDate:!1})}function il(e,r){return Ir({min:e,max:r,omitTime:!1,omitDate:!0}).slice(1)}function xt(e,r,a,n,t=!1){if(n&&t)return Xs(n);let i=Dt("string",e);return r&&i.length>r&&(i=i.substring(0,r)),i}function ol(){return"192.168.0.1"}function sl(){return"2001:0db8:85a3:0000:0000:8a2e:0370:7334"}function ll(){return"example.com"}function ul(){return"приклад.укр"}function cl(){return"http://example.com"}function dl(){return"../dictionary"}function hl(){return"http://example.com/{endpoint}"}function ml(){return"http://example.com/entity/1"}function pl(){return"/entity/1"}function fl(e,r,a){return Ks(a||"id")}function yl(){return"/json/pointer"}function gl(){return"1/relative/json/pointer"}function bl(){return"/regex/"}const kl={email:el,"idn-email":al,password:rl,"date-time":nl,date:tl,time:il,ipv4:ol,ipv6:sl,hostname:ll,"idn-hostname":ul,iri:ml,"iri-reference":pl,uri:cl,"uri-reference":dl,"uri-template":hl,uuid:fl,default:xt,"json-pointer":yl,"relative-json-pointer":gl,regex:bl};function Cl(e,r,a,n){let t=e.format||"default",i=kl[t]||xt,o=n&&n.propertyName;return i(e.minLength||0,e.maxLength,o,e.pattern,r?.enablePatterns)}var Wt={};const vl={skipReadOnly:!1,maxSampleDepth:15};function Sl(e,r){if(!e)throw new Error("Unknown format output for building XML.");return(Array.isArray(e)||Object.keys(e).length>1)&&(e={[r?.xml?.name||"root"]:e}),new k.Builder({ignoreAttributes:!1,format:!0,attributeNamePrefix:"$",textNodeName:"#text",cdataPropName:"#cdata"}).build(e)}function wl(e,r,a){let n=Object.assign({},vl,r);Us();let t=Pe(e,n,a).value;return n?.format==="xml"?Sl(t,e):t}function da(e,r){Wt[e]=r}da("array",Ys);da("boolean",qs);da("integer",Ht);da("number",Ht);da("object",Zs);da("string",Cl);function Gt(e,r){if(e)try{return wl(e,{skipReadOnly:!0,skipNonRequired:!1,quiet:!0})}catch(a){r.error(k.bgRed(" Error while generating test data from JSON Schema ")+`
|
|
2
2
|
`+a);return}}function Al(e,r){if(e?.example)return e.example;if(k.isPlainObject(e?.examples))return Ft(e.examples);if(e?.schema)return Gt(e.schema,r)}function Ft(e){if(k.isPlainObject(e)){const r=Object.keys(e)[0];return r?e[r]?.value:void 0}else return}function Tl(e,r){const a=e?.requestBody?.content||{},[n,t]=Object.entries(a)[0]||[],i=t?.example||Ft(t?.examples)||Gt(t?.schema,r),o=Ml(e);return{parameters:Bl([...Hn(e.pathParameters,r),...Hn(e.parameters,r)]).filter(({value:c})=>c),contentTypeParameters:[...n?[{name:"content-type",in:"header",value:n}]:[],...o?[{name:"accept",in:"header",value:o}]:[]],requestBody:i,contentType:n}}function Ml(e){return e?.responses?Array.from(new Set(Object.values(e.responses).flatMap(r=>k.isPlainObject(r)&&"content"in r?Object.keys(r.content||{}):[]))).join(", "):void 0}function Hn(e,r){return(e||[]).filter(a=>a?.required===!0).map(a=>{if(Fr(a))return{name:a.name,in:a.in,value:Al(a,r),...a.allowReserved&&{allowReserved:a.allowReserved}}}).filter(a=>a!==void 0)}function Bl(e){const r={};for(const a of e)Fr(a)&&(r[(a.name+":"+a.in).toLowerCase()]=a);return Object.values(r)}function Rl(e,r){let a,n;if(e.includes("$sourceDescriptions.")){const[,c,u]=e.split(".");a=c,n=u}else e.includes(".")?[a,n]=e.split("."):(n=e,a=Object.keys(r)[0]);const t=Object.keys(r);if(!r[a])throw new Error(`Unknown description name ${k.red(a)} at ${k.red(e)}. Available descriptions: ${t.join(", ")}.`);const i=r[a],o=i?.components?.securitySchemes,l=i.servers;for(const[c,u]of Object.entries(r[a].paths)){if(!u)return;for(const[h,p]of Object.entries(u))if(p.operationId===n)return{servers:u.servers||l,...p,pathParameters:p.parameters||[],path:c,method:h,descriptionName:a,securitySchemes:o}}throw new Error(`Unknown operationId ${k.red(n)} at ${k.red(e)}.`)}function El(e,r){const{$sourceDescriptions:a,sourceDescriptions:n}=r,[t,i]=e.split("#");if(!n)throw new Error("Missing described sourceDescriptions");const o=n.find(R=>{if(["openapi","arazzo"].includes(R.type)){if(t.includes("$sourceDescriptions.")){const[,E]=t.split(".");return R.name===E}return"url"in R&&R.url===t}return!1})?.name;if(!o)throw new Error(`Unknown operationPath ${k.red(e)}. API description ${k.red(t)} is not listed in 'sourceDescriptions' workflow section.`);const l=a[o]||{},c=l?.components?.securitySchemes,[u,h,p]=k.JsonPointerLib.parse(i);if(u!=="paths")throw new Error(`Invalid fragment identifier: ${i} at operationPath ${k.red(e)}.`);const{servers:y}=l,g=k.JsonPointerLib.get(l,i)||{},A=k.JsonPointerLib.get(l,k.JsonPointerLib.compile(["paths",h]))||{};return{servers:A.servers||y,...g,pathParameters:A.parameters||[],path:h,method:p,descriptionName:o,securitySchemes:c}}function Pl(e,r){if(!e.operationId&&!e.operationPath)return;const{$sourceDescriptions:a,sourceDescriptions:n}=r,{operationId:t,operationPath:i}=e;return t?Rl(t,a):i?El(i,{$sourceDescriptions:a,sourceDescriptions:n}):void 0}function Ll({statusCode:e,contentType:r,descriptionResponses:a}){return a?(a[e]||a.default)?.content?.[r]?.schema:void 0}function Dl(e,r){if(!r)return;const n=r.requestBody?.content;return n&&n[e]?.schema||void 0}function It({ctx:e,security:r,operation:a}){const{scheme:n,schemeName:t}=r;if(n)return r.scheme;if(t){if(typeof t=="string"&&t.startsWith("$sourceDescriptions.")){const[i,o,l]=t.split("."),u=(o&&e.$sourceDescriptions[o])?.components?.securitySchemes;return l&&u?u[l]:void 0}return a?.securitySchemes?.[t]}}function Da(){}function xn(){return typeof WeakMap<"u"?new WeakMap:Nl()}function Nl(){return{add:Da,delete:Da,get:Da,set:Da,has:function(e){return!1}}}var Hl=Object.prototype.hasOwnProperty,Er=function(e,r){return Hl.call(e,r)};function dr(e,r){for(var a in r)Er(r,a)&&(e[a]=r[a]);return e}var xl=/^[ \t]*(?:\r\n|\r|\n)/,Wl=/(?:\r\n|\r|\n)[ \t]*$/,Gl=/^(?:[\r\n]|$)/,Fl=/(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/,Il=/^[ \t]*[\r\n][ \t\r\n]*$/;function Wn(e,r,a){var n=0,t=e[0].match(Fl);t&&(n=t[1].length);var i="(\\r\\n|\\r|\\n).{0,"+n+"}",o=new RegExp(i,"g");r&&(e=e.slice(1));var l=a.newline,c=a.trimLeadingNewline,u=a.trimTrailingNewline,h=typeof l=="string",p=e.length,y=e.map(function(g,A){return g=g.replace(o,"$1"),A===0&&c&&(g=g.replace(xl,"")),A===p-1&&u&&(g=g.replace(Wl,"")),h&&(g=g.replace(/\r\n|\n|\r/g,function(R){return l})),g});return y}function Ol(e,r){for(var a="",n=0,t=e.length;n<t;n++)a+=e[n],n<t-1&&(a+=r[n]);return a}function $l(e){return Er(e,"raw")&&Er(e,"length")}function Ot(e){var r=xn(),a=xn();function n(i){for(var o=[],l=1;l<arguments.length;l++)o[l-1]=arguments[l];if($l(i)){var c=i,u=(o[0]===n||o[0]===He)&&Il.test(c[0])&&Gl.test(c[1]),h=u?a:r,p=h.get(c);if(p||(p=Wn(c,u,e),h.set(c,p)),o.length===0)return p[0];var y=Ol(p,u?o.slice(1):o);return y}else return Ot(dr(dr({},e),i||{}))}var t=dr(n,{string:function(i){return Wn([i],!1,e)[0]}});return t}var He=Ot({trimLeadingNewline:!0,trimTrailingNewline:!0});if(typeof module<"u")try{module.exports=He,Object.defineProperty(He,"__esModule",{value:!0}),He.default=He,He.outdent=He}catch{}function Kl(e){return!Sa.isBrowser&&process.env.NODE_ENV==="test"?"<test>ms":`${Math.ceil(performance.now()-e)}ms`}function qa(e){const r=e.length;let a=0,n=0,t=0,i=0,o=0,l=0,c=0;const u=new Set;let h=0;const p=new Set,y=new Set;for(const g of e){const A=$t(g.executedSteps);let R=!1;for(const E of A){if(i++,E.retriesLeft&&E.retriesLeft!==0)continue;t++;let $=!1;for(const W of E.checks)if(n++,!W.passed)switch(W.severity){case"warn":o++,u.add(g.workflowId),y.add(g.workflowId+":"+E.stepId);break;case"off":l++,p.add(g.workflowId+":"+E.stepId);break;default:a++,$=!0}$&&(h++,R=!0)}R&&c++}return{workflows:{passed:r-c,failed:c,warnings:u.size,skipped:0,total:r},steps:{passed:t-h,failed:h,warnings:y.size,skipped:p.size,total:t},checks:{passed:n-a,failed:a,warnings:o,skipped:l,total:n},totalRequests:i}}function $t(e){return e.flatMap(r=>"executedSteps"in r?$t(r.executedSteps):[r])}function Jl(e){try{return JSON.parse(e),!0}catch{return!1}}function zl(e,r){const a=e.endsWith("/")?e.slice(0,-1):e,n=r.startsWith("/")?r.slice(1):r;return`${a}/${n}`}const Gn=50;function Kt({testNameToDisplay:e,checks:r,verboseLogs:a,verboseResponseLogs:n,logger:t}){const i=r.every(({passed:o})=>o);t.output(` ${i?k.green("✓"):k.red("✗")} ${k.blue(e)}`),a&&(t.output(`${ke}
|
|
3
3
|
`+(Fn({logs:a,logger:t})||"")),t.printNewLine()),n&&(t.output(`${ke}
|
|
4
4
|
`+(Fn({logs:n,type:"response",logger:t})||"")),t.printNewLine()),t.printNewLine();for(const o of r)t.output(`${ne(jl(o,o.severity),4)}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { s as o, i as s, t, u as n, a as d } from "./replay-indexes-B3PJtgeh.js";
|
|
2
|
+
const l = o(
|
|
3
|
+
"step_context",
|
|
4
|
+
{
|
|
5
|
+
id: t("id").primaryKey().notNull(),
|
|
6
|
+
collectionId: t("collection_id").notNull(),
|
|
7
|
+
workflowId: t("workflow_id").notNull(),
|
|
8
|
+
stepId: t("step_id").notNull(),
|
|
9
|
+
request: t("request", { mode: "json" }).$type(),
|
|
10
|
+
response: t("response", { mode: "json" }).$type(),
|
|
11
|
+
outputs: t("outputs", { mode: "json" }).$type(),
|
|
12
|
+
date: s("date").notNull()
|
|
13
|
+
},
|
|
14
|
+
(e) => [
|
|
15
|
+
n("step_context_unique_idx").on(e.collectionId, e.workflowId, e.stepId),
|
|
16
|
+
d("step_context_date_idx").on(e.date)
|
|
17
|
+
]
|
|
18
|
+
);
|
|
19
|
+
export {
|
|
20
|
+
l as s
|
|
21
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-DYtXcqDk.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;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { k as h, s as x, l as i } from "./replay-index-BCz452N6.js";
|
|
2
|
+
import { n as j, o as b, j as k } from "./replay-index-BCz452N6.js";
|
|
3
|
+
async function u(a, e) {
|
|
4
|
+
const t = x(), l = await i(a), c = await i(e), o = l.replace(new RegExp(`^${t}+`), "").split(t).filter(Boolean), s = c.replace(new RegExp(`^${t}+`), "").split(t).filter(Boolean), m = Math.min(o.length, s.length);
|
|
5
|
+
let r = 0;
|
|
6
|
+
for (let n = 0; n < m && o[n] === s[n]; n++)
|
|
7
|
+
r++;
|
|
8
|
+
const p = o.slice(r).map(() => ".."), f = s.slice(r);
|
|
9
|
+
return [...p, ...f].join(t);
|
|
10
|
+
}
|
|
11
|
+
async function w(a) {
|
|
12
|
+
const e = await h(a);
|
|
13
|
+
return e ? `.${e}` : "";
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
j as dirname,
|
|
17
|
+
w as extname,
|
|
18
|
+
b as isAbsolute,
|
|
19
|
+
k as join,
|
|
20
|
+
u as relative,
|
|
21
|
+
i as resolve
|
|
22
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const Ae=require("react"),a=require("./replay-index-
|
|
1
|
+
"use strict";const Ae=require("react"),a=require("./replay-index-DYtXcqDk.js"),m=require("./replay-db-BQXljNM0.js"),n=require("./replay-create-model-Bw20x80b.js"),A=require("./replay-SemanticSearchService-DTc0oxN4.js"),Ce=require("@tanstack/react-query"),M={path:"pathParameters",query:"queryParameters",header:"headers",cookie:"cookies"},ut={run_request:{approveLabel:"Run",denyLabel:"Skip"},update_step:{approveLabel:"Apply",denyLabel:"Dismiss"},update_security:{approveLabel:"Apply",denyLabel:"Dismiss"}},pt={set_active_environment:{approveLabel:"Switch",denyLabel:"Cancel"},add_environment:{approveLabel:"Add",denyLabel:"Cancel"},upsert_input:{approveLabel:"Set",denyLabel:"Cancel"},upsert_server:{approveLabel:"Set",denyLabel:"Cancel"},remove_input:{approveLabel:"Remove",denyLabel:"Cancel"},remove_server:{approveLabel:"Remove",denyLabel:"Cancel"},create_collection:{approveLabel:"Create",denyLabel:"Cancel"},create_workflow:{approveLabel:"Create",denyLabel:"Cancel"},create_step:{approveLabel:"Create",denyLabel:"Cancel"},move_step:{approveLabel:"Move",denyLabel:"Cancel"},delete_collection:{approveLabel:"Delete",denyLabel:"Cancel"},delete_workflow:{approveLabel:"Delete",denyLabel:"Cancel"},delete_step:{approveLabel:"Delete",denyLabel:"Cancel"},save_tab_to_collection:{approveLabel:"Save",denyLabel:"Cancel"}},ft={CHAT:"chat",HISTORY:"history"},mt="report_status",ht="run_workflow",j={WEB_SEARCH:"web_search"};function yt(e){switch(e.provider){case a.AI_PROVIDERS.GEMINI:return{[j.WEB_SEARCH]:n.google.tools.googleSearch({})};case a.AI_PROVIDERS.OPENAI:return{[j.WEB_SEARCH]:n.openai.tools.webSearch({})};case a.AI_PROVIDERS.ANTHROPIC:return{[j.WEB_SEARCH]:n.anthropic.tools.webFetch_20250910()};case a.REUNITE_AI_PROVIDER:return{[j.WEB_SEARCH]:{type:"provider",id:"reunite.web_search",name:"web_search",args:{}}};default:return{}}}const It=["info","workflows","sourceDescriptions"];function wt(e){const t=[];return e.collectionId&&t.push(`Collection ID: ${e.collectionId}`),e.collection?.info?.title&&t.push(`Title: ${e.collection.info.title}`),e.collection?.info?.summary&&t.push(`Summary: ${e.collection.info.summary}`),e.collection?.info?.description&&t.push(`Description: ${e.collection.info.description}`),m.buildMessageFromArray(t,`
|
|
2
2
|
`)}function gt(e){const t=[];if(e.collection?.workflows?.length){t.push("Workflows:");for(const o of e.collection.workflows)t.push(` workflowId=${o.workflowId} ${o.summary??""}`)}return m.buildMessageFromArray(t,`
|
|
3
3
|
`)}function bt(e){const t=[];if(e.collection?.sourceDescriptions?.length){t.push("Source descriptions:");for(const o of e.collection.sourceDescriptions)t.push(` name=${o.name} url=${o.url}`)}return m.buildMessageFromArray(t,`
|
|
4
4
|
`)}function vt(e,t){const o=["Current tab (collection)"];for(const r of t)switch(r){case"info":o.push(wt(e));break;case"workflows":o.push(gt(e));break;case"sourceDescriptions":o.push(bt(e));break}return m.buildMessageFromArray(o,`
|
|
@@ -38,7 +38,7 @@ ${ce(f.step.response?.body,t,m.RESPONSE_BODY_PREVIEW_MAX,!0)}`:`Full response bo
|
|
|
38
38
|
`)}function eo(e,t){const o=e.secretValues?[...e.secretValues]:void 0;if(e.runStatus==="running")return"Run status: RUNNING - the workflow is still executing; re-read this section to get the outcome, which will be reported as SUCCEEDED or FAILED once the run finishes.";if(e.runStatus==="error"){const r=`Run status: FAILED - execution error: ${a.maskSecretsInText(e.runError||"unknown error",o)}`;return e.result?`${r}
|
|
39
39
|
(the stored result is from an earlier run and is omitted as stale)`:r}return e.result?Zt(e.result,o,t?.stepIds):"Run status: NOT STARTED - no run has executed on this tab yet."}function to(e,t,o){const r=["Current tab (workflow run)"];for(const s of t)switch(s){case"info":r.push(Kt(e));break;case"severity":r.push(Jt(e));break;case"result":r.push(eo(e,o));break}return m.buildMessageFromArray(r,`
|
|
40
40
|
|
|
41
|
-
`)}function oo(e,t=["info"],o){if(!e)return null;switch(e.type){case a.TabDataType.Step:return Wt(e,t);case a.TabDataType.Workflow:return xt(e,t);case a.TabDataType.Collection:return vt(e,t);case a.TabDataType.WorkflowRun:return to(e,t,o)}}function no(e){switch(e.type){case a.TabDataType.Collection:return It;case a.TabDataType.Workflow:return kt;case a.TabDataType.Step:return Pt;case a.TabDataType.WorkflowRun:return Ht}}function Ee(e){return e.trim().replace(/\s+/g," ").replace(/[.!?:;,…]+$/,"").toLowerCase()}function ro(e,t){const o=[];let r=0;for(const s of e??[])if(!(s.role!=="assistant"||!Array.isArray(s.content)))for(const i of s.content)i.type==="tool-call"&&(i.toolName===t?(r+=1,o.push(i.input)):r=0);return{priorInputs:o,consecutiveCalls:r}}function so(e,t,o){const r=[];let s=!1;for(const i of e){const c=i(t,o);c&&(r.push(c.message),c.action==="block"&&(s=!0))}return{blocked:s,notes:r}}function _e(e){const t=e.warn!==void 0?"warn":"block",o=e.warn!==void 0?e.warn:e.block;return(r,s)=>{const i=le(e.key,r);return i===null?null:s.priorInputs.some(d=>le(e.key,d)===i)?{action:t,message:o}:null}}function le(e,t){try{return e(t)}catch{return null}}function io(e){const t=de("warn",e.warnAfter,e.warnMessage),o=de("block",e.blockAfter,e.blockMessage);if(!t&&!o)throw new Error("consecutiveCallsRule requires at least warnAfter or blockAfter");if(t&&o&&o.after<=t.after)throw new Error("consecutiveCallsRule requires blockAfter to be greater than warnAfter");return(r,s)=>{const i=s.consecutiveCalls+1;return o&&i>=o.after?{action:"block",message:o.message(i)}:t&&i>=t.after?{action:"warn",message:t.message(i)}:null}}function de(e,t,o){if(!(t===void 0&&o===void 0)){if(t===void 0||o===void 0)throw new Error(`consecutiveCallsRule requires ${e}After and ${e}Message together`);if(!Number.isInteger(t)||t<1)throw new Error(`consecutiveCallsRule requires ${e}After to be a positive integer`);return{after:t,message:o}}}function ao(e){if(!e||typeof e.safeParse!="function")return;const t=e;return o=>{const r=t.safeParse(o);return r.success?r.data:null}}function co(e,t,o,r){return!t||t.length===0?o:async(s,i)=>{const c=ro(i?.messages,e),d={consecutiveCalls:c.consecutiveCalls,priorInputs:r?c.priorInputs.map(r).filter(p=>p!==null):c.priorInputs},l=so(t,s,d);if(l.blocked)return{isError:!1,blocked:!0,note:l.notes.join(" ")};const u=await o(s,i);return l.notes.length===0||!lo(u)?u:{...u,note:[u.note,...l.notes].filter(Boolean).join(" ")}}}function lo(e){return e!==null&&typeof e=="object"&&e.isError===!1}function uo(e,t){return{name:e.name,definition:e.definition,execute:co(e.name,e.guards,e.createExecutor(t),ao(e.definition.inputSchema))}}const po={messages:[],isStreaming:!1,sendMessage:async()=>{},updateMessages:()=>{},stopGeneration:()=>{},addToolApprovalResponse:()=>{},chatStatus:"ready",chatError:void 0},Re=Ae.createContext(po);function fo(){return Ae.useContext(Re)}const mo=n.objectType({message:n.stringType(),details:n.unknownType().optional()})
|
|
41
|
+
`)}function oo(e,t=["info"],o){if(!e)return null;switch(e.type){case a.TabDataType.Step:return Wt(e,t);case a.TabDataType.Workflow:return xt(e,t);case a.TabDataType.Collection:return vt(e,t);case a.TabDataType.WorkflowRun:return to(e,t,o)}}function no(e){switch(e.type){case a.TabDataType.Collection:return It;case a.TabDataType.Workflow:return kt;case a.TabDataType.Step:return Pt;case a.TabDataType.WorkflowRun:return Ht}}function Ee(e){return e.trim().replace(/\s+/g," ").replace(/[.!?:;,…]+$/,"").toLowerCase()}function ro(e,t){const o=[];let r=0;for(const s of e??[])if(!(s.role!=="assistant"||!Array.isArray(s.content)))for(const i of s.content)i.type==="tool-call"&&(i.toolName===t?(r+=1,o.push(i.input)):r=0);return{priorInputs:o,consecutiveCalls:r}}function so(e,t,o){const r=[];let s=!1;for(const i of e){const c=i(t,o);c&&(r.push(c.message),c.action==="block"&&(s=!0))}return{blocked:s,notes:r}}function _e(e){const t=e.warn!==void 0?"warn":"block",o=e.warn!==void 0?e.warn:e.block;return(r,s)=>{const i=le(e.key,r);return i===null?null:s.priorInputs.some(d=>le(e.key,d)===i)?{action:t,message:o}:null}}function le(e,t){try{return e(t)}catch{return null}}function io(e){const t=de("warn",e.warnAfter,e.warnMessage),o=de("block",e.blockAfter,e.blockMessage);if(!t&&!o)throw new Error("consecutiveCallsRule requires at least warnAfter or blockAfter");if(t&&o&&o.after<=t.after)throw new Error("consecutiveCallsRule requires blockAfter to be greater than warnAfter");return(r,s)=>{const i=s.consecutiveCalls+1;return o&&i>=o.after?{action:"block",message:o.message(i)}:t&&i>=t.after?{action:"warn",message:t.message(i)}:null}}function de(e,t,o){if(!(t===void 0&&o===void 0)){if(t===void 0||o===void 0)throw new Error(`consecutiveCallsRule requires ${e}After and ${e}Message together`);if(!Number.isInteger(t)||t<1)throw new Error(`consecutiveCallsRule requires ${e}After to be a positive integer`);return{after:t,message:o}}}function ao(e){if(!e||typeof e.safeParse!="function")return;const t=e;return o=>{const r=t.safeParse(o);return r.success?r.data:null}}function co(e,t,o,r){return!t||t.length===0?o:async(s,i)=>{const c=ro(i?.messages,e),d={consecutiveCalls:c.consecutiveCalls,priorInputs:r?c.priorInputs.map(r).filter(p=>p!==null):c.priorInputs},l=so(t,s,d);if(l.blocked)return{isError:!1,blocked:!0,note:l.notes.join(" ")};const u=await o(s,i);return l.notes.length===0||!lo(u)?u:{...u,note:[u.note,...l.notes].filter(Boolean).join(" ")}}}function lo(e){return e!==null&&typeof e=="object"&&e.isError===!1}function uo(e,t){return{name:e.name,definition:e.definition,execute:co(e.name,e.guards,e.createExecutor(t),ao(e.definition.inputSchema))}}const po={messages:[],isStreaming:!1,sendMessage:async()=>{},updateMessages:()=>{},stopGeneration:()=>{},addToolApprovalResponse:()=>{},chatStatus:"ready",chatError:void 0},Re=Ae.createContext(po);function fo(){return Ae.useContext(Re)}const mo=n.objectType({message:n.stringType(),details:n.unknownType().optional()}),te=n.objectType({action:n.enumType(["add","update","remove"]).describe('Action to perform: "add", "update" or "remove".'),approved:n.booleanType().default(!0)}),$=te.extend({id:n.stringType().optional().describe("Existing item id. Required for update/remove actions.")}),ho=te.extend({index:n.numberType().int().min(0).optional().describe("Existing item index. Required for update/remove actions.")}),yo=n.objectType({isError:n.literalType(!1),blocked:n.literalType(!0),note:n.stringType(),data:n.neverType().optional(),error:n.neverType().optional()});function C(e){return n.unionType([n.objectType({isError:n.literalType(!0),error:mo,data:n.neverType().optional(),blocked:n.neverType().optional()}),n.objectType({isError:n.literalType(!1),data:e,error:n.neverType().optional(),note:n.stringType().optional(),blocked:n.neverType().optional()}),yo])}const Io=n.objectType({status:n.enumType(["applied","failed"]),summary:n.stringType().optional()}),wo=n.objectType({totalChanges:n.numberType().int().min(0),approvedChanges:n.numberType().int().min(0),applied:n.arrayType(Io),resultingState:n.stringType().optional().describe("Resulting state of the mutated fields after all changes were applied.")}),xe=C(wo),go="Read structured state from the **active** Replay tab.\n\n**What it does**\n- Returns structured data for the active tab.\n- Read-only: does not open/switch tabs and does not mutate saved or unsaved content.\n- Returns UI-facing tab data (editable fields, configured values, responses/results), not a full OpenAPI schema dump.\n\n**Use when**\n- You need to verify UI state in the active tab after an action (edit, save, execute, rerun, tab switch).\n- You need to inspect request/response/result content as rendered in Replay UI.\n\n**Never use when**\n- You are gathering **initial schema/context** for a request from project assets (OpenAPI/Arazzo); use project-asset lookup with exact ids/coordinates.\n- You need IDs or operation/workflow coordinates from project assets; resolve them via project-asset lookup, not active-tab UI reads.\n- You need a different tab; this tool never changes focus.\n- You need to run a request or change any saved/unsaved tab content; this tool is strictly read-only.\n\n**Input guidance**\n- Treat IDs from `info` as canonical for follow-up actions.\n- Request only needed sections and combine them in one call.\n- Prefer including `info` unless you need only one slice.\n- Sections by tab type:\n - Collection tab: `info`, `workflows`, `sourceDescriptions`.\n - Workflow tab: `info`, `inputs`, `parameters`, `security`, `outputs`, `steps`, `wiring` (every step's security bindings + outputs in one call - inspect or verify multi-step wiring without opening step tabs).\n - Step tab: `info`, `parameters`, `requestBody`, `security`, `outputs`, `successCriteria`, `response`.\n - Workflow run tab: `info`, `result` (status, per-step outcomes, masked bodies; `stepIds` fetches full ones), `severity`.\n- Invalid sections are skipped; if none apply, response falls back to `info`.\n\n**Loop/budget guidance**\n- Read each needed section once per turn.\n- Re-read only after mutation/save, or when you need to inspect new output.\n- If `result` is RUNNING, re-read until the run finishes.",bo=n.enumType(["info","workflows","sourceDescriptions","inputs","parameters","security","outputs","steps","wiring","requestBody","successCriteria","response","result","severity"]),vo=n.strictObjectType({sections:n.arrayType(bo).min(1).describe("Content blocks to include in the response. Use tab-type-specific sections from the tool description; invalid sections for the current tab are ignored."),stepIds:n.arrayType(n.stringType()).min(1).optional().describe("Workflow run tabs only, together with the `result` section: executed step ids to return the full (secret-masked) response body for. Use after the per-step preview proves insufficient.")}),To=n.objectType({message:n.stringType()}),So=C(To),ko={description:go,inputSchema:vo,outputSchema:So,needsApproval:!1};function y(e,t){return{isError:!0,error:{message:e,details:t}}}function Ao(e,t){const o=no(e),r=[],s=[];for(const i of t)o.includes(i)?r.push(i):s.push(i);return{sections:r,skipped:s}}function Co(e){return async(t,o)=>{const r=e();if(!r)return y("No active tab data available.");const{sections:s,skipped:i}=Ao(r,t.sections),c=s.length>0?s:["info"];let l=oo(r,c,{stepIds:t.stepIds})??"Unable to build a summary for the active tab.";return i.length>0&&(l+=`
|
|
42
42
|
|
|
43
43
|
(Sections not applicable for this tab type were omitted: ${i.join(", ")}.)`),s.length===0&&t.sections.length>0&&(l+="\n\n(No requested sections applied to this tab type; showing `info` instead.)"),t.stepIds?.length&&(r.type!==a.TabDataType.WorkflowRun?l+=`
|
|
44
44
|
|