@redocly/replay 0.29.0-next.3 → 0.29.0-next.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/oauth2-redirect.cjs +1 -1
  2. package/dist/oauth2-redirect.js +1 -1
  3. package/dist/{replay-AiChatProvider-C5p3nTV1.js → replay-AiChatProvider-CMWF3IYp.js} +1 -1
  4. package/dist/{replay-AiChatProvider-Bnz0LDFD.js → replay-AiChatProvider-DUR0_fHq.js} +6 -6
  5. package/dist/{replay-AiChatSqliteDBStorage-DYxoSZak.js → replay-AiChatSqliteDBStorage-CEltYx94.js} +1 -1
  6. package/dist/{replay-AiChatSqliteDBStorage-Dfbp6Mt_.js → replay-AiChatSqliteDBStorage-CITb7hSz.js} +1 -1
  7. package/dist/{replay-AiPanel-BSg5Bap4.js → replay-AiPanel-CYHXUjMI.js} +1 -1
  8. package/dist/{replay-AiPanel-C0E1A47H.js → replay-AiPanel-DbiJfTWy.js} +4 -4
  9. package/dist/{replay-FileWatcher-Ba9Ob_Sy.js → replay-FileWatcher-Bs6dX18v.js} +1 -1
  10. package/dist/{replay-FileWatcher-BiAGOR1Z.js → replay-FileWatcher-Ds_JSG57.js} +2 -2
  11. package/dist/{replay-SemanticSearchService-sIjG5Wxe.js → replay-SemanticSearchService-CdF1TQ_0.js} +1 -1
  12. package/dist/{replay-SemanticSearchService-IInvoSoP.js → replay-SemanticSearchService-CeHFhNDz.js} +1 -1
  13. package/dist/{replay-SqliteDBStorage-C-ovuJna.js → replay-SqliteDBStorage-BFfjCMEn.js} +1 -1
  14. package/dist/{replay-SqliteDBStorage-DMoeVRXU.js → replay-SqliteDBStorage-BRc6vHai.js} +1 -1
  15. package/dist/{replay-TauriFileSystemAdapter-DDo2h7gX.js → replay-TauriFileSystemAdapter-OQ2SMUiS.js} +1 -1
  16. package/dist/{replay-TauriFileSystemAdapter-CB9S1PNT.js → replay-TauriFileSystemAdapter-Z0n8Fot4.js} +1 -1
  17. package/dist/{replay-TauriRootStorage-CR1PyBgZ.js → replay-TauriRootStorage-C9pPtxdD.js} +2 -2
  18. package/dist/{replay-TauriRootStorage-BX-XrEN-.js → replay-TauriRootStorage-CIPk_4D6.js} +1 -1
  19. package/dist/{replay-agent-loop-4YtdgkDh.js → replay-agent-loop-ByI1Wra6.js} +3 -3
  20. package/dist/{replay-agent-loop-BmoYEhOB.js → replay-agent-loop-qMZ-yh7C.js} +1 -1
  21. package/dist/{replay-ai-chat-mappers-42FEVsfw.js → replay-ai-chat-mappers-BJG4qsVh.js} +1 -1
  22. package/dist/{replay-ai-chat-mappers-CgjhiNr7.js → replay-ai-chat-mappers-BhXui_cP.js} +1 -1
  23. package/dist/{replay-create-model-kF4veQPK.js → replay-create-model-DT8aanzL.js} +3 -3
  24. package/dist/{replay-create-model-4Yknbfme.js → replay-create-model-nf-dFfMt.js} +3 -3
  25. package/dist/{replay-db-B3tQE-B9.js → replay-db-B7DOUIxd.js} +1 -1
  26. package/dist/{replay-db-_hwn1n5t.js → replay-db-CEncswPh.js} +1 -1
  27. package/dist/{replay-external-resolver-DS7qAi0G.js → replay-external-resolver-BO-EH2ei.js} +2 -2
  28. package/dist/{replay-external-resolver-DX5JrdGB.js → replay-external-resolver-CMQ9upb6.js} +1 -1
  29. package/dist/{replay-index-CtxNTrRQ.js → replay-index-BNjWkfVs.js} +1 -1
  30. package/dist/{replay-index-BYEUJTGe.js → replay-index-BZZRT4XV.js} +1 -1
  31. package/dist/{replay-index-DD1leCQo.js → replay-index-CBonfX4Z.js} +1 -1
  32. package/dist/replay-index-CFwGH3xH.js +4 -0
  33. package/dist/{replay-index-KN9FLfwz.js → replay-index-DfpfSyMZ.js} +15716 -15612
  34. package/dist/replay-index-DiLsdDeo.js +1 -0
  35. package/dist/{replay-index-BDRC1QoR.js → replay-index-Dlmw0x6l.js} +1120 -1100
  36. package/dist/{replay-index-Bwbd4CsO.js → replay-index-Dr16XpGK.js} +146 -139
  37. package/dist/{replay-lint-C3ireP5A.js → replay-lint-BfS0UNDE.js} +838 -831
  38. package/dist/{replay-lint-BvndGL38.js → replay-lint-DPvfVFm_.js} +48 -48
  39. package/dist/{replay-lint-graphql-CK8-ZL5Q.js → replay-lint-graphql-D6-d3ArO.js} +1 -1
  40. package/dist/{replay-lint-graphql-DKP9oX8y.js → replay-lint-graphql-DeG9a5xu.js} +2 -2
  41. package/dist/replay-oauth2-redirect-handler-BfZRvm6l.js +4 -0
  42. package/dist/{replay-oauth2-redirect-handler-CqKZB3aV.js → replay-oauth2-redirect-handler-Bq6bpZMm.js} +1 -1
  43. package/dist/{replay-periodic-revalidation-chHSyw20.js → replay-periodic-revalidation-BPCrKV7q.js} +1 -1
  44. package/dist/{replay-periodic-revalidation-BcWBqn6g.js → replay-periodic-revalidation-DC30GN6O.js} +1 -1
  45. package/dist/{replay-resolve-B1Kvf3fM.js → replay-resolve-B-ubny1s.js} +1 -1
  46. package/dist/{replay-resolve-DC-rmKvK.js → replay-resolve-CgA90BKO.js} +1 -1
  47. package/dist/{replay-respect-run-DDZ9eF0k.js → replay-respect-run-DU4lsMa5.js} +430 -421
  48. package/dist/{replay-respect-run-C24QylJ-.js → replay-respect-run-FINRH3Fr.js} +21 -21
  49. package/dist/{replay-tauri-path-DBSmio5_.js → replay-tauri-path-1LJEbhgj.js} +1 -1
  50. package/dist/{replay-tauri-path-Bz_q3KUG.js → replay-tauri-path-DRie4WYN.js} +2 -2
  51. package/dist/{replay-useAiChatQueries-C_GZ_b68.js → replay-useAiChatQueries-AyEiBMVh.js} +2 -2
  52. package/dist/{replay-useAiChatQueries-DQks2tVS.js → replay-useAiChatQueries-DqmuaoyJ.js} +5 -5
  53. package/dist/{replay-validate-key-DScTTPU4.js → replay-validate-key-Dn0a7PBu.js} +1 -1
  54. package/dist/{replay-validate-key-c2nCLxiG.js → replay-validate-key-qLqRQU88.js} +2 -2
  55. package/dist/replay.cjs +1 -1
  56. package/dist/replay.d.ts +7 -0
  57. package/dist/replay.js +2 -2
  58. package/package.json +4 -4
  59. package/dist/replay-index-CHdCQ_zw.js +0 -4
  60. package/dist/replay-index-r6bsSAe6.js +0 -1
  61. package/dist/replay-oauth2-redirect-handler-Bqw5UUvl.js +0 -4
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-BDRC1QoR.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-Dlmw0x6l.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,5 +1,5 @@
1
- import { k as h, s as x, l as i } from "./replay-index-KN9FLfwz.js";
2
- import { n as j, o as b, j as k } from "./replay-index-KN9FLfwz.js";
1
+ import { k as h, s as x, l as i } from "./replay-index-DfpfSyMZ.js";
2
+ import { n as j, o as b, j as k } from "./replay-index-DfpfSyMZ.js";
3
3
  async function u(a, e) {
4
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
5
  let r = 0;
@@ -1,4 +1,4 @@
1
- "use strict";const Oe=require("react"),a=require("./replay-index-BDRC1QoR.js"),m=require("./replay-db-_hwn1n5t.js"),r=require("./replay-create-model-4Yknbfme.js"),A=require("./replay-SemanticSearchService-IInvoSoP.js"),Ee=require("@tanstack/react-query"),M={path:"pathParameters",query:"queryParameters",header:"headers",cookie:"cookies"},mt={run_request:{approveLabel:"Run",denyLabel:"Skip"},update_step:{approveLabel:"Apply",denyLabel:"Dismiss"},update_security:{approveLabel:"Apply",denyLabel:"Dismiss"}},ht={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"}},yt={CHAT:"chat",HISTORY:"history"},It="report_status",wt="run_workflow",j={WEB_SEARCH:"web_search"};function gt(e){switch(e.provider){case a.AI_PROVIDERS.GEMINI:return{[j.WEB_SEARCH]:r.google.tools.googleSearch({})};case a.AI_PROVIDERS.OPENAI:return{[j.WEB_SEARCH]:r.openai.tools.webSearch({})};case a.AI_PROVIDERS.ANTHROPIC:return{[j.WEB_SEARCH]:r.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 bt=["info","workflows","sourceDescriptions"];function vt(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,`
1
+ "use strict";const Oe=require("react"),a=require("./replay-index-Dlmw0x6l.js"),m=require("./replay-db-CEncswPh.js"),r=require("./replay-create-model-nf-dFfMt.js"),A=require("./replay-SemanticSearchService-CeHFhNDz.js"),Ee=require("@tanstack/react-query"),M={path:"pathParameters",query:"queryParameters",header:"headers",cookie:"cookies"},mt={run_request:{approveLabel:"Run",denyLabel:"Skip"},update_step:{approveLabel:"Apply",denyLabel:"Dismiss"},update_security:{approveLabel:"Apply",denyLabel:"Dismiss"}},ht={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"}},yt={CHAT:"chat",HISTORY:"history"},It="report_status",wt="run_workflow",j={WEB_SEARCH:"web_search"};function gt(e){switch(e.provider){case a.AI_PROVIDERS.GEMINI:return{[j.WEB_SEARCH]:r.google.tools.googleSearch({})};case a.AI_PROVIDERS.OPENAI:return{[j.WEB_SEARCH]:r.openai.tools.webSearch({})};case a.AI_PROVIDERS.ANTHROPIC:return{[j.WEB_SEARCH]:r.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 bt=["info","workflows","sourceDescriptions"];function vt(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 Tt(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 St(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 kt(e,t){const o=["Current tab (collection)"];for(const n of t)switch(n){case"info":o.push(vt(e));break;case"workflows":o.push(Tt(e));break;case"sourceDescriptions":o.push(St(e));break}return m.buildMessageFromArray(o,`
@@ -38,7 +38,7 @@ ${de(f.step.response?.body,t,m.RESPONSE_BODY_PREVIEW_MAX,!0)}`:`Full response bo
38
38
  `)}function no(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 n=`Run status: FAILED - execution error: ${a.maskSecretsInText(e.runError||"unknown error",o)}`;return e.result?`${n}
39
39
  (the stored result is from an earlier run and is omitted as stale)`:n}return e.result?oo(e.result,o,t?.stepIds):"Run status: NOT STARTED - no run has executed on this tab yet."}function ro(e,t,o){const n=["Current tab (workflow run)"];for(const s of t)switch(s){case"info":n.push(Qt(e));break;case"severity":n.push(Zt(e));break;case"result":n.push(no(e,o));break}return m.buildMessageFromArray(n,`
40
40
 
41
- `)}function so(e,t=["info"],o){if(!e)return null;switch(e.type){case a.TabDataType.Step:return Bt(e,t);case a.TabDataType.Workflow:return qt(e,t);case a.TabDataType.Collection:return kt(e,t);case a.TabDataType.WorkflowRun:return ro(e,t,o)}}function io(e){switch(e.type){case a.TabDataType.Collection:return bt;case a.TabDataType.Workflow:return Ot;case a.TabDataType.Step:return Ut;case a.TabDataType.WorkflowRun:return Kt}}function Re(e){return e.trim().replace(/\s+/g," ").replace(/[.!?:;,…]+$/,"").toLowerCase()}function ao(e,t){const o=[];let n=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?(n+=1,o.push(i.input)):n=0);return{priorInputs:o,consecutiveCalls:n}}function co(e,t,o){const n=[];let s=!1;for(const i of e){const c=i(t,o);c&&(n.push(c.message),c.action==="block"&&(s=!0))}return{blocked:s,notes:n}}function xe(e){const t=e.warn!==void 0?"warn":"block",o=e.warn!==void 0?e.warn:e.block;return(n,s)=>{const i=ue(e.key,n);return i===null?null:s.priorInputs.some(d=>ue(e.key,d)===i)?{action:t,message:o}:null}}function ue(e,t){try{return e(t)}catch{return null}}function lo(e){const t=pe("warn",e.warnAfter,e.warnMessage),o=pe("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(n,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 pe(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 uo(e){if(!e||typeof e.safeParse!="function")return;const t=e;return o=>{const n=t.safeParse(o);return n.success?n.data:null}}function po(e,t,o,n){return!t||t.length===0?o:async(s,i)=>{const c=ao(i?.messages,e),d={consecutiveCalls:c.consecutiveCalls,priorInputs:n?c.priorInputs.map(n).filter(p=>p!==null):c.priorInputs},l=co(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||!fo(u)?u:{...u,note:[u.note,...l.notes].filter(Boolean).join(" ")}}}function fo(e){return e!==null&&typeof e=="object"&&e.isError===!1}function mo(e,t){return{name:e.name,definition:e.definition,execute:po(e.name,e.guards,e.createExecutor(t),uo(e.definition.inputSchema))}}const ho={messages:[],isStreaming:!1,sendMessage:async()=>{},updateMessages:()=>{},stopGeneration:()=>{},addToolApprovalResponse:()=>{},chatStatus:"ready",chatError:void 0},$e=Oe.createContext(ho);function yo(){return Oe.useContext($e)}const Io=r.objectType({message:r.stringType(),details:r.unknownType().optional()}),oe=r.objectType({action:r.enumType(["add","update","remove"]).describe('Action to perform: "add", "update" or "remove".'),approved:r.booleanType().default(!0)}),$=oe.extend({id:r.stringType().optional().describe("Existing item id. Required for update/remove actions.")}),wo=oe.extend({index:r.numberType().int().min(0).optional().describe("Existing item index. Required for update/remove actions.")}),go=r.objectType({isError:r.literalType(!1),blocked:r.literalType(!0),note:r.stringType(),data:r.neverType().optional(),error:r.neverType().optional()});function C(e){return r.unionType([r.objectType({isError:r.literalType(!0),error:Io,data:r.neverType().optional(),blocked:r.neverType().optional()}),r.objectType({isError:r.literalType(!1),data:e,error:r.neverType().optional(),note:r.stringType().optional(),blocked:r.neverType().optional()}),go])}const bo=r.objectType({status:r.enumType(["applied","failed"]),summary:r.stringType().optional()}),vo=r.objectType({totalChanges:r.numberType().int().min(0),approvedChanges:r.numberType().int().min(0),applied:r.arrayType(bo),resultingState:r.stringType().optional().describe("Resulting state of the mutated fields after all changes were applied.")}),Pe=C(vo),To="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.",So=r.enumType(["info","workflows","sourceDescriptions","inputs","parameters","security","outputs","steps","wiring","requestBody","successCriteria","response","result","severity"]),ko=r.strictObjectType({sections:r.arrayType(So).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:r.arrayType(r.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.")}),Ao=r.objectType({message:r.stringType()}),Co=C(Ao),Oo={description:To,inputSchema:ko,outputSchema:Co,needsApproval:!1};function y(e,t){return{isError:!0,error:{message:e,details:t}}}function Eo(e,t){const o=io(e),n=[],s=[];for(const i of t)o.includes(i)?n.push(i):s.push(i);return{sections:n,skipped:s}}function _o(e){return async(t,o)=>{const n=e();if(!n)return y("No active tab data available.");const{sections:s,skipped:i}=Eo(n,t.sections),c=s.length>0?s:["info"];let l=so(n,c,{stepIds:t.stepIds})??"Unable to build a summary for the active tab.";return i.length>0&&(l+=`
41
+ `)}function so(e,t=["info"],o){if(!e)return null;switch(e.type){case a.TabDataType.Step:return Bt(e,t);case a.TabDataType.Workflow:return qt(e,t);case a.TabDataType.Collection:return kt(e,t);case a.TabDataType.WorkflowRun:return ro(e,t,o)}}function io(e){switch(e.type){case a.TabDataType.Collection:return bt;case a.TabDataType.Workflow:return Ot;case a.TabDataType.Step:return Ut;case a.TabDataType.WorkflowRun:return Kt}}function Re(e){return e.trim().replace(/\s+/g," ").replace(new RegExp("(?<![.!?:;,…])[.!?:;,…]+$"),"").toLowerCase()}function ao(e,t){const o=[];let n=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?(n+=1,o.push(i.input)):n=0);return{priorInputs:o,consecutiveCalls:n}}function co(e,t,o){const n=[];let s=!1;for(const i of e){const c=i(t,o);c&&(n.push(c.message),c.action==="block"&&(s=!0))}return{blocked:s,notes:n}}function xe(e){const t=e.warn!==void 0?"warn":"block",o=e.warn!==void 0?e.warn:e.block;return(n,s)=>{const i=ue(e.key,n);return i===null?null:s.priorInputs.some(d=>ue(e.key,d)===i)?{action:t,message:o}:null}}function ue(e,t){try{return e(t)}catch{return null}}function lo(e){const t=pe("warn",e.warnAfter,e.warnMessage),o=pe("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(n,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 pe(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 uo(e){if(!e||typeof e.safeParse!="function")return;const t=e;return o=>{const n=t.safeParse(o);return n.success?n.data:null}}function po(e,t,o,n){return!t||t.length===0?o:async(s,i)=>{const c=ao(i?.messages,e),d={consecutiveCalls:c.consecutiveCalls,priorInputs:n?c.priorInputs.map(n).filter(p=>p!==null):c.priorInputs},l=co(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||!fo(u)?u:{...u,note:[u.note,...l.notes].filter(Boolean).join(" ")}}}function fo(e){return e!==null&&typeof e=="object"&&e.isError===!1}function mo(e,t){return{name:e.name,definition:e.definition,execute:po(e.name,e.guards,e.createExecutor(t),uo(e.definition.inputSchema))}}const ho={messages:[],isStreaming:!1,sendMessage:async()=>{},updateMessages:()=>{},stopGeneration:()=>{},addToolApprovalResponse:()=>{},chatStatus:"ready",chatError:void 0},$e=Oe.createContext(ho);function yo(){return Oe.useContext($e)}const Io=r.objectType({message:r.stringType(),details:r.unknownType().optional()}),oe=r.objectType({action:r.enumType(["add","update","remove"]).describe('Action to perform: "add", "update" or "remove".'),approved:r.booleanType().default(!0)}),$=oe.extend({id:r.stringType().optional().describe("Existing item id. Required for update/remove actions.")}),wo=oe.extend({index:r.numberType().int().min(0).optional().describe("Existing item index. Required for update/remove actions.")}),go=r.objectType({isError:r.literalType(!1),blocked:r.literalType(!0),note:r.stringType(),data:r.neverType().optional(),error:r.neverType().optional()});function C(e){return r.unionType([r.objectType({isError:r.literalType(!0),error:Io,data:r.neverType().optional(),blocked:r.neverType().optional()}),r.objectType({isError:r.literalType(!1),data:e,error:r.neverType().optional(),note:r.stringType().optional(),blocked:r.neverType().optional()}),go])}const bo=r.objectType({status:r.enumType(["applied","failed"]),summary:r.stringType().optional()}),vo=r.objectType({totalChanges:r.numberType().int().min(0),approvedChanges:r.numberType().int().min(0),applied:r.arrayType(bo),resultingState:r.stringType().optional().describe("Resulting state of the mutated fields after all changes were applied.")}),Pe=C(vo),To="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.",So=r.enumType(["info","workflows","sourceDescriptions","inputs","parameters","security","outputs","steps","wiring","requestBody","successCriteria","response","result","severity"]),ko=r.strictObjectType({sections:r.arrayType(So).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:r.arrayType(r.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.")}),Ao=r.objectType({message:r.stringType()}),Co=C(Ao),Oo={description:To,inputSchema:ko,outputSchema:Co,needsApproval:!1};function y(e,t){return{isError:!0,error:{message:e,details:t}}}function Eo(e,t){const o=io(e),n=[],s=[];for(const i of t)o.includes(i)?n.push(i):s.push(i);return{sections:n,skipped:s}}function _o(e){return async(t,o)=>{const n=e();if(!n)return y("No active tab data available.");const{sections:s,skipped:i}=Eo(n,t.sections),c=s.length>0?s:["info"];let l=so(n,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&&(n.type!==a.TabDataType.WorkflowRun?l+=`
44
44
 
@@ -1,8 +1,8 @@
1
1
  import { useContext as Ht, createContext as Gt } from "react";
2
- import { R as Vt, A as be, aP as re, aQ as Kt, aR as Jt, aS as Qt, aa as x, a as de, aF as Y, aT as mt, aU as Oe, aE as Ee, aV as ht, aW as ue, aX as Z, c as b, aY as Xt, al as G, aj as V, aZ as It, a_ as pe, ak as $e, a$ as Zt, b0 as eo, b1 as to, b2 as oo, b3 as no, b4 as ro, b5 as so, ad as K, b6 as ao, ae as ee, a8 as io, b7 as co, b8 as lo, b9 as wt, ba as yt, bb as uo, bc as vt, bd as xe, be as Ae, ag as J, bf as po, a9 as gt, bg as _e, az as bt, bh as fo, bi as mo, C as k, bj as Be, bk as ho, bl as Ye, bm as Io, bn as wo, bo as yo, a7 as kt, a6 as St } from "./replay-index-KN9FLfwz.js";
3
- import { b as C, f as Tt, a as Ct, c as Ot, d as fe, e as At, i as ze, h as Re, R as z, j as vo, k as go, p as bo, s as He, l as ko } from "./replay-db-B3tQE-B9.js";
4
- import { b as So, o as To, d as Co, e as p, u as me, f as i, h as R, j as E, n as A, k as B, m as I, q as T, r as Pe, t as te, v as he, Z as H, w as Oo, x as Ge, c as Ao, s as Eo, y as $o } from "./replay-create-model-kF4veQPK.js";
5
- import { g as xo, e as Ve, a as _o, b as Ro, c as Ke, d as Po, f as qo } from "./replay-SemanticSearchService-sIjG5Wxe.js";
2
+ import { R as Vt, A as be, aP as re, aQ as Kt, aR as Jt, aS as Qt, aa as x, a as de, aF as Y, aT as mt, aU as Oe, aE as Ee, aV as ht, aW as ue, aX as Z, c as b, aY as Xt, al as G, aj as V, aZ as It, a_ as pe, ak as $e, a$ as Zt, b0 as eo, b1 as to, b2 as oo, b3 as no, b4 as ro, b5 as so, ad as K, b6 as ao, ae as ee, a8 as io, b7 as co, b8 as lo, b9 as wt, ba as yt, bb as uo, bc as vt, bd as xe, be as Ae, ag as J, bf as po, a9 as gt, bg as _e, az as bt, bh as fo, bi as mo, C as k, bj as Be, bk as ho, bl as Ye, bm as Io, bn as wo, bo as yo, a7 as kt, a6 as St } from "./replay-index-DfpfSyMZ.js";
3
+ import { b as C, f as Tt, a as Ct, c as Ot, d as fe, e as At, i as ze, h as Re, R as z, j as vo, k as go, p as bo, s as He, l as ko } from "./replay-db-B7DOUIxd.js";
4
+ import { b as So, o as To, d as Co, e as p, u as me, f as i, h as R, j as E, n as A, k as B, m as I, q as T, r as Pe, t as te, v as he, Z as H, w as Oo, x as Ge, c as Ao, s as Eo, y as $o } from "./replay-create-model-DT8aanzL.js";
5
+ import { g as xo, e as Ve, a as _o, b as Ro, c as Ke, d as Po, f as qo } from "./replay-SemanticSearchService-CdF1TQ_0.js";
6
6
  import { useInfiniteQuery as No, useQuery as Uo } from "@tanstack/react-query";
7
7
  const se = {
8
8
  path: "pathParameters",
@@ -504,7 +504,7 @@ function An(e) {
504
504
  }
505
505
  }
506
506
  function $t(e) {
507
- return e.trim().replace(/\s+/g, " ").replace(/[.!?:;,…]+$/, "").toLowerCase();
507
+ return e.trim().replace(/\s+/g, " ").replace(new RegExp("(?<![.!?:;,…])[.!?:;,…]+$"), "").toLowerCase();
508
508
  }
509
509
  function En(e, t) {
510
510
  const o = [];
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./replay-create-model-4Yknbfme.js"),n=require("./replay-index-BDRC1QoR.js"),l=require("./replay-defaults-DVvOnvnR.js");async function s(t,a,o,i){try{const e=r.createModel({provider:t,modelId:o,apiKey:a});return await r.generateText({model:e,prompt:l.VALIDATION_PROMPT,maxOutputTokens:n.MAX_OUTPUT_TOKENS_FOR_VALIDATION,abortSignal:i?.abortSignal}),{valid:!0}}catch(e){if(e instanceof Error&&e.name==="AbortError")throw e;return{valid:!1,error:e instanceof Error&&e.message.length>0?e.message:"Validation failed. Please try again."}}}exports.validateApiKey=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./replay-create-model-nf-dFfMt.js"),n=require("./replay-index-Dlmw0x6l.js"),l=require("./replay-defaults-DVvOnvnR.js");async function s(t,a,o,i){try{const e=r.createModel({provider:t,modelId:o,apiKey:a});return await r.generateText({model:e,prompt:l.VALIDATION_PROMPT,maxOutputTokens:n.MAX_OUTPUT_TOKENS_FOR_VALIDATION,abortSignal:i?.abortSignal}),{valid:!0}}catch(e){if(e instanceof Error&&e.name==="AbortError")throw e;return{valid:!1,error:e instanceof Error&&e.message.length>0?e.message:"Validation failed. Please try again."}}}exports.validateApiKey=s;
@@ -1,5 +1,5 @@
1
- import { c as i, g as n } from "./replay-create-model-kF4veQPK.js";
2
- import { M as s } from "./replay-index-KN9FLfwz.js";
1
+ import { c as i, g as n } from "./replay-create-model-DT8aanzL.js";
2
+ import { M as s } from "./replay-index-DfpfSyMZ.js";
3
3
  import { V as l } from "./replay-defaults-CzR6jw9a.js";
4
4
  async function g(a, e, t, o) {
5
5
  try {
package/dist/replay.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-BDRC1QoR.js"),t=require("./replay-oauth2-redirect-handler-Bqw5UUvl.js");exports.AI_PROVIDERS=e.AI_PROVIDERS;exports.AiPanelContext=e.AiPanelContext;exports.EmbeddedReplay=e.EmbeddedReplay;exports.Modal=e.Modal;exports.REUNITE_AI_PROVIDER=e.REUNITE_AI_PROVIDER;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.createResource=e.createResource;exports.getCurrentTheme=e.getCurrentTheme;exports.loadAgentLoop=e.loadAgentLoop;exports.makeProviderRecord=e.makeProviderRecord;exports.resolveTheme=e.resolveTheme;exports.useAiPanel=e.useAiPanel;exports.useTelemetry=e.useTelemetry;exports.useTelemetryClient=e.useTelemetryClient;exports.validateApiKey=e.validateApiKey;exports.OAuth2Error=t.OAuth2Error;exports.handleOAuth2Redirect=t.handleOAuth2Redirect;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./replay-index-Dlmw0x6l.js"),t=require("./replay-oauth2-redirect-handler-BfZRvm6l.js");exports.AI_PROVIDERS=e.AI_PROVIDERS;exports.AiPanelContext=e.AiPanelContext;exports.EmbeddedReplay=e.EmbeddedReplay;exports.Modal=e.Modal;exports.REUNITE_AI_PROVIDER=e.REUNITE_AI_PROVIDER;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.createResource=e.createResource;exports.getCurrentTheme=e.getCurrentTheme;exports.loadAgentLoop=e.loadAgentLoop;exports.makeProviderRecord=e.makeProviderRecord;exports.resolveTheme=e.resolveTheme;exports.useAiPanel=e.useAiPanel;exports.useTelemetry=e.useTelemetry;exports.useTelemetryClient=e.useTelemetryClient;exports.validateApiKey=e.validateApiKey;exports.OAuth2Error=t.OAuth2Error;exports.handleOAuth2Redirect=t.handleOAuth2Redirect;
package/dist/replay.d.ts CHANGED
@@ -460,6 +460,13 @@ declare type OpenAPIOperation_2 = {
460
460
  };
461
461
  servers: Server[];
462
462
  security?: OperationSecurity[][];
463
+ responses?: {
464
+ [status: string]: {
465
+ mediaTypes?: {
466
+ [name: string]: Pick<MediaType, 'schema'>;
467
+ };
468
+ };
469
+ };
463
470
  response?: Response_2 | null;
464
471
  };
465
472
 
package/dist/replay.js CHANGED
@@ -1,5 +1,5 @@
1
- import { A as s, av as r, bN as t, bO as l, R as o, bP as b, bQ as R, K as d, bR as m, bS as p, L as n, bT as u, bU as y, bV as A, bW as T, au as i, at as O, bX as h, bY as E } from "./replay-index-KN9FLfwz.js";
2
- import { O as v, h as C } from "./replay-oauth2-redirect-handler-CqKZB3aV.js";
1
+ import { A as s, av as r, bN as t, bO as l, R as o, bP as b, bQ as R, K as d, bR as m, bS as p, L as n, bT as u, bU as y, bV as A, bW as T, au as i, at as O, bX as h, bY as E } from "./replay-index-DfpfSyMZ.js";
2
+ import { O as v, h as C } from "./replay-oauth2-redirect-handler-Bq6bpZMm.js";
3
3
  export {
4
4
  s as AI_PROVIDERS,
5
5
  r as AiPanelContext,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/replay",
3
- "version": "0.29.0-next.3",
3
+ "version": "0.29.0-next.5",
4
4
  "type": "module",
5
5
  "main": "./dist/replay.cjs",
6
6
  "module": "./dist/replay.js",
@@ -16,7 +16,7 @@
16
16
  }
17
17
  },
18
18
  "peerDependencies": {
19
- "@redocly/theme": "0.70.0-next.3",
19
+ "@redocly/theme": "0.70.0-next.5",
20
20
  "@tanstack/react-query": "5.62.3",
21
21
  "react": "^19.2.7",
22
22
  "react-dom": "^19.2.7",
@@ -51,9 +51,9 @@
51
51
  "@lezer/highlight": "^1.1.6",
52
52
  "@noble/hashes": "^1.8.0",
53
53
  "@opentelemetry/api": "1.9.1",
54
- "@redocly/openapi-core": "2.53.0",
54
+ "@redocly/openapi-core": "2.55.0",
55
55
  "@redocly/replay-asyncapi-sdk": "0.0.1",
56
- "@redocly/respect-core": "2.53.0",
56
+ "@redocly/respect-core": "2.55.0",
57
57
  "@redocly/vscode-json-languageservice": "^3.4.9",
58
58
  "@tauri-apps/api": "2.4.1",
59
59
  "@tauri-apps/plugin-deep-link": "^2.4.5",
@@ -1,4 +0,0 @@
1
- import { g as r } from "./replay-SemanticSearchService-sIjG5Wxe.js";
2
- export {
3
- r as getSemanticSearchService
4
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./replay-index-BDRC1QoR.js"),s=require("./replay-lint-BvndGL38.js"),o=require("./replay-resolve-B1Kvf3fM.js");function j(e){return(p.pathBrowserifyExports.extname(e)===".yaml"||p.pathBrowserifyExports.extname(e)===".yml")&&!1}function k(e){return p.isPlainObject(e)&&!s.isEmptyObject(e)}async function L(e){return new Promise(t=>setTimeout(t,e))}const S="type",v=["api-description","api-operation","data-schema"];function R(e,t){const{ctx:n}=s.getNodeTypesFromJSONSchema("EntityFileDefault",t),{ctx:r,discriminatorResolver:i}=s.getNodeTypesFromJSONSchema("EntityFile",e);return{entityTypes:{...n,...r,EntityFileArray:{properties:{},items:y=>{if(p.isPlainObject(y)){const m=y[S];if(!m)return"Entity";const l=i?.(y,m);if(l&&typeof l=="string")return l}return"Entity"}}},discriminatorResolver:i}}function c(e,t){if(o.isRef(t.parent))return;const n=t.key.toString(),r=e.counts??={};r[n]=(r[n]??0)+1}function O(e){for(const i of Object.values(e))i.items&&(i.total=i.items.size);const{xExtensions:t}=e,n=t.counts??{},r=Object.keys(n).sort();t.total=r.length,t.counts=Object.fromEntries(r.map(i=>[i,n[i]]))}const w=e=>({SpecExtension:{enter(t,n){c(e.xExtensions,n)}},XCodeSampleList:{enter(t,n){c(e.xExtensions,n)}},ExamplesMap:{enter(t,n){n.key.toString()==="x-examples"&&c(e.xExtensions,n)}},EnumDescriptions:{enter(t,n){c(e.xExtensions,n)}},TagGroups:{enter(t,n){c(e.xExtensions,n)}},Logo:{enter(t,n){c(e.xExtensions,n)}},XServerList:{enter(t,n){c(e.xExtensions,n)}},XUsePkce:{enter(t,n){c(e.xExtensions,n)}},Operation:{enter(t,n){n.key.toString()==="x-query"&&c(e.xExtensions,n)}},ExternalDocs:{leave(){e.externalDocs.total++}},ref:{enter(t){e.refs.items.add(t.$ref)}},Tag:{leave(t){e.tags.items.add(t.name)}},Link:{leave(t){e.links.items.add(t.operationId)}},WebhooksMap:{enter(t,n){n.key.toString()==="x-webhooks"&&c(e.xExtensions,n)},Operation:{leave(t){if(e.webhooks.total++,t.tags)for(const n of t.tags)e.tags.items.add(n)}}},Paths:{PathItem:{leave(){e.pathItems.total++},Operation:{leave(t){if(e.operations.total++,t.tags)for(const n of t.tags)e.tags.items.add(n)}},Parameter:{leave(t){e.parameters.items.add(t.name)}}}},NamedSchemas:{Schema:{leave(){e.schemas.total++}}},Root:{leave(){O(e)}}}),z=e=>({SpecExtension:{enter(t,n){c(e.xExtensions,n)}},ExternalDocs:{leave(){e.externalDocs.total++}},ref:{enter(t){e.refs.items.add(t.$ref)}},Tag:{leave(t){e.tags.items.add(t.name)}},ChannelMap:{Channel:{leave(){e.channels.total++},Operation:{leave(t){if(e.operations.total++,t.tags)for(const n of t.tags)e.tags.items.add(n)}},Parameter:{leave(t,{key:n}){e.parameters.items.add(n.toString())}}}},NamedSchemas:{Schema:{leave(){e.schemas.total++}}},Root:{leave(){O(e)}}}),V=e=>({SpecExtension:{enter(t,n){c(e.xExtensions,n)}},ExternalDocs:{leave(){e.externalDocs.total++}},ref:{enter(t){e.refs.items.add(t.$ref)}},Tag:{leave(t){e.tags.items.add(t.name)}},NamedChannels:{Channel:{leave(){e.channels.total++},Parameter:{leave(t,{key:n}){e.parameters.items.add(n.toString())}}}},NamedOperations:{Operation:{leave(t){if(e.operations.total++,t.tags)for(const n of t.tags)e.tags.items.add(n)}}},NamedSchemas:{Schema:{leave(){e.schemas.total++}}},Root:{leave(){O(e)}}}),G=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,b=2,x=150,U=()=>({any(e,{report:t,location:n}){if(p.isPlainObject(e)&&"key"in e){const r=e.key;if(typeof r!="string"){t({message:"Entity `key` must be a string.",location:n.child(["key"])});return}r.length<b&&t({message:`Entity 'key' must be at least ${b} characters long.`,location:n.child(["key"])}),r.length>x&&t({message:`Entity 'key' must not exceed ${x} characters.`,location:n.child(["key"])}),G.test(r)||t({message:"Entity `key` must contain only lowercase letters, numbers, and hyphens, and cannot start or end with a hyphen.",location:n.child(["key"])})}}});function P(e,t){const r=t.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join("")+e;return Object.values(s.t).includes(r)?r:e}function B(e,t){const n={};for(const[r,i]of Object.entries(t))if(_(r,i)){if(i.severity==="off")continue;n[r]={...q(e,r,i)}}else n[r]=i;return n}function M(e){const t={},n={};for(const[r,i]of Object.entries(e))if(_(r,i)){const a=i;$(a)?t[r]=a:n[r]=a}else n[r]=i;return{entityRules:t,apiRules:n}}function Y(e,t,n){if(!p.isPlainObject(n.parsed)||!p.isPlainObject(n.parsed.components))return null;const r=n.parsed.components,i="schemas"in r?r.schemas:void 0;if(!i||!(e in i))return null;const a=i[e];try{const y=JSON.parse(t);if(s.dequal(a,y))return a}catch{return null}return null}function _(e,t){return e.startsWith("rule/")&&p.isPlainObject(t)}function $(e){return Object.values(s.t).some(t=>e.subject.type===t)}function q(e,t,n){const r=P(n.subject.type,e),i=n.where?.map(a=>({...a,subject:{...a.subject,type:P(a.subject.type,e)}}));return{assertionId:t,subject:{...n.subject,type:r},assertions:n.assertions,...i&&{where:i},...n.message&&{message:n.message},...n.severity&&{severity:n.severity}}}async function N(e){const{document:t,entitySchema:n,entityDefaultSchema:r,severity:i,externalRefResolver:a=new o.BaseResolver,assertionConfig:y={}}=e,m={problems:[],specVersion:"entity",visitorsData:{}},{entityTypes:l,discriminatorResolver:g}=R(n,r),d=o.normalizeTypes(l);let f=d.Entity;if(Array.isArray(t.parsed))f=d.EntityFileArray;else if(p.isPlainObject(t.parsed)){const h=t.parsed[S];if(!h)f=d.Entity;else{const T=g?.(t.parsed,h);T&&typeof T=="string"&&d[T]&&(f=d[T])}}const E=s.Assertions(y),u=Array.isArray(E)?E.map(h=>({severity:i||"error",ruleId:"entity assertions",visitor:h})):[{severity:i||"error",ruleId:"entity assertions",visitor:E}],C=[{severity:i||"error",ruleId:"entity struct",visitor:s.Struct()},{severity:i||"error",ruleId:"entity no-unresolved-refs",visitor:s.NoUnresolvedRefs()},{severity:i||"error",ruleId:"entity key-valid",visitor:U()},...u],D=s.normalizeVisitors(C,d),F=await o.resolveDocument({rootDocument:t,rootType:f,externalRefResolver:a});return s.walkDocument({document:t,rootType:f,normalizedVisitors:D,resolvedRefMap:F,ctx:m}),m.problems}async function A(e,t,n){if(!t.rules)throw new Error(`Scorecard level "${t.name}" has no rules defined.`);const r=new o.BaseResolver,i=o.makeDocumentFromString(JSON.stringify(e,null,2),"entity"),a=i.parsed[S],y=B(a||"unknown",t.rules),{entityRules:m,apiRules:l}=M(y),g=await N({document:i,entitySchema:s.Js,entityDefaultSchema:s.Ls,externalRefResolver:r,assertionConfig:m});if(v.includes(e.type)){if(Object.keys(l).length===0)return g;if(!n)throw new Error(`Document is required for entity type "${e.type}". Provide the source API document to lint API rules.`);if(e.type==="data-schema"&&e.metadata?.schema){Object.values(l).forEach(u=>{if(p.isPlainObject(u)&&p.isPlainObject(u.subject)&&u.subject.type!=="Schema")throw new Error(`API rules for "data-schema" entity must target Schema subject, but found "${u.subject.type}".`)});const f=Y(e.title,e.metadata.schema,n);if(!f)throw new Error(`Schema "${e.title}" not found in the document. Ensure the schema exists in components.schemas.`);const E=await I({schema:f,schemaKey:e.title,config:await s.createConfig({rules:l}),specType:e.metadata.specType,sourceDocument:n,externalRefResolver:r});return[...g,...E]}const d=await s.lintDocument({document:n,externalRefResolver:r,config:await s.createConfig({rules:l})});return[...g,...d]}else if(!s.isEmptyObject(l))throw new Error(`API rules are not supported for entity type "${e.type}". Only ${v.join(", ")} support API rules.`);return g}async function I(e){const{schema:t,schemaKey:n,config:r,sourceDocument:i,specType:a,externalRefResolver:y=new o.BaseResolver(r.resolve)}=e,m=i.parsed,l=m[a],g=m.info,d=o.makeDocumentFromString(JSON.stringify({[a]:l,info:g,components:{schemas:{[n]:t}}},null,2),i?.source.absoluteRef||`schema:${n}`);return(await s.lintDocument({document:d,config:r,externalRefResolver:y})).filter(E=>E.location.some(u=>u.pointer?.includes(`/components/schemas/${n}`)))}class J extends Error{}exports.isPlainObject=p.isPlainObject;exports.Arazzo1Types=s.Arazzo1Types;exports.Arazzo1_1Types=s.Arazzo1_1Types;exports.AsyncApi2Types=s.AsyncApi2Types;exports.AsyncApi3Types=s.AsyncApi3Types;exports.CONFIG_BUNDLER_VISITOR_ID=s.CONFIG_BUNDLER_VISITOR_ID;exports.CONFIG_FILE_NAME=s.CONFIG_FILE_NAME;exports.Config=s.Config;exports.ConfigTypes=s.ConfigTypes;exports.ConfigValidationError=s.ConfigValidationError;exports.DEFAULT_CONFIG=s.DEFAULT_CONFIG;exports.DEFAULT_PROJECT_PLUGIN_PATHS=s.DEFAULT_PROJECT_PLUGIN_PATHS;exports.IGNORE_BANNER=s.IGNORE_BANNER;exports.IGNORE_FILE=s.IGNORE_FILE;exports.Oas2Types=s.Oas2Types;exports.Oas3Types=s.Oas3Types;exports.Oas3_1Types=s.Oas3_1Types;exports.Oas3_2Types=s.Oas3_2Types;exports.OpenRpcTypes=s.OpenRpcTypes;exports.Overlay1Types=s.Overlay1Types;exports.PLUGINS_COLLECTOR_VISITOR_ID=s.PLUGINS_COLLECTOR_VISITOR_ID;exports.bundle=s.bundle;exports.bundleDocument=s.bundleDocument;exports.bundleFromString=s.bundleFromString;exports.clearPluginsCache=s.clearPluginsCache;exports.createConfig=s.createConfig;exports.createConfigTypes=s.createConfigTypes;exports.dequal=s.dequal;exports.detectSpec=s.detectSpec;exports.findConfig=s.findConfig;exports.formatProblems=s.formatProblems;exports.getAstNodeByPointer=s.getAstNodeByPointer;exports.getCodeframe=s.getCodeframe;exports.getLineColLocation=s.getLineColLocation;exports.getMajorSpecVersion=s.getMajorSpecVersion;exports.getPluginCacheVersion=s.getPluginCacheVersion;exports.getTotals=s.getTotals;exports.getTypes=s.getTypes;exports.isEmptyObject=s.isEmptyObject;exports.isNotEmptyArray=s.isNotEmptyArray;exports.isString=s.isString;exports.keysOf=s.keysOf;exports.lint=s.lint;exports.lintConfig=s.lintConfig;exports.lintDocument=s.lintDocument;exports.lintFromString=s.lintFromString;exports.loadConfig=s.loadConfig;exports.loadIgnoreConfig=s.loadIgnoreConfig;exports.logger=s.logger;exports.mapTypeToComponent=s.mapTypeToComponent;exports.normalizeVisitors=s.normalizeVisitors;exports.pluralize=s.pluralize;exports.regexFromString=s.regexFromString;exports.resolvePlugins=s.resolvePlugins;exports.slash=s.slash;exports.validate=s.lint;exports.walkDocument=s.walkDocument;exports.xmlEscape=s.xmlEscape;exports.BaseResolver=o.BaseResolver;exports.ResolveError=o.ResolveError;exports.Source=o.Source;exports.YamlParseError=o.YamlParseError;exports.escapePointerFragment=o.escapePointerFragment;exports.getDir=o.getDir;exports.isAbsoluteUrl=o.isAbsoluteUrl;exports.isBrowser=o.isBrowser;exports.isGraphqlRef=o.isGraphqlRef;exports.isMappingRef=o.isMappingRef;exports.isRef=o.isRef;exports.isSupportedExtension=o.isSupportedExtension;exports.isTruthy=o.isTruthy;exports.makeDocumentFromString=o.makeDocumentFromString;exports.normalizeTypes=o.normalizeTypes;exports.parseYaml=o.parseYaml;exports.readFileFromUrl=o.readFileFromUrl;exports.resolveDocument=o.resolveDocument;exports.resolvePath=o.resolvePath;exports.stringifyYaml=o.stringifyYaml;exports.unescapePointerFragment=o.unescapePointerFragment;exports.HandledError=J;exports.StatsAsync2=z;exports.StatsAsync3=V;exports.StatsOAS=w;exports.createEntityTypes=R;exports.doesYamlFileExist=j;exports.isNotEmptyObject=k;exports.lintEntityFile=N;exports.lintEntityWithScorecardLevel=A;exports.lintSchema=I;exports.pause=L;
@@ -1,4 +0,0 @@
1
- "use strict";const d="Something went wrong, please, try again.";function h(r){return r&&r.replace(/=+$/,"")}function m(r,e){return!!r&&!!e&&h(r)===h(e)}const w={invalid_request:"The request is missing a required parameter, includes an unsupported parameter value (other than grant type), repeats a parameter, includes multiple credentials, utilizes more than one mechanism for authenticating the client, or is otherwise malformed.",invalid_client:"Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method).",invalid_grant:"The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.",unauthorized_client:"The authenticated client is not authorized to use this authorization grant type.",unsupported_grant_type:"The authorization grant type is not supported by the authorization server.",invalid_scope:"The requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner.",unsupported_response_type:"The requested response type is not supported by the authorization server.",access_denied:"The resource owner or authorization server denied the request.",server_error:"The authorization server encountered an unexpected condition.",temporarily_unavailable:"The authorization server is currently unable to handle the request due to a temporary overloading or maintenance."};class n extends Error{error;error_description;constructor({message:e,error:t,error_description:i}){const o=i||t&&w[t]||t||e||d;super(o),this.name="OAuth2Error",this.error=t,this.error_description=i}static fromJsonData(e){return e.error&&typeof e.error=="object"?new n({message:e.error.message}):new n({error:e.error,error_description:e.error_description})}static fromTextData(e){return new n({message:e})}static fromError(e){return new n({error:e.message})}}function y(r,e){let t;const i=e?new URL(e):window.location;if(/code|token|error/.test(i.hash)?t=i.hash.substring(1):t=i.search.substring(1),!t)throw console.error("No query string in OAuth 2 redirect URL"),new n({message:d});const o=new URLSearchParams(t),s=o.get("access_token"),a=o.get("code"),c=o.get("token_type"),l=o.get("expires_in"),p=o.get("state"),u=o.get("error"),g=o.get("error_description");if(u)throw new n({error:u,error_description:g??void 0});if(!m(p,r?.state))throw new Error("Outdated OAuth2 state");if(r?.flow==="implicit"){if(!s)throw new Error(`Your OAuth2 authentication service provider redirected you without an "access_token".
2
- Please, try again or make sure your OAuth2 settings are correct.`);if(!c)throw new Error(`Your OAuth2 authentication service provider redirected you without a "token_type".
3
- Please, try again or make sure your OAuth2 settings are correct.`);r?.successCallback({access_token:s,token_type:c,expires_in:l,auth_code:""})}if(r?.flow==="authorizationCode"){if(!a)throw new Error(`Your OAuth2 authentication service provider redirected you without authorization "code".
4
- Please, try again or make sure your OAuth2 settings are correct.`);r?.successCallback({auth_code:a,access_token:"",token_type:"bearer"})}}exports.OAuth2Error=n;exports.handleOAuth2Redirect=y;