@redocly/replay 0.28.0-next.7 → 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.
Files changed (69) hide show
  1. package/dist/{replay-AiChatProvider-Dib77evR.js → replay-AiChatProvider-B_f9Wn8a.js} +1 -1
  2. package/dist/{replay-AiChatProvider-CL61KEj-.js → replay-AiChatProvider-DuTK5g1N.js} +41 -41
  3. package/dist/{replay-AiChatSqliteDBStorage-CAB-uQ_2.js → replay-AiChatSqliteDBStorage-CHfMo6M6.js} +1 -1
  4. package/dist/{replay-AiChatSqliteDBStorage-BmHRaty6.js → replay-AiChatSqliteDBStorage-cXsRIQfJ.js} +6 -6
  5. package/dist/{replay-AiPanel-CKf0GTch.js → replay-AiPanel-CGbGwIMX.js} +35 -35
  6. package/dist/{replay-AiPanel-Co-SG9hy.js → replay-AiPanel-C_C52r20.js} +1 -1
  7. package/dist/replay-FileWatcher-DEOB0_DG.js +1 -0
  8. package/dist/{replay-FileWatcher-BpncVTHg.js → replay-FileWatcher-Z6eygcBI.js} +4 -5
  9. package/dist/{replay-HistorySqliteDBStorage-CtF6-vY8.js → replay-HistorySqliteDBStorage-Bi5vBQ2T.js} +2 -2
  10. package/dist/{replay-SemanticSearchService-B_97hbQZ.js → replay-SemanticSearchService-BLF1oOOu.js} +8 -12
  11. package/dist/replay-SemanticSearchService-DTc0oxN4.js +1 -0
  12. package/dist/{replay-SqliteDBStorage-BYAD4Hdr.js → replay-SqliteDBStorage-B_kyJ0a3.js} +1 -1
  13. package/dist/{replay-SqliteDBStorage-C4jv_awl.js → replay-SqliteDBStorage-DF9kKplR.js} +49 -49
  14. package/dist/{replay-StepContextSqliteDBStorage-BfAAKDwA.js → replay-StepContextSqliteDBStorage-BkB2NM27.js} +2 -2
  15. package/dist/{replay-TauriFileSystemAdapter-DNp7rTwA.js → replay-TauriFileSystemAdapter-CwSMakdJ.js} +1 -1
  16. package/dist/{replay-TauriFileSystemAdapter-dRydQRfd.js → replay-TauriFileSystemAdapter-DcFBYSUW.js} +8 -8
  17. package/dist/{replay-TauriRootStorage-TvtzeQ9x.js → replay-TauriRootStorage-DEGEIJrz.js} +1 -1
  18. package/dist/{replay-TauriRootStorage-BUSjQzb0.js → replay-TauriRootStorage-Den8gI4S.js} +85 -85
  19. package/dist/{replay-agent-loop-Bv3OEM5Y.js → replay-agent-loop-B8Mjb8DU.js} +9 -9
  20. package/dist/{replay-agent-loop-FONgy9Lo.js → replay-agent-loop-Z_nrrmg_.js} +1 -1
  21. package/dist/{replay-ai-chat-mappers-Kj9YEXwF.js → replay-ai-chat-mappers-D7e8buTk.js} +3 -3
  22. package/dist/{replay-ai-chat-mappers-CknwkJ22.js → replay-ai-chat-mappers-aJ_VMb6Z.js} +1 -1
  23. package/dist/{replay-ai-message-parts.schema-E9u9-nqr.js → replay-ai-message-parts.schema-DKLf0SiG.js} +1 -1
  24. package/dist/{replay-create-model-DgfhU1ps.js → replay-create-model-Be3vPVDb.js} +3 -3
  25. package/dist/{replay-create-model-Bq8Fl5Ai.js → replay-create-model-Bw20x80b.js} +3 -3
  26. package/dist/{replay-db-DjHsvWMQ.js → replay-db-BQXljNM0.js} +1 -1
  27. package/dist/{replay-db-D3MZ3YVw.js → replay-db-BmZNrdZM.js} +5 -5
  28. package/dist/{replay-external-resolver-DgcgzfRI.js → replay-external-resolver-BLzbbtnT.js} +1 -1
  29. package/dist/{replay-external-resolver-SsE1pZoq.js → replay-external-resolver-BQvSDNfH.js} +7 -7
  30. package/dist/{replay-history.schema-5ce6X0R1.js → replay-history.schema-B0lLwmdG.js} +3 -3
  31. package/dist/{replay-index-l3GM4sbc.js → replay-index-B-uZhXHj.js} +1 -1
  32. package/dist/{replay-index-B-Z3hRlH.js → replay-index-BCz452N6.js} +16025 -15956
  33. package/dist/{replay-index-DzrZDRUX.js → replay-index-C0kvTxxm.js} +38 -38
  34. package/dist/{replay-index-eABpOyfi.js → replay-index-C7y4K4Cr.js} +1 -1
  35. package/dist/replay-index-DAIwC3ls.js +1 -0
  36. package/dist/{replay-index-AEsPADo_.js → replay-index-DYtXcqDk.js} +1014 -1010
  37. package/dist/replay-index-gM6vL6iT.js +4 -0
  38. package/dist/{replay-index-BJ5jmb2F.js → replay-index-wBHsAQEV.js} +1 -1
  39. package/dist/{replay-indexes-CfsvVMi_.js → replay-indexes-B3PJtgeh.js} +43 -43
  40. package/dist/replay-lint-BzkTeXqI.js +177 -0
  41. package/dist/{replay-lint-BHwuW5sm.js → replay-lint-CqDMOMQt.js} +11038 -10749
  42. package/dist/{replay-lint-graphql-taKxgtqM.js → replay-lint-graphql-BDBGJSir.js} +1 -1
  43. package/dist/{replay-lint-graphql-CcbpryHy.js → replay-lint-graphql-BZF2eLiZ.js} +1 -1
  44. package/dist/replay-periodic-revalidation-C7SkB1vs.js +1 -0
  45. package/dist/{replay-periodic-revalidation-CEMQo8s1.js → replay-periodic-revalidation-orCv_JoF.js} +4 -5
  46. package/dist/{replay-resolve-DJdvx14A.js → replay-resolve-0e5f8I7b.js} +18 -18
  47. package/dist/{replay-resolve-CSzH6SDp.js → replay-resolve-DZMWoig2.js} +176 -176
  48. package/dist/replay-respect-run-CLW3wGhx.js +8392 -0
  49. package/dist/replay-respect-run-ChP63WzG.js +82 -0
  50. package/dist/replay-step-context.schema-BOprzd6Z.js +21 -0
  51. package/dist/{replay-tauri-path-D_hXMLdc.js → replay-tauri-path-DBt1dqkG.js} +1 -1
  52. package/dist/replay-tauri-path-DvLF4Z8f.js +22 -0
  53. package/dist/{replay-useAiChatQueries-DVCG23XB.js → replay-useAiChatQueries-Bypgnkwa.js} +2 -2
  54. package/dist/{replay-useAiChatQueries-DFd8ZJQG.js → replay-useAiChatQueries-S6v5duiJ.js} +131 -137
  55. package/dist/{replay-validate-key-fIEjvAUc.js → replay-validate-key-CMJODIH6.js} +2 -2
  56. package/dist/{replay-validate-key-qqV8ZWzl.js → replay-validate-key-CNl7BV_v.js} +1 -1
  57. package/dist/replay.cjs +1 -1
  58. package/dist/replay.js +10 -10
  59. package/package.json +4 -4
  60. package/dist/replay-FileWatcher-BpsHu7xD.js +0 -1
  61. package/dist/replay-SemanticSearchService-B9YYS_s4.js +0 -1
  62. package/dist/replay-index-B3h5Szid.js +0 -25
  63. package/dist/replay-index-C04sCExL.js +0 -1
  64. package/dist/replay-lint-7nMI-JAv.js +0 -177
  65. package/dist/replay-periodic-revalidation-Cg2y1tgz.js +0 -1
  66. package/dist/replay-respect-run-DTUpcIOb.js +0 -78
  67. package/dist/replay-respect-run-gVY8_9EV.js +0 -8200
  68. package/dist/replay-step-context.schema-DBk4jufr.js +0 -21
  69. package/dist/replay-tauri-path-C-oZvov6.js +0 -22
@@ -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-AEsPADo_.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-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-AEsPADo_.js"),m=require("./replay-db-DjHsvWMQ.js"),n=require("./replay-create-model-Bq8Fl5Ai.js"),A=require("./replay-SemanticSearchService-B9YYS_s4.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,`
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()});n.objectType({collectionId:n.stringType().min(1).describe("Target collection id."),workflowId:n.stringType().min(1).describe("Target workflow id."),stepId:n.stringType().min(1).describe("Target step id.")});const 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+=`
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