@redocly/replay 0.27.0-next.5 → 0.27.0-next.7

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 (52) hide show
  1. package/dist/{replay-AiChatProvider-CVvR1kSd.js → replay-AiChatProvider-Dub7iVgM.js} +273 -271
  2. package/dist/replay-AiChatProvider-e4PWUCRp.js +6 -0
  3. package/dist/{replay-AiChatSqliteDBStorage-DVJ9f2EK.js → replay-AiChatSqliteDBStorage-CpjwxLnF.js} +1 -1
  4. package/dist/{replay-AiChatSqliteDBStorage-BFHRKFlk.js → replay-AiChatSqliteDBStorage-DbxNU-ot.js} +1 -1
  5. package/dist/replay-AiPanel-B_zDmo55.js +868 -0
  6. package/dist/{replay-AiPanel-CynVcVmm.js → replay-AiPanel-DuRA2zAt.js} +1226 -1114
  7. package/dist/{replay-SqliteDBStorage-eRBPh4E8.js → replay-SqliteDBStorage-BrNleq7S.js} +1 -1
  8. package/dist/{replay-SqliteDBStorage-CSz7NYH4.js → replay-SqliteDBStorage-CafBNNLB.js} +1 -1
  9. package/dist/{replay-agent-loop-CEZz1kj-.js → replay-agent-loop-CV0s4022.js} +48 -48
  10. package/dist/{replay-agent-loop-C60p47KY.js → replay-agent-loop-CzV79Gr1.js} +1 -1
  11. package/dist/{replay-ai-chat-mappers-BAHU6JIc.js → replay-ai-chat-mappers-BNsR30dS.js} +1 -1
  12. package/dist/{replay-ai-chat-mappers-Dqg-QVZy.js → replay-ai-chat-mappers-BWeZN6p_.js} +1 -1
  13. package/dist/{replay-create-model-C2NQtDcL.js → replay-create-model-CEDEaJC8.js} +3 -3
  14. package/dist/{replay-create-model-CUL-l-eX.js → replay-create-model-CmRk68RD.js} +2 -2
  15. package/dist/{replay-db-C4jAfGtc.js → replay-db-BfSnfWcb.js} +8 -8
  16. package/dist/{replay-db-Dw-X2WGx.js → replay-db-CM8OLcFK.js} +21 -21
  17. package/dist/{replay-external-resolver-DAkLV0nr.js → replay-external-resolver-G86hjAvS.js} +2 -2
  18. package/dist/{replay-external-resolver-DN_PWq_2.js → replay-external-resolver-bdSEZsNk.js} +1 -1
  19. package/dist/{replay-index-BmX1FPBL.js → replay-index-BmotNqNI.js} +1170 -1148
  20. package/dist/replay-index-Bsag-eKM.js +1 -0
  21. package/dist/replay-index-C6SJPGDO.js +23 -0
  22. package/dist/replay-index-CUs62_1f.js +1 -0
  23. package/dist/{replay-index-rRWvC2pp.js → replay-index-C_eJVbPZ.js} +1 -1
  24. package/dist/{replay-index-O_Pq5an3.js → replay-index-Cd9LaUVx.js} +23380 -22731
  25. package/dist/{replay-index-m00jnWFr.js → replay-index-D58Mg6_y.js} +1 -1
  26. package/dist/{replay-index-DR1uVBvc.js → replay-index-DYtNY0OY.js} +42 -41
  27. package/dist/replay-lint-CxwKILeF.js +184 -0
  28. package/dist/{replay-lint-CcVVykW7.js → replay-lint-YfaLafO6.js} +8246 -8047
  29. package/dist/{replay-lint-graphql-DlD7bblx.js → replay-lint-graphql-BRrk1UK5.js} +1 -1
  30. package/dist/{replay-lint-graphql-5cGt2KR_.js → replay-lint-graphql-GtbZklco.js} +1 -1
  31. package/dist/replay-resolve-Bza6lozO.js +47 -0
  32. package/dist/{replay-resolve-Ca3DUbGq.js → replay-resolve-Rb3XjiUd.js} +919 -908
  33. package/dist/{replay-respect-run-eSRzH2dk.js → replay-respect-run-BB0VXCz-.js} +1605 -1555
  34. package/dist/replay-respect-run-Pkoy4Q3P.js +78 -0
  35. package/dist/{replay-tauri-path-C-oxFOHe.js → replay-tauri-path-B8tT4cGY.js} +2 -2
  36. package/dist/{replay-tauri-path-CKcvIl_h.js → replay-tauri-path-yOFqWleH.js} +1 -1
  37. package/dist/{replay-useAiChatQueries-CVTxcu2Z.js → replay-useAiChatQueries-1fqZwVTj.js} +71 -48
  38. package/dist/{replay-useAiChatQueries-vdKvbmp2.js → replay-useAiChatQueries-B7ZcWDmG.js} +1111 -990
  39. package/dist/{replay-validate-key-VkgZoK1f.js → replay-validate-key-C8-nF61w.js} +1 -1
  40. package/dist/{replay-validate-key-CwIopif3.js → replay-validate-key-qJOuAQJK.js} +2 -2
  41. package/dist/replay.cjs +1 -1
  42. package/dist/replay.d.ts +35 -5
  43. package/dist/replay.js +10 -10
  44. package/package.json +4 -4
  45. package/dist/replay-AiChatProvider-BGXsZqW2.js +0 -6
  46. package/dist/replay-AiPanel-qVp_s4gD.js +0 -849
  47. package/dist/replay-index-DSKZHOXq.js +0 -1
  48. package/dist/replay-index-DT5gdiBA.js +0 -21
  49. package/dist/replay-index-qZlgEmbq.js +0 -1
  50. package/dist/replay-lint-ON47l7Vu.js +0 -184
  51. package/dist/replay-resolve-BTzo-fSv.js +0 -47
  52. package/dist/replay-respect-run-BtC2agF9.js +0 -78
@@ -1,14 +1,14 @@
1
- import { useContext as _t, createContext as $t } from "react";
2
- import { R as xt, C as se, $ as z, a0 as Rt, a1 as Je, a2 as qt, b as C, Q as L, a3 as Qe, a4 as de, P as ue, a5 as Xe, a6 as pe, a7 as fe, a8 as Pt, a9 as j, aa as me, ab as Ze, ac as et, ad as he, ae as Nt, af as Ut, ag as Dt, I as Lt, ah as Mt, ai as tt, aj as ot, ak as Wt, al as Q, am as Ft, T as nt, H as rt, an as jt, F as Bt, ao as Oe, ap as Yt, aq as zt, ar as Ae, as as Gt, at as Ht, N as v, au as Ee, av as Vt, aw as _e, ax as Kt, ay as Jt, az as Qt, A as st, a as at } from "./replay-index-O_Pq5an3.js";
3
- import { b, f as it, a as ct, c as lt, d as X, e as dt, i as $e, h as Ie, R as M, j as Xt, k as Zt, p as eo, s as xe, l as to } from "./replay-db-Dw-X2WGx.js";
4
- import { b as oo, o as no, d as ro, e as u, u as Z, f as c, h as x, j as T, n as O, k as D, m as h, q as k, r as we, t as ee, v as te, Z as W, w as so, x as Re, c as ao, s as io, y as co } from "./replay-create-model-C2NQtDcL.js";
1
+ import { useContext as Et, createContext as xt } from "react";
2
+ import { R as $t, E as se, a1 as H, a2 as Rt, a3 as _t, a4 as qt, b as O, U as D, a5 as Je, a6 as de, Q as ue, a7 as Qe, a8 as pe, a9 as fe, aa as Pt, ab as j, ac as me, ad as Xe, ae as Ze, af as he, ag as Nt, ah as Ut, ai as Dt, I as Lt, aj as Wt, ak as et, al as tt, am as Mt, J as X, an as Ft, T as ot, H as nt, ao as jt, Y as Bt, ap as Oe, aq as Yt, ar as zt, as as Ae, at as Ht, au as Gt, O as g, av as Ee, aw as Vt, ax as xe, ay as Kt, az as Jt, aA as Qt, A as rt, a as st } from "./replay-index-Cd9LaUVx.js";
3
+ import { b as k, f as at, a as it, c as ct, d as Z, e as lt, i as $e, h as we, R as L, j as Xt, k as Zt, p as eo, s as Re, l as to } from "./replay-db-CM8OLcFK.js";
4
+ import { b as oo, o as no, d as ro, e as p, u as ee, f as c, h as x, j as S, n as T, k as U, m as w, q as b, r as Ie, t as B, v as te, Z as W, w as so, x as _e, c as ao, s as io, y as co } from "./replay-create-model-CEDEaJC8.js";
5
5
  import { useInfiniteQuery as lo, useQuery as uo } from "@tanstack/react-query";
6
6
  const G = {
7
7
  path: "pathParameters",
8
8
  query: "queryParameters",
9
9
  header: "headers",
10
10
  cookie: "cookies"
11
- }, vi = {
11
+ }, $i = {
12
12
  run_request: {
13
13
  approveLabel: "Run",
14
14
  denyLabel: "Skip"
@@ -21,7 +21,7 @@ const G = {
21
21
  approveLabel: "Apply",
22
22
  denyLabel: "Dismiss"
23
23
  }
24
- }, gi = {
24
+ }, Ri = {
25
25
  set_active_environment: { approveLabel: "Switch", denyLabel: "Cancel" },
26
26
  add_environment: { approveLabel: "Add", denyLabel: "Cancel" },
27
27
  upsert_input: { approveLabel: "Set", denyLabel: "Cancel" },
@@ -35,29 +35,29 @@ const G = {
35
35
  delete_workflow: { approveLabel: "Delete", denyLabel: "Cancel" },
36
36
  delete_step: { approveLabel: "Delete", denyLabel: "Cancel" },
37
37
  save_tab_to_collection: { approveLabel: "Save", denyLabel: "Cancel" }
38
- }, bi = {
38
+ }, _i = {
39
39
  CHAT: "chat",
40
40
  HISTORY: "history"
41
- }, po = "report_status", Y = {
41
+ }, po = "report_status", fo = "run_workflow", z = {
42
42
  WEB_SEARCH: "web_search"
43
43
  };
44
- function fo(e) {
44
+ function mo(e) {
45
45
  switch (e.provider) {
46
46
  case se.GEMINI:
47
47
  return {
48
- [Y.WEB_SEARCH]: ro.tools.googleSearch({})
48
+ [z.WEB_SEARCH]: ro.tools.googleSearch({})
49
49
  };
50
50
  case se.OPENAI:
51
51
  return {
52
- [Y.WEB_SEARCH]: no.tools.webSearch({})
52
+ [z.WEB_SEARCH]: no.tools.webSearch({})
53
53
  };
54
54
  case se.ANTHROPIC:
55
55
  return {
56
- [Y.WEB_SEARCH]: oo.tools.webFetch_20250910()
56
+ [z.WEB_SEARCH]: oo.tools.webFetch_20250910()
57
57
  };
58
- case xt:
58
+ case $t:
59
59
  return {
60
- [Y.WEB_SEARCH]: {
60
+ [z.WEB_SEARCH]: {
61
61
  type: "provider",
62
62
  id: "reunite.web_search",
63
63
  name: "web_search",
@@ -68,10 +68,10 @@ function fo(e) {
68
68
  return {};
69
69
  }
70
70
  }
71
- const mo = ["info", "workflows", "sourceDescriptions"];
72
- function ho(e) {
71
+ const ho = ["info", "workflows", "sourceDescriptions"];
72
+ function wo(e) {
73
73
  const t = [];
74
- 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}`), b(t, `
74
+ 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}`), k(t, `
75
75
  `);
76
76
  }
77
77
  function Io(e) {
@@ -81,39 +81,39 @@ function Io(e) {
81
81
  for (const o of e.collection.workflows)
82
82
  t.push(` workflowId=${o.workflowId} ${o.summary ?? ""}`);
83
83
  }
84
- return b(t, `
84
+ return k(t, `
85
85
  `);
86
86
  }
87
- function wo(e) {
87
+ function yo(e) {
88
88
  const t = [];
89
89
  if (e.collection?.sourceDescriptions?.length) {
90
90
  t.push("Source descriptions:");
91
91
  for (const o of e.collection.sourceDescriptions)
92
92
  t.push(` name=${o.name} url=${o.url}`);
93
93
  }
94
- return b(t, `
94
+ return k(t, `
95
95
  `);
96
96
  }
97
- function yo(e, t) {
97
+ function vo(e, t) {
98
98
  const o = ["Current tab (collection)"];
99
99
  for (const n of t)
100
100
  switch (n) {
101
101
  case "info":
102
- o.push(ho(e));
102
+ o.push(wo(e));
103
103
  break;
104
104
  case "workflows":
105
105
  o.push(Io(e));
106
106
  break;
107
107
  case "sourceDescriptions":
108
- o.push(wo(e));
108
+ o.push(yo(e));
109
109
  break;
110
110
  }
111
- return b(o, `
111
+ return k(o, `
112
112
 
113
113
  `);
114
114
  }
115
- function vo(e, t) {
116
- return b(
115
+ function go(e, t) {
116
+ return k(
117
117
  [
118
118
  e.collectionId ? `Collection ID: ${e.collectionId}` : null,
119
119
  t.includes("title") && e.title ? `Title: ${e.title}` : null,
@@ -123,8 +123,8 @@ function vo(e, t) {
123
123
  `
124
124
  );
125
125
  }
126
- function go(e, t) {
127
- return b(
126
+ function bo(e, t) {
127
+ return k(
128
128
  [
129
129
  t.includes("title") ? e.title : null,
130
130
  e.apiId ? `API ID: ${e.apiId}` : null,
@@ -133,16 +133,16 @@ function go(e, t) {
133
133
  t.includes("method") && e.method ? `Method: ${e.method}` : null,
134
134
  t.includes("operationId") && e.operationId ? `Operation ID: ${e.operationId}` : null,
135
135
  t.includes("requestBody") && e.requestBodySchema ? `Request body schema: ${e.requestBodySchema}` : null,
136
- t.includes("parameters") && e.parameterDetails ? `Parameter details: ${it(e.parameterDetails)}` : null,
137
- t.includes("security") && e.relatedSecuritySchemes ? `Security schemes: ${ct(e.relatedSecuritySchemes)}` : null,
136
+ t.includes("parameters") && e.parameterDetails ? `Parameter details: ${at(e.parameterDetails)}` : null,
137
+ t.includes("security") && e.relatedSecuritySchemes ? `Security schemes: ${it(e.relatedSecuritySchemes)}` : null,
138
138
  t.includes("tags") && e.tags ? `Tags: ${e.tags.join("; ")}` : null,
139
- t.includes("responses") && e.responseSchemas ? `Responses: ${lt(e.responseSchemas)}` : null
139
+ t.includes("responses") && e.responseSchemas ? `Responses: ${ct(e.responseSchemas)}` : null
140
140
  ],
141
141
  `
142
142
  `
143
143
  );
144
144
  }
145
- const bo = [
145
+ const ko = [
146
146
  "info",
147
147
  "inputs",
148
148
  "parameters",
@@ -151,79 +151,79 @@ const bo = [
151
151
  "steps",
152
152
  "wiring"
153
153
  ];
154
- function ko(e) {
154
+ function So(e) {
155
155
  return !e.inputs || Object.keys(e.inputs).length === 0 ? null : `Workflow inputs (JSON Schema):
156
156
  ${JSON.stringify(e.inputs, null, 2)}`;
157
157
  }
158
- function So(e) {
158
+ function To(e) {
159
159
  return e.outputs?.length ? `Workflow outputs:
160
160
  ${e.outputs.map(
161
161
  (t) => ` id=${t.id} key=${t.key} value=${t.value} active=${t.active}`
162
162
  ).join(`
163
163
  `)}` : null;
164
164
  }
165
- function ut(e) {
165
+ function dt(e) {
166
166
  return e.operation ? ` apiId=${e.operation.apiId} method=${e.operation.method} path=${e.operation.path}` : e.xOperation ? ` method=${e.xOperation.method} path=${e.xOperation.url}` : "";
167
167
  }
168
- function To(e) {
168
+ function Co(e) {
169
169
  return e.steps?.length ? `Steps:
170
170
  ${e.steps.map(
171
- (t) => ` stepId=${t.stepId} ${ut(t)}`
171
+ (t) => ` stepId=${t.stepId} ${dt(t)}`
172
172
  ).join(`
173
173
  `)}` : null;
174
174
  }
175
- function Co(e) {
175
+ function Oo(e) {
176
176
  return e.steps?.length ? `Step wiring (security + outputs per step):
177
177
  ${e.steps.map((o) => {
178
- const n = [` stepId=${o.stepId}${ut(o)}`], r = X(o.security);
178
+ const n = [` stepId=${o.stepId}${dt(o)}`], r = Z(o.security);
179
179
  r && n.push($e(r, " "));
180
- const s = Ie(o.outputs);
180
+ const s = we(o.outputs);
181
181
  return s && n.push($e(s, " ")), n.join(`
182
182
  `);
183
183
  }).join(`
184
184
  `)}` : null;
185
185
  }
186
- function Oo(e, t) {
186
+ function Ao(e, t) {
187
187
  switch (t) {
188
188
  case "inputs":
189
- return ko(e);
189
+ return So(e);
190
190
  case "parameters":
191
- return dt(e.parameters);
191
+ return lt(e.parameters);
192
192
  case "security":
193
- return X(e.security);
193
+ return Z(e.security);
194
194
  case "outputs":
195
- return So(e);
196
- case "steps":
197
195
  return To(e);
198
- case "wiring":
196
+ case "steps":
199
197
  return Co(e);
198
+ case "wiring":
199
+ return Oo(e);
200
200
  default:
201
201
  return null;
202
202
  }
203
203
  }
204
- function Ao(e) {
204
+ function Eo(e) {
205
205
  const t = [];
206
- return e.collectionId && t.push(`Collection ID: ${e.collectionId}`), e.workflowId && t.push(`Workflow ID: ${e.workflowId}`), e.workflow?.summary && t.push(`Summary: ${e.workflow.summary}`), e.workflow?.description && t.push(`Description: ${e.workflow.description}`), b(t, `
206
+ return e.collectionId && t.push(`Collection ID: ${e.collectionId}`), e.workflowId && t.push(`Workflow ID: ${e.workflowId}`), e.workflow?.summary && t.push(`Summary: ${e.workflow.summary}`), e.workflow?.description && t.push(`Description: ${e.workflow.description}`), k(t, `
207
207
  `);
208
208
  }
209
- function Eo(e, t) {
209
+ function xo(e, t) {
210
210
  const o = ["Current tab (workflow)"], n = e.workflow;
211
211
  for (const r of t) {
212
212
  if (r === "info") {
213
- o.push(Ao(e));
213
+ o.push(Eo(e));
214
214
  continue;
215
215
  }
216
216
  if (!n)
217
217
  continue;
218
- const s = Oo(n, r);
218
+ const s = Ao(n, r);
219
219
  s && o.push(s);
220
220
  }
221
- return b(o, `
221
+ return k(o, `
222
222
 
223
223
  `);
224
224
  }
225
- function _o(e, t) {
226
- return b(
225
+ function $o(e, t) {
226
+ return k(
227
227
  [
228
228
  e.collectionId ? `Collection ID: ${e.collectionId}` : null,
229
229
  e.workflowId ? `Workflow ID: ${e.workflowId}` : null,
@@ -234,7 +234,7 @@ function _o(e, t) {
234
234
  `
235
235
  );
236
236
  }
237
- const $o = [
237
+ const Ro = [
238
238
  "info",
239
239
  "parameters",
240
240
  "requestBody",
@@ -243,64 +243,64 @@ const $o = [
243
243
  "successCriteria",
244
244
  "response"
245
245
  ];
246
- function xo(e) {
246
+ function _o(e) {
247
247
  const t = [
248
248
  `apiId: ${e.apiId}`,
249
249
  `method: ${e.method}`,
250
250
  `path: ${e.path}`,
251
251
  e.operationId ? `operationId: ${e.operationId}` : null
252
252
  ];
253
- return `Step is connected to API (${b(t, ", ")})`;
253
+ return `Step is connected to API (${k(t, ", ")})`;
254
254
  }
255
- function Ro(e) {
255
+ function qo(e) {
256
256
  const t = [`method: ${e.method}`, `url: ${e.url}`];
257
- return `Step is not connected to API (${b(t, ", ")})`;
257
+ return `Step is not connected to API (${k(t, ", ")})`;
258
258
  }
259
- function qo(e) {
259
+ function Po(e) {
260
260
  return e.description?.trim() ? `Description:
261
261
  ${e.description}` : null;
262
262
  }
263
- function Po(e, t) {
263
+ function No(e, t) {
264
264
  switch (t) {
265
265
  case "parameters":
266
- return dt(e.parameters) || null;
266
+ return lt(e.parameters) || null;
267
267
  case "requestBody":
268
268
  return Zt(e.requestBody) || null;
269
269
  case "security":
270
- return X(e.security) || null;
270
+ return Z(e.security) || null;
271
271
  case "outputs":
272
- return Ie(e.outputs) || null;
272
+ return we(e.outputs) || null;
273
273
  case "successCriteria":
274
274
  return Xt(e.successCriteria) || null;
275
275
  default:
276
276
  return null;
277
277
  }
278
278
  }
279
- function No(e) {
279
+ function Uo(e) {
280
280
  const t = [];
281
281
  e.collectionId && t.push(`Collection ID: ${e.collectionId}`), e.workflowId && t.push(`Workflow ID: ${e.workflowId}`), e.stepId && t.push(`Step ID: ${e.stepId}`), t.push(`Saved in collection: ${e.step ? "yes" : "no"}`);
282
282
  const o = e.draftStep ?? e.step;
283
283
  if (o) {
284
- if (t.push(qo(o)), o.operation) {
284
+ if (t.push(Po(o)), o.operation) {
285
285
  const n = o.operation;
286
- t.push(xo(n));
286
+ t.push(_o(n));
287
287
  } else if (o.xOperation) {
288
288
  const n = o.xOperation;
289
- t.push(Ro(n));
289
+ t.push(qo(n));
290
290
  }
291
291
  }
292
292
  return e.response && t.push(
293
293
  `Last response: status=${e.response.status} durationMs=${e.response.duration} size=${e.response.size}`
294
- ), e.requestError && t.push(`Request error: ${e.requestError}`), b(t, `
294
+ ), e.requestError && t.push(`Request error: ${e.requestError}`), k(t, `
295
295
  `);
296
296
  }
297
- function Uo(e) {
297
+ function Do(e) {
298
298
  if (!e.response) return null;
299
299
  const t = e.response, o = t.headers?.length ? t.headers.map((s) => ` ${s[0]}: ${s[1]}`) : [];
300
300
  let n = "";
301
301
  t.bodyNotStored ? n = " (body not stored)" : t.body && (n = `
302
302
  Body:
303
- ${t.body.length > M ? `${t.body.slice(0, M)}…` : t.body}`);
303
+ ${t.body.length > L ? `${t.body.slice(0, L)}…` : t.body}`);
304
304
  const r = [
305
305
  "Last response (full)",
306
306
  `status: ${t.status}`,
@@ -308,29 +308,29 @@ ${t.body.length > M ? `${t.body.slice(0, M)}…` : t.body}`);
308
308
  `durationMs: ${t.duration}`,
309
309
  `size: ${t.size}`,
310
310
  o.length > 0 ? `Headers:
311
- ${b(o, `
311
+ ${k(o, `
312
312
  `)}` : null,
313
313
  n || null
314
314
  ];
315
- return b(r, `
315
+ return k(r, `
316
316
  `);
317
317
  }
318
318
  function qe(e, t) {
319
319
  const o = [];
320
320
  for (const n of t) {
321
- const r = Po(e, n);
321
+ const r = No(e, n);
322
322
  r && o.push(r);
323
323
  }
324
324
  return o.length ? o.filter(Boolean).join(`
325
325
  `) : "";
326
326
  }
327
- function Do(e, t) {
327
+ function Lo(e, t) {
328
328
  const o = ["Current tab (step)"];
329
- return t.length === 0 ? null : (t.includes("info") && o.push(No(e)), e.draftStep ? o.push(qe(e.draftStep, t)) : e.step && o.push(qe(e.step, t)), t.includes("response") && o.push(Uo(e)), b(o, `
329
+ return t.length === 0 ? null : (t.includes("info") && o.push(Uo(e)), e.draftStep ? o.push(qe(e.draftStep, t)) : e.step && o.push(qe(e.step, t)), t.includes("response") && o.push(Do(e)), k(o, `
330
330
 
331
331
  `));
332
332
  }
333
- function Lo(e) {
333
+ function Wo(e) {
334
334
  return e?.trim() ? `Description:
335
335
  ${e}` : null;
336
336
  }
@@ -342,124 +342,124 @@ function Mo(e, t) {
342
342
  t.includes("path") ? `path: ${e.path}` : null,
343
343
  t.includes("operationId") && e.operationId ? `operationId: ${e.operationId}` : null
344
344
  ];
345
- return `Step is connected to API (${b(o, ", ")})`;
345
+ return `Step is connected to API (${k(o, ", ")})`;
346
346
  }
347
347
  if (e.path || e.method) {
348
348
  const o = [
349
349
  t.includes("method") && e.method ? `method: ${e.method}` : null,
350
350
  t.includes("path") && e.path ? `url: ${e.path}` : null
351
351
  ];
352
- return `Step is not connected to API (${b(o, ", ")})`;
352
+ return `Step is not connected to API (${k(o, ", ")})`;
353
353
  }
354
354
  return null;
355
355
  }
356
- function Wo(e, t) {
357
- return b(
356
+ function Fo(e, t) {
357
+ return k(
358
358
  [
359
359
  e.collectionId ? `Collection ID: ${e.collectionId}` : null,
360
360
  e.workflowId ? `Workflow ID: ${e.workflowId}` : null,
361
361
  e.stepId ? `Step ID: ${e.stepId}` : null,
362
- t.includes("description") ? Lo(e.description) : null,
362
+ t.includes("description") ? Wo(e.description) : null,
363
363
  Mo(e, t),
364
364
  t.includes("requestBody") && e.requestBodySchema ? `Request body schema: ${e.requestBodySchema}` : null,
365
- t.includes("parameters") && e.parameterDetails ? `Parameter details: ${it(e.parameterDetails)}` : null,
365
+ t.includes("parameters") && e.parameterDetails ? `Parameter details: ${at(e.parameterDetails)}` : null,
366
366
  t.includes("successCriteria") && e.successCriteria?.length ? `Success criteria: ${e.successCriteria.join("; ")}` : null,
367
367
  t.includes("tags") && e.tags ? `Tags: ${e.tags.join("; ")}` : null,
368
- t.includes("security") && e.relatedSecuritySchemes ? `Security schemes: ${ct(e.relatedSecuritySchemes)}` : null,
369
- t.includes("responses") && e.responseSchemas ? `Responses: ${lt(e.responseSchemas)}` : null
368
+ t.includes("security") && e.relatedSecuritySchemes ? `Security schemes: ${it(e.relatedSecuritySchemes)}` : null,
369
+ t.includes("responses") && e.responseSchemas ? `Responses: ${ct(e.responseSchemas)}` : null
370
370
  ],
371
371
  `
372
372
  `
373
373
  );
374
374
  }
375
- function Fo(e, t) {
376
- return e.type === "collection" ? vo(e, t) : e.type === "workflow" ? _o(e, t) : e.type === "step" ? Wo(e, t) : go(e, t);
377
- }
378
375
  function jo(e, t) {
379
- return e.map((o) => Fo(o, t));
376
+ return e.type === "collection" ? go(e, t) : e.type === "workflow" ? $o(e, t) : e.type === "step" ? Fo(e, t) : bo(e, t);
380
377
  }
381
- const Bo = ["info", "result", "severity"], Yo = 500, zo = M * 2;
378
+ function Bo(e, t) {
379
+ return e.map((o) => jo(o, t));
380
+ }
381
+ const Yo = ["info", "result", "severity"], zo = 500, Ho = L * 2;
382
382
  function Go(e) {
383
383
  const t = [];
384
- return e.collectionId && t.push(`Collection ID: ${e.collectionId}`), e.workflowId && t.push(`Workflow ID: ${e.workflowId}`), e.workflow?.summary && t.push(`Summary: ${e.workflow.summary}`), e.workflow?.description && t.push(`Description: ${e.workflow.description}`), e.runDate && t.push(`Run date: ${new Date(e.runDate).toISOString()}`), b(t, `
384
+ return e.collectionId && t.push(`Collection ID: ${e.collectionId}`), e.workflowId && t.push(`Workflow ID: ${e.workflowId}`), e.workflow?.summary && t.push(`Summary: ${e.workflow.summary}`), e.workflow?.description && t.push(`Description: ${e.workflow.description}`), e.runDate && t.push(`Run date: ${new Date(e.runDate).toISOString()}`), k(t, `
385
385
  `);
386
386
  }
387
- function Ho(e) {
387
+ function Vo(e) {
388
388
  return `Severity settings:
389
389
  ${JSON.stringify(e.severitySettings, null, 2)}`;
390
390
  }
391
- function Vo(e, t) {
391
+ function Ko(e, t) {
392
392
  return e.length > t ? `${e.slice(0, t)}…` : e;
393
393
  }
394
394
  function Pe(e, t, o, n = !1) {
395
395
  if (e == null || e === "") return "(empty)";
396
396
  const r = typeof e == "string" ? e : n ? JSON.stringify(e, null, 2) : JSON.stringify(e);
397
- return Vo(z(r, t), o);
397
+ return Ko(H(r, t), o);
398
398
  }
399
- function Ko(e, t) {
399
+ function Jo(e, t) {
400
400
  const o = e.request?.method || e["x-operation"]?.method, n = e.verboseLog ? `${e.verboseLog.host}${e.verboseLog.path}` : e.request?.url || e["x-operation"]?.url, r = e.response?.statusCode, s = [`${e.stepId}:`];
401
401
  (o || n) && s.push(
402
- [o?.toUpperCase(), n ? z(n, t) : null].filter(Boolean).join(" "),
402
+ [o?.toUpperCase(), n ? H(n, t) : null].filter(Boolean).join(" "),
403
403
  "->"
404
- ), s.push(`status=${r ?? "n/a"}`, Je(e) ? "passed" : "failed");
404
+ ), s.push(`status=${r ?? "n/a"}`, _t(e) ? "passed" : "failed");
405
405
  const a = e.checks ? qt(e.checks) : [];
406
406
  if (a.length > 0) {
407
407
  const l = a.map(
408
- (i) => i.message ? `${i.name}: ${z(i.message, t)}` : i.name
408
+ (i) => i.message ? `${i.name}: ${H(i.message, t)}` : i.name
409
409
  );
410
410
  s.push(`(${l.join("; ")})`);
411
411
  }
412
412
  return s.join(" ");
413
413
  }
414
- function Jo(e, t, o) {
415
- const n = Rt(e.executedSteps ? [...e.executedSteps] : []), r = n.filter((i) => !Je(i)).length, l = [`Run status: ${r === 0 && !e.globalTimeoutError ? "SUCCEEDED" : "FAILED"} (${n.length - r}/${n.length} steps passed, ${e.totalTimeMs}ms total${e.globalTimeoutError ? ", global timeout reached" : ""})`];
414
+ function Qo(e, t, o) {
415
+ const { steps: n, totalSteps: r, passedSteps: s, succeeded: a, timedOut: l } = Rt(e), u = [`Run status: ${a ? "SUCCEEDED" : "FAILED"} (${s}/${r} steps passed, ${e.totalTimeMs}ms total${l ? ", global timeout reached" : ""})`];
416
416
  if (n.length > 0) {
417
- const i = [];
418
- let d = zo, p = 0;
419
- for (const m of n) {
420
- if (i.push(` ${Ko(m, t)}`), d <= 0) {
421
- p++;
417
+ const d = [];
418
+ let m = Ho, f = 0;
419
+ for (const { step: y } of n) {
420
+ if (d.push(` ${Jo(y, t)}`), m <= 0) {
421
+ f++;
422
422
  continue;
423
423
  }
424
- const f = Pe(m.response?.body, t, Yo);
425
- d -= f.length, i.push(` body: ${f}`);
424
+ const v = Pe(y.response?.body, t, zo);
425
+ m -= v.length, d.push(` body: ${v}`);
426
426
  }
427
- p > 0 && i.push(
428
- ` (${p} step body previews omitted to save space; request them via stepIds)`
429
- ), l.push(`Steps:
430
- ${i.join(`
427
+ f > 0 && d.push(
428
+ ` (${f} step body previews omitted to save space; request them via stepIds)`
429
+ ), u.push(`Steps:
430
+ ${d.join(`
431
431
  `)}`);
432
432
  }
433
- for (const i of o ?? []) {
434
- const d = n.find((p) => p.stepId === i);
435
- l.push(
436
- d ? `Full response body for step ${i}:
433
+ for (const d of o ?? []) {
434
+ const m = n.find((f) => f.step.stepId === d);
435
+ u.push(
436
+ m ? `Full response body for step ${d}:
437
437
  ${Pe(
438
- d.response?.body,
438
+ m.step.response?.body,
439
439
  t,
440
- M,
440
+ L,
441
441
  !0
442
- )}` : `Full response body for step ${i}: step not found in this run.`
442
+ )}` : `Full response body for step ${d}: step not found in this run.`
443
443
  );
444
444
  }
445
- return b(l, `
445
+ return k(u, `
446
446
  `);
447
447
  }
448
- function Qo(e, t) {
448
+ function Xo(e, t) {
449
449
  const o = e.secretValues ? [...e.secretValues] : void 0;
450
450
  if (e.runStatus === "running")
451
451
  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.";
452
452
  if (e.runStatus === "error") {
453
- const n = `Run status: FAILED - execution error: ${z(
453
+ const n = `Run status: FAILED - execution error: ${H(
454
454
  e.runError || "unknown error",
455
455
  o
456
456
  )}`;
457
457
  return e.result ? `${n}
458
458
  (the stored result is from an earlier run and is omitted as stale)` : n;
459
459
  }
460
- return e.result ? Jo(e.result, o, t?.stepIds) : "Run status: NOT STARTED - no run has executed on this tab yet.";
460
+ return e.result ? Qo(e.result, o, t?.stepIds) : "Run status: NOT STARTED - no run has executed on this tab yet.";
461
461
  }
462
- function Xo(e, t, o) {
462
+ function Zo(e, t, o) {
463
463
  const n = ["Current tab (workflow run)"];
464
464
  for (const r of t)
465
465
  switch (r) {
@@ -467,46 +467,46 @@ function Xo(e, t, o) {
467
467
  n.push(Go(e));
468
468
  break;
469
469
  case "severity":
470
- n.push(Ho(e));
470
+ n.push(Vo(e));
471
471
  break;
472
472
  case "result":
473
- n.push(Qo(e, o));
473
+ n.push(Xo(e, o));
474
474
  break;
475
475
  }
476
- return b(n, `
476
+ return k(n, `
477
477
 
478
478
  `);
479
479
  }
480
- function Zo(e, t = ["info"], o) {
480
+ function en(e, t = ["info"], o) {
481
481
  if (!e)
482
482
  return null;
483
483
  switch (e.type) {
484
- case C.Step:
485
- return Do(e, t);
486
- case C.Workflow:
487
- return Eo(e, t);
488
- case C.Collection:
489
- return yo(e, t);
490
- case C.WorkflowRun:
491
- return Xo(e, t, o);
484
+ case O.Step:
485
+ return Lo(e, t);
486
+ case O.Workflow:
487
+ return xo(e, t);
488
+ case O.Collection:
489
+ return vo(e, t);
490
+ case O.WorkflowRun:
491
+ return Zo(e, t, o);
492
492
  }
493
493
  }
494
- function en(e) {
494
+ function tn(e) {
495
495
  switch (e.type) {
496
- case C.Collection:
497
- return mo;
498
- case C.Workflow:
499
- return bo;
500
- case C.Step:
501
- return $o;
502
- case C.WorkflowRun:
503
- return Bo;
496
+ case O.Collection:
497
+ return ho;
498
+ case O.Workflow:
499
+ return ko;
500
+ case O.Step:
501
+ return Ro;
502
+ case O.WorkflowRun:
503
+ return Yo;
504
504
  }
505
505
  }
506
- function pt(e) {
506
+ function ut(e) {
507
507
  return e.trim().replace(/\s+/g, " ").replace(/[.!?:;,…]+$/, "").toLowerCase();
508
508
  }
509
- function tn(e, t) {
509
+ function on(e, t) {
510
510
  const o = [];
511
511
  let n = 0;
512
512
  for (const r of e ?? [])
@@ -515,7 +515,7 @@ function tn(e, t) {
515
515
  s.type === "tool-call" && (s.toolName === t ? (n += 1, o.push(s.input)) : n = 0);
516
516
  return { priorInputs: o, consecutiveCalls: n };
517
517
  }
518
- function on(e, t, o) {
518
+ function nn(e, t, o) {
519
519
  const n = [];
520
520
  let r = !1;
521
521
  for (const s of e) {
@@ -524,7 +524,7 @@ function on(e, t, o) {
524
524
  }
525
525
  return { blocked: r, notes: n };
526
526
  }
527
- function ft(e) {
527
+ function pt(e) {
528
528
  const t = e.warn !== void 0 ? "warn" : "block", o = e.warn !== void 0 ? e.warn : e.block;
529
529
  return (n, r) => {
530
530
  const s = Ne(e.key, n);
@@ -538,7 +538,7 @@ function Ne(e, t) {
538
538
  return null;
539
539
  }
540
540
  }
541
- function nn(e) {
541
+ function rn(e) {
542
542
  const t = Ue("warn", e.warnAfter, e.warnMessage), o = Ue("block", e.blockAfter, e.blockMessage);
543
543
  if (!t && !o)
544
544
  throw new Error("consecutiveCallsRule requires at least warnAfter or blockAfter");
@@ -558,7 +558,7 @@ function Ue(e, t, o) {
558
558
  return { after: t, message: o };
559
559
  }
560
560
  }
561
- function rn(e) {
561
+ function sn(e) {
562
562
  if (!e || typeof e.safeParse != "function")
563
563
  return;
564
564
  const t = e;
@@ -567,37 +567,37 @@ function rn(e) {
567
567
  return n.success ? n.data : null;
568
568
  };
569
569
  }
570
- function sn(e, t, o, n) {
570
+ function an(e, t, o, n) {
571
571
  return !t || t.length === 0 ? o : async (r, s) => {
572
- const a = tn(s?.messages, e), l = {
572
+ const a = on(s?.messages, e), l = {
573
573
  consecutiveCalls: a.consecutiveCalls,
574
- priorInputs: n ? a.priorInputs.map(n).filter((p) => p !== null) : a.priorInputs
575
- }, i = on(t, r, l);
574
+ priorInputs: n ? a.priorInputs.map(n).filter((d) => d !== null) : a.priorInputs
575
+ }, i = nn(t, r, l);
576
576
  if (i.blocked)
577
577
  return { isError: !1, blocked: !0, note: i.notes.join(" ") };
578
- const d = await o(r, s);
579
- return i.notes.length === 0 || !an(d) ? d : {
580
- ...d,
581
- note: [d.note, ...i.notes].filter(Boolean).join(" ")
578
+ const u = await o(r, s);
579
+ return i.notes.length === 0 || !cn(u) ? u : {
580
+ ...u,
581
+ note: [u.note, ...i.notes].filter(Boolean).join(" ")
582
582
  };
583
583
  };
584
584
  }
585
- function an(e) {
585
+ function cn(e) {
586
586
  return e !== null && typeof e == "object" && e.isError === !1;
587
587
  }
588
- function cn(e, t) {
588
+ function ln(e, t) {
589
589
  return {
590
590
  name: e.name,
591
591
  definition: e.definition,
592
- execute: sn(
592
+ execute: an(
593
593
  e.name,
594
594
  e.guards,
595
595
  e.createExecutor(t),
596
- rn(e.definition.inputSchema)
596
+ sn(e.definition.inputSchema)
597
597
  )
598
598
  };
599
599
  }
600
- const ln = {
600
+ const dn = {
601
601
  messages: [],
602
602
  isStreaming: !1,
603
603
  sendMessage: async () => {
@@ -610,62 +610,62 @@ const ln = {
610
610
  },
611
611
  chatStatus: "ready",
612
612
  chatError: void 0
613
- }, dn = $t(
614
- ln
613
+ }, un = xt(
614
+ dn
615
615
  );
616
- function ki() {
617
- return _t(dn);
616
+ function qi() {
617
+ return Et(un);
618
618
  }
619
- const un = u({
619
+ const pn = p({
620
620
  message: c(),
621
- details: Z().optional()
621
+ details: ee().optional()
622
622
  });
623
- u({
623
+ p({
624
624
  collectionId: c().min(1).describe("Target collection id."),
625
625
  workflowId: c().min(1).describe("Target workflow id."),
626
626
  stepId: c().min(1).describe("Target step id.")
627
627
  });
628
- const ye = u({
629
- action: T(["add", "update", "remove"]).describe('Action to perform: "add", "update" or "remove".'),
628
+ const ye = p({
629
+ action: S(["add", "update", "remove"]).describe('Action to perform: "add", "update" or "remove".'),
630
630
  approved: x().default(!0)
631
- }), R = ye.extend({
631
+ }), _ = ye.extend({
632
632
  id: c().optional().describe("Existing item id. Required for update/remove actions.")
633
- }), pn = ye.extend({
634
- index: O().int().min(0).optional().describe("Existing item index. Required for update/remove actions.")
635
- }), fn = u({
636
- isError: h(!1),
637
- blocked: h(!0),
633
+ }), fn = ye.extend({
634
+ index: T().int().min(0).optional().describe("Existing item index. Required for update/remove actions.")
635
+ }), mn = p({
636
+ isError: w(!1),
637
+ blocked: w(!0),
638
638
  note: c(),
639
- data: D().optional(),
640
- error: D().optional()
639
+ data: U().optional(),
640
+ error: U().optional()
641
641
  });
642
642
  function $(e) {
643
- return we([
644
- u({
645
- isError: h(!0),
646
- error: un,
647
- data: D().optional(),
648
- blocked: D().optional()
643
+ return Ie([
644
+ p({
645
+ isError: w(!0),
646
+ error: pn,
647
+ data: U().optional(),
648
+ blocked: U().optional()
649
649
  }),
650
- u({
651
- isError: h(!1),
650
+ p({
651
+ isError: w(!1),
652
652
  data: e,
653
- error: D().optional(),
653
+ error: U().optional(),
654
654
  note: c().optional(),
655
- blocked: D().optional()
655
+ blocked: U().optional()
656
656
  }),
657
- fn
657
+ mn
658
658
  ]);
659
659
  }
660
- const mn = u({
661
- status: T(["applied", "failed"]),
660
+ const hn = p({
661
+ status: S(["applied", "failed"]),
662
662
  summary: c().optional()
663
- }), hn = u({
664
- totalChanges: O().int().min(0),
665
- approvedChanges: O().int().min(0),
666
- applied: k(mn),
663
+ }), wn = p({
664
+ totalChanges: T().int().min(0),
665
+ approvedChanges: T().int().min(0),
666
+ applied: b(hn),
667
667
  resultingState: c().optional().describe("Resulting state of the mutated fields after all changes were applied.")
668
- }), mt = $(hn), In = "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.", wn = T([
668
+ }), ft = $(wn), In = "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.", yn = S([
669
669
  "info",
670
670
  "workflows",
671
671
  "sourceDescriptions",
@@ -680,43 +680,43 @@ const mn = u({
680
680
  "response",
681
681
  "result",
682
682
  "severity"
683
- ]), yn = ee({
684
- sections: k(wn).min(1).describe(
683
+ ]), vn = B({
684
+ sections: b(yn).min(1).describe(
685
685
  "Content blocks to include in the response. Use tab-type-specific sections from the tool description; invalid sections for the current tab are ignored."
686
686
  ),
687
- stepIds: k(c()).min(1).optional().describe(
687
+ stepIds: b(c()).min(1).optional().describe(
688
688
  "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."
689
689
  )
690
- }), vn = u({
690
+ }), gn = p({
691
691
  message: c()
692
- }), gn = $(vn), bn = {
692
+ }), bn = $(gn), kn = {
693
693
  description: In,
694
- inputSchema: yn,
695
- outputSchema: gn,
694
+ inputSchema: vn,
695
+ outputSchema: bn,
696
696
  needsApproval: !1
697
697
  };
698
- function I(e, t) {
698
+ function h(e, t) {
699
699
  return {
700
700
  isError: !0,
701
701
  error: { message: e, details: t }
702
702
  };
703
703
  }
704
- function kn(e, t) {
705
- const o = en(e), n = [], r = [];
704
+ function Sn(e, t) {
705
+ const o = tn(e), n = [], r = [];
706
706
  for (const s of t)
707
707
  o.includes(s) ? n.push(s) : r.push(s);
708
708
  return { sections: n, skipped: r };
709
709
  }
710
- function Sn(e) {
710
+ function Tn(e) {
711
711
  return async (t, o) => {
712
712
  const n = e();
713
713
  if (!n)
714
- return I("No active tab data available.");
715
- const { sections: r, skipped: s } = kn(n, t.sections), a = r.length > 0 ? r : ["info"];
716
- let i = Zo(n, a, { stepIds: t.stepIds }) ?? "Unable to build a summary for the active tab.";
714
+ return h("No active tab data available.");
715
+ const { sections: r, skipped: s } = Sn(n, t.sections), a = r.length > 0 ? r : ["info"];
716
+ let i = en(n, a, { stepIds: t.stepIds }) ?? "Unable to build a summary for the active tab.";
717
717
  return s.length > 0 && (i += `
718
718
 
719
- (Sections not applicable for this tab type were omitted: ${s.join(", ")}.)`), r.length === 0 && t.sections.length > 0 && (i += "\n\n(No requested sections applied to this tab type; showing `info` instead.)"), t.stepIds?.length && (n.type !== C.WorkflowRun ? i += `
719
+ (Sections not applicable for this tab type were omitted: ${s.join(", ")}.)`), r.length === 0 && t.sections.length > 0 && (i += "\n\n(No requested sections applied to this tab type; showing `info` instead.)"), t.stepIds?.length && (n.type !== O.WorkflowRun ? i += `
720
720
 
721
721
  (stepIds applies only to workflow run tabs.)` : a.includes("result") || (i += "\n\n(stepIds requires the `result` section.)")), {
722
722
  isError: !1,
@@ -724,11 +724,11 @@ function Sn(e) {
724
724
  };
725
725
  };
726
726
  }
727
- const Tn = {
727
+ const Cn = {
728
728
  name: "get_current_tab",
729
- definition: bn,
730
- createExecutor: (e) => Sn(e.getActiveTabDetailedData)
731
- }, Cn = `Read top-level metadata of a loaded OpenAPI document in the current Replay project.
729
+ definition: kn,
730
+ createExecutor: (e) => Tn(e.getActiveTabDetailedData)
731
+ }, On = `Read top-level metadata of a loaded OpenAPI document in the current Replay project.
732
732
 
733
733
  **What it does**
734
734
  - Scan: omit \`field\` to list the metadata fields present in the document, each with its shape (and item count for lists/maps).
@@ -743,7 +743,7 @@ const Tn = {
743
743
 
744
744
  **Input guidance**
745
745
  - \`apiId\` is required (the loaded API's id, the same identifier the search tool uses).
746
- - Read one \`field\` at a time; use \`cursor\` only to continue a section you already started.`, On = ee({
746
+ - Read one \`field\` at a time; use \`cursor\` only to continue a section you already started.`, An = B({
747
747
  apiId: c().describe(
748
748
  "ID of the loaded API document to read (the API URI, the same identifier used by the search tool)."
749
749
  ),
@@ -753,98 +753,98 @@ const Tn = {
753
753
  cursor: c().optional().describe(
754
754
  "Opaque cursor to continue a previously truncated section. Only meaningful together with `field`."
755
755
  )
756
- }), An = u({
756
+ }), En = p({
757
757
  name: c(),
758
- kind: T(["scalar", "object", "array"]),
759
- count: O().int().nonnegative().optional()
760
- }), En = u({
758
+ kind: S(["scalar", "object", "array"]),
759
+ count: T().int().nonnegative().optional()
760
+ }), xn = p({
761
761
  name: c(),
762
762
  hint: c()
763
- }), _n = u({
764
- available: k(An),
765
- blocked: k(En)
766
- }), $n = u({
763
+ }), $n = p({
764
+ available: b(En),
765
+ blocked: b(xn)
766
+ }), Rn = p({
767
767
  field: c(),
768
- value: Z(),
769
- start: O().int().nonnegative().optional(),
770
- end: O().int().nonnegative().optional(),
771
- total: O().int().nonnegative().optional(),
768
+ value: ee(),
769
+ start: T().int().nonnegative().optional(),
770
+ end: T().int().nonnegative().optional(),
771
+ total: T().int().nonnegative().optional(),
772
772
  truncated: x(),
773
773
  nextCursor: c().nullable()
774
- }), xn = we([_n, $n]), Rn = $(xn), qn = {
775
- description: Cn,
776
- inputSchema: On,
777
- outputSchema: Rn,
774
+ }), _n = Ie([$n, Rn]), qn = $(_n), Pn = {
775
+ description: On,
776
+ inputSchema: An,
777
+ outputSchema: qn,
778
778
  needsApproval: !1
779
- }, H = {
779
+ }, V = {
780
780
  paths: "Use the search tool to read endpoints and operations.",
781
781
  webhooks: "Use the search tool to read webhook operations.",
782
782
  components: "Use the search tool to read reusable components such as schemas and responses.",
783
783
  definitions: "Use the search tool to read reusable schemas.",
784
784
  parameters: "Use the search tool to read reusable parameters.",
785
785
  responses: "Use the search tool to read reusable responses."
786
- }, ht = ["id", "srcType", "fileDependencies"], oe = [
786
+ }, mt = ["id", "srcType", "fileDependencies"], oe = [
787
787
  {
788
788
  name: "securitySchemes",
789
789
  sources: ["components.securitySchemes", "securityDefinitions"]
790
790
  }
791
- ], Pn = 10, De = 500;
792
- function It(e, t) {
791
+ ], Nn = 10, De = 500;
792
+ function ht(e, t) {
793
793
  for (const o of t.sources) {
794
- const n = Nn(e, o);
795
- if (Un(n)) return n;
794
+ const n = Un(e, o);
795
+ if (Dn(n)) return n;
796
796
  }
797
797
  return null;
798
798
  }
799
- function Nn(e, t) {
800
- return t.split(".").reduce((o, n) => F(o) ? o[n] : void 0, e);
799
+ function Un(e, t) {
800
+ return t.split(".").reduce((o, n) => M(o) ? o[n] : void 0, e);
801
801
  }
802
- function Un(e) {
803
- return e == null ? !1 : Array.isArray(e) ? e.length > 0 : F(e) ? Object.keys(e).length > 0 : !0;
802
+ function Dn(e) {
803
+ return e == null ? !1 : Array.isArray(e) ? e.length > 0 : M(e) ? Object.keys(e).length > 0 : !0;
804
804
  }
805
- function F(e) {
805
+ function M(e) {
806
806
  return !(e === null || typeof e != "object" || Array.isArray(e));
807
807
  }
808
- const Dn = new Set(
808
+ const Ln = new Set(
809
809
  oe.flatMap((e) => e.sources.map((t) => t.split(".")[0]))
810
810
  );
811
811
  function Le(e) {
812
812
  const t = [], o = [];
813
813
  for (const [n, r] of Object.entries(e)) {
814
- if (n in H) {
815
- o.push({ name: n, hint: H[n] });
814
+ if (n in V) {
815
+ o.push({ name: n, hint: V[n] });
816
816
  continue;
817
817
  }
818
- ht.includes(n) || Dn.has(n) || t.push(Me(n, r));
818
+ mt.includes(n) || Ln.has(n) || t.push(We(n, r));
819
819
  }
820
820
  for (const n of oe) {
821
- const r = It(e, n);
822
- r !== null && t.push(Me(n.name, r));
821
+ const r = ht(e, n);
822
+ r !== null && t.push(We(n.name, r));
823
823
  }
824
824
  return { available: t, blocked: o };
825
825
  }
826
- function Me(e, t) {
827
- const o = { name: e, kind: Ln(t) };
828
- return Array.isArray(t) ? o.count = t.length : F(t) && (o.count = Object.keys(t).length), o;
826
+ function We(e, t) {
827
+ const o = { name: e, kind: Wn(t) };
828
+ return Array.isArray(t) ? o.count = t.length : M(t) && (o.count = Object.keys(t).length), o;
829
829
  }
830
- function Ln(e) {
831
- return Array.isArray(e) ? "array" : F(e) ? "object" : "scalar";
830
+ function Wn(e) {
831
+ return Array.isArray(e) ? "array" : M(e) ? "object" : "scalar";
832
832
  }
833
833
  function Mn(e, t, o) {
834
834
  if (Array.isArray(t))
835
- return We(e, t, o, (n) => n);
836
- if (F(t)) {
835
+ return Me(e, t, o, (n) => n);
836
+ if (M(t)) {
837
837
  const n = Object.keys(t).sort().map((r) => [r, t[r]]);
838
- return We(e, n, o, (r) => Object.fromEntries(r));
838
+ return Me(e, n, o, (r) => Object.fromEntries(r));
839
839
  }
840
840
  return {
841
841
  field: e,
842
- value: V(t),
842
+ value: K(t),
843
843
  truncated: !1,
844
844
  nextCursor: null
845
845
  };
846
846
  }
847
- function Wn(e, t) {
847
+ function Fn(e, t) {
848
848
  if (!e) return 0;
849
849
  let o;
850
850
  try {
@@ -857,63 +857,63 @@ function Wn(e, t) {
857
857
  const s = Number(o.slice(n + 1));
858
858
  return !Number.isInteger(s) || s < 0 ? null : s;
859
859
  }
860
- function We(e, t, o, n) {
861
- const r = Math.min(Math.max(o, 0), t.length), s = Math.min(r + Pn, t.length), a = s < t.length;
860
+ function Me(e, t, o, n) {
861
+ const r = Math.min(Math.max(o, 0), t.length), s = Math.min(r + Nn, t.length), a = s < t.length;
862
862
  return {
863
863
  field: e,
864
- value: V(n(t.slice(r, s))),
864
+ value: K(n(t.slice(r, s))),
865
865
  truncated: a,
866
866
  start: r,
867
867
  end: s,
868
868
  total: t.length,
869
- nextCursor: a ? Fn(e, s) : null
869
+ nextCursor: a ? jn(e, s) : null
870
870
  };
871
871
  }
872
- function V(e) {
872
+ function K(e) {
873
873
  if (typeof e == "string")
874
874
  return e.length > De ? `${e.slice(0, De)}…` : e;
875
875
  if (Array.isArray(e))
876
- return e.map(V);
877
- if (F(e)) {
876
+ return e.map(K);
877
+ if (M(e)) {
878
878
  const t = {};
879
879
  for (const [o, n] of Object.entries(e))
880
- t[o] = V(n);
880
+ t[o] = K(n);
881
881
  return t;
882
882
  }
883
883
  return e;
884
884
  }
885
- function Fn(e, t) {
885
+ function jn(e, t) {
886
886
  return btoa(`${e}:${t}`);
887
887
  }
888
- const jn = new Map(
888
+ const Bn = new Map(
889
889
  oe.flatMap(
890
890
  (e) => e.sources.map((t) => [t.split(".")[0], e.name])
891
891
  )
892
892
  );
893
- function Bn(e, t, o) {
893
+ function Yn(e, t, o) {
894
894
  const n = oe.find((a) => a.name === t);
895
895
  if (n) {
896
- const a = It(e, n);
896
+ const a = ht(e, n);
897
897
  return a === null ? je(t) : Fe(t, a, o);
898
898
  }
899
- if (t in H)
900
- return I(
901
- `"${t}" is not available from this tool. ${H[t]}`,
899
+ if (t in V)
900
+ return h(
901
+ `"${t}" is not available from this tool. ${V[t]}`,
902
902
  { field: t }
903
903
  );
904
- if (ht.includes(t))
905
- return I(`"${t}" is not an OpenAPI metadata field.`, { field: t });
906
- const r = jn.get(t);
904
+ if (mt.includes(t))
905
+ return h(`"${t}" is not an OpenAPI metadata field.`, { field: t });
906
+ const r = Bn.get(t);
907
907
  if (r !== void 0)
908
- return I(`"${t}" is not a valid field name. Use "${r}" instead.`, {
908
+ return h(`"${t}" is not a valid field name. Use "${r}" instead.`, {
909
909
  field: t
910
910
  });
911
911
  const s = e[t];
912
912
  return s == null ? je(t) : Fe(t, s, o);
913
913
  }
914
914
  function Fe(e, t, o) {
915
- const n = Wn(o, e);
916
- return n === null ? I(
915
+ const n = Fn(o, e);
916
+ return n === null ? h(
917
917
  `The provided cursor is not valid for field "${e}". Omit the cursor to start from the first page.`,
918
918
  { field: e }
919
919
  ) : {
@@ -922,79 +922,79 @@ function Fe(e, t, o) {
922
922
  };
923
923
  }
924
924
  function je(e) {
925
- return I(
925
+ return h(
926
926
  `"${e}" is not present in this API. Call this tool without a "field" to scan the available metadata fields.`,
927
927
  { field: e }
928
928
  );
929
929
  }
930
- function Yn(e) {
930
+ function zn(e) {
931
931
  return async (t) => {
932
932
  const o = e.apis.get({ noproxy: !0 }) ?? [], n = o.find((s) => s.id === t.apiId);
933
933
  if (!n)
934
- return I(`API "${t.apiId}" is not loaded.`, {
934
+ return h(`API "${t.apiId}" is not loaded.`, {
935
935
  availableApiIds: o.map((s) => s.id)
936
936
  });
937
937
  const r = n;
938
- return t.field == null && t.cursor !== void 0 ? I(
938
+ return t.field == null && t.cursor !== void 0 ? h(
939
939
  "`cursor` requires `field` to be set — omit `cursor` and pass `field` to read a specific section, or omit both to scan. Returning scan results.",
940
940
  {
941
941
  data: Le(r)
942
942
  }
943
- ) : t.field !== void 0 ? Bn(r, t.field, t.cursor) : {
943
+ ) : t.field !== void 0 ? Yn(r, t.field, t.cursor) : {
944
944
  isError: !1,
945
945
  data: Le(r)
946
946
  };
947
947
  };
948
948
  }
949
- const zn = {
949
+ const Hn = {
950
950
  name: "get_api_metadata",
951
- definition: qn,
952
- createExecutor: (e) => Yn(e.store)
953
- }, Gn = "Manage Replay collections and YAML-backed Arazzo workflows/steps.\n\n**What it does**\n- Creates or deletes collections, workflows, and steps.\n- Can copy the currently focused step tab into another workflow as a new step.\n- Returns a summary plus created/affected IDs when available.\n\n**Use when**\n- You need structural changes to collection/workflow/step hierarchy.\n- You need to create a workflow step from an OpenAPI operation, ad-hoc request, or blank step.\n- You need to persist the currently focused step tab into a target collection/workflow.\n\n**Never use when**\n- You only need to edit fields on an existing step without creating/deleting structure.\n- Required target ids are unknown or ambiguous.\n- You are not sure destructive deletes are intended.\n\n**Input guidance**\n- Provide `payload` with one `action` from:\n - `create_collection`, `delete_collection`\n - `create_workflow`, `delete_workflow`\n - `create_step`, `delete_step`\n - `save_tab_to_collection`\n- Resolve missing `collectionId`, `workflowId`, and `stepId` before mutation.\n- `create_collection`: `title` is display name and derives file ID.\n- `create_step`: choose one source shape:\n - `operation` for OpenAPI link (`apiId`, `path`, `method`, optional `operationId`)\n - `xOperation` for ad-hoc HTTP (`method` + `url`)\n - omit both for a blank step\n- `create_step` optional initial fields: `description`, `parameters`, `body`, `outputs`, `successCriteria`.\n- `save_tab_to_collection`: provide `targetCollectionId`, `targetWorkflowId`, and `newStepName`.\n\n**Loop/budget guidance**\n- Prefer batching related structure setup in minimal calls per workflow.\n- Track returned `stepId` values from create actions; names may be uniquified on collisions.\n- Define outputs for producer steps and reference them as `$steps.<stepId>.outputs.<name>` in downstream steps.\n- Add `successCriteria` on created steps so workflow runs fail on unexpected responses.", Hn = u({
954
- action: h("create_collection"),
951
+ definition: Pn,
952
+ createExecutor: (e) => zn(e.store)
953
+ }, Gn = "Manage Replay collections and YAML-backed Arazzo workflows/steps.\n\n**What it does**\n- Creates or deletes collections, workflows, and steps.\n- Can copy the currently focused step tab into another workflow as a new step.\n- Returns a summary plus created/affected IDs when available.\n\n**Use when**\n- You need structural changes to collection/workflow/step hierarchy.\n- You need to create a workflow step from an OpenAPI operation, ad-hoc request, or blank step.\n- You need to persist the currently focused step tab into a target collection/workflow.\n\n**Never use when**\n- You only need to edit fields on an existing step without creating/deleting structure.\n- Required target ids are unknown or ambiguous.\n- You are not sure destructive deletes are intended.\n\n**Input guidance**\n- Provide `payload` with one `action` from:\n - `create_collection`, `delete_collection`\n - `create_workflow`, `delete_workflow`\n - `create_step`, `delete_step`\n - `save_tab_to_collection`\n- Resolve missing `collectionId`, `workflowId`, and `stepId` before mutation.\n- `create_collection`: `title` is display name and derives file ID.\n- `create_step`: choose one source shape:\n - `operation` for OpenAPI link (`apiId`, `path`, `method`, optional `operationId`)\n - `xOperation` for ad-hoc HTTP (`method` + `url`)\n - omit both for a blank step\n- `create_step` optional initial fields: `description`, `parameters`, `body`, `outputs`, `successCriteria`.\n- `save_tab_to_collection`: provide `targetCollectionId`, `targetWorkflowId`, and `newStepName`.\n\n**Loop/budget guidance**\n- Prefer batching related structure setup in minimal calls per workflow.\n- Track returned `stepId` values from create actions; names may be uniquified on collisions.\n- Define outputs for producer steps and reference them as `$steps.<stepId>.outputs.<name>` in downstream steps.\n- Add `successCriteria` on created steps so workflow runs fail on unexpected responses.", Vn = p({
954
+ action: w("create_collection"),
955
955
  title: c().min(1).describe("Collection display title (also used to derive the file id).")
956
- }).strict(), Vn = u({
957
- action: h("delete_collection"),
956
+ }).strict(), Kn = p({
957
+ action: w("delete_collection"),
958
958
  collectionId: c().min(1).describe("Target collection id.")
959
- }).strict(), Kn = u({
960
- action: h("create_workflow"),
959
+ }).strict(), Jn = p({
960
+ action: w("create_workflow"),
961
961
  collectionId: c().min(1).describe("Parent collection id."),
962
962
  name: c().min(1).describe("Workflow summary / display name.")
963
- }).strict(), Jn = u({
964
- action: h("delete_workflow"),
963
+ }).strict(), Qn = p({
964
+ action: w("delete_workflow"),
965
965
  collectionId: c().min(1),
966
966
  workflowId: c().min(1)
967
- }).strict(), Qn = [
968
- L.Text,
969
- L.JSON,
970
- L.XML
971
- ], Xn = u({
967
+ }).strict(), Xn = [
968
+ D.Text,
969
+ D.JSON,
970
+ D.XML
971
+ ], Zn = p({
972
972
  name: c().min(1),
973
- in: T(["path", "query", "header", "cookie"]),
973
+ in: S(["path", "query", "header", "cookie"]),
974
974
  value: c()
975
- }).strict(), Zn = u({
975
+ }).strict(), er = p({
976
976
  name: c().min(1).describe("Output name."),
977
977
  expression: c().min(1).describe("Output expression.")
978
- }).strict(), er = u({
978
+ }).strict(), tr = p({
979
979
  condition: c().min(1),
980
980
  context: c().optional(),
981
- type: T(["simple", "regex", "jsonpath", "xpath"]).optional()
982
- }).strict(), tr = u({
983
- action: h("create_step"),
981
+ type: S(["simple", "regex", "jsonpath", "xpath"]).optional()
982
+ }).strict(), or = p({
983
+ action: w("create_step"),
984
984
  collectionId: c().min(1),
985
985
  workflowId: c().min(1),
986
986
  stepName: c().min(1).optional().describe(
987
987
  'Label used verbatim as the stepId, so pass a single camelCase token such as "updateUser", reusing the source operationId when there is one. Put prose in `description` instead (default: "New Step").'
988
988
  ),
989
989
  description: c().min(1).optional().describe("Step description text (overrides default derived from stepName)."),
990
- parameters: k(Xn).optional().describe("Initial request parameters (path, query, header, cookie)."),
991
- body: u({
990
+ parameters: b(Zn).optional().describe("Initial request parameters (path, query, header, cookie)."),
991
+ body: p({
992
992
  content: c().describe("Request body content as string."),
993
- contentType: T(Qn).optional().describe("Request body content type.")
993
+ contentType: S(Xn).optional().describe("Request body content type.")
994
994
  }).strict().optional().describe("Initial request body."),
995
- outputs: k(Zn).optional().describe("Initial step outputs (mappings for later steps)."),
996
- successCriteria: k(er).optional().describe("Initial success criteria rows."),
997
- operation: u({
995
+ outputs: b(er).optional().describe("Initial step outputs (mappings for later steps)."),
996
+ successCriteria: b(tr).optional().describe("Initial success criteria rows."),
997
+ operation: p({
998
998
  apiId: c().min(1).describe("API id."),
999
999
  path: c().min(1).describe("Request path."),
1000
1000
  method: c().min(1).describe("HTTP method."),
@@ -1002,52 +1002,52 @@ const zn = {
1002
1002
  }).optional().describe(
1003
1003
  "OpenAPI operation link (apiId, path, method). Omit if using xOperation or a blank step."
1004
1004
  ),
1005
- xOperation: u({
1005
+ xOperation: p({
1006
1006
  method: c().min(1).describe("HTTP method."),
1007
1007
  url: c().min(1).describe("Request URL.")
1008
1008
  }).optional().describe("Ad-hoc HTTP request (method + URL). Omit if using operation or a blank step.")
1009
- }).strict(), or = u({
1010
- action: h("delete_step"),
1009
+ }).strict(), nr = p({
1010
+ action: w("delete_step"),
1011
1011
  collectionId: c().min(1),
1012
1012
  workflowId: c().min(1),
1013
1013
  stepId: c().min(1)
1014
- }).strict(), nr = u({
1015
- action: h("save_tab_to_collection"),
1014
+ }).strict(), rr = p({
1015
+ action: w("save_tab_to_collection"),
1016
1016
  targetCollectionId: c().min(1),
1017
1017
  targetWorkflowId: c().min(1),
1018
1018
  newStepName: c().min(1).describe(
1019
1019
  'Step id / label for the new step, used verbatim, so pass a single camelCase token such as "updateUser".'
1020
1020
  )
1021
- }).strict(), rr = u({
1021
+ }).strict(), sr = p({
1022
1022
  payload: te("action", [
1023
- Hn,
1024
1023
  Vn,
1025
1024
  Kn,
1026
1025
  Jn,
1027
- tr,
1026
+ Qn,
1028
1027
  or,
1029
- nr
1028
+ nr,
1029
+ rr
1030
1030
  ])
1031
1031
  }).superRefine((e, t) => {
1032
1032
  e.payload.action === "create_step" && e.payload.operation && e.payload.xOperation && t.addIssue({
1033
1033
  code: W.custom,
1034
1034
  message: "Only one of `operation` or `xOperation` may be specified."
1035
1035
  });
1036
- }), sr = u({
1036
+ }), ar = p({
1037
1037
  summary: c(),
1038
1038
  collectionId: c().optional(),
1039
1039
  workflowId: c().optional(),
1040
1040
  stepId: c().optional()
1041
- }), ar = $(sr), ir = {
1041
+ }), ir = $(ar), cr = {
1042
1042
  description: Gn,
1043
- inputSchema: rr,
1044
- outputSchema: ar,
1043
+ inputSchema: sr,
1044
+ outputSchema: ir,
1045
1045
  needsApproval: (e) => e.payload.action === "delete_collection" || e.payload.action === "delete_workflow" || e.payload.action === "delete_step" || e.payload.action === "save_tab_to_collection"
1046
1046
  };
1047
1047
  function Be(e, t, o) {
1048
- return { ...Xe(e), key: t, value: o, active: !0 };
1048
+ return { ...Qe(e), key: t, value: o, active: !0 };
1049
1049
  }
1050
- function cr(e, t, o) {
1050
+ function lr(e, t, o) {
1051
1051
  const n = /* @__PURE__ */ new Map();
1052
1052
  for (const s of o)
1053
1053
  n.set(s.name, s.value);
@@ -1068,7 +1068,7 @@ function cr(e, t, o) {
1068
1068
  n.has(s.name) && (r.push(Be(t, s.name, n.get(s.name))), n.delete(s.name));
1069
1069
  return r;
1070
1070
  }
1071
- function lr(e, t) {
1071
+ function dr(e, t) {
1072
1072
  if (t.description !== void 0 && (e.description = t.description), t.body && (e.requestBody = {
1073
1073
  ...e.requestBody,
1074
1074
  content: t.body.content,
@@ -1084,7 +1084,7 @@ function lr(e, t) {
1084
1084
  if (!r?.length)
1085
1085
  continue;
1086
1086
  const s = G[n];
1087
- e.parameters[s] = cr(
1087
+ e.parameters[s] = lr(
1088
1088
  e.parameters[s],
1089
1089
  n,
1090
1090
  r
@@ -1105,7 +1105,7 @@ function lr(e, t) {
1105
1105
  }
1106
1106
  if (t.successCriteria?.length)
1107
1107
  for (const o of t.successCriteria) {
1108
- const n = Qe(
1108
+ const n = Je(
1109
1109
  o.type ?? de.SIMPLE
1110
1110
  );
1111
1111
  e.successCriteria.push({
@@ -1116,27 +1116,27 @@ function lr(e, t) {
1116
1116
  }
1117
1117
  return e;
1118
1118
  }
1119
- function dr(e) {
1119
+ function ur(e) {
1120
1120
  return async (t) => {
1121
1121
  switch (t.payload.action) {
1122
1122
  case "create_collection":
1123
- return ur(t.payload, e);
1124
- case "delete_collection":
1125
1123
  return pr(t.payload, e);
1126
- case "create_workflow":
1124
+ case "delete_collection":
1127
1125
  return fr(t.payload, e);
1128
- case "delete_workflow":
1126
+ case "create_workflow":
1129
1127
  return mr(t.payload, e);
1130
- case "create_step":
1128
+ case "delete_workflow":
1131
1129
  return hr(t.payload, e);
1130
+ case "create_step":
1131
+ return wr(t.payload, e);
1132
1132
  case "delete_step":
1133
1133
  return Ir(t.payload, e);
1134
1134
  case "save_tab_to_collection":
1135
- return wr(t.payload, e);
1135
+ return yr(t.payload, e);
1136
1136
  }
1137
1137
  };
1138
1138
  }
1139
- function ur(e, { store: t }) {
1139
+ function pr(e, { store: t }) {
1140
1140
  const o = Dt({
1141
1141
  name: e.title.trim(),
1142
1142
  collections: t.collections
@@ -1149,12 +1149,12 @@ function ur(e, { store: t }) {
1149
1149
  }
1150
1150
  };
1151
1151
  }
1152
- function pr(e, { store: t, handleCloseByDataId: o }) {
1152
+ function fr(e, { store: t, handleCloseByDataId: o }) {
1153
1153
  const n = j(t, e.collectionId);
1154
1154
  if (!n)
1155
- return I("Collection not found.", { collectionId: e.collectionId });
1155
+ return h("Collection not found.", { collectionId: e.collectionId });
1156
1156
  const r = n.info.title.get();
1157
- return K(n, o), n.set(he), {
1157
+ return J(n, o), n.set(he), {
1158
1158
  isError: !1,
1159
1159
  data: {
1160
1160
  summary: `Deleted collection "${r}" (${e.collectionId}).`,
@@ -1162,10 +1162,10 @@ function pr(e, { store: t, handleCloseByDataId: o }) {
1162
1162
  }
1163
1163
  };
1164
1164
  }
1165
- function fr(e, { store: t }) {
1165
+ function mr(e, { store: t }) {
1166
1166
  const o = j(t, e.collectionId);
1167
1167
  if (!o)
1168
- return I("Collection not found.", { collectionId: e.collectionId });
1168
+ return h("Collection not found.", { collectionId: e.collectionId });
1169
1169
  const n = Ut({
1170
1170
  name: e.name.trim(),
1171
1171
  collection: o
@@ -1179,14 +1179,14 @@ function fr(e, { store: t }) {
1179
1179
  }
1180
1180
  };
1181
1181
  }
1182
- function mr(e, { store: t, handleCloseByDataId: o }) {
1182
+ function hr(e, { store: t, handleCloseByDataId: o }) {
1183
1183
  if (!j(t, e.collectionId))
1184
- return I("Collection not found.", { collectionId: e.collectionId });
1184
+ return h("Collection not found.", { collectionId: e.collectionId });
1185
1185
  const r = me(t, {
1186
1186
  collectionId: e.collectionId,
1187
1187
  workflowId: e.workflowId
1188
1188
  });
1189
- return r ? (K(r, o, {
1189
+ return r ? (J(r, o, {
1190
1190
  collectionId: e.collectionId,
1191
1191
  workflowId: null
1192
1192
  }), r.set(he), {
@@ -1196,20 +1196,20 @@ function mr(e, { store: t, handleCloseByDataId: o }) {
1196
1196
  collectionId: e.collectionId,
1197
1197
  workflowId: e.workflowId
1198
1198
  }
1199
- }) : I("Workflow not found.", {
1199
+ }) : h("Workflow not found.", {
1200
1200
  collectionId: e.collectionId,
1201
1201
  workflowId: e.workflowId
1202
1202
  });
1203
1203
  }
1204
- async function hr(e, { store: t, attachApiToCollection: o, convertOperationToReplayValue: n }) {
1204
+ async function wr(e, { store: t, attachApiToCollection: o, convertOperationToReplayValue: n }) {
1205
1205
  if (!j(t, e.collectionId))
1206
- return I("Collection not found.", { collectionId: e.collectionId });
1206
+ return h("Collection not found.", { collectionId: e.collectionId });
1207
1207
  const s = me(t, {
1208
1208
  collectionId: e.collectionId,
1209
1209
  workflowId: e.workflowId
1210
1210
  });
1211
1211
  if (!s)
1212
- return I("Workflow not found.", {
1212
+ return h("Workflow not found.", {
1213
1213
  collectionId: e.collectionId,
1214
1214
  workflowId: e.workflowId
1215
1215
  });
@@ -1228,31 +1228,31 @@ async function hr(e, { store: t, attachApiToCollection: o, convertOperationToRep
1228
1228
  collectionId: e.collectionId,
1229
1229
  apiId: a.apiId
1230
1230
  }));
1231
- const d = Ze({
1231
+ const u = Xe({
1232
1232
  name: e.stepName?.trim() || "New Step",
1233
1233
  workflow: s,
1234
1234
  operation: a,
1235
1235
  xOperation: l,
1236
1236
  apiOperation: i
1237
1237
  });
1238
- return lr(d, {
1238
+ return dr(u, {
1239
1239
  description: e.description,
1240
1240
  parameters: e.parameters,
1241
1241
  body: e.body,
1242
1242
  outputs: e.outputs,
1243
1243
  successCriteria: e.successCriteria
1244
- }), s.steps.merge([d]), {
1244
+ }), s.steps.merge([u]), {
1245
1245
  isError: !1,
1246
1246
  data: {
1247
- summary: `Created step ${d.stepId} in workflow ${e.workflowId}.`,
1247
+ summary: `Created step ${u.stepId} in workflow ${e.workflowId}.`,
1248
1248
  collectionId: e.collectionId,
1249
1249
  workflowId: e.workflowId,
1250
- stepId: d.stepId
1250
+ stepId: u.stepId
1251
1251
  }
1252
1252
  };
1253
1253
  }
1254
1254
  function Ir(e, { store: t, handleCloseByDataId: o }) {
1255
- const n = et(t, {
1255
+ const n = Ze(t, {
1256
1256
  collectionId: e.collectionId,
1257
1257
  workflowId: e.workflowId,
1258
1258
  stepId: e.stepId
@@ -1269,25 +1269,25 @@ function Ir(e, { store: t, handleCloseByDataId: o }) {
1269
1269
  workflowId: e.workflowId,
1270
1270
  stepId: e.stepId
1271
1271
  }
1272
- }) : I("Step not found.", {
1272
+ }) : h("Step not found.", {
1273
1273
  collectionId: e.collectionId,
1274
1274
  workflowId: e.workflowId,
1275
1275
  stepId: e.stepId
1276
1276
  });
1277
1277
  }
1278
- async function wr(e, { store: t, attachApiToCollection: o }) {
1278
+ async function yr(e, { store: t, attachApiToCollection: o }) {
1279
1279
  const n = pe(t);
1280
1280
  if (!n)
1281
- return I("No active tab.");
1281
+ return h("No active tab.");
1282
1282
  if (!fe(n))
1283
- return I("Active tab is not a step tab.", {
1283
+ return h("Active tab is not a step tab.", {
1284
1284
  tabType: n.data.type.get()
1285
1285
  });
1286
1286
  const r = Pt(t, n);
1287
1287
  if (!r)
1288
- return I("No step data available on the active tab.");
1288
+ return h("No step data available on the active tab.");
1289
1289
  if (!j(t, e.targetCollectionId))
1290
- return I("Target collection not found.", {
1290
+ return h("Target collection not found.", {
1291
1291
  collectionId: e.targetCollectionId
1292
1292
  });
1293
1293
  const a = me(t, {
@@ -1295,11 +1295,11 @@ async function wr(e, { store: t, attachApiToCollection: o }) {
1295
1295
  workflowId: e.targetWorkflowId
1296
1296
  });
1297
1297
  if (!a)
1298
- return I("Target workflow not found.", {
1298
+ return h("Target workflow not found.", {
1299
1299
  collectionId: e.targetCollectionId,
1300
1300
  workflowId: e.targetWorkflowId
1301
1301
  });
1302
- const l = Ze({
1302
+ const l = Xe({
1303
1303
  name: e.newStepName.trim(),
1304
1304
  workflow: a,
1305
1305
  fromStep: r
@@ -1317,11 +1317,11 @@ async function wr(e, { store: t, attachApiToCollection: o }) {
1317
1317
  }
1318
1318
  };
1319
1319
  }
1320
- function K(e, t, o) {
1320
+ function J(e, t, o) {
1321
1321
  if ("workflows" in e) {
1322
1322
  const r = e.id.get();
1323
1323
  e.workflows.forEach(
1324
- (s) => K(s, t, {
1324
+ (s) => J(s, t, {
1325
1325
  collectionId: r,
1326
1326
  workflowId: null
1327
1327
  })
@@ -1331,7 +1331,7 @@ function K(e, t, o) {
1331
1331
  if ("steps" in e) {
1332
1332
  const r = e.workflowId.get();
1333
1333
  e.steps.forEach(
1334
- (s) => K(s, t, {
1334
+ (s) => J(s, t, {
1335
1335
  collectionId: o?.collectionId,
1336
1336
  workflowId: r
1337
1337
  })
@@ -1349,11 +1349,11 @@ function K(e, t, o) {
1349
1349
  stepId: n
1350
1350
  });
1351
1351
  }
1352
- const yr = {
1352
+ const vr = {
1353
1353
  name: "manage_collection",
1354
- definition: ir,
1355
- createExecutor: (e) => dr(e)
1356
- }, vr = `Read, add, or change Replay environments (inputs and server mappings).
1354
+ definition: cr,
1355
+ createExecutor: (e) => ur(e)
1356
+ }, gr = `Read, add, or change Replay environments (inputs and server mappings).
1357
1357
 
1358
1358
  **What it does**
1359
1359
  - Manages Replay project environments: inputs (values and secrecy) and per-\`apiId\` server URLs/variables.
@@ -1377,135 +1377,135 @@ const yr = {
1377
1377
  **Loop/budget guidance**
1378
1378
  - Re-read environment/input data when decisions depend on up-to-date values.
1379
1379
  - Batch related input/server changes for the same environment when practical.
1380
- - After changing the active environment, re-check assumptions that depended on the previous one.`, q = c().min(1).optional().describe("Environment name. Omit to use the active environment."), gr = u({
1381
- action: h("get_environments")
1382
- }).strict(), br = u({
1383
- action: h("get_active_environment")
1384
- }).strict(), kr = u({
1385
- action: h("get_inputs"),
1380
+ - After changing the active environment, re-check assumptions that depended on the previous one.`, q = c().min(1).optional().describe("Environment name. Omit to use the active environment."), br = p({
1381
+ action: w("get_environments")
1382
+ }).strict(), kr = p({
1383
+ action: w("get_active_environment")
1384
+ }).strict(), Sr = p({
1385
+ action: w("get_inputs"),
1386
1386
  environment: q
1387
- }).strict(), Sr = u({
1388
- action: h("get_servers"),
1387
+ }).strict(), Tr = p({
1388
+ action: w("get_servers"),
1389
1389
  environment: q
1390
- }).strict(), Tr = u({
1391
- action: h("get_input"),
1390
+ }).strict(), Cr = p({
1391
+ action: w("get_input"),
1392
1392
  environment: q,
1393
1393
  inputName: c().min(1)
1394
- }).strict(), Cr = u({
1395
- action: h("upsert_input"),
1394
+ }).strict(), Or = p({
1395
+ action: w("upsert_input"),
1396
1396
  environment: q,
1397
1397
  name: c().min(1),
1398
1398
  value: c(),
1399
1399
  isSecret: x().optional().describe(
1400
1400
  "Only when creating a new input name: whether the value is secret (default false). Ignored when the name already exists."
1401
1401
  )
1402
- }).strict(), Or = u({
1403
- action: h("remove_input"),
1402
+ }).strict(), Ar = p({
1403
+ action: w("remove_input"),
1404
1404
  environment: q,
1405
1405
  inputName: c().min(1)
1406
- }).strict(), ve = u({
1406
+ }).strict(), ve = p({
1407
1407
  name: c().min(1),
1408
1408
  value: c()
1409
- }).strict(), Ar = u({
1410
- action: h("upsert_server"),
1409
+ }).strict(), Er = p({
1410
+ action: w("upsert_server"),
1411
1411
  environment: q,
1412
1412
  apiId: c().min(1),
1413
1413
  value: c(),
1414
- variables: k(ve).optional()
1415
- }).strict(), Er = u({
1414
+ variables: b(ve).optional()
1415
+ }).strict(), xr = p({
1416
1416
  name: c().min(1),
1417
1417
  value: c(),
1418
1418
  isSecret: x().optional().describe("Defaults to false when omitted.")
1419
- }).strict(), _r = u({
1419
+ }).strict(), $r = p({
1420
1420
  apiId: c().min(1),
1421
1421
  value: c(),
1422
- variables: k(ve).optional()
1423
- }).strict(), $r = u({
1424
- action: h("add_environment"),
1422
+ variables: b(ve).optional()
1423
+ }).strict(), Rr = p({
1424
+ action: w("add_environment"),
1425
1425
  environment: c().min(1).describe("Name of a new environment to create."),
1426
- inputs: k(Er).optional().describe("Optional initial inputs for the new environment."),
1427
- servers: k(_r).optional().describe("Optional initial server mappings for the new environment."),
1426
+ inputs: b(xr).optional().describe("Optional initial inputs for the new environment."),
1427
+ servers: b($r).optional().describe("Optional initial server mappings for the new environment."),
1428
1428
  setActive: x().optional().describe("When true, also set the new environment as active.")
1429
- }).strict(), xr = u({
1430
- action: h("remove_server"),
1429
+ }).strict(), _r = p({
1430
+ action: w("remove_server"),
1431
1431
  environment: q,
1432
1432
  apiId: c().min(1)
1433
- }).strict(), Rr = u({
1434
- action: h("set_active_environment"),
1433
+ }).strict(), qr = p({
1434
+ action: w("set_active_environment"),
1435
1435
  environment: c().min(1).describe("Name of the environment to activate.")
1436
- }).strict(), qr = u({
1436
+ }).strict(), Pr = p({
1437
1437
  payload: te("action", [
1438
- gr,
1439
- $r,
1440
1438
  br,
1439
+ Rr,
1441
1440
  kr,
1442
1441
  Sr,
1443
1442
  Tr,
1444
1443
  Cr,
1445
1444
  Or,
1446
1445
  Ar,
1447
- xr,
1448
- Rr
1446
+ Er,
1447
+ _r,
1448
+ qr
1449
1449
  ])
1450
- }), Pr = u({
1450
+ }), Nr = p({
1451
1451
  summary: c(),
1452
- environmentNames: k(c()).optional(),
1453
- inputs: k(
1454
- u({
1452
+ environmentNames: b(c()).optional(),
1453
+ inputs: b(
1454
+ p({
1455
1455
  name: c(),
1456
1456
  isSecret: x(),
1457
1457
  value: c()
1458
1458
  })
1459
1459
  ).optional(),
1460
- servers: k(
1461
- u({
1460
+ servers: b(
1461
+ p({
1462
1462
  apiId: c(),
1463
1463
  value: c(),
1464
- variables: k(ve)
1464
+ variables: b(ve)
1465
1465
  })
1466
1466
  ).optional(),
1467
- input: u({
1467
+ input: p({
1468
1468
  name: c(),
1469
1469
  isSecret: x(),
1470
1470
  value: c()
1471
1471
  }).optional(),
1472
1472
  environment: c().optional(),
1473
1473
  apiId: c().optional()
1474
- }), Nr = $(Pr), Ur = {
1475
- description: vr,
1476
- inputSchema: qr,
1477
- outputSchema: Nr,
1474
+ }), Ur = $(Nr), Dr = {
1475
+ description: gr,
1476
+ inputSchema: Pr,
1477
+ outputSchema: Ur,
1478
1478
  needsApproval: (e) => e.payload.action === "add_environment" || e.payload.action === "set_active_environment" || e.payload.action === "upsert_input" || e.payload.action === "remove_input" || e.payload.action === "upsert_server" || e.payload.action === "remove_server"
1479
1479
  };
1480
- function Dr(e) {
1480
+ function Lr(e) {
1481
1481
  return async (t, o) => {
1482
1482
  switch (t.payload.action) {
1483
1483
  case "get_environments":
1484
- return Lr(e);
1484
+ return Wr(e);
1485
1485
  case "add_environment":
1486
1486
  return Mr(e, t.payload);
1487
1487
  case "get_active_environment":
1488
- return Wr(e);
1488
+ return Fr(e);
1489
1489
  case "set_active_environment":
1490
- return Vr(e, t.payload);
1490
+ return Kr(e, t.payload);
1491
1491
  case "get_inputs":
1492
- return Fr(e, t.payload);
1493
- case "get_servers":
1494
1492
  return jr(e, t.payload);
1495
- case "get_input":
1493
+ case "get_servers":
1496
1494
  return Br(e, t.payload);
1497
- case "upsert_input":
1495
+ case "get_input":
1498
1496
  return Yr(e, t.payload);
1499
- case "remove_input":
1497
+ case "upsert_input":
1500
1498
  return zr(e, t.payload);
1499
+ case "remove_input":
1500
+ return Hr(e, t.payload);
1501
1501
  case "upsert_server":
1502
1502
  return Gr(e, t.payload);
1503
1503
  case "remove_server":
1504
- return Hr(e, t.payload);
1504
+ return Vr(e, t.payload);
1505
1505
  }
1506
1506
  };
1507
1507
  }
1508
- function Lr(e) {
1508
+ function Wr(e) {
1509
1509
  const t = e.activeEnvironmentId.get(), o = e.environments.map((n) => n.name.get());
1510
1510
  return {
1511
1511
  isError: !1,
@@ -1517,7 +1517,7 @@ function Lr(e) {
1517
1517
  }
1518
1518
  function Mr(e, t) {
1519
1519
  if (ne(e, t.environment))
1520
- return I("Environment already exists.", {
1520
+ return h("Environment already exists.", {
1521
1521
  environment: t.environment
1522
1522
  });
1523
1523
  const n = (t.inputs ?? []).map((s) => ({
@@ -1544,7 +1544,7 @@ function Mr(e, t) {
1544
1544
  }
1545
1545
  };
1546
1546
  }
1547
- function Wr(e) {
1547
+ function Fr(e) {
1548
1548
  const t = e.activeEnvironmentId.get();
1549
1549
  return ne(e, t) ? {
1550
1550
  isError: !1,
@@ -1552,15 +1552,15 @@ function Wr(e) {
1552
1552
  summary: `Active environment is "${t}".`,
1553
1553
  environment: t
1554
1554
  }
1555
- } : I("Active environment not found.", {
1555
+ } : h("Active environment not found.", {
1556
1556
  environment: t
1557
1557
  });
1558
1558
  }
1559
- function Fr(e, t) {
1559
+ function jr(e, t) {
1560
1560
  const o = P(e, t.environment);
1561
1561
  if (!o.ok)
1562
1562
  return o.result;
1563
- const { name: n, env: r } = o, s = Jr(r.get());
1563
+ const { name: n, env: r } = o, s = Qr(r.get());
1564
1564
  return {
1565
1565
  isError: !1,
1566
1566
  data: {
@@ -1570,11 +1570,11 @@ function Fr(e, t) {
1570
1570
  }
1571
1571
  };
1572
1572
  }
1573
- function jr(e, t) {
1573
+ function Br(e, t) {
1574
1574
  const o = P(e, t.environment);
1575
1575
  if (!o.ok)
1576
1576
  return o.result;
1577
- const { name: n, env: r } = o, s = Qr(r.get());
1577
+ const { name: n, env: r } = o, s = Xr(r.get());
1578
1578
  return {
1579
1579
  isError: !1,
1580
1580
  data: {
@@ -1584,13 +1584,13 @@ function jr(e, t) {
1584
1584
  }
1585
1585
  };
1586
1586
  }
1587
- function Br(e, t) {
1587
+ function Yr(e, t) {
1588
1588
  const o = P(e, t.environment);
1589
1589
  if (!o.ok)
1590
1590
  return o.result;
1591
- const { name: n, env: r } = o, s = r.inputs.find((d) => d.name.get() === t.inputName);
1591
+ const { name: n, env: r } = o, s = r.inputs.find((u) => u.name.get() === t.inputName);
1592
1592
  if (!s)
1593
- return I("Input not found.", {
1593
+ return h("Input not found.", {
1594
1594
  environment: n,
1595
1595
  inputName: t.inputName
1596
1596
  });
@@ -1608,13 +1608,13 @@ function Br(e, t) {
1608
1608
  }
1609
1609
  };
1610
1610
  }
1611
- function Yr(e, t) {
1611
+ function zr(e, t) {
1612
1612
  const o = P(e, t.environment);
1613
1613
  if (!o.ok)
1614
1614
  return o.result;
1615
1615
  const { name: n, env: r } = o, a = r.inputs.get().find((i) => i.name === t.name), l = a ? a.isSecret : t.isSecret ?? !1;
1616
1616
  return r.inputs.set((i) => [
1617
- ...i.filter((d) => d.name !== t.name),
1617
+ ...i.filter((u) => u.name !== t.name),
1618
1618
  { name: t.name, value: t.value, isSecret: l }
1619
1619
  ]), {
1620
1620
  isError: !1,
@@ -1624,12 +1624,12 @@ function Yr(e, t) {
1624
1624
  }
1625
1625
  };
1626
1626
  }
1627
- function zr(e, t) {
1627
+ function Hr(e, t) {
1628
1628
  const o = P(e, t.environment);
1629
1629
  if (!o.ok)
1630
1630
  return o.result;
1631
1631
  const { name: n, env: r } = o, s = r.inputs.get(), a = s.filter((l) => l.name !== t.inputName);
1632
- return a.length === s.length ? I("Input not found.", {
1632
+ return a.length === s.length ? h("Input not found.", {
1633
1633
  environment: n,
1634
1634
  inputName: t.inputName
1635
1635
  }) : (r.inputs.set(a), {
@@ -1646,7 +1646,7 @@ function Gr(e, t) {
1646
1646
  return o.result;
1647
1647
  const { name: n, env: r } = o;
1648
1648
  return r.servers.set((s) => {
1649
- const a = s.findIndex((d) => d.apiId === t.apiId), l = a >= 0 && t.variables === void 0 ? s[a].variables : t.variables ?? [], i = {
1649
+ const a = s.findIndex((u) => u.apiId === t.apiId), l = a >= 0 && t.variables === void 0 ? s[a].variables : t.variables ?? [], i = {
1650
1650
  apiId: t.apiId,
1651
1651
  value: t.value,
1652
1652
  variables: l
@@ -1661,12 +1661,12 @@ function Gr(e, t) {
1661
1661
  }
1662
1662
  };
1663
1663
  }
1664
- function Hr(e, t) {
1664
+ function Vr(e, t) {
1665
1665
  const o = P(e, t.environment);
1666
1666
  if (!o.ok)
1667
1667
  return o.result;
1668
1668
  const { name: n, env: r } = o, s = r.servers.get(), a = s.filter((l) => l.apiId !== t.apiId);
1669
- return a.length === s.length ? I("Server not found.", {
1669
+ return a.length === s.length ? h("Server not found.", {
1670
1670
  environment: n,
1671
1671
  apiId: t.apiId
1672
1672
  }) : (r.servers.set(a), {
@@ -1678,22 +1678,22 @@ function Hr(e, t) {
1678
1678
  }
1679
1679
  });
1680
1680
  }
1681
- function Vr(e, t) {
1681
+ function Kr(e, t) {
1682
1682
  return ne(e, t.environment) ? (e.activeEnvironmentId.set(t.environment), {
1683
1683
  isError: !1,
1684
1684
  data: {
1685
1685
  summary: `Active environment is now "${t.environment}".`
1686
1686
  }
1687
- }) : I("Environment not found.", { environment: t.environment });
1687
+ }) : h("Environment not found.", { environment: t.environment });
1688
1688
  }
1689
- function Kr(e, t) {
1689
+ function Jr(e, t) {
1690
1690
  return t ?? e.activeEnvironmentId.get();
1691
1691
  }
1692
1692
  function P(e, t) {
1693
- const o = Kr(e, t), n = ne(e, o);
1693
+ const o = Jr(e, t), n = ne(e, o);
1694
1694
  return n ? { ok: !0, name: o, env: n } : {
1695
1695
  ok: !1,
1696
- result: I(
1696
+ result: h(
1697
1697
  t !== void 0 ? "Environment not found." : "Active environment not found.",
1698
1698
  { environment: o }
1699
1699
  )
@@ -1702,14 +1702,14 @@ function P(e, t) {
1702
1702
  function ne(e, t) {
1703
1703
  return e.environments.find((o) => o.name.get() === t);
1704
1704
  }
1705
- function Jr(e) {
1705
+ function Qr(e) {
1706
1706
  return e.inputs.map((t) => ({
1707
1707
  name: t.name,
1708
1708
  isSecret: t.isSecret,
1709
1709
  value: wt(t.isSecret, t.value)
1710
1710
  }));
1711
1711
  }
1712
- function Qr(e) {
1712
+ function Xr(e) {
1713
1713
  return e.servers.map((t) => ({
1714
1714
  apiId: t.apiId,
1715
1715
  value: t.value,
@@ -1717,27 +1717,26 @@ function Qr(e) {
1717
1717
  }));
1718
1718
  }
1719
1719
  function wt(e, t) {
1720
- return e ? Mt : t;
1720
+ return e ? Wt : t;
1721
1721
  }
1722
- const Xr = {
1722
+ const Zr = {
1723
1723
  name: "manage_environment",
1724
- definition: Ur,
1725
- createExecutor: (e) => Dr(e.store)
1726
- }, Zr = tt, es = "Open or focus a tab in Replay.\n\n**What it does**\n- Opens or focuses tabs only (navigation/state change).\n- Does not execute requests and does not create/update/delete saved assets.\n\n**Use when**\n- You need to open a request, operation, collection, workflow, step, or workflow-run tab.\n- You need to bring an already open tab into focus.\n\n**Never use when**\n- You need to execute an HTTP request.\n- You need to create or edit saved workflow content.\n- You are re-opening the same target only to re-verify unchanged state.\n\n**Input guidance**\n- Use ids exactly as stored in Replay (same spelling and casing).\n- Choose action by intent:\n - `open_new_request`: one-off HTTP call; blank tab when `requestUrl` is omitted, prefilled ad-hoc request when provided (`requestMethod` defaults to GET).\n - `open_operation`: open a spec operation by `operationId` in an unsaved request tab.\n - `open_collection` / `open_workflow` / `open_step` / `open_workflow_run`: open saved entities by their required ids.\n - `focus_tab`: focus an already open tab by zero-based `tabIndex`.\n- Use `open_workflow_run` when you need full workflow execution context (including cross-step `$steps.*` resolution).\n\n**Loop/budget guidance**\n- Open or focus each target once per task unless state changed.\n- Prefer `focus_tab` for already open tabs instead of repeatedly opening the same target.\n- `open_workflow_run` creates a new run tab each call; use only when a new run context is needed.\n- During workflow build, avoid opening run tabs until planned step creation is complete.", ts = T([
1724
+ definition: Dr,
1725
+ createExecutor: (e) => Lr(e.store)
1726
+ }, es = et, ts = "Open or focus a tab in Replay.\n\n**What it does**\n- Opens or focuses tabs only (navigation/state change).\n- Does not execute requests and does not create/update/delete saved assets.\n\n**Use when**\n- You need to open a request, operation, collection, workflow, or step tab.\n- You need to bring an already open tab into focus.\n\n**Never use when**\n- You need to execute an HTTP request.\n- You need to run a workflow — use `run_workflow`; it runs headlessly and returns the run's `historyId`.\n- You need to create or edit saved workflow content.\n- You are re-opening the same target only to re-verify unchanged state.\n\n**Input guidance**\n- Use ids exactly as stored in Replay (same spelling and casing).\n- Choose action by intent:\n - `open_new_request`: one-off HTTP call; blank tab when `requestUrl` is omitted, prefilled ad-hoc request when provided (`requestMethod` defaults to GET).\n - `open_operation`: open a spec operation by `operationId` in an unsaved request tab.\n - `open_collection` / `open_workflow` / `open_step`: open saved entities by their required ids.\n - `focus_tab`: focus an already open tab by zero-based `tabIndex`.\n\n**Loop/budget guidance**\n- Open or focus each target once per task unless state changed.\n- Prefer `focus_tab` for already open tabs instead of repeatedly opening the same target.", os = S([
1727
1727
  "focus_tab",
1728
1728
  "open_operation",
1729
1729
  "open_collection",
1730
1730
  "open_workflow",
1731
1731
  "open_step",
1732
- "open_workflow_run",
1733
1732
  "open_new_request"
1734
- ]), os = ee({
1735
- action: ts.describe(
1733
+ ]), ns = B({
1734
+ action: os.describe(
1736
1735
  "Tab to open or focus; see tool description for unsaved vs collection actions."
1737
1736
  ),
1738
- tabIndex: O().optional().describe("focus_tab only: zero-based index of an already open tab."),
1739
- collectionId: c().optional().describe("open_collection, open_workflow, open_step, or open_workflow_run."),
1740
- workflowId: c().optional().describe("open_workflow, open_step, or open_workflow_run."),
1737
+ tabIndex: T().optional().describe("focus_tab only: zero-based index of an already open tab."),
1738
+ collectionId: c().optional().describe("open_collection, open_workflow, or open_step."),
1739
+ workflowId: c().optional().describe("open_workflow or open_step."),
1741
1740
  stepId: c().optional().describe("open_step only."),
1742
1741
  operationId: c().optional().describe(
1743
1742
  "open_operation only: OpenAPI operationId from the loaded spec; opens an unsaved request tab for that operation."
@@ -1745,7 +1744,7 @@ const Xr = {
1745
1744
  requestUrl: c().optional().describe(
1746
1745
  "open_new_request only: absolute or host URL for an unsaved ad-hoc request (e.g. https://example.com/api). Omit for a blank tab."
1747
1746
  ),
1748
- requestMethod: T(Zr).optional().describe("open_new_request with requestUrl: HTTP method; defaults to GET if omitted.")
1747
+ requestMethod: S(es).optional().describe("open_new_request with requestUrl: HTTP method; defaults to GET if omitted.")
1749
1748
  }).superRefine((e, t) => {
1750
1749
  const n = (e.requestUrl?.trim() ?? "").length > 0, r = e.requestMethod !== void 0;
1751
1750
  (n || r) && e.action !== "open_new_request" && t.addIssue({
@@ -1757,15 +1756,15 @@ const Xr = {
1757
1756
  message: "requestMethod requires a non-empty requestUrl.",
1758
1757
  path: ["requestMethod"]
1759
1758
  });
1760
- }), ns = u({
1761
- outcome: T(["focused", "opened"]),
1762
- activeTabIndex: O().int().nonnegative(),
1759
+ }), rs = p({
1760
+ outcome: S(["focused", "opened"]),
1761
+ activeTabIndex: T().int().nonnegative(),
1763
1762
  tabId: c(),
1764
- tabType: so(C)
1765
- }), rs = $(ns), ss = {
1766
- description: es,
1767
- inputSchema: os,
1768
- outputSchema: rs,
1763
+ tabType: so(O)
1764
+ }), ss = $(rs), as = {
1765
+ description: ts,
1766
+ inputSchema: ns,
1767
+ outputSchema: ss,
1769
1768
  needsApproval: !1
1770
1769
  };
1771
1770
  function re({
@@ -1785,7 +1784,7 @@ function re({
1785
1784
  details: { matches: l.map(r) }
1786
1785
  } : { ok: !1, message: o.notFound, details: s(a) };
1787
1786
  }
1788
- function yt(e, t) {
1787
+ function It(e, t) {
1789
1788
  const o = re({
1790
1789
  items: e.collections,
1791
1790
  id: t,
@@ -1809,7 +1808,7 @@ function yt(e, t) {
1809
1808
  };
1810
1809
  }
1811
1810
  function ge(e, t, o) {
1812
- const n = yt(e, t);
1811
+ const n = It(e, t);
1813
1812
  if (!n.ok) return n;
1814
1813
  const r = re({
1815
1814
  items: n.value.collection.workflows,
@@ -1840,7 +1839,7 @@ function ge(e, t, o) {
1840
1839
  }
1841
1840
  };
1842
1841
  }
1843
- function vt(e, t, o, n) {
1842
+ function yt(e, t, o, n) {
1844
1843
  const r = ge(e, t, o);
1845
1844
  if (!r.ok) return r;
1846
1845
  const s = re({
@@ -1874,8 +1873,8 @@ function vt(e, t, o, n) {
1874
1873
  }
1875
1874
  };
1876
1875
  }
1877
- function as(e, t) {
1878
- const o = Wt(e.apis).filter(
1876
+ function is(e, t) {
1877
+ const o = Mt(e.apis).filter(
1879
1878
  (r) => r.operationId != null && r.operationId !== ""
1880
1879
  );
1881
1880
  if (!o.length)
@@ -1901,7 +1900,7 @@ function as(e, t) {
1901
1900
  });
1902
1901
  return n.ok ? { ok: !0, value: n.value } : n;
1903
1902
  }
1904
- function gt(e, t, o, n) {
1903
+ function vt(e, t, o, n) {
1905
1904
  t = t.trim(), o = o.trim(), n = n.trim();
1906
1905
  const r = !t && !o && !n, s = !!(t && o && n);
1907
1906
  if (!r && !s)
@@ -1910,7 +1909,7 @@ function gt(e, t, o, n) {
1910
1909
  message: "Provide all three ids for a saved step, or three empty strings for the focused unsaved request tab."
1911
1910
  };
1912
1911
  if (s) {
1913
- const m = vt(e, t, o, n);
1912
+ const m = yt(e, t, o, n);
1914
1913
  return m.ok ? { ok: !0, value: m.value.step } : m;
1915
1914
  }
1916
1915
  const a = pe(e);
@@ -1920,19 +1919,19 @@ function gt(e, t, o, n) {
1920
1919
  message: "Active tab is not a step tab.",
1921
1920
  details: { tabType: a?.data?.type?.get() }
1922
1921
  };
1923
- const l = a.data.collectionId.get(), i = a.data.workflowId.get(), d = a.data.stepId.get();
1924
- if (!ot(l, i, d, "", "", ""))
1922
+ const l = a.data.collectionId.get(), i = a.data.workflowId.get(), u = a.data.stepId.get();
1923
+ if (!tt(l, i, u, "", "", ""))
1925
1924
  return {
1926
1925
  ok: !1,
1927
1926
  message: "Active tab does not match unsaved draft target. Open the unsaved request tab first, or pass collection/workflow/step ids for a saved step.",
1928
1927
  details: {
1929
- activeTab: { collectionId: l, workflowId: i, stepId: d }
1928
+ activeTab: { collectionId: l, workflowId: i, stepId: u }
1930
1929
  }
1931
1930
  };
1932
- const p = a.data.draftStep.ornull;
1933
- return p ? { ok: !0, value: p } : { ok: !1, message: "No draft step on the active tab." };
1931
+ const d = a.data.draftStep.ornull;
1932
+ return d ? { ok: !0, value: d } : { ok: !1, message: "No draft step on the active tab." };
1934
1933
  }
1935
- function is(e) {
1934
+ function cs(e) {
1936
1935
  return {
1937
1936
  apiId: e.apiId,
1938
1937
  path: e.path,
@@ -1941,174 +1940,160 @@ function is(e) {
1941
1940
  isAdditionalOperation: e.isAdditionalOperation
1942
1941
  };
1943
1942
  }
1944
- function cs(e, t, o) {
1943
+ function ls(e, t, o) {
1945
1944
  const n = o.getApiOperation(t), s = e.tabsState.tabs.get({ noproxy: !0 }).findIndex((l) => {
1946
1945
  const i = l.data;
1947
- return Q(i, C.Step) && i.draftStep?.operation?.apiId === t.apiId && i.draftStep?.operation?.path === t.path && i.draftStep?.operation?.method === t.method;
1946
+ return X(i, O.Step) && i.draftStep?.operation?.apiId === t.apiId && i.draftStep?.operation?.path === t.path && i.draftStep?.operation?.method === t.method;
1948
1947
  });
1949
1948
  if (s !== -1)
1950
1949
  return o.handleTabChange(s), "focused";
1951
1950
  const a = Ft(t, n);
1952
- return o.addNewTab({ ...a, state: nt.Normal }), "opened";
1951
+ return o.addNewTab({ ...a, state: ot.Normal }), "opened";
1953
1952
  }
1954
- function ls(e, t) {
1953
+ function ds(e, t) {
1955
1954
  return (o, n) => {
1956
1955
  try {
1957
1956
  switch (o.action) {
1958
1957
  case "focus_tab":
1959
- return ds(e, t, o.tabIndex);
1958
+ return us(e, t, o.tabIndex);
1960
1959
  case "open_operation":
1961
- return us(e, t, o.operationId);
1960
+ return ps(e, t, o.operationId);
1962
1961
  case "open_collection":
1963
- return ps(e, t, o.collectionId);
1962
+ return fs(e, t, o.collectionId);
1964
1963
  case "open_workflow":
1965
- return fs(e, t, o.collectionId, o.workflowId);
1964
+ return ms(e, t, o.collectionId, o.workflowId);
1966
1965
  case "open_step":
1967
- return ms(e, t, o.collectionId, o.workflowId, o.stepId);
1968
- case "open_workflow_run":
1969
- return hs(e, t, o.collectionId, o.workflowId);
1966
+ return hs(e, t, o.collectionId, o.workflowId, o.stepId);
1970
1967
  case "open_new_request":
1971
- return Is(e, t, o.requestUrl, o.requestMethod);
1968
+ return ws(e, t, o.requestUrl, o.requestMethod);
1972
1969
  default: {
1973
1970
  const r = o.action;
1974
- return S("Unsupported open_tab action.", { action: r });
1971
+ return C("Unsupported open_tab action.", { action: r });
1975
1972
  }
1976
1973
  }
1977
1974
  } catch (r) {
1978
- return S("Failed to open or focus tab.", {
1975
+ return C("Failed to open or focus tab.", {
1979
1976
  cause: r instanceof Error ? r.message : String(r)
1980
1977
  });
1981
1978
  }
1982
1979
  };
1983
1980
  }
1984
- function ds(e, t, o) {
1981
+ function us(e, t, o) {
1985
1982
  if (o === void 0)
1986
- return S("tabIndex is required when action is focus_tab");
1983
+ return C("tabIndex is required when action is focus_tab");
1987
1984
  const n = e.tabsState.tabs.get({ noproxy: !0 });
1988
- return o < 0 || o >= n.length ? S("Invalid tab index.", {
1985
+ return o < 0 || o >= n.length ? C("Invalid tab index.", {
1989
1986
  tabIndex: o,
1990
1987
  tabCount: n.length
1991
- }) : (t.handleTabChange(o), N(e, "focused"));
1988
+ }) : (t.handleTabChange(o), F(e, "focused"));
1992
1989
  }
1993
- function us(e, t, o) {
1990
+ function ps(e, t, o) {
1994
1991
  const n = o?.trim();
1995
1992
  if (!n)
1996
- return S("operationId is required when action is open_operation");
1997
- const r = as(e, n);
1993
+ return C("operationId is required when action is open_operation");
1994
+ const r = is(e, n);
1998
1995
  if (!r.ok)
1999
- return S(r.message, r.details);
2000
- const s = cs(
1996
+ return C(r.message, r.details);
1997
+ const s = ls(
2001
1998
  e,
2002
- is(r.value),
1999
+ cs(r.value),
2003
2000
  t
2004
2001
  );
2005
- return N(e, s);
2002
+ return F(e, s);
2006
2003
  }
2007
- function ps(e, t, o) {
2004
+ function fs(e, t, o) {
2008
2005
  const n = o?.trim();
2009
2006
  if (!n)
2010
- return S("collectionId is required when action is open_collection");
2011
- const r = yt(e, n);
2007
+ return C("collectionId is required when action is open_collection");
2008
+ const r = It(e, n);
2012
2009
  if (!r.ok)
2013
- return S(r.message, r.details);
2010
+ return C(r.message, r.details);
2014
2011
  const { collectionId: s } = r.value, a = e.tabsState.tabs.findIndex((l) => {
2015
2012
  const i = l.data.get();
2016
- return Q(i, C.Collection) && i.collectionId === s;
2013
+ return X(i, O.Collection) && i.collectionId === s;
2017
2014
  }) !== -1;
2018
2015
  return t.openCollectionTab({
2019
2016
  collectionId: s,
2020
- activeTabName: rt.COLLECTION_SETTINGS
2021
- }), N(e, a ? "focused" : "opened");
2017
+ activeTabName: nt.COLLECTION_SETTINGS
2018
+ }), F(e, a ? "focused" : "opened");
2022
2019
  }
2023
- function fs(e, t, o, n) {
2020
+ function ms(e, t, o, n) {
2024
2021
  const r = o?.trim(), s = n?.trim();
2025
2022
  if (!r)
2026
- return S("collectionId is required when action is open_workflow");
2023
+ return C("collectionId is required when action is open_workflow");
2027
2024
  if (!s)
2028
- return S("workflowId is required when action is open_workflow");
2025
+ return C("workflowId is required when action is open_workflow");
2029
2026
  const a = ge(e, r, s);
2030
2027
  if (!a.ok)
2031
- return S(a.message, a.details);
2032
- const { collectionId: l, workflowId: i } = a.value, d = e.tabsState.tabs.findIndex((p) => {
2033
- const m = p.data.get();
2034
- return Q(m, C.Workflow) && m.workflowId === i && m.collectionId === l;
2028
+ return C(a.message, a.details);
2029
+ const { collectionId: l, workflowId: i } = a.value, u = e.tabsState.tabs.findIndex((d) => {
2030
+ const m = d.data.get();
2031
+ return X(m, O.Workflow) && m.workflowId === i && m.collectionId === l;
2035
2032
  }) !== -1;
2036
2033
  return t.openWorkflowTab({
2037
2034
  collectionId: l,
2038
2035
  workflowId: i,
2039
- activeTabName: rt.WORKFLOW_SETTINGS
2040
- }), N(e, d ? "focused" : "opened");
2036
+ activeTabName: nt.WORKFLOW_SETTINGS
2037
+ }), F(e, u ? "focused" : "opened");
2041
2038
  }
2042
- function ms(e, t, o, n, r) {
2039
+ function hs(e, t, o, n, r) {
2043
2040
  const s = o?.trim(), a = n?.trim(), l = r?.trim();
2044
2041
  if (!s)
2045
- return S("collectionId is required when action is open_step");
2042
+ return C("collectionId is required when action is open_step");
2046
2043
  if (!a)
2047
- return S("workflowId is required when action is open_step");
2044
+ return C("workflowId is required when action is open_step");
2048
2045
  if (!l)
2049
- return S("stepId is required when action is open_step");
2050
- const i = vt(e, s, a, l);
2046
+ return C("stepId is required when action is open_step");
2047
+ const i = yt(e, s, a, l);
2051
2048
  if (!i.ok)
2052
- return S(i.message, i.details);
2049
+ return C(i.message, i.details);
2053
2050
  const {
2054
- collectionId: d,
2055
- workflowId: p,
2051
+ collectionId: u,
2052
+ workflowId: d,
2056
2053
  stepId: m
2057
- } = i.value, f = e.tabsState.tabs.get().find(({ data: y }) => Q(y, C.Step) && y.collectionId === d && y.workflowId === p && y.stepId === m && y.historyId === null) !== void 0;
2054
+ } = i.value, f = e.tabsState.tabs.get().find(({ data: y }) => X(y, O.Step) && y.collectionId === u && y.workflowId === d && y.stepId === m && y.historyId === null) !== void 0;
2058
2055
  return t.openStepTabFromCollection({
2059
- collectionId: d,
2060
- workflowId: p,
2056
+ collectionId: u,
2057
+ workflowId: d,
2061
2058
  stepId: m,
2062
- state: nt.Normal
2063
- }), N(e, f ? "focused" : "opened");
2064
- }
2065
- function hs(e, t, o, n) {
2066
- const r = o?.trim(), s = n?.trim();
2067
- if (!r)
2068
- return S("collectionId is required when action is open_workflow_run");
2069
- if (!s)
2070
- return S("workflowId is required when action is open_workflow_run");
2071
- const a = ge(e, r, s);
2072
- if (!a.ok)
2073
- return S(a.message, a.details);
2074
- const { collectionId: l, workflowId: i } = a.value;
2075
- return t.openWorkflowRunTab({ collectionId: l, workflowId: i }), N(e, "opened");
2059
+ state: ot.Normal
2060
+ }), F(e, f ? "focused" : "opened");
2076
2061
  }
2077
- function Is(e, t, o, n) {
2062
+ function ws(e, t, o, n) {
2078
2063
  return o ? t.openStepTabFromXOperation({
2079
2064
  method: n ?? "GET",
2080
2065
  url: o
2081
- }) : t.handleNewTabOpen(), N(e, "opened");
2066
+ }) : t.handleNewTabOpen(), F(e, "opened");
2082
2067
  }
2083
- function N(e, t) {
2068
+ function F(e, t) {
2084
2069
  const o = e.tabsState.activeTabIdx.get(), n = e.tabsState.tabs.get({ noproxy: !0 })[o];
2085
- return n ? ws(t, o, n.id, n.data.type) : S("No active tab after navigation.", { activeTabIndex: o });
2070
+ return n ? Is(t, o, n.id, n.data.type) : C("No active tab after navigation.", { activeTabIndex: o });
2086
2071
  }
2087
- function S(e, t) {
2072
+ function C(e, t) {
2088
2073
  return {
2089
2074
  isError: !0,
2090
2075
  error: { message: e, ...t !== void 0 ? { details: t } : {} }
2091
2076
  };
2092
2077
  }
2093
- function ws(e, t, o, n) {
2078
+ function Is(e, t, o, n) {
2094
2079
  return { isError: !1, data: { outcome: e, activeTabIndex: t, tabId: o, tabType: n } };
2095
2080
  }
2096
2081
  const ys = {
2097
2082
  name: "open_tab",
2098
- definition: ss,
2099
- createExecutor: (e) => ls(e.store, e.context)
2083
+ definition: as,
2084
+ createExecutor: (e) => ds(e.store, e.context)
2100
2085
  }, vs = `Report a short milestone status for the current task. UI-only: shows a one-line status above the next action; performs no workflow action and returns only acknowledgment.
2101
2086
 
2102
2087
  Use when: starting a multi-step task after deciding the plan; crossing a major phase boundary (planning -> creating -> wiring -> verifying); starting a new debug attempt; or pivoting to a different approach.
2103
2088
 
2104
2089
  Report at most one status per phase and only a few per task. Do not narrate routine tool calls, repeat the previous status, or use it in place of the final assistant response. Make the message concrete and user-facing: plain text, no markdown; name the relevant Arazzo object; describe milestone intent, not internal reasoning or tool names.
2105
2090
 
2106
- Duplicates of earlier statuses and statuses reported back-to-back with no action in between add no value; when detected, the acknowledgment includes a corrective note - act on it instead of reporting another status. Too many statuses in a row are blocked instead of acknowledged.`, gs = ee({
2091
+ Duplicates of earlier statuses and statuses reported back-to-back with no action in between add no value; when detected, the acknowledgment includes a corrective note - act on it instead of reporting another status. Too many statuses in a row are blocked instead of acknowledged.`, gs = B({
2107
2092
  message: c().trim().min(1).max(220).regex(/^[^\r\n]+$/, "must be a single line").describe(
2108
2093
  "Short status line for a milestone (plan start, phase boundary, new debug attempt, pivot). Plain text, no markdown. Do not narrate every tool call."
2109
2094
  )
2110
- }), bs = u({
2111
- acknowledged: h(!0)
2095
+ }), bs = p({
2096
+ acknowledged: w(!0)
2112
2097
  }), ks = $(bs), Ss = {
2113
2098
  description: vs,
2114
2099
  inputSchema: gs,
@@ -2129,17 +2114,17 @@ function As(e) {
2129
2114
  return `STOP: ${e} status messages in a row with no action taken. Reporting status is not progress. Do NOT call report_status again until you have made a change or run a request. Take the next concrete action now, or if you are blocked, say so in your final answer.`;
2130
2115
  }
2131
2116
  const Es = [
2132
- ft({
2133
- key: (e) => pt(e.message),
2117
+ pt({
2118
+ key: (e) => ut(e.message),
2134
2119
  warn: Cs
2135
2120
  }),
2136
- nn({
2121
+ rn({
2137
2122
  warnAfter: 2,
2138
2123
  warnMessage: Os,
2139
2124
  blockAfter: 4,
2140
2125
  blockMessage: As
2141
2126
  })
2142
- ], _s = {
2127
+ ], xs = {
2143
2128
  name: "report_status",
2144
2129
  definition: Ss,
2145
2130
  guards: Es,
@@ -2173,7 +2158,7 @@ const Es = [
2173
2158
  - Execute when you need new runtime evidence, not by default after every edit.
2174
2159
  - Re-run after meaningful request/config changes or when validating a fix/hypothesis.
2175
2160
  - Avoid rapid duplicate runs with unchanged inputs when prior output already answers the question.
2176
- - For endpoint exploration, treat one run per endpoint as default budget unless inputs changed or rerun is explicitly needed.`, xs = u({
2161
+ - For endpoint exploration, treat one run per endpoint as default budget unless inputs changed or rerun is explicitly needed.`, Rs = p({
2177
2162
  collectionId: c().describe(
2178
2163
  "Saved step: collection id. Unsaved draft tab on focus: empty string (with empty workflowId and stepId)."
2179
2164
  ),
@@ -2190,17 +2175,17 @@ const Es = [
2190
2175
  message: "Provide all three ids for a saved step, or three empty strings for the focused unsaved request tab.",
2191
2176
  path: ["collectionId"]
2192
2177
  });
2193
- }), Rs = u({
2194
- status: O().optional().describe("HTTP status code."),
2195
- headers: k(Re([c(), c()])).optional().describe("Response headers as key-value pairs."),
2196
- cookies: k(Re([c(), c()])).optional().describe("Response cookies as key-value pairs."),
2178
+ }), _s = p({
2179
+ status: T().optional().describe("HTTP status code."),
2180
+ headers: b(_e([c(), c()])).optional().describe("Response headers as key-value pairs."),
2181
+ cookies: b(_e([c(), c()])).optional().describe("Response cookies as key-value pairs."),
2197
2182
  body: c().optional().describe("Response body, truncated if too large."),
2198
2183
  url: c().optional().describe("Final response URL."),
2199
- duration: O().optional().describe("Request duration in milliseconds."),
2200
- size: O().optional().describe("Response size in bytes.")
2201
- }), qs = $(Rs), Ps = {
2184
+ duration: T().optional().describe("Request duration in milliseconds."),
2185
+ size: T().optional().describe("Response size in bytes.")
2186
+ }), qs = $(_s), Ps = {
2202
2187
  description: $s,
2203
- inputSchema: xs,
2188
+ inputSchema: Rs,
2204
2189
  outputSchema: qs,
2205
2190
  needsApproval: () => !0
2206
2191
  };
@@ -2208,19 +2193,19 @@ function Ns(e, t) {
2208
2193
  return async (n, r) => {
2209
2194
  const s = pe(e);
2210
2195
  if (!s || !fe(s))
2211
- return I("Active tab is not a step tab", {
2196
+ return h("Active tab is not a step tab", {
2212
2197
  tabType: s?.data?.type?.get()
2213
2198
  });
2214
- const a = s.data.collectionId.get(), l = s.data.workflowId.get(), i = s.data.stepId.get(), d = n.collectionId.trim(), p = n.workflowId.trim(), m = n.stepId.trim();
2215
- if (!ot(
2199
+ const a = s.data.collectionId.get(), l = s.data.workflowId.get(), i = s.data.stepId.get(), u = n.collectionId.trim(), d = n.workflowId.trim(), m = n.stepId.trim();
2200
+ if (!tt(
2216
2201
  a,
2217
2202
  l,
2218
2203
  i,
2204
+ u,
2219
2205
  d,
2220
- p,
2221
2206
  m
2222
2207
  ))
2223
- return I(
2208
+ return h(
2224
2209
  "Active tab does not match the target step. Open the target tab first using open_tab.",
2225
2210
  {
2226
2211
  activeTab: {
@@ -2231,19 +2216,19 @@ function Ns(e, t) {
2231
2216
  hint: a === null && l === null && i === null ? "Focused tab is an unsaved request; pass empty strings for collectionId, workflowId, and stepId." : void 0
2232
2217
  }
2233
2218
  );
2234
- const y = et(e, {
2235
- collectionId: d || null,
2236
- workflowId: p || null,
2219
+ const y = Ze(e, {
2220
+ collectionId: u || null,
2221
+ workflowId: d || null,
2237
2222
  stepId: m || null
2238
2223
  }) ?? s.data.draftStep.ornull;
2239
2224
  if (!y)
2240
- return I("No step available for the active tab.");
2225
+ return h("No step available for the active tab.");
2241
2226
  await jt(e, y, t);
2242
- const g = s.data.response.get();
2243
- return g ? {
2227
+ const v = s.data.response.get();
2228
+ return v ? {
2244
2229
  isError: !1,
2245
- data: Us(g)
2246
- } : I("Request did not produce a response.");
2230
+ data: Us(v)
2231
+ } : h("Request did not produce a response.");
2247
2232
  };
2248
2233
  }
2249
2234
  function Us(e) {
@@ -2264,20 +2249,121 @@ function Ye(e) {
2264
2249
  return t;
2265
2250
  }
2266
2251
  function Ds(e) {
2267
- return e.length <= M ? e : `${e.slice(0, M)}… (truncated, total ${e.length} chars)`;
2252
+ return e.length <= L ? e : `${e.slice(0, L)}… (truncated, total ${e.length} chars)`;
2268
2253
  }
2269
2254
  const Ls = {
2270
2255
  name: "run_request",
2271
2256
  definition: Ps,
2272
2257
  createExecutor: (e) => Ns(e.store, e.settingsState)
2273
- }, Ms = 25, Ws = 'RAG semantic search over OpenAPI specs and Arazzo assets in the current Replay project.\n\n**What it does**\n- Finds OpenAPI and Arazzo entities via natural-language query (scoped by `type`), returning up to `count` matches with detail via `include`.\n\n**Use when**\n- You need **initial schema/context** or request schema details from project assets.\n- You need canonical IDs/coordinates for an API, collection, workflow, or step.\n- You need to find operations/workflows/steps by natural language when IDs are unknown.\n\n**Never use when**\n- You are only verifying post-action UI changes in the active tab.\n- You already have exact IDs and only need active-tab state.\n- You are about to repeat an identical no-result query.\n\n**Input guidance**\n- Rewording the same query rarely helps; change `type`, `query`, or intent instead.\n- "Collection" is ambiguous (Arazzo entity vs API requests by tags/path/criteria). For request lists, use `type: api_operation` with query/filters—not Arazzo `collection`.\n- Pass all known filters (`apiId`, `path`, `method`, `operationId`, `collectionId`, `workflowId`, `stepId`); `query + filters` is most precise.\n- If semantic search returns no matches, ID filters enable direct lookup (see pairing on each filter field).\n- Phrase `query` like indexed text: titles/descriptions for collections/workflows; `step: …`; `operationId: …`; path/method/tags for endpoints.\n- If results are empty and lookup needs missing IDs, the tool may ask for them.\n', Fs = u({
2258
+ }, Ws = `Run an Arazzo workflow and return its result.
2259
+
2260
+ **What it does**
2261
+ - Executes the whole workflow (all steps, with cross-step \`$steps.*\` resolution) and waits for it to finish.
2262
+ - Saves the run and returns its \`historyId\` plus a per-step outcome summary.
2263
+ - Does not open any tab. The user opens the finished run themselves from the link you provide.
2264
+
2265
+ **Use when**
2266
+ - The user explicitly asks to run, re-run, test, or verify a workflow, or accepts a run you offered.
2267
+ - You need the actual outcome of a workflow (status codes, which steps failed).
2268
+
2269
+ **Never use when**
2270
+ - The user only asked to create, build, update, or fix a workflow. Creating is not running: finish at the saved workflow and offer the run instead of starting one.
2271
+ - You want to confirm your own work. A build request never authorizes real traffic with the user's credentials.
2272
+ - You need a single HTTP request — use \`run_request\`.
2273
+ - You only need to read an already finished run that is open in a tab — use \`get_current_tab\`.
2274
+
2275
+ **Input guidance**
2276
+ - \`collectionId\` and \`workflowId\` are required; use ids exactly as stored in Replay.
2277
+
2278
+ **After the run**
2279
+ - Report the outcome from this tool's result; do not re-read it with other tools.
2280
+ - When \`historyId\` is non-null, link to the run: \`[label](replay://workflow-run?collectionId=...&workflowId=...&historyId=...)\`. That link reopens this exact run; it never starts a new one. When it is null, say the run was not saved instead of building a link; never put the literal text null in the url.
2281
+ - Each call starts a NEW run. Call it again only when the user wants another run.`, Ms = B({
2282
+ collectionId: c().describe("Id of the collection that holds the workflow."),
2283
+ workflowId: c().describe("Id of the workflow to run.")
2284
+ }), Fs = p({
2285
+ stepId: c(),
2286
+ statusCode: T().int().nullable(),
2287
+ passed: x()
2288
+ }), js = p({
2289
+ collectionId: c().describe("Resolved id of the collection that was run."),
2290
+ workflowId: c().describe("Resolved id of the workflow that was run."),
2291
+ historyId: c().nullable().describe(
2292
+ "Id of this saved run. Put it in the workflow-run link as &historyId=... so the user can reopen this exact run. Null when history is not persisted."
2293
+ ),
2294
+ success: x().describe(
2295
+ "Overall verdict from the execution engine. False when a step failed a non-warn check or the run hit the global timeout. Can be false even when passedSteps equals totalSteps: a step that failed and then passed on retry is not counted as failed here."
2296
+ ),
2297
+ timedOut: x().describe(
2298
+ "True when the run hit the global execution timeout. Then success is false even if every listed step passed; report that the run timed out rather than blaming a step."
2299
+ ),
2300
+ durationMs: T().describe("Total run time in milliseconds."),
2301
+ totalSteps: T().int().nonnegative(),
2302
+ passedSteps: T().int().nonnegative(),
2303
+ steps: b(Fs).describe(
2304
+ "Per-step outcome, in execution order: stepId, HTTP statusCode, and pass/fail only — no check name or failure message."
2305
+ )
2306
+ }), Bs = $(js), Ys = {
2307
+ description: Ws,
2308
+ inputSchema: Ms,
2309
+ outputSchema: Bs,
2310
+ needsApproval: !1
2311
+ };
2312
+ function zs(e, t) {
2313
+ return async (o, n) => {
2314
+ const r = o.collectionId.trim(), s = o.workflowId.trim();
2315
+ if (!r)
2316
+ return h("collectionId is required.");
2317
+ if (!s)
2318
+ return h("workflowId is required.");
2319
+ const a = ge(e, r, s);
2320
+ if (!a.ok)
2321
+ return h(
2322
+ a.message,
2323
+ a.details
2324
+ );
2325
+ try {
2326
+ const { workflowResult: l, historyId: i, verdict: u } = await t({
2327
+ collectionId: a.value.collectionId,
2328
+ workflowId: a.value.workflowId
2329
+ });
2330
+ return {
2331
+ isError: !1,
2332
+ data: {
2333
+ collectionId: a.value.collectionId,
2334
+ workflowId: a.value.workflowId,
2335
+ historyId: i,
2336
+ success: u.succeeded,
2337
+ timedOut: u.timedOut,
2338
+ durationMs: l.totalTimeMs,
2339
+ totalSteps: u.totalSteps,
2340
+ passedSteps: u.passedSteps,
2341
+ steps: u.steps.map(({ step: d, passed: m }) => ({
2342
+ stepId: d.stepId,
2343
+ statusCode: d.response?.statusCode ?? null,
2344
+ passed: m
2345
+ }))
2346
+ }
2347
+ };
2348
+ } catch (l) {
2349
+ return h(
2350
+ l instanceof Error ? l.message : "Workflow execution failed."
2351
+ );
2352
+ }
2353
+ };
2354
+ }
2355
+ const Hs = {
2356
+ name: "run_workflow",
2357
+ definition: Ys,
2358
+ createExecutor: (e) => zs(e.store, e.runWorkflow)
2359
+ }, Gs = 25, Vs = 'RAG semantic search over OpenAPI specs and Arazzo assets in the current Replay project.\n\n**What it does**\n- Finds OpenAPI and Arazzo entities via natural-language query (scoped by `type`), returning up to `count` matches with detail via `include`.\n\n**Use when**\n- You need **initial schema/context** or request schema details from project assets.\n- You need canonical IDs/coordinates for an API, collection, workflow, or step.\n- You need to find operations/workflows/steps by natural language when IDs are unknown.\n\n**Never use when**\n- You are only verifying post-action UI changes in the active tab.\n- You already have exact IDs and only need active-tab state.\n- You are about to repeat an identical no-result query.\n\n**Input guidance**\n- Rewording the same query rarely helps; change `type`, `query`, or intent instead.\n- "Collection" is ambiguous (Arazzo entity vs API requests by tags/path/criteria). For request lists, use `type: api_operation` with query/filters—not Arazzo `collection`.\n- Pass all known filters (`apiId`, `path`, `method`, `operationId`, `collectionId`, `workflowId`, `stepId`); `query + filters` is most precise.\n- If semantic search returns no matches, ID filters enable direct lookup (see pairing on each filter field).\n- Phrase `query` like indexed text: titles/descriptions for collections/workflows; `step: …`; `operationId: …`; path/method/tags for endpoints.\n- If results are empty and lookup needs missing IDs, the tool may ask for them.\n', Ks = p({
2274
2360
  query: c().optional().describe("Natural language search query."),
2275
- count: O().positive().max(Ms).optional().default(10),
2276
- type: T(["api_operation", "api", "collection", "workflow", "step"]).describe(
2361
+ count: T().positive().max(Gs).optional().default(10),
2362
+ type: S(["api_operation", "api", "collection", "workflow", "step"]).describe(
2277
2363
  "Scope results to this item type. api = OpenAPI spec; api_operation = API endpoint; collection = Arazzo collection; workflow = Arazzo workflow; step = Arazzo workflow step."
2278
2364
  ),
2279
- include: k(
2280
- T([
2365
+ include: b(
2366
+ S([
2281
2367
  "description",
2282
2368
  "path",
2283
2369
  "method",
@@ -2304,13 +2390,13 @@ const Ls = {
2304
2390
  collectionId: c().optional().describe("Arazzo collection ID."),
2305
2391
  workflowId: c().optional().describe("Workflow ID within the collection. Requires collectionId."),
2306
2392
  stepId: c().optional().describe("Step ID within a workflow. Requires collectionId and workflowId.")
2307
- }).strict(), js = Z(), Bs = {
2308
- description: Ws,
2309
- inputSchema: Fs,
2310
- outputSchema: js,
2393
+ }).strict(), Js = ee(), Qs = {
2394
+ description: Vs,
2395
+ inputSchema: Ks,
2396
+ outputSchema: Js,
2311
2397
  needsApproval: !1
2312
- }, Ys = ["get", "put", "post", "delete", "options", "head", "patch", "trace"], zs = ["query", "x-query"];
2313
- function Gs(e) {
2398
+ }, Xs = ["get", "put", "post", "delete", "options", "head", "patch", "trace"], Zs = ["query", "x-query"];
2399
+ function ea(e) {
2314
2400
  return async (t, o) => {
2315
2401
  const n = Bt(), r = {
2316
2402
  type: t.type,
@@ -2323,21 +2409,21 @@ function Gs(e) {
2323
2409
  stepId: t.stepId
2324
2410
  }, s = t.query ?? "";
2325
2411
  let a = await n.search(s, t.count, r);
2326
- return a.length === 0 && (a = Qs(e, r)), a.length === 0 ? {
2412
+ return a.length === 0 && (a = sa(e, r)), a.length === 0 ? {
2327
2413
  isError: !1,
2328
2414
  data: {
2329
- message: `No results found. ${Hs(t)}`
2415
+ message: `No results found. ${ta(t)}`
2330
2416
  }
2331
2417
  } : {
2332
2418
  isError: !1,
2333
2419
  data: {
2334
- message: Xs(a, t.include)
2420
+ message: aa(a, t.include)
2335
2421
  }
2336
2422
  };
2337
2423
  };
2338
2424
  }
2339
- function Hs(e) {
2340
- const t = [], { type: o, apiId: n, path: r, method: s, operationId: a, collectionId: l, workflowId: i, stepId: d, query: p } = e;
2425
+ function ta(e) {
2426
+ const t = [], { type: o, apiId: n, path: r, method: s, operationId: a, collectionId: l, workflowId: i, stepId: u, query: d } = e;
2341
2427
  switch (o) {
2342
2428
  case "api":
2343
2429
  n || t.push("apiId");
@@ -2347,8 +2433,8 @@ function Hs(e) {
2347
2433
  t.push("apiId");
2348
2434
  break;
2349
2435
  }
2350
- const g = a != null && a !== "", A = r != null && r !== "" && s != null && s !== "";
2351
- !g && !A && t.push("operationId", "path", "method");
2436
+ const v = a != null && a !== "", A = r != null && r !== "" && s != null && s !== "";
2437
+ !v && !A && t.push("operationId", "path", "method");
2352
2438
  break;
2353
2439
  }
2354
2440
  case "collection":
@@ -2358,56 +2444,56 @@ function Hs(e) {
2358
2444
  l ? i || t.push("workflowId") : t.push("collectionId");
2359
2445
  break;
2360
2446
  case "step":
2361
- l ? i ? d || t.push("stepId") : t.push("workflowId") : t.push("collectionId");
2447
+ l ? i ? u || t.push("stepId") : t.push("workflowId") : t.push("collectionId");
2362
2448
  break;
2363
2449
  default:
2364
- if (l != null && l !== "" && (i ? d || t.push("stepId") : t.push("workflowId")), n != null && n !== "") {
2365
- const g = a != null && a !== "", A = r != null && r !== "" && s != null && s !== "";
2366
- !g && !A && t.push("operationId", "path", "method");
2450
+ if (l != null && l !== "" && (i ? u || t.push("stepId") : t.push("workflowId")), n != null && n !== "") {
2451
+ const v = a != null && a !== "", A = r != null && r !== "" && s != null && s !== "";
2452
+ !v && !A && t.push("operationId", "path", "method");
2367
2453
  }
2368
2454
  }
2369
- p != null && p.trim() !== "" || t.push("query");
2455
+ d != null && d.trim() !== "" || t.push("query");
2370
2456
  const f = [...new Set(t)];
2371
2457
  let y;
2372
2458
  return f.length === 0 ? y = "You already pass strong filters. Try a more specific natural-language query, or confirm IDs and paths match the project." : y = `To improve results, prefer adding (in order): ${f.slice(0, 5).join(", ")}. When names are known but IDs are not, phrase query like indexed text: collection/workflow titles and descriptions; step: …; operationId: …; path/method/summary/tags for endpoints.`, y;
2373
2459
  }
2374
- function Vs(e, t) {
2460
+ function oa(e, t) {
2375
2461
  const o = e.paths ?? {};
2376
2462
  for (const [n, r] of Object.entries(o)) {
2377
2463
  if (!r || typeof r != "object") continue;
2378
2464
  const s = r, a = [
2379
- ...Ys.filter((i) => i in r),
2380
- ...zs.filter((i) => i in r)
2465
+ ...Xs.filter((i) => i in r),
2466
+ ...Zs.filter((i) => i in r)
2381
2467
  ];
2382
2468
  for (const i of a) {
2383
- const d = r[i];
2384
- if (!d || typeof d != "object") continue;
2385
- const p = d;
2386
- if (!(t.operationId && (p.operationId ?? "") !== t.operationId) && !(t.path && n !== t.path) && !(t.method && i.toUpperCase() !== t.method.toUpperCase()))
2387
- return { path: n, method: i, op: p, pathItem: s };
2469
+ const u = r[i];
2470
+ if (!u || typeof u != "object") continue;
2471
+ const d = u;
2472
+ if (!(t.operationId && (d.operationId ?? "") !== t.operationId) && !(t.path && n !== t.path) && !(t.method && i.toUpperCase() !== t.method.toUpperCase()))
2473
+ return { path: n, method: i, op: d, pathItem: s };
2388
2474
  }
2389
2475
  const l = s.additionalOperations;
2390
2476
  if (l && typeof l == "object")
2391
- for (const [i, d] of Object.entries(l)) {
2392
- if (!d || typeof d != "object") continue;
2393
- const p = d;
2394
- if (!(t.operationId && (p.operationId ?? "") !== t.operationId) && !(t.path && n !== t.path) && !(t.method && i.toUpperCase() !== t.method.toUpperCase()))
2395
- return { path: n, method: i, op: p, pathItem: s };
2477
+ for (const [i, u] of Object.entries(l)) {
2478
+ if (!u || typeof u != "object") continue;
2479
+ const d = u;
2480
+ if (!(t.operationId && (d.operationId ?? "") !== t.operationId) && !(t.path && n !== t.path) && !(t.method && i.toUpperCase() !== t.method.toUpperCase()))
2481
+ return { path: n, method: i, op: d, pathItem: s };
2396
2482
  }
2397
2483
  }
2398
2484
  return null;
2399
2485
  }
2400
- function Ks(e, t) {
2486
+ function na(e, t) {
2401
2487
  const { type: o, apiId: n, operationId: r, path: s, method: a } = t;
2402
2488
  if (!n) return [];
2403
2489
  const l = e.find((y) => y.id === n);
2404
2490
  if (!l) return [];
2405
2491
  if (o === "api")
2406
2492
  return [{ ...Oe(l).payload, score: 1 }];
2407
- const i = r != null && r !== "", d = s != null && s !== "" && a != null && a !== "";
2408
- if (!(o === "api_operation" || i || d || o == null && (i || d)))
2493
+ const i = r != null && r !== "", u = s != null && s !== "" && a != null && a !== "";
2494
+ if (!(o === "api_operation" || i || u || o == null && (i || u)))
2409
2495
  return o == null ? [{ ...Oe(l).payload, score: 1 }] : [];
2410
- const m = Vs(l, { operationId: r, path: s, method: a });
2496
+ const m = oa(l, { operationId: r, path: s, method: a });
2411
2497
  return m ? [{ ...Yt({
2412
2498
  apiId: l.id,
2413
2499
  apiTitle: l.info?.title ?? "Untitled API",
@@ -2419,50 +2505,50 @@ function Ks(e, t) {
2419
2505
  apiSecurity: l.security
2420
2506
  }).payload, score: 1 }] : [];
2421
2507
  }
2422
- function Js(e, t) {
2508
+ function ra(e, t) {
2423
2509
  const { type: o, collectionId: n, workflowId: r, stepId: s } = t;
2424
2510
  if (!n) return [];
2425
- const a = e.find((p) => p.id === n);
2511
+ const a = e.find((d) => d.id === n);
2426
2512
  if (!a) return [];
2427
2513
  const l = a.info?.title ?? "Untitled Collection";
2428
2514
  if (o === "collection")
2429
2515
  return [{ ...Ae(a).payload, score: 1 }];
2430
2516
  const i = () => {
2431
2517
  if (!r || !s) return [];
2432
- const p = a.workflows?.find((f) => (f.workflowId ?? "") === r);
2433
- if (!p) return [];
2434
- const m = p.steps?.find((f) => (f.stepId ?? "") === s);
2518
+ const d = a.workflows?.find((f) => (f.workflowId ?? "") === r);
2519
+ if (!d) return [];
2520
+ const m = d.steps?.find((f) => (f.stepId ?? "") === s);
2435
2521
  return m ? [
2436
2522
  {
2437
- ...Gt({
2523
+ ...Ht({
2438
2524
  collectionId: n,
2439
2525
  collectionTitle: l,
2440
2526
  workflowId: r,
2441
- workflowTitle: p.summary ?? r,
2527
+ workflowTitle: d.summary ?? r,
2442
2528
  step: m
2443
2529
  }).payload,
2444
2530
  score: 1
2445
2531
  }
2446
2532
  ] : [];
2447
- }, d = () => {
2533
+ }, u = () => {
2448
2534
  if (!r) return [];
2449
- const p = a.workflows?.find((m) => (m.workflowId ?? "") === r);
2450
- return p ? [
2535
+ const d = a.workflows?.find((m) => (m.workflowId ?? "") === r);
2536
+ return d ? [
2451
2537
  {
2452
- ...Ht({ collectionId: n, collectionTitle: l, workflow: p }).payload,
2538
+ ...Gt({ collectionId: n, collectionTitle: l, workflow: d }).payload,
2453
2539
  score: 1
2454
2540
  }
2455
2541
  ] : [];
2456
2542
  };
2457
- return o === "step" ? i() : o === "workflow" ? d() : o == null ? s && r ? i() : r ? d() : [{ ...Ae(a).payload, score: 1 }] : [];
2543
+ return o === "step" ? i() : o === "workflow" ? u() : o == null ? s && r ? i() : r ? u() : [{ ...Ae(a).payload, score: 1 }] : [];
2458
2544
  }
2459
- function Qs(e, t) {
2545
+ function sa(e, t) {
2460
2546
  const o = e.apis.get(), n = e.collections.get(), { type: r } = t;
2461
- return r === "api" || r === "api_operation" ? Ks(o, t) : r === "collection" || r === "workflow" || r === "step" ? Js(n, t) : [];
2547
+ return r === "api" || r === "api_operation" ? na(o, t) : r === "collection" || r === "workflow" || r === "step" ? ra(n, t) : [];
2462
2548
  }
2463
- function Xs(e, t) {
2549
+ function aa(e, t) {
2464
2550
  return [
2465
- jo(e, t).join(`
2551
+ Bo(e, t).join(`
2466
2552
 
2467
2553
  `)
2468
2554
  // ... other parts
@@ -2470,51 +2556,51 @@ function Xs(e, t) {
2470
2556
 
2471
2557
  `);
2472
2558
  }
2473
- const Zs = "You already ran this exact search earlier in this conversation. If nothing has changed since then, reuse those results instead of repeating. If you expect different results (for example after an edit), do not just repeat the same search - change the query, the type, or the filters, or read the current state another way.", ea = 10;
2474
- function ta(e) {
2559
+ const ia = "You already ran this exact search earlier in this conversation. If nothing has changed since then, reuse those results instead of repeating. If you expect different results (for example after an edit), do not just repeat the same search - change the query, the type, or the filters, or read the current state another way.", ca = 10;
2560
+ function la(e) {
2475
2561
  const t = [
2476
2562
  e.type,
2477
- _(e.query),
2478
- _(e.apiId),
2479
- _(e.operationId),
2480
- _(e.path),
2481
- _(e.method)?.toLowerCase(),
2482
- _(e.collectionId),
2483
- _(e.workflowId),
2484
- _(e.stepId)
2563
+ R(e.query),
2564
+ R(e.apiId),
2565
+ R(e.operationId),
2566
+ R(e.path),
2567
+ R(e.method)?.toLowerCase(),
2568
+ R(e.collectionId),
2569
+ R(e.workflowId),
2570
+ R(e.stepId)
2485
2571
  ];
2486
- return t.every((o) => o == null) ? null : JSON.stringify([...t, oa(e), na(e)]);
2572
+ return t.every((o) => o == null) ? null : JSON.stringify([...t, da(e), ua(e)]);
2487
2573
  }
2488
- function oa(e) {
2489
- return typeof e?.count == "number" ? e.count : ea;
2574
+ function da(e) {
2575
+ return typeof e?.count == "number" ? e.count : ca;
2490
2576
  }
2491
- function na(e) {
2577
+ function ua(e) {
2492
2578
  return Array.isArray(e?.include) ? [...new Set(e.include)].sort() : [];
2493
2579
  }
2494
- function _(e) {
2580
+ function R(e) {
2495
2581
  if (typeof e != "string") return null;
2496
- const t = pt(e);
2582
+ const t = ut(e);
2497
2583
  return t === "" ? null : t;
2498
2584
  }
2499
- const ra = [
2500
- ft({
2501
- key: ta,
2502
- warn: Zs
2585
+ const pa = [
2586
+ pt({
2587
+ key: la,
2588
+ warn: ia
2503
2589
  })
2504
- ], sa = {
2590
+ ], fa = {
2505
2591
  name: "search",
2506
- definition: Bs,
2507
- guards: ra,
2508
- createExecutor: (e) => Gs(e.store)
2509
- }, aa = "Update security (x-security) for one or more Replay steps.\n\n**What it does**\n- Applies atomic add/update/remove changes to step security entries.\n- `add` UPSERTS by scheme identity: an existing entry with the same `schemeId` (or same `type` when `schemeId` is omitted) - including the auto-seeded entry created when the step was linked to its operation - is updated in place, never duplicated. Repeated identical wiring converges.\n- The result echoes each affected step's resulting security in `resultingState`; confirm from it, do NOT re-read tabs after mutation.\n- Empty security list falls back to No Auth.\n\n**Targeting**\n- Saved step: `collectionId` + `workflowId` + `stepId`.\n- Multi-step batch: set `changes[].stepId` per change (top-level `stepId` is the default and may be empty); wire a whole chain in ONE call.\n- Unsaved draft tab on focus: all three ids empty strings, no per-change stepId.\n\n**Choosing the type (match the OpenAPI scheme)**\n- http bearer -> `JWT` (`data.token`). A plain bearer token is NOT OAuth 2.0.\n- http basic -> `Basic Auth`, http digest -> `Digest Auth` (`data.username`, `data.password`).\n- apiKey -> `API key` (`data.name`, `data.key`, `data.location`); keep `data.key`'s `$inputs.<name>` segment identical to `data.name`.\n- oauth2 (grant-based flows only) -> `OAuth 2.0`; `data.grantType` is REQUIRED with flow values (`accessToken`, `clientId`, ...): `clientCredentials`, `clientCredentialsWithJwtAssertion`, `authorizationCode`, `authorizationCodeWithPkce`, `implicit`, `password`.\n- openIdConnect -> `OpenID Connect` (`data.openIdConnectUrl` plus OAuth2 fields).\n- `add` with a `schemeId` existing under a different type is rejected; use `update` at that index only to intentionally change a type.\n\n**Change shapes**\n- add/update: `{ action, stepId?, index?, type, schemeId?, data? }`; pass `schemeId` whenever known (it is the upsert identity), `index` is required for update.\n- remove: `{ action: \"remove\", stepId?, index }`.", ia = [
2592
+ definition: Qs,
2593
+ guards: pa,
2594
+ createExecutor: (e) => ea(e.store)
2595
+ }, ma = "Update security (x-security) for one or more Replay steps.\n\n**What it does**\n- Applies atomic add/update/remove changes to step security entries.\n- `add` UPSERTS by scheme identity: an existing entry with the same `schemeId` (or same `type` when `schemeId` is omitted) - including the auto-seeded entry created when the step was linked to its operation - is updated in place, never duplicated. Repeated identical wiring converges.\n- The result echoes each affected step's resulting security in `resultingState`; confirm from it, do NOT re-read tabs after mutation.\n- Empty security list falls back to No Auth.\n\n**Targeting**\n- Saved step: `collectionId` + `workflowId` + `stepId`.\n- Multi-step batch: set `changes[].stepId` per change (top-level `stepId` is the default and may be empty); wire a whole chain in ONE call.\n- Unsaved draft tab on focus: all three ids empty strings, no per-change stepId.\n\n**Choosing the type (match the OpenAPI scheme)**\n- http bearer -> `JWT` (`data.token`). A plain bearer token is NOT OAuth 2.0.\n- http basic -> `Basic Auth`, http digest -> `Digest Auth` (`data.username`, `data.password`).\n- apiKey -> `API key` (`data.name`, `data.key`, `data.location`); keep `data.key`'s `$inputs.<name>` segment identical to `data.name`.\n- oauth2 (grant-based flows only) -> `OAuth 2.0`; `data.grantType` is REQUIRED with flow values (`accessToken`, `clientId`, ...): `clientCredentials`, `clientCredentialsWithJwtAssertion`, `authorizationCode`, `authorizationCodeWithPkce`, `implicit`, `password`.\n- openIdConnect -> `OpenID Connect` (`data.openIdConnectUrl` plus OAuth2 fields).\n- `add` with a `schemeId` existing under a different type is rejected; use `update` at that index only to intentionally change a type.\n\n**Change shapes**\n- add/update: `{ action, stepId?, index?, type, schemeId?, data? }`; pass `schemeId` whenever known (it is the upsert identity), `index` is required for update.\n- remove: `{ action: \"remove\", stepId?, index }`.", ha = [
2510
2596
  "clientCredentials",
2511
2597
  "clientCredentialsWithJwtAssertion",
2512
2598
  "authorizationCode",
2513
2599
  "authorizationCodeWithPkce",
2514
2600
  "implicit",
2515
2601
  "password"
2516
- ], ca = {
2517
- grantType: T(ia).optional().describe("OAuth2 grant type."),
2602
+ ], wa = {
2603
+ grantType: S(ha).optional().describe("OAuth2 grant type."),
2518
2604
  clientId: c().optional(),
2519
2605
  clientSecret: c().optional(),
2520
2606
  tokenUrl: c().optional(),
@@ -2523,65 +2609,65 @@ const ra = [
2523
2609
  accessToken: c().optional(),
2524
2610
  username: c().optional().describe("For password grant type."),
2525
2611
  password: c().optional().describe("For password grant type.")
2526
- }, la = u({
2612
+ }, Ia = p({
2527
2613
  username: c().optional(),
2528
2614
  password: c().optional()
2529
- }).strict(), da = u({
2615
+ }).strict(), ya = p({
2530
2616
  username: c().optional(),
2531
2617
  password: c().optional()
2532
- }).strict(), ua = u({
2618
+ }).strict(), va = p({
2533
2619
  token: c().optional()
2534
- }).strict(), pa = u({
2535
- location: T(["header", "query", "cookie"]).optional(),
2620
+ }).strict(), ga = p({
2621
+ location: S(["header", "query", "cookie"]).optional(),
2536
2622
  name: c().optional().describe(
2537
2623
  "Must match the OpenAPI security scheme `name` (header/query/cookie parameter name). Not the scheme component ref id (e.g. UserCookie)."
2538
2624
  ),
2539
2625
  key: c().optional().describe(
2540
2626
  "Secret value or `$inputs.<name>` / `{$inputs.<name>}`. The `<name>` segment must be identical to `data.name` (OpenAPI apiKey `name`, e.g. accessToken). Wrong example: `data.name` accessToken but key `$inputs.UserCookie` (UserCookie is the securitySchemes ref, not the cookie name)."
2541
2627
  )
2542
- }).strict(), bt = u({
2543
- ...ca
2544
- }).strict(), fa = bt.extend({
2628
+ }).strict(), gt = p({
2629
+ ...wa
2630
+ }).strict(), ba = gt.extend({
2545
2631
  openIdConnectUrl: c().optional(),
2546
2632
  userInfoUrl: c().optional()
2547
- }).strict(), kt = c().optional().describe(
2633
+ }).strict(), bt = c().optional().describe(
2548
2634
  "Target step id for this change. Overrides the top-level stepId; use to batch changes for several steps of the same workflow in one call."
2549
- ), U = pn.extend({
2550
- action: T(["add", "update"]),
2635
+ ), N = fn.extend({
2636
+ action: S(["add", "update"]),
2551
2637
  schemeId: c().optional(),
2552
- stepId: kt
2553
- }), ma = te("type", [
2554
- U.extend({
2555
- type: h(v.BasicAuth),
2556
- data: la.optional()
2638
+ stepId: bt
2639
+ }), ka = te("type", [
2640
+ N.extend({
2641
+ type: w(g.BasicAuth),
2642
+ data: Ia.optional()
2557
2643
  }).strict(),
2558
- U.extend({
2559
- type: h(v.DigestAuth),
2560
- data: da.optional()
2644
+ N.extend({
2645
+ type: w(g.DigestAuth),
2646
+ data: ya.optional()
2561
2647
  }).strict(),
2562
- U.extend({
2563
- type: h(v.JWT),
2564
- data: ua.optional()
2648
+ N.extend({
2649
+ type: w(g.JWT),
2650
+ data: va.optional()
2565
2651
  }).strict(),
2566
- U.extend({
2567
- type: h(v.APIKey),
2568
- data: pa.optional()
2652
+ N.extend({
2653
+ type: w(g.APIKey),
2654
+ data: ga.optional()
2569
2655
  }).strict(),
2570
- U.extend({
2571
- type: h(v.OAuth2),
2572
- data: bt.optional()
2656
+ N.extend({
2657
+ type: w(g.OAuth2),
2658
+ data: gt.optional()
2573
2659
  }).strict(),
2574
- U.extend({
2575
- type: h(v.OpenIDConnect),
2576
- data: fa.optional()
2660
+ N.extend({
2661
+ type: w(g.OpenIDConnect),
2662
+ data: ba.optional()
2577
2663
  }).strict()
2578
- ]), ha = ye.extend({
2579
- action: h("remove"),
2580
- index: O().int().min(0).describe(
2664
+ ]), Sa = ye.extend({
2665
+ action: w("remove"),
2666
+ index: T().int().min(0).describe(
2581
2667
  "0-based position of the entry in the step's current security list; every index in one call refers to that same list. Position, not schemeId, identifies the entry - a step can list the same scheme more than once."
2582
2668
  ),
2583
- stepId: kt
2584
- }).strict(), Ia = we([ma, ha]), wa = u({
2669
+ stepId: bt
2670
+ }).strict(), Ta = Ie([ka, Sa]), Ca = p({
2585
2671
  collectionId: c().describe(
2586
2672
  "Saved step: collection id. Unsaved draft tab on focus: empty string (with empty workflowId and stepId)."
2587
2673
  ),
@@ -2591,31 +2677,31 @@ const ra = [
2591
2677
  stepId: c().describe(
2592
2678
  "Saved step: step id (default target for changes without their own stepId; may be empty when every change sets one). Unsaved draft tab: empty string (with empty collectionId and workflowId)."
2593
2679
  ),
2594
- changes: k(Ia).min(1).describe("List of security changes to apply.")
2680
+ changes: b(Ta).min(1).describe("List of security changes to apply.")
2595
2681
  }).strict().superRefine((e, t) => {
2596
- const o = e.collectionId.trim(), n = e.workflowId.trim(), r = e.stepId.trim(), s = e.changes.map((p) => p.stepId?.trim()), a = s.every(Boolean), l = s.some(Boolean);
2682
+ const o = e.collectionId.trim(), n = e.workflowId.trim(), r = e.stepId.trim(), s = e.changes.map((d) => d.stepId?.trim()), a = s.every(Boolean), l = s.some(Boolean);
2597
2683
  !(o && n && (r || a)) && !(!o && !n && !r && !l) && t.addIssue({
2598
2684
  code: W.custom,
2599
2685
  message: "Provide collectionId and workflowId plus a stepId for every change (top-level or per-change), or all empty ids for the focused unsaved request tab.",
2600
2686
  path: ["collectionId"]
2601
2687
  });
2602
- }), ya = mt, va = {
2603
- description: aa,
2604
- inputSchema: wa,
2605
- outputSchema: ya,
2688
+ }), Oa = ft, Aa = {
2689
+ description: ma,
2690
+ inputSchema: Ca,
2691
+ outputSchema: Oa,
2606
2692
  needsApproval: () => !0
2607
2693
  }, E = {
2608
2694
  ADD: "add",
2609
2695
  UPDATE: "update",
2610
2696
  REMOVE: "remove"
2611
2697
  };
2612
- function w(e, t) {
2698
+ function I(e, t) {
2613
2699
  return {
2614
2700
  status: e,
2615
2701
  ...t !== void 0 && { summary: t }
2616
2702
  };
2617
2703
  }
2618
- function St(e) {
2704
+ function kt(e) {
2619
2705
  if (!e || typeof e != "object" || !("meta" in e))
2620
2706
  return {};
2621
2707
  const { meta: t } = e;
@@ -2624,79 +2710,79 @@ function St(e) {
2624
2710
  const o = "totalChanges" in t && typeof t.totalChanges == "number" ? t.totalChanges : void 0, n = "approvedChanges" in t && typeof t.approvedChanges == "number" ? t.approvedChanges : void 0;
2625
2711
  return { totalChanges: o, approvedChanges: n };
2626
2712
  }
2627
- function ga(e, t) {
2713
+ function Ea(e, t) {
2628
2714
  return !Number.isInteger(t.index) || t.index < 0 || t.index >= e.length ? {
2629
2715
  ok: !1,
2630
2716
  message: `Index ${t.index} out of bounds. Step has ${e.length} security entries.`
2631
2717
  } : { ok: !0, entry: e[t.index] };
2632
2718
  }
2633
- const ba = /* @__PURE__ */ new Set(["grantType", "openIdConnectUrl", "userInfoUrl"]);
2634
- function ka(e) {
2635
- return e.type === v.OAuth2 || e.type === v.OpenIDConnect;
2719
+ const xa = /* @__PURE__ */ new Set(["grantType", "openIdConnectUrl", "userInfoUrl"]);
2720
+ function $a(e) {
2721
+ return e.type === g.OAuth2 || e.type === g.OpenIDConnect;
2636
2722
  }
2637
2723
  function ze(e, t) {
2638
2724
  const o = e;
2639
2725
  for (const [n, r] of Object.entries(t))
2640
2726
  r !== void 0 && n in o && (o[n] = r);
2641
2727
  }
2642
- function Ge(e, t) {
2728
+ function He(e, t) {
2643
2729
  const o = Object.entries(t);
2644
2730
  for (const [s, a] of o)
2645
- s === "grantType" && typeof a == "string" && _e[a] && (e.grantType = _e[a]);
2731
+ s === "grantType" && typeof a == "string" && xe[a] && (e.grantType = xe[a]);
2646
2732
  const n = e[e.grantType], r = new Set(Object.keys(Kt[e.grantType]));
2647
2733
  for (const [s, a] of o)
2648
2734
  s !== "grantType" && a !== void 0 && r.has(s) && (n[s] = a);
2649
2735
  }
2650
- function Tt(e) {
2651
- return e.securityType === v.NoAuth ? null : e[e.securityType]?.schemeName ?? null;
2736
+ function St(e) {
2737
+ return e.securityType === g.NoAuth ? null : e[e.securityType]?.schemeName ?? null;
2652
2738
  }
2653
- function Sa(e, t) {
2654
- !t || e.securityType === v.NoAuth || (e.securitySchemeId = t, e[e.securityType].schemeName = t);
2739
+ function Ra(e, t) {
2740
+ !t || e.securityType === g.NoAuth || (e.securitySchemeId = t, e[e.securityType].schemeName = t);
2655
2741
  }
2656
2742
  function ae(e, t) {
2657
- if (e.securityType = t.type, Sa(e, t.schemeId), !t.data) return e;
2743
+ if (e.securityType = t.type, Ra(e, t.schemeId), !t.data) return e;
2658
2744
  switch (t.type) {
2659
- case v.BasicAuth:
2660
- case v.DigestAuth:
2661
- case v.JWT:
2745
+ case g.BasicAuth:
2746
+ case g.DigestAuth:
2747
+ case g.JWT:
2662
2748
  ze(e[t.type], t.data);
2663
2749
  break;
2664
- case v.APIKey: {
2750
+ case g.APIKey: {
2665
2751
  const { location: o, ...n } = t.data;
2666
- ze(e[v.APIKey], n), o && (e[v.APIKey].location = Vt(o));
2752
+ ze(e[g.APIKey], n), o && (e[g.APIKey].location = Vt(o));
2667
2753
  break;
2668
2754
  }
2669
- case v.OAuth2:
2670
- Ge(e[v.OAuth2], t.data);
2755
+ case g.OAuth2:
2756
+ He(e[g.OAuth2], t.data);
2671
2757
  break;
2672
- case v.OpenIDConnect: {
2758
+ case g.OpenIDConnect: {
2673
2759
  const { openIdConnectUrl: o, userInfoUrl: n, ...r } = t.data;
2674
- Ge(e[v.OpenIDConnect], r), o !== void 0 && (e[v.OpenIDConnect].openIdConnectUrl = o), n !== void 0 && (e[v.OpenIDConnect].userInfoUrl = n);
2760
+ He(e[g.OpenIDConnect], r), o !== void 0 && (e[g.OpenIDConnect].openIdConnectUrl = o), n !== void 0 && (e[g.OpenIDConnect].userInfoUrl = n);
2675
2761
  break;
2676
2762
  }
2677
2763
  }
2678
2764
  return e;
2679
2765
  }
2680
- function Ta(e, t) {
2766
+ function _a(e, t) {
2681
2767
  return t.schemeId ? e.findIndex(
2682
- (o) => o.securitySchemeId === t.schemeId || Tt(o) === t.schemeId
2768
+ (o) => o.securitySchemeId === t.schemeId || St(o) === t.schemeId
2683
2769
  ) : e.findIndex((o) => o.securityType === t.type);
2684
2770
  }
2685
- function Ca(e) {
2771
+ function qa(e) {
2686
2772
  return e.data ? Object.entries(e.data).some(
2687
- ([t, o]) => o !== void 0 && !ba.has(t)
2773
+ ([t, o]) => o !== void 0 && !xa.has(t)
2688
2774
  ) : !1;
2689
2775
  }
2690
- function Oa(e) {
2776
+ function Pa(e) {
2691
2777
  return e.schemeId ? `${e.type} (scheme '${e.schemeId}')` : e.type;
2692
2778
  }
2693
- function He(e, t, o, n) {
2779
+ function Ge(e, t, o, n) {
2694
2780
  return e.has(t) ? {
2695
2781
  ok: !1,
2696
2782
  message: `The security entry at index ${o} is targeted by both a mutation and a remove${n}; issue only one action for it.`
2697
2783
  } : null;
2698
2784
  }
2699
- function Aa(e, t, o) {
2785
+ function Na(e, t, o) {
2700
2786
  let n = e;
2701
2787
  const r = [], s = t.filter(
2702
2788
  (i) => i.action !== E.REMOVE
@@ -2704,40 +2790,40 @@ function Aa(e, t, o) {
2704
2790
  (i) => i.action === E.REMOVE
2705
2791
  ), l = /* @__PURE__ */ new Set();
2706
2792
  for (const i of a) {
2707
- const d = ga(e, i);
2708
- if (!d.ok) return { ok: !1, message: d.message };
2709
- l.add(d.entry);
2793
+ const u = Ea(e, i);
2794
+ if (!u.ok) return { ok: !1, message: u.message };
2795
+ l.add(u.entry);
2710
2796
  }
2711
2797
  for (const i of s) {
2712
2798
  if (i.action === E.ADD) {
2713
- const m = n.length === 1 && n[0].securityType === v.NoAuth, f = m ? -1 : Ta(n, i);
2799
+ const m = n.length === 1 && n[0].securityType === g.NoAuth, f = m ? -1 : _a(n, i);
2714
2800
  if (f >= 0) {
2715
- const g = n[f], A = He(l, g, f, o);
2801
+ const v = n[f], A = Ge(l, v, f, o);
2716
2802
  if (A) return A;
2717
- if (g.securityType !== i.type)
2803
+ if (v.securityType !== i.type)
2718
2804
  return {
2719
2805
  ok: !1,
2720
- message: `Scheme '${i.schemeId}' already exists${o} as ${g.securityType}, not ${i.type}. Match the documented scheme type (plain http/bearer -> JWT with data.token; OAuth 2.0 only for grant-based flows), or use action "update" at index ${f} to intentionally change the type.`
2806
+ message: `Scheme '${i.schemeId}' already exists${o} as ${v.securityType}, not ${i.type}. Match the documented scheme type (plain http/bearer -> JWT with data.token; OAuth 2.0 only for grant-based flows), or use action "update" at index ${f} to intentionally change the type.`
2721
2807
  };
2722
2808
  n = [...n], n[f] = ae(
2723
- structuredClone(g),
2809
+ structuredClone(v),
2724
2810
  i
2725
2811
  ), r.push(
2726
- w(
2812
+ I(
2727
2813
  "applied",
2728
- `Updated existing ${Oa(i)} in place (index: ${f})${o}`
2814
+ `Updated existing ${Pa(i)} in place (index: ${f})${o}`
2729
2815
  )
2730
2816
  );
2731
2817
  continue;
2732
2818
  }
2733
- if (ka(i) && Ca(i) && !i.data?.grantType)
2819
+ if ($a(i) && qa(i) && !i.data?.grantType)
2734
2820
  return {
2735
2821
  ok: !1,
2736
- message: `grantType is required when adding ${i.type} security with flow values${o}. For a plain http/bearer token use type "${v.JWT}" with data.token instead.`
2822
+ message: `grantType is required when adding ${i.type} security with flow values${o}. For a plain http/bearer token use type "${g.JWT}" with data.token instead.`
2737
2823
  };
2738
2824
  const y = ae(Ee(), i);
2739
2825
  n = m ? [y] : [...n, y], r.push(
2740
- w(
2826
+ I(
2741
2827
  "applied",
2742
2828
  `Added ${i.type} security (index: ${n.length - 1})${o}`
2743
2829
  )
@@ -2751,50 +2837,50 @@ function Aa(e, t, o) {
2751
2837
  ok: !1,
2752
2838
  message: `Index ${i.index} out of bounds. Step has ${n.length} security entries.`
2753
2839
  };
2754
- const d = n[i.index], p = He(l, d, i.index, o);
2755
- if (p) return p;
2756
- if (d.securitySchemeId) {
2757
- const m = Tt(d);
2840
+ const u = n[i.index], d = Ge(l, u, i.index, o);
2841
+ if (d) return d;
2842
+ if (u.securitySchemeId) {
2843
+ const m = St(u);
2758
2844
  if (i.schemeId && m !== i.schemeId)
2759
2845
  return {
2760
2846
  ok: !1,
2761
2847
  message: `schemeId mismatch at index ${i.index}. Expected ${m ?? "none"}.`
2762
2848
  };
2763
2849
  }
2764
- n = [...n], n[i.index] = ae(structuredClone(d), i), r.push(
2765
- w("applied", `Updated ${i.type} at index ${i.index}${o}`)
2850
+ n = [...n], n[i.index] = ae(structuredClone(u), i), r.push(
2851
+ I("applied", `Updated ${i.type} at index ${i.index}${o}`)
2766
2852
  );
2767
2853
  }
2768
2854
  if (l.size > 0) {
2769
- const i = n.filter((p) => !l.has(p)), d = n.length - i.length;
2855
+ const i = n.filter((d) => !l.has(d)), u = n.length - i.length;
2770
2856
  n = i;
2771
- for (let p = 0; p < d; p++)
2772
- r.push(w("applied"));
2857
+ for (let d = 0; d < u; d++)
2858
+ r.push(I("applied"));
2773
2859
  }
2774
2860
  return n.length === 0 && (n = [Ee()]), { ok: !0, security: n, applied: r };
2775
2861
  }
2776
- function Ea(e) {
2862
+ function Ua(e) {
2777
2863
  return async (t) => {
2778
- const { changes: o, collectionId: n, workflowId: r, stepId: s } = t, a = St(t), l = s.trim(), i = /* @__PURE__ */ new Map();
2864
+ const { changes: o, collectionId: n, workflowId: r, stepId: s } = t, a = kt(t), l = s.trim(), i = /* @__PURE__ */ new Map();
2779
2865
  for (const f of o) {
2780
- const y = f.stepId?.trim() || l, g = i.get(y);
2781
- g ? g.push(f) : i.set(y, [f]);
2866
+ const y = f.stepId?.trim() || l, v = i.get(y);
2867
+ v ? v.push(f) : i.set(y, [f]);
2782
2868
  }
2783
- const d = [], p = [];
2869
+ const u = [], d = [];
2784
2870
  for (const [f, y] of i) {
2785
- const g = gt(e, n, r, f);
2786
- if (!g.ok)
2787
- return I(g.message, g.details);
2788
- const A = g.value, Ce = f || A.stepId.get(), At = i.size > 1 ? ` for step '${Ce}'` : "", Et = Array.from(
2871
+ const v = vt(e, n, r, f);
2872
+ if (!v.ok)
2873
+ return h(v.message, v.details);
2874
+ const A = v.value, Ce = f || A.stepId.get(), Ot = i.size > 1 ? ` for step '${Ce}'` : "", At = Array.from(
2789
2875
  A.security.get({ noproxy: !0 })
2790
- ), B = Aa(Et, y, At);
2791
- if (!B.ok) return I(B.message);
2792
- d.push(...B.applied), p.push({ step: A, security: B.security, label: Ce });
2876
+ ), Y = Na(At, y, Ot);
2877
+ if (!Y.ok) return h(Y.message);
2878
+ u.push(...Y.applied), d.push({ step: A, security: Y.security, label: Ce });
2793
2879
  }
2794
- for (const f of p)
2880
+ for (const f of d)
2795
2881
  f.step.security.set(f.security);
2796
- const m = p.map((f) => `stepId=${f.label}
2797
- ${X(f.security)}`).join(`
2882
+ const m = d.map((f) => `stepId=${f.label}
2883
+ ${Z(f.security)}`).join(`
2798
2884
 
2799
2885
  `);
2800
2886
  return {
@@ -2802,17 +2888,17 @@ ${X(f.security)}`).join(`
2802
2888
  data: {
2803
2889
  totalChanges: a.totalChanges ?? o.length,
2804
2890
  approvedChanges: a.approvedChanges ?? o.length,
2805
- applied: d,
2891
+ applied: u,
2806
2892
  resultingState: m
2807
2893
  }
2808
2894
  };
2809
2895
  };
2810
2896
  }
2811
- const _a = {
2897
+ const Da = {
2812
2898
  name: "update_security",
2813
- definition: va,
2814
- createExecutor: (e) => Ea(e.store)
2815
- }, $a = `Update an existing Replay step with atomic changes.
2899
+ definition: Aa,
2900
+ createExecutor: (e) => Ua(e.store)
2901
+ }, La = `Update an existing Replay step with atomic changes.
2816
2902
 
2817
2903
  **What it does**
2818
2904
  - Mutates an existing step only (no create/delete).
@@ -2835,7 +2921,7 @@ const _a = {
2835
2921
  - Data shapes:
2836
2922
  - \`url\`: string
2837
2923
  - \`description\`: string
2838
- - \`method\`: one of ${tt.join(", ")}
2924
+ - \`method\`: one of ${et.join(", ")}
2839
2925
  - \`parameters\`: \`{ name, in: path|query|header|cookie, value }\`
2840
2926
  - \`outputs\`: \`{ name, expression }\`
2841
2927
  - \`successCriteria\`: \`{ condition, context?, type? }\`
@@ -2846,58 +2932,58 @@ const _a = {
2846
2932
  - Batch related edits in one call; include all known edits up front.
2847
2933
  - For OpenAPI-linked steps, avoid method/url changes.
2848
2934
  - After changing path/query parameters, decide whether to add a separate URL change.
2849
- `, xa = ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"], Ra = [
2850
- L.Text,
2851
- L.JSON,
2852
- L.XML
2853
- ], qa = u({
2935
+ `, Wa = ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"], Ma = [
2936
+ D.Text,
2937
+ D.JSON,
2938
+ D.XML
2939
+ ], Fa = p({
2854
2940
  name: c().min(1),
2855
- in: T(["path", "query", "header", "cookie"]),
2941
+ in: S(["path", "query", "header", "cookie"]),
2856
2942
  value: c()
2857
- }).strict(), Pa = u({
2943
+ }).strict(), ja = p({
2858
2944
  condition: c().min(1),
2859
2945
  context: c().optional().describe("Context for the expression."),
2860
- type: T(["simple", "regex", "jsonpath", "xpath"]).optional()
2861
- }).strict(), Na = R.extend({
2862
- field: h("url"),
2946
+ type: S(["simple", "regex", "jsonpath", "xpath"]).optional()
2947
+ }).strict(), Ba = _.extend({
2948
+ field: w("url"),
2863
2949
  data: c().min(1).describe("New request URL for step.")
2864
- }).strict(), Ua = R.extend({
2865
- field: h("description"),
2950
+ }).strict(), Ya = _.extend({
2951
+ field: w("description"),
2866
2952
  data: c().describe("New step description text.")
2867
- }).strict(), Da = R.extend({
2868
- field: h("method"),
2869
- data: T(xa).describe("New HTTP method for x-operation step.")
2870
- }).strict(), La = R.extend({
2871
- field: h("parameters"),
2872
- data: qa.optional().describe("Parameter data. Required for add/update actions.")
2873
- }).strict(), Ma = R.extend({
2874
- field: h("outputs"),
2875
- data: u({
2953
+ }).strict(), za = _.extend({
2954
+ field: w("method"),
2955
+ data: S(Wa).describe("New HTTP method for x-operation step.")
2956
+ }).strict(), Ha = _.extend({
2957
+ field: w("parameters"),
2958
+ data: Fa.optional().describe("Parameter data. Required for add/update actions.")
2959
+ }).strict(), Ga = _.extend({
2960
+ field: w("outputs"),
2961
+ data: p({
2876
2962
  name: c().min(1).describe("Output name."),
2877
2963
  expression: c().min(1).describe("Output expression.")
2878
2964
  }).strict().optional().describe("Output mapping. Required for add/update actions.")
2879
- }).strict(), Wa = R.extend({
2880
- field: h("successCriteria"),
2881
- data: Pa.optional().describe(
2965
+ }).strict(), Va = _.extend({
2966
+ field: w("successCriteria"),
2967
+ data: ja.optional().describe(
2882
2968
  "Success criterion. Required for add/update actions."
2883
2969
  )
2884
- }).strict(), Fa = R.extend({
2885
- field: h("body"),
2886
- data: u({
2887
- contentType: T(Ra).optional().describe(
2970
+ }).strict(), Ka = _.extend({
2971
+ field: w("body"),
2972
+ data: p({
2973
+ contentType: S(Ma).optional().describe(
2888
2974
  "Request body content type. Allowed: text/plain, application/json, application/xml."
2889
2975
  ),
2890
2976
  content: c().describe("Request body content as string.")
2891
2977
  }).strict().describe("Request body content and optional content type.")
2892
- }).strict(), ja = te("field", [
2893
- Na,
2894
- Ua,
2895
- Da,
2896
- La,
2897
- Ma,
2898
- Wa,
2899
- Fa
2900
- ]), Ba = u({
2978
+ }).strict(), Ja = te("field", [
2979
+ Ba,
2980
+ Ya,
2981
+ za,
2982
+ Ha,
2983
+ Ga,
2984
+ Va,
2985
+ Ka
2986
+ ]), Qa = p({
2901
2987
  collectionId: c().describe(
2902
2988
  "Saved step: collection id. Unsaved draft tab on focus: empty string (with empty workflowId and stepId)."
2903
2989
  ),
@@ -2907,7 +2993,7 @@ const _a = {
2907
2993
  stepId: c().describe(
2908
2994
  "Saved step: step id. Unsaved draft tab: empty string (with empty collectionId and workflowId)."
2909
2995
  ),
2910
- changes: k(ja).min(1).describe("List of individual changes to apply to the step.")
2996
+ changes: b(Ja).min(1).describe("List of individual changes to apply to the step.")
2911
2997
  }).strict().superRefine((e, t) => {
2912
2998
  const o = e.collectionId.trim(), n = e.workflowId.trim(), r = e.stepId.trim();
2913
2999
  !(o && n && r) && !(!o && !n && !r) && t.addIssue({
@@ -2915,13 +3001,13 @@ const _a = {
2915
3001
  message: "Provide all three ids for a saved step, or three empty strings for the focused unsaved request tab.",
2916
3002
  path: ["collectionId"]
2917
3003
  });
2918
- }), Ya = mt, za = {
2919
- description: $a,
2920
- inputSchema: Ba,
2921
- outputSchema: Ya,
3004
+ }), Xa = ft, Za = {
3005
+ description: La,
3006
+ inputSchema: Qa,
3007
+ outputSchema: Xa,
2922
3008
  needsApproval: () => !0
2923
3009
  };
2924
- function Ga(e) {
3010
+ function ei(e) {
2925
3011
  return e.replace(/\{\{([^{}\s]+)\}\}/g, "{$1}");
2926
3012
  }
2927
3013
  function ie(e) {
@@ -2937,12 +3023,12 @@ function le(e, t) {
2937
3023
  return ue(e) && e.id === t;
2938
3024
  }
2939
3025
  function Ke(e, t, o) {
2940
- return { ...Xe(e), key: t, value: o, active: !0 };
3026
+ return { ...Qe(e), key: t, value: o, active: !0 };
2941
3027
  }
2942
3028
  function be(e, t) {
2943
3029
  e.set((o) => [...o, ...t]);
2944
3030
  }
2945
- function J(e, t, o) {
3031
+ function Q(e, t, o) {
2946
3032
  let n = !1;
2947
3033
  return e.set((r) => {
2948
3034
  const s = r.findIndex((l) => o.find(l, t));
@@ -2958,35 +3044,35 @@ function ke(e, t, o) {
2958
3044
  return n = s.length < r.length, s;
2959
3045
  }), n;
2960
3046
  }
2961
- function Ha(e, t) {
3047
+ function ti(e, t) {
2962
3048
  switch (e.action) {
2963
3049
  case E.ADD: {
2964
3050
  if (!e.data)
2965
- return w("failed", "Failed parameter add because data is missing.");
3051
+ return I("failed", "Failed parameter add because data is missing.");
2966
3052
  const { in: o, name: n, value: r } = e.data, s = ie(o), a = Ke(o, n, r);
2967
- return be(t.parameters[s], [a]), w(
3053
+ return be(t.parameters[s], [a]), I(
2968
3054
  "applied",
2969
3055
  `Added ${o} parameter '${n}' (id: ${a.id})`
2970
3056
  );
2971
3057
  }
2972
3058
  case E.UPDATE: {
2973
3059
  if (!e.id)
2974
- return w("failed", "Failed parameter update because id is missing.");
3060
+ return I("failed", "Failed parameter update because id is missing.");
2975
3061
  if (!e.data)
2976
- return w("failed", "Failed parameter update because data is missing.");
3062
+ return I("failed", "Failed parameter update because data is missing.");
2977
3063
  const { in: o, name: n, value: r } = e.data, s = ie(o);
2978
- return J(t.parameters[s], e.id, {
3064
+ return Q(t.parameters[s], e.id, {
2979
3065
  find: le,
2980
3066
  produce: (l) => ue(l) ? {
2981
3067
  ...Ke(o, n, r),
2982
3068
  id: l.id,
2983
3069
  ...l.allowReserved !== void 0 && { allowReserved: l.allowReserved }
2984
3070
  } : l
2985
- }) ? w("applied") : w("failed", `Parameter with id '${e.id}' not found.`);
3071
+ }) ? I("applied") : I("failed", `Parameter with id '${e.id}' not found.`);
2986
3072
  }
2987
3073
  case E.REMOVE: {
2988
3074
  if (!e.id)
2989
- return w("failed", "Failed parameter remove because id is missing.");
3075
+ return I("failed", "Failed parameter remove because id is missing.");
2990
3076
  const o = e.id, n = e.data?.in, r = n ? [ie(n)] : Object.values(G);
2991
3077
  let s = !1;
2992
3078
  for (const a of r)
@@ -2994,48 +3080,48 @@ function Ha(e, t) {
2994
3080
  s = ke(t.parameters[a], o, le);
2995
3081
  break;
2996
3082
  }
2997
- return s ? w("applied") : w("failed", `Parameter with id '${o}' not found.`);
3083
+ return s ? I("applied") : I("failed", `Parameter with id '${o}' not found.`);
2998
3084
  }
2999
3085
  }
3000
3086
  }
3001
- function Va(e, t) {
3087
+ function oi(e, t) {
3002
3088
  switch (e.action) {
3003
3089
  case E.ADD: {
3004
3090
  if (!e.data)
3005
- return w("failed", "Failed output add because data is missing.");
3091
+ return I("failed", "Failed output add because data is missing.");
3006
3092
  const { name: o, expression: n } = e.data, r = t.outputs.get({ noproxy: !0 }).find((a) => a.key === o);
3007
3093
  if (r)
3008
- return J(t.outputs, r.id, {
3094
+ return Q(t.outputs, r.id, {
3009
3095
  find: ce,
3010
3096
  produce: (a) => ({ ...a, key: o, value: n, active: !0 })
3011
- }), w(
3097
+ }), I(
3012
3098
  "applied",
3013
3099
  `Updated existing output '${o}' in place (id: ${r.id})`
3014
3100
  );
3015
3101
  const s = crypto.randomUUID();
3016
- return be(t.outputs, [{ id: s, key: o, value: n, active: !0 }]), w("applied", `Added output '${o}' (id: ${s})`);
3102
+ return be(t.outputs, [{ id: s, key: o, value: n, active: !0 }]), I("applied", `Added output '${o}' (id: ${s})`);
3017
3103
  }
3018
3104
  case E.UPDATE: {
3019
3105
  if (!e.id)
3020
- return w("failed", "Failed output update because id is missing.");
3106
+ return I("failed", "Failed output update because id is missing.");
3021
3107
  if (!e.data)
3022
- return w("failed", "Failed output update because data is missing.");
3108
+ return I("failed", "Failed output update because data is missing.");
3023
3109
  const { name: o, expression: n } = e.data;
3024
- return J(t.outputs, e.id, {
3110
+ return Q(t.outputs, e.id, {
3025
3111
  find: ce,
3026
3112
  produce: (s) => ({ ...s, key: o, value: n, active: !0 })
3027
- }) ? w("applied") : w("failed", `Output with id '${e.id}' not found.`);
3113
+ }) ? I("applied") : I("failed", `Output with id '${e.id}' not found.`);
3028
3114
  }
3029
3115
  case E.REMOVE:
3030
- return e.id ? ke(t.outputs, e.id, ce) ? w("applied") : w("failed", `Output with id '${e.id}' not found.`) : w("failed", "Failed output remove because id is missing.");
3116
+ return e.id ? ke(t.outputs, e.id, ce) ? I("applied") : I("failed", `Output with id '${e.id}' not found.`) : I("failed", "Failed output remove because id is missing.");
3031
3117
  }
3032
3118
  }
3033
- function Ka(e, t) {
3119
+ function ni(e, t) {
3034
3120
  switch (e.action) {
3035
3121
  case E.ADD: {
3036
3122
  if (!e.data)
3037
- return w("failed", "Failed success criteria add because data is missing.");
3038
- const { condition: o, context: n, type: r } = e.data, s = Qe(
3123
+ return I("failed", "Failed success criteria add because data is missing.");
3124
+ const { condition: o, context: n, type: r } = e.data, s = Je(
3039
3125
  r ?? de.SIMPLE
3040
3126
  );
3041
3127
  return be(t.successCriteria, [
@@ -3044,21 +3130,21 @@ function Ka(e, t) {
3044
3130
  condition: o,
3045
3131
  ...n !== void 0 && { context: n }
3046
3132
  }
3047
- ]), w("applied");
3133
+ ]), I("applied");
3048
3134
  }
3049
3135
  case E.UPDATE: {
3050
3136
  if (typeof e.id != "string")
3051
- return w(
3137
+ return I(
3052
3138
  "failed",
3053
3139
  "Failed success criteria update because id is missing."
3054
3140
  );
3055
3141
  if (!e.data)
3056
- return w(
3142
+ return I(
3057
3143
  "failed",
3058
3144
  "Failed success criteria update because data is missing."
3059
3145
  );
3060
3146
  const { condition: o, context: n, type: r } = e.data;
3061
- return J(t.successCriteria, e.id, {
3147
+ return Q(t.successCriteria, e.id, {
3062
3148
  find: Ve,
3063
3149
  produce: (a) => ({
3064
3150
  ...a,
@@ -3067,38 +3153,38 @@ function Ka(e, t) {
3067
3153
  context: n ?? a.context,
3068
3154
  type: r ?? a.type ?? de.SIMPLE
3069
3155
  })
3070
- }) ? w("applied") : w(
3156
+ }) ? I("applied") : I(
3071
3157
  "failed",
3072
3158
  `Success criterion with condition '${e.id}' not found.`
3073
3159
  );
3074
3160
  }
3075
3161
  case E.REMOVE:
3076
- return typeof e.id != "string" ? w(
3162
+ return typeof e.id != "string" ? I(
3077
3163
  "failed",
3078
3164
  "Failed success criteria remove because id is missing."
3079
3165
  ) : ke(
3080
3166
  t.successCriteria,
3081
3167
  e.id,
3082
3168
  Ve
3083
- ) ? w("applied") : w(
3169
+ ) ? I("applied") : I(
3084
3170
  "failed",
3085
3171
  `Success criterion with condition '${e.id}' not found.`
3086
3172
  );
3087
3173
  }
3088
3174
  }
3089
- function Ja(e) {
3175
+ function ri(e) {
3090
3176
  return async (t) => {
3091
- const { changes: o, collectionId: n, workflowId: r, stepId: s } = t, a = St(t), l = gt(e, n, r, s);
3177
+ const { changes: o, collectionId: n, workflowId: r, stepId: s } = t, a = kt(t), l = vt(e, n, r, s);
3092
3178
  if (!l.ok)
3093
- return I(l.message, l.details);
3179
+ return h(l.message, l.details);
3094
3180
  const i = l.value;
3095
3181
  if (o.some(
3096
3182
  (f) => f.field === "method" || f.field === "url"
3097
3183
  ) && i.operation.ornull !== null)
3098
- return I(
3184
+ return h(
3099
3185
  "Cannot update method or url for a step linked to an OpenAPI operation."
3100
3186
  );
3101
- const p = [];
3187
+ const d = [];
3102
3188
  for (const f of o)
3103
3189
  switch (f.field) {
3104
3190
  case "method":
@@ -3106,40 +3192,40 @@ function Ja(e) {
3106
3192
  i.xOperation.ornull === null && i.xOperation.set({ method: "GET", url: "" });
3107
3193
  const y = i.xOperation.ornull;
3108
3194
  if (!y)
3109
- return I("Step xOperation state is unavailable.");
3195
+ return h("Step xOperation state is unavailable.");
3110
3196
  if (f.field === "method")
3111
3197
  y.method.set(f.data);
3112
3198
  else {
3113
- const g = Ga(f.data);
3114
- y.url.set(g);
3199
+ const v = ei(f.data);
3200
+ y.url.set(v);
3115
3201
  const A = i.parameters.queryParameters.get({ noproxy: !0 });
3116
3202
  i.parameters.queryParameters.set(
3117
3203
  Jt(
3118
- Qt(g),
3204
+ Qt(v),
3119
3205
  A
3120
3206
  )
3121
3207
  );
3122
3208
  }
3123
- p.push(w("applied"));
3209
+ d.push(I("applied"));
3124
3210
  break;
3125
3211
  }
3126
3212
  case "description":
3127
- i.description.set(f.data), p.push(w("applied"));
3213
+ i.description.set(f.data), d.push(I("applied"));
3128
3214
  break;
3129
3215
  case "body":
3130
3216
  i.requestBody.merge({
3131
3217
  content: f.data.content,
3132
3218
  ...f.data.contentType !== void 0 && { type: f.data.contentType }
3133
- }), p.push(w("applied"));
3219
+ }), d.push(I("applied"));
3134
3220
  break;
3135
3221
  case "parameters":
3136
- p.push(Ha(f, i));
3222
+ d.push(ti(f, i));
3137
3223
  break;
3138
3224
  case "outputs":
3139
- p.push(Va(f, i));
3225
+ d.push(oi(f, i));
3140
3226
  break;
3141
3227
  case "successCriteria":
3142
- p.push(Ka(f, i));
3228
+ d.push(ni(f, i));
3143
3229
  break;
3144
3230
  }
3145
3231
  const m = o.some((f) => f.field === "outputs");
@@ -3148,19 +3234,19 @@ function Ja(e) {
3148
3234
  data: {
3149
3235
  totalChanges: a.totalChanges ?? o.length,
3150
3236
  approvedChanges: a.approvedChanges ?? o.length,
3151
- applied: p,
3237
+ applied: d,
3152
3238
  ...m && {
3153
- resultingState: Ie(i.outputs.get({ noproxy: !0 })) || "Outputs: (none)"
3239
+ resultingState: we(i.outputs.get({ noproxy: !0 })) || "Outputs: (none)"
3154
3240
  }
3155
3241
  }
3156
3242
  };
3157
3243
  };
3158
3244
  }
3159
- const Qa = {
3245
+ const si = {
3160
3246
  name: "update_step",
3161
- definition: za,
3162
- createExecutor: (e) => Ja(e.store)
3163
- }, Xa = `Search the public web via a nested agent and return a consolidated summary.
3247
+ definition: Za,
3248
+ createExecutor: (e) => ri(e.store)
3249
+ }, ai = `Search the public web via a nested agent and return a consolidated summary.
3164
3250
 
3165
3251
  **What it does**
3166
3252
  - Runs provider web search (results depend on the active model provider) and synthesizes findings for the parent agent.
@@ -3177,21 +3263,21 @@ const Qa = {
3177
3263
 
3178
3264
  **Input guidance**
3179
3265
  - State a clear, self-contained query: what to look up and what to return (facts, links, version numbers, etc.).
3180
- - Prefer one web search call per distinct lookup; do not nest web search calls.`, Za = u({
3266
+ - Prefer one web search call per distinct lookup; do not nest web search calls.`, ii = p({
3181
3267
  task: c().describe("What to search for on the web and what to return"),
3182
3268
  url: c().describe("The URL to execute search on")
3183
- }), ei = Z(), ti = {
3184
- description: Xa,
3185
- inputSchema: Za,
3186
- outputSchema: ei,
3269
+ }), ci = ee(), li = {
3270
+ description: ai,
3271
+ inputSchema: ii,
3272
+ outputSchema: ci,
3187
3273
  needsApproval: !0
3188
- }, oi = `
3274
+ }, di = `
3189
3275
  You are a web search subagent inside Replay, invoked by the parent agent to complete a single lookup task.
3190
3276
 
3191
3277
  Your job is to search the public web and return verified findings for the parent agent to act on. You do not communicate with the end user directly.
3192
3278
 
3193
3279
  You must use the provider web search tool to gather information. You cannot access the Replay project, UI, workflows, internal state, or any tools other than the web search tool.
3194
- `, ni = `
3280
+ `, ui = `
3195
3281
  - Never hallucinate or invent an answer when the information is not available from the web search.
3196
3282
  - Do not use general knowledge, assumptions, prior training data, or speculation as evidence. Only make claims that are explicitly supported by the web search results.
3197
3283
  - If the web search results do not contain enough information to answer the question, clearly state that the information could not be found or verified.
@@ -3200,16 +3286,16 @@ You must use the provider web search tool to gather information. You cannot acce
3200
3286
  - Include source URLs for all claims that are material to the parent agent's next steps.
3201
3287
  - Clearly distinguish between verified findings, inferred conclusions, and information that could not be verified.
3202
3288
  - When sources conflict, report the conflict and cite the competing sources rather than selecting a winner without evidence.
3203
- `, ri = eo(
3289
+ `, pi = eo(
3204
3290
  //
3205
- xe("role", oi),
3206
- xe("output", ni)
3291
+ Re("role", di),
3292
+ Re("output", ui)
3207
3293
  );
3208
- function si() {
3209
- return [to(ri)];
3294
+ function fi() {
3295
+ return [to(pi)];
3210
3296
  }
3211
- function ai(e) {
3212
- const t = fo(e), o = ao(e);
3297
+ function mi(e) {
3298
+ const t = mo(e), o = ao(e);
3213
3299
  return async (n, r) => {
3214
3300
  try {
3215
3301
  return {
@@ -3217,8 +3303,8 @@ function ai(e) {
3217
3303
  data: {
3218
3304
  message: await io({
3219
3305
  model: o,
3220
- system: si(),
3221
- prompt: ii(n),
3306
+ system: fi(),
3307
+ prompt: hi(n),
3222
3308
  tools: t,
3223
3309
  toolChoice: "required",
3224
3310
  stopWhen: co("web_search"),
@@ -3235,8 +3321,8 @@ function ai(e) {
3235
3321
  }
3236
3322
  };
3237
3323
  }
3238
- function ii(e) {
3239
- return b([
3324
+ function hi(e) {
3325
+ return k([
3240
3326
  //
3241
3327
  "[URL]",
3242
3328
  e.url,
@@ -3245,38 +3331,42 @@ function ii(e) {
3245
3331
  e.task
3246
3332
  ]);
3247
3333
  }
3248
- const ci = {
3334
+ const wi = {
3249
3335
  name: "web_search",
3250
- definition: ti,
3251
- createExecutor: (e) => ai(e.model)
3252
- }, Ct = [
3336
+ definition: li,
3337
+ createExecutor: (e) => mi(e.model)
3338
+ }, Tt = [
3253
3339
  ys,
3254
- _s,
3340
+ xs,
3255
3341
  Ls,
3256
- sa,
3257
- _a,
3258
- Qa,
3259
- Tn,
3260
- yr,
3261
- Xr,
3262
- ci,
3263
- zn
3342
+ Hs,
3343
+ fa,
3344
+ Da,
3345
+ si,
3346
+ Cn,
3347
+ vr,
3348
+ Zr,
3349
+ wi,
3350
+ Hn
3264
3351
  ];
3265
- function li(e) {
3266
- return Ct.some((t) => t.name === e);
3352
+ function Ii(e) {
3353
+ return Tt.some((t) => t.name === e);
3267
3354
  }
3268
- function Si(e, t) {
3269
- for (const o of Ct)
3355
+ function Pi(e, t) {
3356
+ for (const o of Tt)
3270
3357
  e.register(
3271
- cn(
3358
+ ln(
3272
3359
  o,
3273
3360
  t[o.name]
3274
3361
  )
3275
3362
  );
3276
3363
  }
3277
- function di(e) {
3364
+ function yi(e) {
3278
3365
  const t = e.startsWith("tool-") ? e.slice(5) : e;
3279
- return li(t) ? t : void 0;
3366
+ return Ii(t) ? t : void 0;
3367
+ }
3368
+ function vi(e, t) {
3369
+ return `${e}::${t}`;
3280
3370
  }
3281
3371
  function Se(e) {
3282
3372
  return typeof e == "object" && e !== null && "type" in e && typeof e.type == "string" && e.type.startsWith("tool-") && "toolCallId" in e;
@@ -3284,68 +3374,97 @@ function Se(e) {
3284
3374
  function Te(e) {
3285
3375
  return e.state === "approval-requested" && e.approval?.id != null;
3286
3376
  }
3287
- function ui(e) {
3377
+ function gi(e) {
3288
3378
  return e.state === "output-denied" ? !0 : e.state === "output-available" && e.approval != null;
3289
3379
  }
3290
- function Ot(e) {
3380
+ function Ct(e) {
3291
3381
  return e.parts.some((t) => Se(t) && Te(t));
3292
3382
  }
3293
- function Ti(e) {
3294
- return e.some(Ot);
3383
+ function Ni(e) {
3384
+ return e.some(Ct);
3295
3385
  }
3296
- function Ci(e) {
3386
+ function Ui(e) {
3297
3387
  return e.map(
3298
- (t) => Ot(t) ? { ...t, parts: t.parts.map(pi) } : t
3388
+ (t) => Ct(t) ? { ...t, parts: t.parts.map(bi) } : t
3299
3389
  );
3300
3390
  }
3301
- function pi(e) {
3391
+ function bi(e) {
3302
3392
  return !Se(e) || !Te(e) ? e : {
3303
3393
  ...e,
3304
3394
  state: "output-denied",
3305
3395
  approval: { id: e.approval.id, approved: !1 }
3306
3396
  };
3307
3397
  }
3308
- function Oi(e) {
3398
+ function Di(e) {
3309
3399
  const t = [], o = [];
3310
3400
  let n = 0;
3311
- const r = () => {
3401
+ const r = {}, s = () => {
3312
3402
  o.length !== 0 && (t.push({
3313
3403
  kind: "reasoning-block",
3314
3404
  key: `reasoning-${n++}`,
3315
3405
  items: [...o]
3316
3406
  }), o.length = 0);
3317
- }, s = (a) => {
3318
- const l = a.trim();
3319
- if (l.length === 0)
3407
+ }, a = (l) => {
3408
+ const i = l.trim();
3409
+ if (i.length === 0)
3320
3410
  return;
3321
- const i = o[o.length - 1];
3322
- i?.kind === "action" && i.text === l || o.push({ kind: "action", text: l });
3411
+ const u = o[o.length - 1];
3412
+ u?.kind === "action" && u.text === i || o.push({ kind: "action", text: i });
3323
3413
  };
3324
- for (let a = 0; a < e.length; a++) {
3325
- const l = e[a];
3326
- if (l.type === "step-start")
3414
+ for (let l = 0; l < e.length; l++) {
3415
+ const i = e[l];
3416
+ if (i.type === "step-start")
3327
3417
  continue;
3328
- if (l.type === "text") {
3329
- r();
3330
- const d = l.text ?? "";
3331
- d.length > 0 && t.push({ kind: "text", text: d, key: `text-${a}` });
3418
+ if (i.type === "text") {
3419
+ s();
3420
+ const d = i.text ?? "";
3421
+ d.length > 0 && t.push({
3422
+ kind: "text",
3423
+ text: d,
3424
+ key: `text-${l}`,
3425
+ workflowRunHistoryIds: Object.fromEntries(
3426
+ Object.entries(r).map(([m, f]) => [m, [...f]])
3427
+ )
3428
+ });
3332
3429
  continue;
3333
3430
  }
3334
- if (!Se(l))
3431
+ if (!Se(i))
3335
3432
  continue;
3336
- if (di(l.type) === po) {
3337
- const d = fi(l.input);
3338
- d && s(d);
3433
+ const u = yi(i.type);
3434
+ if (u === fo) {
3435
+ const d = Si(i);
3436
+ if (d) {
3437
+ const m = vi(d.collectionId, d.workflowId), f = r[m] ??= [];
3438
+ f.includes(d.historyId) || f.push(d.historyId);
3439
+ }
3440
+ }
3441
+ if (u === po) {
3442
+ const d = Ti(i.input);
3443
+ d && a(d);
3339
3444
  continue;
3340
3445
  }
3341
- if (Te(l) || ui(l)) {
3342
- r(), t.push({ kind: "tool", part: l, key: `tool-${a}` });
3446
+ if (Te(i) || gi(i)) {
3447
+ s(), t.push({ kind: "tool", part: i, key: `tool-${l}` });
3343
3448
  continue;
3344
3449
  }
3345
3450
  }
3346
- return r(), t;
3451
+ return s(), t;
3452
+ }
3453
+ const ki = p({
3454
+ isError: w(!1),
3455
+ data: p({
3456
+ collectionId: c().min(1),
3457
+ workflowId: c().min(1),
3458
+ historyId: c().min(1)
3459
+ })
3460
+ });
3461
+ function Si(e) {
3462
+ if (e.state !== "output-available")
3463
+ return;
3464
+ const t = ki.safeParse(e.output);
3465
+ return t.success ? t.data.data : void 0;
3347
3466
  }
3348
- function fi(e) {
3467
+ function Ti(e) {
3349
3468
  if (e == null || typeof e != "object")
3350
3469
  return;
3351
3470
  const t = e.message;
@@ -3354,21 +3473,21 @@ function fi(e) {
3354
3473
  const o = t.trim();
3355
3474
  return o.length > 0 ? o : void 0;
3356
3475
  }
3357
- function Ai(e) {
3476
+ function Li(e) {
3358
3477
  return e.filter((t) => t.type === "text").map((t) => t.text ?? "").join("");
3359
3478
  }
3360
- function Ei(e) {
3479
+ function Wi(e) {
3361
3480
  return uo({
3362
- queryKey: at.detail(e ?? ""),
3363
- queryFn: async () => e ? await st.getInstance().findOne(e) ?? null : null,
3481
+ queryKey: st.detail(e ?? ""),
3482
+ queryFn: async () => e ? await rt.getInstance().findOne(e) ?? null : null,
3364
3483
  enabled: !!e
3365
3484
  });
3366
3485
  }
3367
- function _i(e) {
3486
+ function Mi(e) {
3368
3487
  return lo({
3369
- queryKey: at.infiniteHistory(e),
3488
+ queryKey: st.infiniteHistory(e),
3370
3489
  initialPageParam: 0,
3371
- queryFn: async ({ pageParam: t }) => st.getInstance().findRecentChatsPage({
3490
+ queryFn: async ({ pageParam: t }) => rt.getInstance().findRecentChatsPage({
3372
3491
  offset: t,
3373
3492
  limit: e
3374
3493
  }),
@@ -3376,38 +3495,40 @@ function _i(e) {
3376
3495
  });
3377
3496
  }
3378
3497
  export {
3379
- dn as A,
3380
- ui as B,
3498
+ un as A,
3499
+ qi as B,
3381
3500
  E as C,
3382
- Oi as D,
3383
- _i as E,
3384
- bi as F,
3501
+ yi as D,
3502
+ gi as E,
3503
+ Di as F,
3504
+ Mi as G,
3505
+ _i as H,
3385
3506
  G as L,
3386
- gi as T,
3387
- Tn as a,
3388
- yr as b,
3389
- _a as c,
3390
- Ls as d,
3391
- _s as e,
3392
- Ci as f,
3393
- zn as g,
3394
- Ti as h,
3395
- Ai as i,
3396
- Ei as j,
3397
- as as k,
3398
- cs as l,
3399
- Xr as m,
3400
- is as n,
3507
+ Ri as T,
3508
+ Cn as a,
3509
+ vr as b,
3510
+ Da as c,
3511
+ Hs as d,
3512
+ Ls as e,
3513
+ xs as f,
3514
+ Hn as g,
3515
+ Ni as h,
3516
+ Ui as i,
3517
+ Li as j,
3518
+ Wi as k,
3519
+ is as l,
3520
+ Zr as m,
3521
+ ls as n,
3401
3522
  ys as o,
3402
- vi as p,
3403
- Se as q,
3404
- Si as r,
3405
- sa as s,
3406
- Te as t,
3407
- Qa as u,
3408
- ga as v,
3409
- ci as w,
3410
- gt as x,
3411
- ki as y,
3412
- di as z
3523
+ cs as p,
3524
+ vi as q,
3525
+ Pi as r,
3526
+ fa as s,
3527
+ $i as t,
3528
+ si as u,
3529
+ Se as v,
3530
+ wi as w,
3531
+ Te as x,
3532
+ Ea as y,
3533
+ vt as z
3413
3534
  };