@redocly/replay 0.27.0-next.8 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/{replay-AiChatProvider-DHIxHTKX.js → replay-AiChatProvider-LQhrLIDL.js} +44 -44
  2. package/dist/{replay-AiChatProvider-O8HHQobN.js → replay-AiChatProvider-Oms5CFgT.js} +1 -1
  3. package/dist/{replay-AiChatSqliteDBStorage-DNMrzkJg.js → replay-AiChatSqliteDBStorage-3-p1mthX.js} +1 -1
  4. package/dist/{replay-AiChatSqliteDBStorage-DjUq9VX3.js → replay-AiChatSqliteDBStorage-GZibdHOQ.js} +1 -1
  5. package/dist/replay-AiPanel-BvwwBTh1.js +742 -0
  6. package/dist/{replay-AiPanel-CR815YqV.js → replay-AiPanel-lcDNvgo0.js} +973 -1176
  7. package/dist/replay-FileWatcher-ClVd_wG0.js +1 -0
  8. package/dist/replay-FileWatcher-DR-wJLe2.js +343 -0
  9. package/dist/replay-Observable-D6wKbFwB.js +31 -0
  10. package/dist/replay-Observable-bjJ6wkRB.js +1 -0
  11. package/dist/replay-SemanticSearchService-CCqwCRo6.js +1 -0
  12. package/dist/replay-SemanticSearchService-U1eXQGfF.js +723 -0
  13. package/dist/{replay-SqliteDBStorage-B3oYWXem.js → replay-SqliteDBStorage-Dn6DoVWW.js} +1 -1
  14. package/dist/{replay-SqliteDBStorage-CC9kLioX.js → replay-SqliteDBStorage-d_ZK6ScA.js} +1 -1
  15. package/dist/replay-TauriFileSystemAdapter-CpiUuG3T.js +99 -0
  16. package/dist/replay-TauriFileSystemAdapter-dwJ0xBYr.js +1 -0
  17. package/dist/replay-TauriRootStorage-CuVbYMXX.js +605 -0
  18. package/dist/replay-TauriRootStorage-DhzbAahU.js +1 -0
  19. package/dist/{replay-agent-loop-CTq5eJ4u.js → replay-agent-loop-BLSu4v_O.js} +1 -1
  20. package/dist/{replay-agent-loop-CCYOzyHo.js → replay-agent-loop-DgEHdXUt.js} +11 -11
  21. package/dist/{replay-ai-chat-mappers-C8y5UhCq.js → replay-ai-chat-mappers-BvfcEubB.js} +5 -5
  22. package/dist/{replay-ai-chat-mappers-B_wovMvG.js → replay-ai-chat-mappers-Dy2kJ7ZG.js} +1 -1
  23. package/dist/replay-core-BJmXmoC5.js +1 -0
  24. package/dist/replay-core-B_hiOZZr.js +10 -0
  25. package/dist/{replay-create-model-C5yvtnXA.js → replay-create-model-DNPFcOIp.js} +579 -578
  26. package/dist/{replay-create-model-CBCmuEKC.js → replay-create-model-bOIDB-e8.js} +10 -10
  27. package/dist/{replay-db-CCBQadnT.js → replay-db-BQGv3PGw.js} +1 -1
  28. package/dist/{replay-db-DfOjLqsq.js → replay-db-CMXZZs9v.js} +1 -1
  29. package/dist/{replay-external-resolver-BRouROm6.js → replay-external-resolver-mrykFC2h.js} +2 -2
  30. package/dist/{replay-external-resolver-B6tpqUZt.js → replay-external-resolver-n5OvQMRF.js} +1 -1
  31. package/dist/replay-index-3lwhSmvi.js +1 -0
  32. package/dist/{replay-index-BzzBKjHm.js → replay-index-Bc5RHu5L.js} +23771 -25420
  33. package/dist/replay-index-CFLu-XMV.js +25 -0
  34. package/dist/{replay-index-Xq6K7XSm.js → replay-index-CHGVyIdG.js} +1 -1
  35. package/dist/{replay-index-Cpkh9r0X.js → replay-index-CSR_qlua.js} +1 -1
  36. package/dist/replay-index-CepJ5Z0m.js +6875 -0
  37. package/dist/{replay-index-Bzttek8l.js → replay-index-CgCGhu4l.js} +6 -6
  38. package/dist/replay-index-DDjmUXWm.js +1 -0
  39. package/dist/replay-index-DiSy_1OY.js +21 -0
  40. package/dist/replay-index-Oct6Dygd.js +1 -0
  41. package/dist/{replay-index-B_OHqSlS.js → replay-index-QXosJxRc.js} +18 -18
  42. package/dist/replay-index-jkDlU0Lx.js +32 -0
  43. package/dist/{replay-lint-gtuMJgII.js → replay-lint-DoHQIATV.js} +122 -122
  44. package/dist/{replay-lint-DlDmPTBV.js → replay-lint-PWaLESz5.js} +8921 -8880
  45. package/dist/{replay-lint-graphql-DHOq8lRT.js → replay-lint-graphql-xh8VoAwd.js} +1 -1
  46. package/dist/{replay-lint-graphql-BQJ00lU4.js → replay-lint-graphql-zO8zunug.js} +1 -1
  47. package/dist/replay-periodic-revalidation-BoyLQHtg.js +1 -0
  48. package/dist/replay-periodic-revalidation-Dsp-n7ui.js +21 -0
  49. package/dist/replay-promise-map-limit-DRDkHc-b.js +1 -0
  50. package/dist/replay-promise-map-limit-Db_42GvV.js +14 -0
  51. package/dist/replay-resolve-B0AjmaE9.js +47 -0
  52. package/dist/{replay-resolve-DsgcWnjC.js → replay-resolve-MVe_8Ube.js} +1364 -1329
  53. package/dist/{replay-respect-run-7Cwe1_ri.js → replay-respect-run-BJsR4a4m.js} +1 -1
  54. package/dist/{replay-respect-run-D1zyh-5j.js → replay-respect-run-X4PSO6Fj.js} +3 -3
  55. package/dist/{replay-tauri-path-BAY3g5sW.js → replay-tauri-path-CkGiQWsb.js} +5 -5
  56. package/dist/{replay-tauri-path-CaVeI3a-.js → replay-tauri-path-D8FJsoZb.js} +1 -1
  57. package/dist/replay-useAiChatQueries-BXL-_N2Q.js +215 -0
  58. package/dist/{replay-useAiChatQueries-CxZNLVje.js → replay-useAiChatQueries-D7sHNAfV.js} +1078 -1022
  59. package/dist/{replay-validate-key-Cv0mvYDS.js → replay-validate-key-CmzSfORv.js} +1 -1
  60. package/dist/{replay-validate-key-Di8MCBz7.js → replay-validate-key-CtZEJRP7.js} +2 -2
  61. package/dist/replay.cjs +1 -1
  62. package/dist/replay.js +11 -11
  63. package/package.json +10 -9
  64. package/dist/replay-AiPanel-CfYBCkrN.js +0 -868
  65. package/dist/replay-index-C6SJPGDO.js +0 -23
  66. package/dist/replay-index-CUs62_1f.js +0 -1
  67. package/dist/replay-index-Dfnqt_IZ.js +0 -6899
  68. package/dist/replay-resolve-DqFS69S_.js +0 -47
  69. package/dist/replay-useAiChatQueries-D99tAUpY.js +0 -215
@@ -1,14 +1,15 @@
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-BzzBKjHm.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-DfOjLqsq.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-C5yvtnXA.js";
5
- import { useInfiniteQuery as lo, useQuery as uo } from "@tanstack/react-query";
1
+ import { useContext as Et, createContext as $t } from "react";
2
+ import { F as _t, V as ae, aj as H, ak as Rt, al as qt, am as Pt, h as O, ab as D, an as Je, ao as ue, aa as pe, ap as Qe, aq as fe, ar as me, as as Nt, at as j, au as X, av as Xe, aw as Ze, n as he, ax as Ut, ay as Dt, az as Lt, I as Wt, aA as Mt, aB as et, aC as tt, aD as Ft, a4 as Z, aE as jt, T as ot, a3 as nt, aF as Bt, a8 as g, aG as Oe, aH as Yt, aI as Ae, aJ as zt, aK as Ht, aL as Gt, A as rt, f as st } from "./replay-index-Bc5RHu5L.js";
3
+ import { b as k, f as at, a as it, c as ct, d as ee, e as lt, i as xe, h as Ie, R as L, j as Vt, k as Kt, p as Jt, s as Ee, l as Qt } from "./replay-db-CMXZZs9v.js";
4
+ import { b as Xt, o as Zt, d as eo, e as p, u as te, f as i, h as E, j as T, n as S, k as U, m as I, q as b, r as we, t as B, v as oe, Z as W, w as to, x as $e, c as oo, s as no, y as ro } from "./replay-create-model-DNPFcOIp.js";
5
+ import { g as so, c as _e, d as ao, f as io, h as Re, i as co, j as lo } from "./replay-SemanticSearchService-U1eXQGfF.js";
6
+ import { useInfiniteQuery as uo, useQuery as po } from "@tanstack/react-query";
6
7
  const G = {
7
8
  path: "pathParameters",
8
9
  query: "queryParameters",
9
10
  header: "headers",
10
11
  cookie: "cookies"
11
- }, $i = {
12
+ }, Ni = {
12
13
  run_request: {
13
14
  approveLabel: "Run",
14
15
  denyLabel: "Skip"
@@ -21,7 +22,7 @@ const G = {
21
22
  approveLabel: "Apply",
22
23
  denyLabel: "Dismiss"
23
24
  }
24
- }, Ri = {
25
+ }, Ui = {
25
26
  set_active_environment: { approveLabel: "Switch", denyLabel: "Cancel" },
26
27
  add_environment: { approveLabel: "Add", denyLabel: "Cancel" },
27
28
  upsert_input: { approveLabel: "Set", denyLabel: "Cancel" },
@@ -31,31 +32,32 @@ const G = {
31
32
  create_collection: { approveLabel: "Create", denyLabel: "Cancel" },
32
33
  create_workflow: { approveLabel: "Create", denyLabel: "Cancel" },
33
34
  create_step: { approveLabel: "Create", denyLabel: "Cancel" },
35
+ move_step: { approveLabel: "Move", denyLabel: "Cancel" },
34
36
  delete_collection: { approveLabel: "Delete", denyLabel: "Cancel" },
35
37
  delete_workflow: { approveLabel: "Delete", denyLabel: "Cancel" },
36
38
  delete_step: { approveLabel: "Delete", denyLabel: "Cancel" },
37
39
  save_tab_to_collection: { approveLabel: "Save", denyLabel: "Cancel" }
38
- }, _i = {
40
+ }, Di = {
39
41
  CHAT: "chat",
40
42
  HISTORY: "history"
41
- }, po = "report_status", fo = "run_workflow", z = {
43
+ }, fo = "report_status", mo = "run_workflow", z = {
42
44
  WEB_SEARCH: "web_search"
43
45
  };
44
- function mo(e) {
46
+ function ho(e) {
45
47
  switch (e.provider) {
46
- case se.GEMINI:
48
+ case ae.GEMINI:
47
49
  return {
48
- [z.WEB_SEARCH]: ro.tools.googleSearch({})
50
+ [z.WEB_SEARCH]: eo.tools.googleSearch({})
49
51
  };
50
- case se.OPENAI:
52
+ case ae.OPENAI:
51
53
  return {
52
- [z.WEB_SEARCH]: no.tools.webSearch({})
54
+ [z.WEB_SEARCH]: Zt.tools.webSearch({})
53
55
  };
54
- case se.ANTHROPIC:
56
+ case ae.ANTHROPIC:
55
57
  return {
56
- [z.WEB_SEARCH]: oo.tools.webFetch_20250910()
58
+ [z.WEB_SEARCH]: Xt.tools.webFetch_20250910()
57
59
  };
58
- case $t:
60
+ case _t:
59
61
  return {
60
62
  [z.WEB_SEARCH]: {
61
63
  type: "provider",
@@ -68,13 +70,13 @@ function mo(e) {
68
70
  return {};
69
71
  }
70
72
  }
71
- const ho = ["info", "workflows", "sourceDescriptions"];
73
+ const Io = ["info", "workflows", "sourceDescriptions"];
72
74
  function wo(e) {
73
75
  const t = [];
74
76
  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
77
  `);
76
78
  }
77
- function Io(e) {
79
+ function yo(e) {
78
80
  const t = [];
79
81
  if (e.collection?.workflows?.length) {
80
82
  t.push("Workflows:");
@@ -84,7 +86,7 @@ function Io(e) {
84
86
  return k(t, `
85
87
  `);
86
88
  }
87
- function yo(e) {
89
+ function vo(e) {
88
90
  const t = [];
89
91
  if (e.collection?.sourceDescriptions?.length) {
90
92
  t.push("Source descriptions:");
@@ -94,7 +96,7 @@ function yo(e) {
94
96
  return k(t, `
95
97
  `);
96
98
  }
97
- function vo(e, t) {
99
+ function go(e, t) {
98
100
  const o = ["Current tab (collection)"];
99
101
  for (const n of t)
100
102
  switch (n) {
@@ -102,17 +104,17 @@ function vo(e, t) {
102
104
  o.push(wo(e));
103
105
  break;
104
106
  case "workflows":
105
- o.push(Io(e));
107
+ o.push(yo(e));
106
108
  break;
107
109
  case "sourceDescriptions":
108
- o.push(yo(e));
110
+ o.push(vo(e));
109
111
  break;
110
112
  }
111
113
  return k(o, `
112
114
 
113
115
  `);
114
116
  }
115
- function go(e, t) {
117
+ function bo(e, t) {
116
118
  return k(
117
119
  [
118
120
  e.collectionId ? `Collection ID: ${e.collectionId}` : null,
@@ -123,7 +125,7 @@ function go(e, t) {
123
125
  `
124
126
  );
125
127
  }
126
- function bo(e, t) {
128
+ function ko(e, t) {
127
129
  return k(
128
130
  [
129
131
  t.includes("title") ? e.title : null,
@@ -142,7 +144,7 @@ function bo(e, t) {
142
144
  `
143
145
  );
144
146
  }
145
- const ko = [
147
+ const So = [
146
148
  "info",
147
149
  "inputs",
148
150
  "parameters",
@@ -151,11 +153,11 @@ const ko = [
151
153
  "steps",
152
154
  "wiring"
153
155
  ];
154
- function So(e) {
156
+ function To(e) {
155
157
  return !e.inputs || Object.keys(e.inputs).length === 0 ? null : `Workflow inputs (JSON Schema):
156
158
  ${JSON.stringify(e.inputs, null, 2)}`;
157
159
  }
158
- function To(e) {
160
+ function Co(e) {
159
161
  return e.outputs?.length ? `Workflow outputs:
160
162
  ${e.outputs.map(
161
163
  (t) => ` id=${t.id} key=${t.key} value=${t.value} active=${t.active}`
@@ -165,38 +167,38 @@ ${e.outputs.map(
165
167
  function dt(e) {
166
168
  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
169
  }
168
- function Co(e) {
170
+ function Oo(e) {
169
171
  return e.steps?.length ? `Steps:
170
172
  ${e.steps.map(
171
173
  (t) => ` stepId=${t.stepId} ${dt(t)}`
172
174
  ).join(`
173
175
  `)}` : null;
174
176
  }
175
- function Oo(e) {
177
+ function Ao(e) {
176
178
  return e.steps?.length ? `Step wiring (security + outputs per step):
177
179
  ${e.steps.map((o) => {
178
- const n = [` stepId=${o.stepId}${dt(o)}`], r = Z(o.security);
179
- r && n.push($e(r, " "));
180
- const s = we(o.outputs);
181
- return s && n.push($e(s, " ")), n.join(`
180
+ const n = [` stepId=${o.stepId}${dt(o)}`], r = ee(o.security);
181
+ r && n.push(xe(r, " "));
182
+ const s = Ie(o.outputs);
183
+ return s && n.push(xe(s, " ")), n.join(`
182
184
  `);
183
185
  }).join(`
184
186
  `)}` : null;
185
187
  }
186
- function Ao(e, t) {
188
+ function xo(e, t) {
187
189
  switch (t) {
188
190
  case "inputs":
189
- return So(e);
191
+ return To(e);
190
192
  case "parameters":
191
193
  return lt(e.parameters);
192
194
  case "security":
193
- return Z(e.security);
195
+ return ee(e.security);
194
196
  case "outputs":
195
- return To(e);
196
- case "steps":
197
197
  return Co(e);
198
- case "wiring":
198
+ case "steps":
199
199
  return Oo(e);
200
+ case "wiring":
201
+ return Ao(e);
200
202
  default:
201
203
  return null;
202
204
  }
@@ -206,7 +208,7 @@ function Eo(e) {
206
208
  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
209
  `);
208
210
  }
209
- function xo(e, t) {
211
+ function $o(e, t) {
210
212
  const o = ["Current tab (workflow)"], n = e.workflow;
211
213
  for (const r of t) {
212
214
  if (r === "info") {
@@ -215,14 +217,14 @@ function xo(e, t) {
215
217
  }
216
218
  if (!n)
217
219
  continue;
218
- const s = Ao(n, r);
220
+ const s = xo(n, r);
219
221
  s && o.push(s);
220
222
  }
221
223
  return k(o, `
222
224
 
223
225
  `);
224
226
  }
225
- function $o(e, t) {
227
+ function _o(e, t) {
226
228
  return k(
227
229
  [
228
230
  e.collectionId ? `Collection ID: ${e.collectionId}` : null,
@@ -243,7 +245,7 @@ const Ro = [
243
245
  "successCriteria",
244
246
  "response"
245
247
  ];
246
- function _o(e) {
248
+ function qo(e) {
247
249
  const t = [
248
250
  `apiId: ${e.apiId}`,
249
251
  `method: ${e.method}`,
@@ -252,41 +254,41 @@ function _o(e) {
252
254
  ];
253
255
  return `Step is connected to API (${k(t, ", ")})`;
254
256
  }
255
- function qo(e) {
257
+ function Po(e) {
256
258
  const t = [`method: ${e.method}`, `url: ${e.url}`];
257
259
  return `Step is not connected to API (${k(t, ", ")})`;
258
260
  }
259
- function Po(e) {
261
+ function No(e) {
260
262
  return e.description?.trim() ? `Description:
261
263
  ${e.description}` : null;
262
264
  }
263
- function No(e, t) {
265
+ function Uo(e, t) {
264
266
  switch (t) {
265
267
  case "parameters":
266
268
  return lt(e.parameters) || null;
267
269
  case "requestBody":
268
- return Zt(e.requestBody) || null;
270
+ return Kt(e.requestBody) || null;
269
271
  case "security":
270
- return Z(e.security) || null;
272
+ return ee(e.security) || null;
271
273
  case "outputs":
272
- return we(e.outputs) || null;
274
+ return Ie(e.outputs) || null;
273
275
  case "successCriteria":
274
- return Xt(e.successCriteria) || null;
276
+ return Vt(e.successCriteria) || null;
275
277
  default:
276
278
  return null;
277
279
  }
278
280
  }
279
- function Uo(e) {
281
+ function Do(e) {
280
282
  const t = [];
281
283
  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
284
  const o = e.draftStep ?? e.step;
283
285
  if (o) {
284
- if (t.push(Po(o)), o.operation) {
286
+ if (t.push(No(o)), o.operation) {
285
287
  const n = o.operation;
286
- t.push(_o(n));
288
+ t.push(qo(n));
287
289
  } else if (o.xOperation) {
288
290
  const n = o.xOperation;
289
- t.push(qo(n));
291
+ t.push(Po(n));
290
292
  }
291
293
  }
292
294
  return e.response && t.push(
@@ -294,7 +296,7 @@ function Uo(e) {
294
296
  ), e.requestError && t.push(`Request error: ${e.requestError}`), k(t, `
295
297
  `);
296
298
  }
297
- function Do(e) {
299
+ function Lo(e) {
298
300
  if (!e.response) return null;
299
301
  const t = e.response, o = t.headers?.length ? t.headers.map((s) => ` ${s[0]}: ${s[1]}`) : [];
300
302
  let n = "";
@@ -318,23 +320,23 @@ ${k(o, `
318
320
  function qe(e, t) {
319
321
  const o = [];
320
322
  for (const n of t) {
321
- const r = No(e, n);
323
+ const r = Uo(e, n);
322
324
  r && o.push(r);
323
325
  }
324
326
  return o.length ? o.filter(Boolean).join(`
325
327
  `) : "";
326
328
  }
327
- function Lo(e, t) {
329
+ function Wo(e, t) {
328
330
  const o = ["Current tab (step)"];
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, `
331
+ return t.length === 0 ? null : (t.includes("info") && o.push(Do(e)), e.draftStep ? o.push(qe(e.draftStep, t)) : e.step && o.push(qe(e.step, t)), t.includes("response") && o.push(Lo(e)), k(o, `
330
332
 
331
333
  `));
332
334
  }
333
- function Wo(e) {
335
+ function Mo(e) {
334
336
  return e?.trim() ? `Description:
335
337
  ${e}` : null;
336
338
  }
337
- function Mo(e, t) {
339
+ function Fo(e, t) {
338
340
  if (e.apiId && e.path && e.method) {
339
341
  const o = [
340
342
  `apiId: ${e.apiId}`,
@@ -353,14 +355,14 @@ function Mo(e, t) {
353
355
  }
354
356
  return null;
355
357
  }
356
- function Fo(e, t) {
358
+ function jo(e, t) {
357
359
  return k(
358
360
  [
359
361
  e.collectionId ? `Collection ID: ${e.collectionId}` : null,
360
362
  e.workflowId ? `Workflow ID: ${e.workflowId}` : null,
361
363
  e.stepId ? `Step ID: ${e.stepId}` : null,
362
- t.includes("description") ? Wo(e.description) : null,
363
- Mo(e, t),
364
+ t.includes("description") ? Mo(e.description) : null,
365
+ Fo(e, t),
364
366
  t.includes("requestBody") && e.requestBodySchema ? `Request body schema: ${e.requestBodySchema}` : null,
365
367
  t.includes("parameters") && e.parameterDetails ? `Parameter details: ${at(e.parameterDetails)}` : null,
366
368
  t.includes("successCriteria") && e.successCriteria?.length ? `Success criteria: ${e.successCriteria.join("; ")}` : null,
@@ -372,56 +374,56 @@ function Fo(e, t) {
372
374
  `
373
375
  );
374
376
  }
375
- function jo(e, t) {
376
- return e.type === "collection" ? go(e, t) : e.type === "workflow" ? $o(e, t) : e.type === "step" ? Fo(e, t) : bo(e, t);
377
- }
378
377
  function Bo(e, t) {
379
- return e.map((o) => jo(o, t));
378
+ return e.type === "collection" ? bo(e, t) : e.type === "workflow" ? _o(e, t) : e.type === "step" ? jo(e, t) : ko(e, t);
379
+ }
380
+ function Yo(e, t) {
381
+ return e.map((o) => Bo(o, t));
380
382
  }
381
- const Yo = ["info", "result", "severity"], zo = 500, Ho = L * 2;
382
- function Go(e) {
383
+ const zo = ["info", "result", "severity"], Ho = 500, Go = L * 2;
384
+ function Vo(e) {
383
385
  const t = [];
384
386
  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
387
  `);
386
388
  }
387
- function Vo(e) {
389
+ function Ko(e) {
388
390
  return `Severity settings:
389
391
  ${JSON.stringify(e.severitySettings, null, 2)}`;
390
392
  }
391
- function Ko(e, t) {
393
+ function Jo(e, t) {
392
394
  return e.length > t ? `${e.slice(0, t)}…` : e;
393
395
  }
394
396
  function Pe(e, t, o, n = !1) {
395
397
  if (e == null || e === "") return "(empty)";
396
398
  const r = typeof e == "string" ? e : n ? JSON.stringify(e, null, 2) : JSON.stringify(e);
397
- return Ko(H(r, t), o);
399
+ return Jo(H(r, t), o);
398
400
  }
399
- function Jo(e, t) {
401
+ function Qo(e, t) {
400
402
  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
403
  (o || n) && s.push(
402
404
  [o?.toUpperCase(), n ? H(n, t) : null].filter(Boolean).join(" "),
403
405
  "->"
404
- ), s.push(`status=${r ?? "n/a"}`, _t(e) ? "passed" : "failed");
405
- const a = e.checks ? qt(e.checks) : [];
406
+ ), s.push(`status=${r ?? "n/a"}`, qt(e) ? "passed" : "failed");
407
+ const a = e.checks ? Pt(e.checks) : [];
406
408
  if (a.length > 0) {
407
409
  const l = a.map(
408
- (i) => i.message ? `${i.name}: ${H(i.message, t)}` : i.name
410
+ (c) => c.message ? `${c.name}: ${H(c.message, t)}` : c.name
409
411
  );
410
412
  s.push(`(${l.join("; ")})`);
411
413
  }
412
414
  return s.join(" ");
413
415
  }
414
- function Qo(e, t, o) {
416
+ function Xo(e, t, o) {
415
417
  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
418
  if (n.length > 0) {
417
419
  const d = [];
418
- let m = Ho, f = 0;
420
+ let m = Go, f = 0;
419
421
  for (const { step: y } of n) {
420
- if (d.push(` ${Jo(y, t)}`), m <= 0) {
422
+ if (d.push(` ${Qo(y, t)}`), m <= 0) {
421
423
  f++;
422
424
  continue;
423
425
  }
424
- const v = Pe(y.response?.body, t, zo);
426
+ const v = Pe(y.response?.body, t, Ho);
425
427
  m -= v.length, d.push(` body: ${v}`);
426
428
  }
427
429
  f > 0 && d.push(
@@ -445,7 +447,7 @@ ${Pe(
445
447
  return k(u, `
446
448
  `);
447
449
  }
448
- function Xo(e, t) {
450
+ function Zo(e, t) {
449
451
  const o = e.secretValues ? [...e.secretValues] : void 0;
450
452
  if (e.runStatus === "running")
451
453
  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.";
@@ -457,56 +459,56 @@ function Xo(e, t) {
457
459
  return e.result ? `${n}
458
460
  (the stored result is from an earlier run and is omitted as stale)` : n;
459
461
  }
460
- return e.result ? Qo(e.result, o, t?.stepIds) : "Run status: NOT STARTED - no run has executed on this tab yet.";
462
+ return e.result ? Xo(e.result, o, t?.stepIds) : "Run status: NOT STARTED - no run has executed on this tab yet.";
461
463
  }
462
- function Zo(e, t, o) {
464
+ function en(e, t, o) {
463
465
  const n = ["Current tab (workflow run)"];
464
466
  for (const r of t)
465
467
  switch (r) {
466
468
  case "info":
467
- n.push(Go(e));
469
+ n.push(Vo(e));
468
470
  break;
469
471
  case "severity":
470
- n.push(Vo(e));
472
+ n.push(Ko(e));
471
473
  break;
472
474
  case "result":
473
- n.push(Xo(e, o));
475
+ n.push(Zo(e, o));
474
476
  break;
475
477
  }
476
478
  return k(n, `
477
479
 
478
480
  `);
479
481
  }
480
- function en(e, t = ["info"], o) {
482
+ function tn(e, t = ["info"], o) {
481
483
  if (!e)
482
484
  return null;
483
485
  switch (e.type) {
484
486
  case O.Step:
485
- return Lo(e, t);
487
+ return Wo(e, t);
486
488
  case O.Workflow:
487
- return xo(e, t);
489
+ return $o(e, t);
488
490
  case O.Collection:
489
- return vo(e, t);
491
+ return go(e, t);
490
492
  case O.WorkflowRun:
491
- return Zo(e, t, o);
493
+ return en(e, t, o);
492
494
  }
493
495
  }
494
- function tn(e) {
496
+ function on(e) {
495
497
  switch (e.type) {
496
498
  case O.Collection:
497
- return ho;
499
+ return Io;
498
500
  case O.Workflow:
499
- return ko;
501
+ return So;
500
502
  case O.Step:
501
503
  return Ro;
502
504
  case O.WorkflowRun:
503
- return Yo;
505
+ return zo;
504
506
  }
505
507
  }
506
508
  function ut(e) {
507
509
  return e.trim().replace(/\s+/g, " ").replace(/[.!?:;,…]+$/, "").toLowerCase();
508
510
  }
509
- function on(e, t) {
511
+ function nn(e, t) {
510
512
  const o = [];
511
513
  let n = 0;
512
514
  for (const r of e ?? [])
@@ -515,7 +517,7 @@ function on(e, t) {
515
517
  s.type === "tool-call" && (s.toolName === t ? (n += 1, o.push(s.input)) : n = 0);
516
518
  return { priorInputs: o, consecutiveCalls: n };
517
519
  }
518
- function nn(e, t, o) {
520
+ function rn(e, t, o) {
519
521
  const n = [];
520
522
  let r = !1;
521
523
  for (const s of e) {
@@ -538,7 +540,7 @@ function Ne(e, t) {
538
540
  return null;
539
541
  }
540
542
  }
541
- function rn(e) {
543
+ function sn(e) {
542
544
  const t = Ue("warn", e.warnAfter, e.warnMessage), o = Ue("block", e.blockAfter, e.blockMessage);
543
545
  if (!t && !o)
544
546
  throw new Error("consecutiveCallsRule requires at least warnAfter or blockAfter");
@@ -558,7 +560,7 @@ function Ue(e, t, o) {
558
560
  return { after: t, message: o };
559
561
  }
560
562
  }
561
- function sn(e) {
563
+ function an(e) {
562
564
  if (!e || typeof e.safeParse != "function")
563
565
  return;
564
566
  const t = e;
@@ -567,37 +569,37 @@ function sn(e) {
567
569
  return n.success ? n.data : null;
568
570
  };
569
571
  }
570
- function an(e, t, o, n) {
572
+ function cn(e, t, o, n) {
571
573
  return !t || t.length === 0 ? o : async (r, s) => {
572
- const a = on(s?.messages, e), l = {
574
+ const a = nn(s?.messages, e), l = {
573
575
  consecutiveCalls: a.consecutiveCalls,
574
576
  priorInputs: n ? a.priorInputs.map(n).filter((d) => d !== null) : a.priorInputs
575
- }, i = nn(t, r, l);
576
- if (i.blocked)
577
- return { isError: !1, blocked: !0, note: i.notes.join(" ") };
577
+ }, c = rn(t, r, l);
578
+ if (c.blocked)
579
+ return { isError: !1, blocked: !0, note: c.notes.join(" ") };
578
580
  const u = await o(r, s);
579
- return i.notes.length === 0 || !cn(u) ? u : {
581
+ return c.notes.length === 0 || !ln(u) ? u : {
580
582
  ...u,
581
- note: [u.note, ...i.notes].filter(Boolean).join(" ")
583
+ note: [u.note, ...c.notes].filter(Boolean).join(" ")
582
584
  };
583
585
  };
584
586
  }
585
- function cn(e) {
587
+ function ln(e) {
586
588
  return e !== null && typeof e == "object" && e.isError === !1;
587
589
  }
588
- function ln(e, t) {
590
+ function dn(e, t) {
589
591
  return {
590
592
  name: e.name,
591
593
  definition: e.definition,
592
- execute: an(
594
+ execute: cn(
593
595
  e.name,
594
596
  e.guards,
595
597
  e.createExecutor(t),
596
- sn(e.definition.inputSchema)
598
+ an(e.definition.inputSchema)
597
599
  )
598
600
  };
599
601
  }
600
- const dn = {
602
+ const un = {
601
603
  messages: [],
602
604
  isStreaming: !1,
603
605
  sendMessage: async () => {
@@ -610,62 +612,62 @@ const dn = {
610
612
  },
611
613
  chatStatus: "ready",
612
614
  chatError: void 0
613
- }, un = xt(
614
- dn
615
+ }, pn = $t(
616
+ un
615
617
  );
616
- function qi() {
617
- return Et(un);
618
+ function Li() {
619
+ return Et(pn);
618
620
  }
619
- const pn = p({
620
- message: c(),
621
- details: ee().optional()
621
+ const fn = p({
622
+ message: i(),
623
+ details: te().optional()
622
624
  });
623
625
  p({
624
- collectionId: c().min(1).describe("Target collection id."),
625
- workflowId: c().min(1).describe("Target workflow id."),
626
- stepId: c().min(1).describe("Target step id.")
626
+ collectionId: i().min(1).describe("Target collection id."),
627
+ workflowId: i().min(1).describe("Target workflow id."),
628
+ stepId: i().min(1).describe("Target step id.")
627
629
  });
628
630
  const ye = p({
629
- action: S(["add", "update", "remove"]).describe('Action to perform: "add", "update" or "remove".'),
630
- approved: x().default(!0)
631
- }), _ = ye.extend({
632
- id: c().optional().describe("Existing item id. Required for update/remove actions.")
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
- note: c(),
631
+ action: T(["add", "update", "remove"]).describe('Action to perform: "add", "update" or "remove".'),
632
+ approved: E().default(!0)
633
+ }), R = ye.extend({
634
+ id: i().optional().describe("Existing item id. Required for update/remove actions.")
635
+ }), mn = ye.extend({
636
+ index: S().int().min(0).optional().describe("Existing item index. Required for update/remove actions.")
637
+ }), hn = p({
638
+ isError: I(!1),
639
+ blocked: I(!0),
640
+ note: i(),
639
641
  data: U().optional(),
640
642
  error: U().optional()
641
643
  });
642
644
  function $(e) {
643
- return Ie([
645
+ return we([
644
646
  p({
645
- isError: w(!0),
646
- error: pn,
647
+ isError: I(!0),
648
+ error: fn,
647
649
  data: U().optional(),
648
650
  blocked: U().optional()
649
651
  }),
650
652
  p({
651
- isError: w(!1),
653
+ isError: I(!1),
652
654
  data: e,
653
655
  error: U().optional(),
654
- note: c().optional(),
656
+ note: i().optional(),
655
657
  blocked: U().optional()
656
658
  }),
657
- mn
659
+ hn
658
660
  ]);
659
661
  }
660
- const hn = p({
661
- status: S(["applied", "failed"]),
662
- summary: c().optional()
662
+ const In = p({
663
+ status: T(["applied", "failed"]),
664
+ summary: i().optional()
663
665
  }), wn = p({
664
- totalChanges: T().int().min(0),
665
- approvedChanges: T().int().min(0),
666
- applied: b(hn),
667
- resultingState: c().optional().describe("Resulting state of the mutated fields after all changes were applied.")
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([
666
+ totalChanges: S().int().min(0),
667
+ approvedChanges: S().int().min(0),
668
+ applied: b(In),
669
+ resultingState: i().optional().describe("Resulting state of the mutated fields after all changes were applied.")
670
+ }), ft = $(wn), yn = "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.", vn = T([
669
671
  "info",
670
672
  "workflows",
671
673
  "sourceDescriptions",
@@ -680,19 +682,19 @@ const hn = p({
680
682
  "response",
681
683
  "result",
682
684
  "severity"
683
- ]), vn = B({
684
- sections: b(yn).min(1).describe(
685
+ ]), gn = B({
686
+ sections: b(vn).min(1).describe(
685
687
  "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
688
  ),
687
- stepIds: b(c()).min(1).optional().describe(
689
+ stepIds: b(i()).min(1).optional().describe(
688
690
  "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
691
  )
690
- }), gn = p({
691
- message: c()
692
- }), bn = $(gn), kn = {
693
- description: In,
694
- inputSchema: vn,
695
- outputSchema: bn,
692
+ }), bn = p({
693
+ message: i()
694
+ }), kn = $(bn), Sn = {
695
+ description: yn,
696
+ inputSchema: gn,
697
+ outputSchema: kn,
696
698
  needsApproval: !1
697
699
  };
698
700
  function h(e, t) {
@@ -701,34 +703,34 @@ function h(e, t) {
701
703
  error: { message: e, details: t }
702
704
  };
703
705
  }
704
- function Sn(e, t) {
705
- const o = tn(e), n = [], r = [];
706
+ function Tn(e, t) {
707
+ const o = on(e), n = [], r = [];
706
708
  for (const s of t)
707
709
  o.includes(s) ? n.push(s) : r.push(s);
708
710
  return { sections: n, skipped: r };
709
711
  }
710
- function Tn(e) {
712
+ function Cn(e) {
711
713
  return async (t, o) => {
712
714
  const n = e();
713
715
  if (!n)
714
716
  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
- return s.length > 0 && (i += `
717
+ const { sections: r, skipped: s } = Tn(n, t.sections), a = r.length > 0 ? r : ["info"];
718
+ let c = tn(n, a, { stepIds: t.stepIds }) ?? "Unable to build a summary for the active tab.";
719
+ return s.length > 0 && (c += `
718
720
 
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 += `
721
+ (Sections not applicable for this tab type were omitted: ${s.join(", ")}.)`), r.length === 0 && t.sections.length > 0 && (c += "\n\n(No requested sections applied to this tab type; showing `info` instead.)"), t.stepIds?.length && (n.type !== O.WorkflowRun ? c += `
720
722
 
721
- (stepIds applies only to workflow run tabs.)` : a.includes("result") || (i += "\n\n(stepIds requires the `result` section.)")), {
723
+ (stepIds applies only to workflow run tabs.)` : a.includes("result") || (c += "\n\n(stepIds requires the `result` section.)")), {
722
724
  isError: !1,
723
- data: { message: i }
725
+ data: { message: c }
724
726
  };
725
727
  };
726
728
  }
727
- const Cn = {
729
+ const On = {
728
730
  name: "get_current_tab",
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.
731
+ definition: Sn,
732
+ createExecutor: (e) => Cn(e.getActiveTabDetailedData)
733
+ }, An = `Read top-level metadata of a loaded OpenAPI document in the current Replay project.
732
734
 
733
735
  **What it does**
734
736
  - Scan: omit \`field\` to list the metadata fields present in the document, each with its shape (and item count for lists/maps).
@@ -743,38 +745,38 @@ const Cn = {
743
745
 
744
746
  **Input guidance**
745
747
  - \`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.`, An = B({
747
- apiId: c().describe(
748
+ - Read one \`field\` at a time; use \`cursor\` only to continue a section you already started.`, xn = B({
749
+ apiId: i().describe(
748
750
  "ID of the loaded API document to read (the API URI, the same identifier used by the search tool)."
749
751
  ),
750
- field: c().optional().describe(
752
+ field: i().optional().describe(
751
753
  'Top-level metadata field to read (e.g. "info", "servers", "tags", "externalDocs", "securitySchemes"). Omit to scan: list the metadata fields present in the document. Operations and reusable components (paths, webhooks, components, definitions, parameters, responses) are not available here — use the search tool for those.'
752
754
  ),
753
- cursor: c().optional().describe(
755
+ cursor: i().optional().describe(
754
756
  "Opaque cursor to continue a previously truncated section. Only meaningful together with `field`."
755
757
  )
756
758
  }), En = p({
757
- name: c(),
758
- kind: S(["scalar", "object", "array"]),
759
- count: T().int().nonnegative().optional()
760
- }), xn = p({
761
- name: c(),
762
- hint: c()
759
+ name: i(),
760
+ kind: T(["scalar", "object", "array"]),
761
+ count: S().int().nonnegative().optional()
763
762
  }), $n = p({
763
+ name: i(),
764
+ hint: i()
765
+ }), _n = p({
764
766
  available: b(En),
765
- blocked: b(xn)
767
+ blocked: b($n)
766
768
  }), Rn = p({
767
- field: c(),
768
- value: ee(),
769
- start: T().int().nonnegative().optional(),
770
- end: T().int().nonnegative().optional(),
771
- total: T().int().nonnegative().optional(),
772
- truncated: x(),
773
- nextCursor: c().nullable()
774
- }), _n = Ie([$n, Rn]), qn = $(_n), Pn = {
775
- description: On,
776
- inputSchema: An,
777
- outputSchema: qn,
769
+ field: i(),
770
+ value: te(),
771
+ start: S().int().nonnegative().optional(),
772
+ end: S().int().nonnegative().optional(),
773
+ total: S().int().nonnegative().optional(),
774
+ truncated: E(),
775
+ nextCursor: i().nullable()
776
+ }), qn = we([_n, Rn]), Pn = $(qn), Nn = {
777
+ description: An,
778
+ inputSchema: xn,
779
+ outputSchema: Pn,
778
780
  needsApproval: !1
779
781
  }, V = {
780
782
  paths: "Use the search tool to read endpoints and operations.",
@@ -783,30 +785,30 @@ const Cn = {
783
785
  definitions: "Use the search tool to read reusable schemas.",
784
786
  parameters: "Use the search tool to read reusable parameters.",
785
787
  responses: "Use the search tool to read reusable responses."
786
- }, mt = ["id", "srcType", "fileDependencies"], oe = [
788
+ }, mt = ["id", "srcType", "fileDependencies"], ne = [
787
789
  {
788
790
  name: "securitySchemes",
789
791
  sources: ["components.securitySchemes", "securityDefinitions"]
790
792
  }
791
- ], Nn = 10, De = 500;
793
+ ], Un = 10, De = 500;
792
794
  function ht(e, t) {
793
795
  for (const o of t.sources) {
794
- const n = Un(e, o);
795
- if (Dn(n)) return n;
796
+ const n = Dn(e, o);
797
+ if (Ln(n)) return n;
796
798
  }
797
799
  return null;
798
800
  }
799
- function Un(e, t) {
801
+ function Dn(e, t) {
800
802
  return t.split(".").reduce((o, n) => M(o) ? o[n] : void 0, e);
801
803
  }
802
- function Dn(e) {
804
+ function Ln(e) {
803
805
  return e == null ? !1 : Array.isArray(e) ? e.length > 0 : M(e) ? Object.keys(e).length > 0 : !0;
804
806
  }
805
807
  function M(e) {
806
808
  return !(e === null || typeof e != "object" || Array.isArray(e));
807
809
  }
808
- const Ln = new Set(
809
- oe.flatMap((e) => e.sources.map((t) => t.split(".")[0]))
810
+ const Wn = new Set(
811
+ ne.flatMap((e) => e.sources.map((t) => t.split(".")[0]))
810
812
  );
811
813
  function Le(e) {
812
814
  const t = [], o = [];
@@ -815,22 +817,22 @@ function Le(e) {
815
817
  o.push({ name: n, hint: V[n] });
816
818
  continue;
817
819
  }
818
- mt.includes(n) || Ln.has(n) || t.push(We(n, r));
820
+ mt.includes(n) || Wn.has(n) || t.push(We(n, r));
819
821
  }
820
- for (const n of oe) {
822
+ for (const n of ne) {
821
823
  const r = ht(e, n);
822
824
  r !== null && t.push(We(n.name, r));
823
825
  }
824
826
  return { available: t, blocked: o };
825
827
  }
826
828
  function We(e, t) {
827
- const o = { name: e, kind: Wn(t) };
829
+ const o = { name: e, kind: Mn(t) };
828
830
  return Array.isArray(t) ? o.count = t.length : M(t) && (o.count = Object.keys(t).length), o;
829
831
  }
830
- function Wn(e) {
832
+ function Mn(e) {
831
833
  return Array.isArray(e) ? "array" : M(e) ? "object" : "scalar";
832
834
  }
833
- function Mn(e, t, o) {
835
+ function Fn(e, t, o) {
834
836
  if (Array.isArray(t))
835
837
  return Me(e, t, o, (n) => n);
836
838
  if (M(t)) {
@@ -844,7 +846,7 @@ function Mn(e, t, o) {
844
846
  nextCursor: null
845
847
  };
846
848
  }
847
- function Fn(e, t) {
849
+ function jn(e, t) {
848
850
  if (!e) return 0;
849
851
  let o;
850
852
  try {
@@ -858,7 +860,7 @@ function Fn(e, t) {
858
860
  return !Number.isInteger(s) || s < 0 ? null : s;
859
861
  }
860
862
  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;
863
+ const r = Math.min(Math.max(o, 0), t.length), s = Math.min(r + Un, t.length), a = s < t.length;
862
864
  return {
863
865
  field: e,
864
866
  value: K(n(t.slice(r, s))),
@@ -866,7 +868,7 @@ function Me(e, t, o, n) {
866
868
  start: r,
867
869
  end: s,
868
870
  total: t.length,
869
- nextCursor: a ? jn(e, s) : null
871
+ nextCursor: a ? Bn(e, s) : null
870
872
  };
871
873
  }
872
874
  function K(e) {
@@ -882,16 +884,16 @@ function K(e) {
882
884
  }
883
885
  return e;
884
886
  }
885
- function jn(e, t) {
887
+ function Bn(e, t) {
886
888
  return btoa(`${e}:${t}`);
887
889
  }
888
- const Bn = new Map(
889
- oe.flatMap(
890
+ const Yn = new Map(
891
+ ne.flatMap(
890
892
  (e) => e.sources.map((t) => [t.split(".")[0], e.name])
891
893
  )
892
894
  );
893
- function Yn(e, t, o) {
894
- const n = oe.find((a) => a.name === t);
895
+ function zn(e, t, o) {
896
+ const n = ne.find((a) => a.name === t);
895
897
  if (n) {
896
898
  const a = ht(e, n);
897
899
  return a === null ? je(t) : Fe(t, a, o);
@@ -903,7 +905,7 @@ function Yn(e, t, o) {
903
905
  );
904
906
  if (mt.includes(t))
905
907
  return h(`"${t}" is not an OpenAPI metadata field.`, { field: t });
906
- const r = Bn.get(t);
908
+ const r = Yn.get(t);
907
909
  if (r !== void 0)
908
910
  return h(`"${t}" is not a valid field name. Use "${r}" instead.`, {
909
911
  field: t
@@ -912,13 +914,13 @@ function Yn(e, t, o) {
912
914
  return s == null ? je(t) : Fe(t, s, o);
913
915
  }
914
916
  function Fe(e, t, o) {
915
- const n = Fn(o, e);
917
+ const n = jn(o, e);
916
918
  return n === null ? h(
917
919
  `The provided cursor is not valid for field "${e}". Omit the cursor to start from the first page.`,
918
920
  { field: e }
919
921
  ) : {
920
922
  isError: !1,
921
- data: Mn(e, t, n)
923
+ data: Fn(e, t, n)
922
924
  };
923
925
  }
924
926
  function je(e) {
@@ -927,7 +929,7 @@ function je(e) {
927
929
  { field: e }
928
930
  );
929
931
  }
930
- function zn(e) {
932
+ function Hn(e) {
931
933
  return async (t) => {
932
934
  const o = e.apis.get({ noproxy: !0 }) ?? [], n = o.find((s) => s.id === t.apiId);
933
935
  if (!n)
@@ -940,120 +942,132 @@ function zn(e) {
940
942
  {
941
943
  data: Le(r)
942
944
  }
943
- ) : t.field !== void 0 ? Yn(r, t.field, t.cursor) : {
945
+ ) : t.field !== void 0 ? zn(r, t.field, t.cursor) : {
944
946
  isError: !1,
945
947
  data: Le(r)
946
948
  };
947
949
  };
948
950
  }
949
- const Hn = {
951
+ const Gn = {
950
952
  name: "get_api_metadata",
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
- title: c().min(1).describe("Collection display title (also used to derive the file id).")
956
- }).strict(), Kn = p({
957
- action: w("delete_collection"),
958
- collectionId: c().min(1).describe("Target collection id.")
953
+ definition: Nn,
954
+ createExecutor: (e) => Hn(e.store)
955
+ }, Vn = "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 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- Create a step from an OpenAPI operation, ad-hoc request, or blank step.\n- Persist the focused step tab into a target collection/workflow.\n\n**Never use when**\n- Only editing fields on an existing step, no structural change needed.\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`, `move_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- `create_step` optional `index` inserts at that 0-based position (default: append). `move_step` moves a step to `toIndex` (0-based); indices clamp to the valid range.\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; names may be uniquified on collisions.\n- Define outputs on producer steps; reference via `$steps.<stepId>.outputs.<name>` downstream.\n- Add `successCriteria` on created steps so workflow runs fail on unexpected responses.", Kn = p({
956
+ action: I("create_collection"),
957
+ title: i().min(1).describe("Collection display title (also used to derive the file id).")
959
958
  }).strict(), Jn = p({
960
- action: w("create_workflow"),
961
- collectionId: c().min(1).describe("Parent collection id."),
962
- name: c().min(1).describe("Workflow summary / display name.")
959
+ action: I("delete_collection"),
960
+ collectionId: i().min(1).describe("Target collection id.")
963
961
  }).strict(), Qn = p({
964
- action: w("delete_workflow"),
965
- collectionId: c().min(1),
966
- workflowId: c().min(1)
967
- }).strict(), Xn = [
962
+ action: I("create_workflow"),
963
+ collectionId: i().min(1).describe("Parent collection id."),
964
+ name: i().min(1).describe("Workflow summary / display name.")
965
+ }).strict(), Xn = p({
966
+ action: I("delete_workflow"),
967
+ collectionId: i().min(1),
968
+ workflowId: i().min(1)
969
+ }).strict(), Zn = [
968
970
  D.Text,
969
971
  D.JSON,
970
972
  D.XML
971
- ], Zn = p({
972
- name: c().min(1),
973
- in: S(["path", "query", "header", "cookie"]),
974
- value: c()
975
- }).strict(), er = p({
976
- name: c().min(1).describe("Output name."),
977
- expression: c().min(1).describe("Output expression.")
973
+ ], er = p({
974
+ name: i().min(1),
975
+ in: T(["path", "query", "header", "cookie"]),
976
+ value: i()
978
977
  }).strict(), tr = p({
979
- condition: c().min(1),
980
- context: c().optional(),
981
- type: S(["simple", "regex", "jsonpath", "xpath"]).optional()
978
+ name: i().min(1).describe("Output name."),
979
+ expression: i().min(1).describe("Output expression.")
982
980
  }).strict(), or = p({
983
- action: w("create_step"),
984
- collectionId: c().min(1),
985
- workflowId: c().min(1),
986
- stepName: c().min(1).optional().describe(
981
+ condition: i().min(1),
982
+ context: i().optional(),
983
+ type: T(["simple", "regex", "jsonpath", "xpath"]).optional()
984
+ }).strict(), nr = p({
985
+ action: I("create_step"),
986
+ collectionId: i().min(1),
987
+ workflowId: i().min(1),
988
+ stepName: i().min(1).optional().describe(
987
989
  '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
990
  ),
989
- description: c().min(1).optional().describe("Step description text (overrides default derived from stepName)."),
990
- parameters: b(Zn).optional().describe("Initial request parameters (path, query, header, cookie)."),
991
+ description: i().min(1).optional().describe("Step description text (overrides default derived from stepName)."),
992
+ parameters: b(er).optional().describe("Initial request parameters (path, query, header, cookie)."),
991
993
  body: p({
992
- content: c().describe("Request body content as string."),
993
- contentType: S(Xn).optional().describe("Request body content type.")
994
+ content: i().describe("Request body content as string."),
995
+ contentType: T(Zn).optional().describe("Request body content type.")
994
996
  }).strict().optional().describe("Initial request body."),
995
- outputs: b(er).optional().describe("Initial step outputs (mappings for later steps)."),
996
- successCriteria: b(tr).optional().describe("Initial success criteria rows."),
997
+ outputs: b(tr).optional().describe("Initial step outputs (mappings for later steps)."),
998
+ successCriteria: b(or).optional().describe("Initial success criteria rows."),
997
999
  operation: p({
998
- apiId: c().min(1).describe("API id."),
999
- path: c().min(1).describe("Request path."),
1000
- method: c().min(1).describe("HTTP method."),
1001
- operationId: c().min(1).optional().describe("Operation id.")
1000
+ apiId: i().min(1).describe("API id."),
1001
+ path: i().min(1).describe("Request path."),
1002
+ method: i().min(1).describe("HTTP method."),
1003
+ operationId: i().min(1).optional().describe("Operation id.")
1002
1004
  }).optional().describe(
1003
1005
  "OpenAPI operation link (apiId, path, method). Omit if using xOperation or a blank step."
1004
1006
  ),
1005
1007
  xOperation: p({
1006
- method: c().min(1).describe("HTTP method."),
1007
- url: c().min(1).describe("Request URL.")
1008
- }).optional().describe("Ad-hoc HTTP request (method + URL). Omit if using operation or a blank step.")
1009
- }).strict(), nr = p({
1010
- action: w("delete_step"),
1011
- collectionId: c().min(1),
1012
- workflowId: c().min(1),
1013
- stepId: c().min(1)
1008
+ method: i().min(1).describe("HTTP method."),
1009
+ url: i().min(1).describe("Request URL.")
1010
+ }).optional().describe("Ad-hoc HTTP request (method + URL). Omit if using operation or a blank step."),
1011
+ index: S().int().min(0).optional().describe(
1012
+ "0-based position to insert the new step at within the workflow. Omit to append at the end. Out-of-range values clamp to the nearest valid position."
1013
+ )
1014
1014
  }).strict(), rr = p({
1015
- action: w("save_tab_to_collection"),
1016
- targetCollectionId: c().min(1),
1017
- targetWorkflowId: c().min(1),
1018
- newStepName: c().min(1).describe(
1015
+ action: I("delete_step"),
1016
+ collectionId: i().min(1),
1017
+ workflowId: i().min(1),
1018
+ stepId: i().min(1)
1019
+ }).strict(), sr = p({
1020
+ action: I("move_step"),
1021
+ collectionId: i().min(1),
1022
+ workflowId: i().min(1),
1023
+ stepId: i().min(1).describe("Id of the existing step to move."),
1024
+ toIndex: S().int().min(0).describe(
1025
+ "0-based target position for the step within the same workflow. Out-of-range values clamp to the nearest valid position."
1026
+ )
1027
+ }).strict(), ar = p({
1028
+ action: I("save_tab_to_collection"),
1029
+ targetCollectionId: i().min(1),
1030
+ targetWorkflowId: i().min(1),
1031
+ newStepName: i().min(1).describe(
1019
1032
  'Step id / label for the new step, used verbatim, so pass a single camelCase token such as "updateUser".'
1020
1033
  )
1021
- }).strict(), sr = p({
1022
- payload: te("action", [
1023
- Vn,
1034
+ }).strict(), ir = p({
1035
+ payload: oe("action", [
1024
1036
  Kn,
1025
1037
  Jn,
1026
1038
  Qn,
1027
- or,
1039
+ Xn,
1028
1040
  nr,
1029
- rr
1041
+ rr,
1042
+ sr,
1043
+ ar
1030
1044
  ])
1031
1045
  }).superRefine((e, t) => {
1032
1046
  e.payload.action === "create_step" && e.payload.operation && e.payload.xOperation && t.addIssue({
1033
1047
  code: W.custom,
1034
1048
  message: "Only one of `operation` or `xOperation` may be specified."
1035
1049
  });
1036
- }), ar = p({
1037
- summary: c(),
1038
- collectionId: c().optional(),
1039
- workflowId: c().optional(),
1040
- stepId: c().optional()
1041
- }), ir = $(ar), cr = {
1042
- description: Gn,
1043
- inputSchema: sr,
1044
- outputSchema: ir,
1050
+ }), cr = p({
1051
+ summary: i(),
1052
+ collectionId: i().optional(),
1053
+ workflowId: i().optional(),
1054
+ stepId: i().optional()
1055
+ }), lr = $(cr), dr = {
1056
+ description: Vn,
1057
+ inputSchema: ir,
1058
+ outputSchema: lr,
1045
1059
  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
1060
  };
1047
1061
  function Be(e, t, o) {
1048
1062
  return { ...Qe(e), key: t, value: o, active: !0 };
1049
1063
  }
1050
- function lr(e, t, o) {
1064
+ function ur(e, t, o) {
1051
1065
  const n = /* @__PURE__ */ new Map();
1052
1066
  for (const s of o)
1053
1067
  n.set(s.name, s.value);
1054
1068
  const r = [];
1055
1069
  for (const s of e) {
1056
- if (ue(s) && s.key && n.has(s.key)) {
1070
+ if (pe(s) && s.key && n.has(s.key)) {
1057
1071
  const a = n.get(s.key);
1058
1072
  n.delete(s.key), r.push({
1059
1073
  ...Be(t, s.key, a),
@@ -1068,7 +1082,7 @@ function lr(e, t, o) {
1068
1082
  n.has(s.name) && (r.push(Be(t, s.name, n.get(s.name))), n.delete(s.name));
1069
1083
  return r;
1070
1084
  }
1071
- function dr(e, t) {
1085
+ function pr(e, t) {
1072
1086
  if (t.description !== void 0 && (e.description = t.description), t.body && (e.requestBody = {
1073
1087
  ...e.requestBody,
1074
1088
  content: t.body.content,
@@ -1084,7 +1098,7 @@ function dr(e, t) {
1084
1098
  if (!r?.length)
1085
1099
  continue;
1086
1100
  const s = G[n];
1087
- e.parameters[s] = lr(
1101
+ e.parameters[s] = ur(
1088
1102
  e.parameters[s],
1089
1103
  n,
1090
1104
  r
@@ -1106,7 +1120,7 @@ function dr(e, t) {
1106
1120
  if (t.successCriteria?.length)
1107
1121
  for (const o of t.successCriteria) {
1108
1122
  const n = Je(
1109
- o.type ?? de.SIMPLE
1123
+ o.type ?? ue.SIMPLE
1110
1124
  );
1111
1125
  e.successCriteria.push({
1112
1126
  ...n,
@@ -1116,28 +1130,30 @@ function dr(e, t) {
1116
1130
  }
1117
1131
  return e;
1118
1132
  }
1119
- function ur(e) {
1133
+ function fr(e) {
1120
1134
  return async (t) => {
1121
1135
  switch (t.payload.action) {
1122
1136
  case "create_collection":
1123
- return pr(t.payload, e);
1137
+ return mr(t.payload, e);
1124
1138
  case "delete_collection":
1125
- return fr(t.payload, e);
1139
+ return hr(t.payload, e);
1126
1140
  case "create_workflow":
1127
- return mr(t.payload, e);
1141
+ return Ir(t.payload, e);
1128
1142
  case "delete_workflow":
1129
- return hr(t.payload, e);
1130
- case "create_step":
1131
1143
  return wr(t.payload, e);
1144
+ case "create_step":
1145
+ return yr(t.payload, e);
1132
1146
  case "delete_step":
1133
- return Ir(t.payload, e);
1147
+ return gr(t.payload, e);
1148
+ case "move_step":
1149
+ return br(t.payload, e);
1134
1150
  case "save_tab_to_collection":
1135
- return yr(t.payload, e);
1151
+ return kr(t.payload, e);
1136
1152
  }
1137
1153
  };
1138
1154
  }
1139
- function pr(e, { store: t }) {
1140
- const o = Dt({
1155
+ function mr(e, { store: t }) {
1156
+ const o = Lt({
1141
1157
  name: e.title.trim(),
1142
1158
  collections: t.collections
1143
1159
  });
@@ -1149,7 +1165,7 @@ function pr(e, { store: t }) {
1149
1165
  }
1150
1166
  };
1151
1167
  }
1152
- function fr(e, { store: t, handleCloseByDataId: o }) {
1168
+ function hr(e, { store: t, handleCloseByDataId: o }) {
1153
1169
  const n = j(t, e.collectionId);
1154
1170
  if (!n)
1155
1171
  return h("Collection not found.", { collectionId: e.collectionId });
@@ -1162,11 +1178,11 @@ function fr(e, { store: t, handleCloseByDataId: o }) {
1162
1178
  }
1163
1179
  };
1164
1180
  }
1165
- function mr(e, { store: t }) {
1181
+ function Ir(e, { store: t }) {
1166
1182
  const o = j(t, e.collectionId);
1167
1183
  if (!o)
1168
1184
  return h("Collection not found.", { collectionId: e.collectionId });
1169
- const n = Ut({
1185
+ const n = Dt({
1170
1186
  name: e.name.trim(),
1171
1187
  collection: o
1172
1188
  });
@@ -1179,10 +1195,10 @@ function mr(e, { store: t }) {
1179
1195
  }
1180
1196
  };
1181
1197
  }
1182
- function hr(e, { store: t, handleCloseByDataId: o }) {
1198
+ function wr(e, { store: t, handleCloseByDataId: o }) {
1183
1199
  if (!j(t, e.collectionId))
1184
1200
  return h("Collection not found.", { collectionId: e.collectionId });
1185
- const r = me(t, {
1201
+ const r = X(t, {
1186
1202
  collectionId: e.collectionId,
1187
1203
  workflowId: e.workflowId
1188
1204
  });
@@ -1201,10 +1217,10 @@ function hr(e, { store: t, handleCloseByDataId: o }) {
1201
1217
  workflowId: e.workflowId
1202
1218
  });
1203
1219
  }
1204
- async function wr(e, { store: t, attachApiToCollection: o, convertOperationToReplayValue: n }) {
1220
+ async function yr(e, { store: t, attachApiToCollection: o, convertOperationToReplayValue: n }) {
1205
1221
  if (!j(t, e.collectionId))
1206
1222
  return h("Collection not found.", { collectionId: e.collectionId });
1207
- const s = me(t, {
1223
+ const s = X(t, {
1208
1224
  collectionId: e.collectionId,
1209
1225
  workflowId: e.workflowId
1210
1226
  });
@@ -1223,8 +1239,8 @@ async function wr(e, { store: t, attachApiToCollection: o, convertOperationToRep
1223
1239
  method: e.xOperation.method,
1224
1240
  url: e.xOperation.url
1225
1241
  } : void 0;
1226
- let i;
1227
- a && (i = Nt(t.apis, a, n), i && await o({
1242
+ let c;
1243
+ a && (c = Ut(t.apis, a, n), c && await o({
1228
1244
  collectionId: e.collectionId,
1229
1245
  apiId: a.apiId
1230
1246
  }));
@@ -1233,25 +1249,34 @@ async function wr(e, { store: t, attachApiToCollection: o, convertOperationToRep
1233
1249
  workflow: s,
1234
1250
  operation: a,
1235
1251
  xOperation: l,
1236
- apiOperation: i
1252
+ apiOperation: c
1237
1253
  });
1238
- return dr(u, {
1254
+ pr(u, {
1239
1255
  description: e.description,
1240
1256
  parameters: e.parameters,
1241
1257
  body: e.body,
1242
1258
  outputs: e.outputs,
1243
1259
  successCriteria: e.successCriteria
1244
- }), s.steps.merge([u]), {
1260
+ });
1261
+ const d = vr(s, u, e.index);
1262
+ return {
1245
1263
  isError: !1,
1246
1264
  data: {
1247
- summary: `Created step ${u.stepId} in workflow ${e.workflowId}.`,
1265
+ summary: `Created step ${u.stepId} at position ${d} in workflow ${e.workflowId}.`,
1248
1266
  collectionId: e.collectionId,
1249
1267
  workflowId: e.workflowId,
1250
1268
  stepId: u.stepId
1251
1269
  }
1252
1270
  };
1253
1271
  }
1254
- function Ir(e, { store: t, handleCloseByDataId: o }) {
1272
+ function It(e, t) {
1273
+ return Math.min(Math.max(e, 0), t);
1274
+ }
1275
+ function vr(e, t, o) {
1276
+ const n = e.steps.length, r = o === void 0 ? n : It(o, n);
1277
+ return e.steps.set((s) => (s.splice(r, 0, t), s)), r;
1278
+ }
1279
+ function gr(e, { store: t, handleCloseByDataId: o }) {
1255
1280
  const n = Ze(t, {
1256
1281
  collectionId: e.collectionId,
1257
1282
  workflowId: e.workflowId,
@@ -1275,22 +1300,53 @@ function Ir(e, { store: t, handleCloseByDataId: o }) {
1275
1300
  stepId: e.stepId
1276
1301
  });
1277
1302
  }
1278
- async function yr(e, { store: t, attachApiToCollection: o }) {
1279
- const n = pe(t);
1303
+ function br(e, { store: t }) {
1304
+ const o = X(t, {
1305
+ collectionId: e.collectionId,
1306
+ workflowId: e.workflowId
1307
+ });
1308
+ if (!o)
1309
+ return h("Workflow not found.", {
1310
+ collectionId: e.collectionId,
1311
+ workflowId: e.workflowId
1312
+ });
1313
+ const n = o.steps.get({ noproxy: !0 }), r = n.findIndex((a) => a.stepId === e.stepId);
1314
+ if (r === -1)
1315
+ return h("Step not found.", {
1316
+ collectionId: e.collectionId,
1317
+ workflowId: e.workflowId,
1318
+ stepId: e.stepId
1319
+ });
1320
+ const s = It(e.toIndex, n.length - 1);
1321
+ return o.steps.set((a) => {
1322
+ const [l] = a.splice(r, 1);
1323
+ return a.splice(s, 0, l), a;
1324
+ }), {
1325
+ isError: !1,
1326
+ data: {
1327
+ summary: `Moved step ${e.stepId} to position ${s} in workflow ${e.workflowId}.`,
1328
+ collectionId: e.collectionId,
1329
+ workflowId: e.workflowId,
1330
+ stepId: e.stepId
1331
+ }
1332
+ };
1333
+ }
1334
+ async function kr(e, { store: t, attachApiToCollection: o }) {
1335
+ const n = fe(t);
1280
1336
  if (!n)
1281
1337
  return h("No active tab.");
1282
- if (!fe(n))
1338
+ if (!me(n))
1283
1339
  return h("Active tab is not a step tab.", {
1284
1340
  tabType: n.data.type.get()
1285
1341
  });
1286
- const r = Pt(t, n);
1342
+ const r = Nt(t, n);
1287
1343
  if (!r)
1288
1344
  return h("No step data available on the active tab.");
1289
1345
  if (!j(t, e.targetCollectionId))
1290
1346
  return h("Target collection not found.", {
1291
1347
  collectionId: e.targetCollectionId
1292
1348
  });
1293
- const a = me(t, {
1349
+ const a = X(t, {
1294
1350
  collectionId: e.targetCollectionId,
1295
1351
  workflowId: e.targetWorkflowId
1296
1352
  });
@@ -1349,11 +1405,11 @@ function J(e, t, o) {
1349
1405
  stepId: n
1350
1406
  });
1351
1407
  }
1352
- const vr = {
1408
+ const Sr = {
1353
1409
  name: "manage_collection",
1354
- definition: cr,
1355
- createExecutor: (e) => ur(e)
1356
- }, gr = `Read, add, or change Replay environments (inputs and server mappings).
1410
+ definition: dr,
1411
+ createExecutor: (e) => fr(e)
1412
+ }, Tr = `Read, add, or change Replay environments (inputs and server mappings).
1357
1413
 
1358
1414
  **What it does**
1359
1415
  - Manages Replay project environments: inputs (values and secrecy) and per-\`apiId\` server URLs/variables.
@@ -1377,135 +1433,135 @@ const vr = {
1377
1433
  **Loop/budget guidance**
1378
1434
  - Re-read environment/input data when decisions depend on up-to-date values.
1379
1435
  - 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."), 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"),
1436
+ - After changing the active environment, re-check assumptions that depended on the previous one.`, q = i().min(1).optional().describe("Environment name. Omit to use the active environment."), Cr = p({
1437
+ action: I("get_environments")
1438
+ }).strict(), Or = p({
1439
+ action: I("get_active_environment")
1440
+ }).strict(), Ar = p({
1441
+ action: I("get_inputs"),
1386
1442
  environment: q
1387
- }).strict(), Tr = p({
1388
- action: w("get_servers"),
1443
+ }).strict(), xr = p({
1444
+ action: I("get_servers"),
1389
1445
  environment: q
1390
- }).strict(), Cr = p({
1391
- action: w("get_input"),
1446
+ }).strict(), Er = p({
1447
+ action: I("get_input"),
1392
1448
  environment: q,
1393
- inputName: c().min(1)
1394
- }).strict(), Or = p({
1395
- action: w("upsert_input"),
1449
+ inputName: i().min(1)
1450
+ }).strict(), $r = p({
1451
+ action: I("upsert_input"),
1396
1452
  environment: q,
1397
- name: c().min(1),
1398
- value: c(),
1399
- isSecret: x().optional().describe(
1453
+ name: i().min(1),
1454
+ value: i(),
1455
+ isSecret: E().optional().describe(
1400
1456
  "Only when creating a new input name: whether the value is secret (default false). Ignored when the name already exists."
1401
1457
  )
1402
- }).strict(), Ar = p({
1403
- action: w("remove_input"),
1458
+ }).strict(), _r = p({
1459
+ action: I("remove_input"),
1404
1460
  environment: q,
1405
- inputName: c().min(1)
1461
+ inputName: i().min(1)
1406
1462
  }).strict(), ve = p({
1407
- name: c().min(1),
1408
- value: c()
1409
- }).strict(), Er = p({
1410
- action: w("upsert_server"),
1411
- environment: q,
1412
- apiId: c().min(1),
1413
- value: c(),
1414
- variables: b(ve).optional()
1415
- }).strict(), xr = p({
1416
- name: c().min(1),
1417
- value: c(),
1418
- isSecret: x().optional().describe("Defaults to false when omitted.")
1419
- }).strict(), $r = p({
1420
- apiId: c().min(1),
1421
- value: c(),
1422
- variables: b(ve).optional()
1463
+ name: i().min(1),
1464
+ value: i()
1423
1465
  }).strict(), Rr = p({
1424
- action: w("add_environment"),
1425
- environment: c().min(1).describe("Name of a new environment to create."),
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
- setActive: x().optional().describe("When true, also set the new environment as active.")
1429
- }).strict(), _r = p({
1430
- action: w("remove_server"),
1466
+ action: I("upsert_server"),
1431
1467
  environment: q,
1432
- apiId: c().min(1)
1468
+ apiId: i().min(1),
1469
+ value: i(),
1470
+ variables: b(ve).optional()
1433
1471
  }).strict(), qr = p({
1434
- action: w("set_active_environment"),
1435
- environment: c().min(1).describe("Name of the environment to activate.")
1472
+ name: i().min(1),
1473
+ value: i(),
1474
+ isSecret: E().optional().describe("Defaults to false when omitted.")
1436
1475
  }).strict(), Pr = p({
1437
- payload: te("action", [
1438
- br,
1439
- Rr,
1440
- kr,
1441
- Sr,
1442
- Tr,
1476
+ apiId: i().min(1),
1477
+ value: i(),
1478
+ variables: b(ve).optional()
1479
+ }).strict(), Nr = p({
1480
+ action: I("add_environment"),
1481
+ environment: i().min(1).describe("Name of a new environment to create."),
1482
+ inputs: b(qr).optional().describe("Optional initial inputs for the new environment."),
1483
+ servers: b(Pr).optional().describe("Optional initial server mappings for the new environment."),
1484
+ setActive: E().optional().describe("When true, also set the new environment as active.")
1485
+ }).strict(), Ur = p({
1486
+ action: I("remove_server"),
1487
+ environment: q,
1488
+ apiId: i().min(1)
1489
+ }).strict(), Dr = p({
1490
+ action: I("set_active_environment"),
1491
+ environment: i().min(1).describe("Name of the environment to activate.")
1492
+ }).strict(), Lr = p({
1493
+ payload: oe("action", [
1443
1494
  Cr,
1495
+ Nr,
1444
1496
  Or,
1445
1497
  Ar,
1498
+ xr,
1446
1499
  Er,
1500
+ $r,
1447
1501
  _r,
1448
- qr
1502
+ Rr,
1503
+ Ur,
1504
+ Dr
1449
1505
  ])
1450
- }), Nr = p({
1451
- summary: c(),
1452
- environmentNames: b(c()).optional(),
1506
+ }), Wr = p({
1507
+ summary: i(),
1508
+ environmentNames: b(i()).optional(),
1453
1509
  inputs: b(
1454
1510
  p({
1455
- name: c(),
1456
- isSecret: x(),
1457
- value: c()
1511
+ name: i(),
1512
+ isSecret: E(),
1513
+ value: i()
1458
1514
  })
1459
1515
  ).optional(),
1460
1516
  servers: b(
1461
1517
  p({
1462
- apiId: c(),
1463
- value: c(),
1518
+ apiId: i(),
1519
+ value: i(),
1464
1520
  variables: b(ve)
1465
1521
  })
1466
1522
  ).optional(),
1467
1523
  input: p({
1468
- name: c(),
1469
- isSecret: x(),
1470
- value: c()
1524
+ name: i(),
1525
+ isSecret: E(),
1526
+ value: i()
1471
1527
  }).optional(),
1472
- environment: c().optional(),
1473
- apiId: c().optional()
1474
- }), Ur = $(Nr), Dr = {
1475
- description: gr,
1476
- inputSchema: Pr,
1477
- outputSchema: Ur,
1528
+ environment: i().optional(),
1529
+ apiId: i().optional()
1530
+ }), Mr = $(Wr), Fr = {
1531
+ description: Tr,
1532
+ inputSchema: Lr,
1533
+ outputSchema: Mr,
1478
1534
  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
1535
  };
1480
- function Lr(e) {
1536
+ function jr(e) {
1481
1537
  return async (t, o) => {
1482
1538
  switch (t.payload.action) {
1483
1539
  case "get_environments":
1484
- return Wr(e);
1540
+ return Br(e);
1485
1541
  case "add_environment":
1486
- return Mr(e, t.payload);
1542
+ return Yr(e, t.payload);
1487
1543
  case "get_active_environment":
1488
- return Fr(e);
1544
+ return zr(e);
1489
1545
  case "set_active_environment":
1490
- return Kr(e, t.payload);
1546
+ return Zr(e, t.payload);
1491
1547
  case "get_inputs":
1492
- return jr(e, t.payload);
1548
+ return Hr(e, t.payload);
1493
1549
  case "get_servers":
1494
- return Br(e, t.payload);
1550
+ return Gr(e, t.payload);
1495
1551
  case "get_input":
1496
- return Yr(e, t.payload);
1552
+ return Vr(e, t.payload);
1497
1553
  case "upsert_input":
1498
- return zr(e, t.payload);
1554
+ return Kr(e, t.payload);
1499
1555
  case "remove_input":
1500
- return Hr(e, t.payload);
1556
+ return Jr(e, t.payload);
1501
1557
  case "upsert_server":
1502
- return Gr(e, t.payload);
1558
+ return Qr(e, t.payload);
1503
1559
  case "remove_server":
1504
- return Vr(e, t.payload);
1560
+ return Xr(e, t.payload);
1505
1561
  }
1506
1562
  };
1507
1563
  }
1508
- function Wr(e) {
1564
+ function Br(e) {
1509
1565
  const t = e.activeEnvironmentId.get(), o = e.environments.map((n) => n.name.get());
1510
1566
  return {
1511
1567
  isError: !1,
@@ -1515,8 +1571,8 @@ function Wr(e) {
1515
1571
  }
1516
1572
  };
1517
1573
  }
1518
- function Mr(e, t) {
1519
- if (ne(e, t.environment))
1574
+ function Yr(e, t) {
1575
+ if (re(e, t.environment))
1520
1576
  return h("Environment already exists.", {
1521
1577
  environment: t.environment
1522
1578
  });
@@ -1534,7 +1590,7 @@ function Mr(e, t) {
1534
1590
  name: t.environment,
1535
1591
  inputs: n,
1536
1592
  servers: r,
1537
- state: Lt.Normal
1593
+ state: Wt.Normal
1538
1594
  }
1539
1595
  ]), t.setActive && e.activeEnvironmentId.set(t.environment), {
1540
1596
  isError: !1,
@@ -1544,9 +1600,9 @@ function Mr(e, t) {
1544
1600
  }
1545
1601
  };
1546
1602
  }
1547
- function Fr(e) {
1603
+ function zr(e) {
1548
1604
  const t = e.activeEnvironmentId.get();
1549
- return ne(e, t) ? {
1605
+ return re(e, t) ? {
1550
1606
  isError: !1,
1551
1607
  data: {
1552
1608
  summary: `Active environment is "${t}".`,
@@ -1556,11 +1612,11 @@ function Fr(e) {
1556
1612
  environment: t
1557
1613
  });
1558
1614
  }
1559
- function jr(e, t) {
1615
+ function Hr(e, t) {
1560
1616
  const o = P(e, t.environment);
1561
1617
  if (!o.ok)
1562
1618
  return o.result;
1563
- const { name: n, env: r } = o, s = Qr(r.get());
1619
+ const { name: n, env: r } = o, s = ts(r.get());
1564
1620
  return {
1565
1621
  isError: !1,
1566
1622
  data: {
@@ -1570,11 +1626,11 @@ function jr(e, t) {
1570
1626
  }
1571
1627
  };
1572
1628
  }
1573
- function Br(e, t) {
1629
+ function Gr(e, t) {
1574
1630
  const o = P(e, t.environment);
1575
1631
  if (!o.ok)
1576
1632
  return o.result;
1577
- const { name: n, env: r } = o, s = Xr(r.get());
1633
+ const { name: n, env: r } = o, s = os(r.get());
1578
1634
  return {
1579
1635
  isError: !1,
1580
1636
  data: {
@@ -1584,7 +1640,7 @@ function Br(e, t) {
1584
1640
  }
1585
1641
  };
1586
1642
  }
1587
- function Yr(e, t) {
1643
+ function Vr(e, t) {
1588
1644
  const o = P(e, t.environment);
1589
1645
  if (!o.ok)
1590
1646
  return o.result;
@@ -1594,7 +1650,7 @@ function Yr(e, t) {
1594
1650
  environment: n,
1595
1651
  inputName: t.inputName
1596
1652
  });
1597
- const { name: a, isSecret: l, value: i } = s.get();
1653
+ const { name: a, isSecret: l, value: c } = s.get();
1598
1654
  return {
1599
1655
  isError: !1,
1600
1656
  data: {
@@ -1603,18 +1659,18 @@ function Yr(e, t) {
1603
1659
  input: {
1604
1660
  name: a,
1605
1661
  isSecret: l,
1606
- value: wt(l, i)
1662
+ value: wt(l, c)
1607
1663
  }
1608
1664
  }
1609
1665
  };
1610
1666
  }
1611
- function zr(e, t) {
1667
+ function Kr(e, t) {
1612
1668
  const o = P(e, t.environment);
1613
1669
  if (!o.ok)
1614
1670
  return o.result;
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
- return r.inputs.set((i) => [
1617
- ...i.filter((u) => u.name !== t.name),
1671
+ const { name: n, env: r } = o, a = r.inputs.get().find((c) => c.name === t.name), l = a ? a.isSecret : t.isSecret ?? !1;
1672
+ return r.inputs.set((c) => [
1673
+ ...c.filter((u) => u.name !== t.name),
1618
1674
  { name: t.name, value: t.value, isSecret: l }
1619
1675
  ]), {
1620
1676
  isError: !1,
@@ -1624,7 +1680,7 @@ function zr(e, t) {
1624
1680
  }
1625
1681
  };
1626
1682
  }
1627
- function Hr(e, t) {
1683
+ function Jr(e, t) {
1628
1684
  const o = P(e, t.environment);
1629
1685
  if (!o.ok)
1630
1686
  return o.result;
@@ -1640,18 +1696,18 @@ function Hr(e, t) {
1640
1696
  }
1641
1697
  });
1642
1698
  }
1643
- function Gr(e, t) {
1699
+ function Qr(e, t) {
1644
1700
  const o = P(e, t.environment);
1645
1701
  if (!o.ok)
1646
1702
  return o.result;
1647
1703
  const { name: n, env: r } = o;
1648
1704
  return r.servers.set((s) => {
1649
- const a = s.findIndex((u) => u.apiId === t.apiId), l = a >= 0 && t.variables === void 0 ? s[a].variables : t.variables ?? [], i = {
1705
+ const a = s.findIndex((u) => u.apiId === t.apiId), l = a >= 0 && t.variables === void 0 ? s[a].variables : t.variables ?? [], c = {
1650
1706
  apiId: t.apiId,
1651
1707
  value: t.value,
1652
1708
  variables: l
1653
1709
  };
1654
- return a >= 0 ? s.toSpliced(a, 1, i) : [i, ...s];
1710
+ return a >= 0 ? s.toSpliced(a, 1, c) : [c, ...s];
1655
1711
  }), {
1656
1712
  isError: !1,
1657
1713
  data: {
@@ -1661,7 +1717,7 @@ function Gr(e, t) {
1661
1717
  }
1662
1718
  };
1663
1719
  }
1664
- function Vr(e, t) {
1720
+ function Xr(e, t) {
1665
1721
  const o = P(e, t.environment);
1666
1722
  if (!o.ok)
1667
1723
  return o.result;
@@ -1678,19 +1734,19 @@ function Vr(e, t) {
1678
1734
  }
1679
1735
  });
1680
1736
  }
1681
- function Kr(e, t) {
1682
- return ne(e, t.environment) ? (e.activeEnvironmentId.set(t.environment), {
1737
+ function Zr(e, t) {
1738
+ return re(e, t.environment) ? (e.activeEnvironmentId.set(t.environment), {
1683
1739
  isError: !1,
1684
1740
  data: {
1685
1741
  summary: `Active environment is now "${t.environment}".`
1686
1742
  }
1687
1743
  }) : h("Environment not found.", { environment: t.environment });
1688
1744
  }
1689
- function Jr(e, t) {
1745
+ function es(e, t) {
1690
1746
  return t ?? e.activeEnvironmentId.get();
1691
1747
  }
1692
1748
  function P(e, t) {
1693
- const o = Jr(e, t), n = ne(e, o);
1749
+ const o = es(e, t), n = re(e, o);
1694
1750
  return n ? { ok: !0, name: o, env: n } : {
1695
1751
  ok: !1,
1696
1752
  result: h(
@@ -1699,17 +1755,17 @@ function P(e, t) {
1699
1755
  )
1700
1756
  };
1701
1757
  }
1702
- function ne(e, t) {
1758
+ function re(e, t) {
1703
1759
  return e.environments.find((o) => o.name.get() === t);
1704
1760
  }
1705
- function Qr(e) {
1761
+ function ts(e) {
1706
1762
  return e.inputs.map((t) => ({
1707
1763
  name: t.name,
1708
1764
  isSecret: t.isSecret,
1709
1765
  value: wt(t.isSecret, t.value)
1710
1766
  }));
1711
1767
  }
1712
- function Xr(e) {
1768
+ function os(e) {
1713
1769
  return e.servers.map((t) => ({
1714
1770
  apiId: t.apiId,
1715
1771
  value: t.value,
@@ -1717,34 +1773,34 @@ function Xr(e) {
1717
1773
  }));
1718
1774
  }
1719
1775
  function wt(e, t) {
1720
- return e ? Wt : t;
1776
+ return e ? Mt : t;
1721
1777
  }
1722
- const Zr = {
1778
+ const ns = {
1723
1779
  name: "manage_environment",
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([
1780
+ definition: Fr,
1781
+ createExecutor: (e) => jr(e.store)
1782
+ }, rs = et, ss = "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.", as = T([
1727
1783
  "focus_tab",
1728
1784
  "open_operation",
1729
1785
  "open_collection",
1730
1786
  "open_workflow",
1731
1787
  "open_step",
1732
1788
  "open_new_request"
1733
- ]), ns = B({
1734
- action: os.describe(
1789
+ ]), is = B({
1790
+ action: as.describe(
1735
1791
  "Tab to open or focus; see tool description for unsaved vs collection actions."
1736
1792
  ),
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."),
1740
- stepId: c().optional().describe("open_step only."),
1741
- operationId: c().optional().describe(
1793
+ tabIndex: S().optional().describe("focus_tab only: zero-based index of an already open tab."),
1794
+ collectionId: i().optional().describe("open_collection, open_workflow, or open_step."),
1795
+ workflowId: i().optional().describe("open_workflow or open_step."),
1796
+ stepId: i().optional().describe("open_step only."),
1797
+ operationId: i().optional().describe(
1742
1798
  "open_operation only: OpenAPI operationId from the loaded spec; opens an unsaved request tab for that operation."
1743
1799
  ),
1744
- requestUrl: c().optional().describe(
1800
+ requestUrl: i().optional().describe(
1745
1801
  "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."
1746
1802
  ),
1747
- requestMethod: S(es).optional().describe("open_new_request with requestUrl: HTTP method; defaults to GET if omitted.")
1803
+ requestMethod: T(rs).optional().describe("open_new_request with requestUrl: HTTP method; defaults to GET if omitted.")
1748
1804
  }).superRefine((e, t) => {
1749
1805
  const n = (e.requestUrl?.trim() ?? "").length > 0, r = e.requestMethod !== void 0;
1750
1806
  (n || r) && e.action !== "open_new_request" && t.addIssue({
@@ -1756,18 +1812,18 @@ const Zr = {
1756
1812
  message: "requestMethod requires a non-empty requestUrl.",
1757
1813
  path: ["requestMethod"]
1758
1814
  });
1759
- }), rs = p({
1760
- outcome: S(["focused", "opened"]),
1761
- activeTabIndex: T().int().nonnegative(),
1762
- tabId: c(),
1763
- tabType: so(O)
1764
- }), ss = $(rs), as = {
1765
- description: ts,
1766
- inputSchema: ns,
1767
- outputSchema: ss,
1815
+ }), cs = p({
1816
+ outcome: T(["focused", "opened"]),
1817
+ activeTabIndex: S().int().nonnegative(),
1818
+ tabId: i(),
1819
+ tabType: to(O)
1820
+ }), ls = $(cs), ds = {
1821
+ description: ss,
1822
+ inputSchema: is,
1823
+ outputSchema: ls,
1768
1824
  needsApproval: !1
1769
1825
  };
1770
- function re({
1826
+ function se({
1771
1827
  items: e,
1772
1828
  id: t,
1773
1829
  messages: o,
@@ -1777,15 +1833,15 @@ function re({
1777
1833
  }) {
1778
1834
  const a = t.trim();
1779
1835
  if (!a) return { ok: !1, message: o.empty };
1780
- const l = e.filter((i) => n(i) === a);
1836
+ const l = e.filter((c) => n(c) === a);
1781
1837
  return l.length === 1 ? { ok: !0, value: l[0] } : l.length > 1 ? {
1782
1838
  ok: !1,
1783
1839
  message: o.ambiguous,
1784
1840
  details: { matches: l.map(r) }
1785
1841
  } : { ok: !1, message: o.notFound, details: s(a) };
1786
1842
  }
1787
- function It(e, t) {
1788
- const o = re({
1843
+ function yt(e, t) {
1844
+ const o = se({
1789
1845
  items: e.collections,
1790
1846
  id: t,
1791
1847
  messages: {
@@ -1808,9 +1864,9 @@ function It(e, t) {
1808
1864
  };
1809
1865
  }
1810
1866
  function ge(e, t, o) {
1811
- const n = It(e, t);
1867
+ const n = yt(e, t);
1812
1868
  if (!n.ok) return n;
1813
- const r = re({
1869
+ const r = se({
1814
1870
  items: n.value.collection.workflows,
1815
1871
  id: o,
1816
1872
  messages: {
@@ -1839,10 +1895,10 @@ function ge(e, t, o) {
1839
1895
  }
1840
1896
  };
1841
1897
  }
1842
- function yt(e, t, o, n) {
1898
+ function vt(e, t, o, n) {
1843
1899
  const r = ge(e, t, o);
1844
1900
  if (!r.ok) return r;
1845
- const s = re({
1901
+ const s = se({
1846
1902
  items: r.value.workflow.steps,
1847
1903
  id: n,
1848
1904
  messages: {
@@ -1873,8 +1929,8 @@ function yt(e, t, o, n) {
1873
1929
  }
1874
1930
  };
1875
1931
  }
1876
- function is(e, t) {
1877
- const o = Mt(e.apis).filter(
1932
+ function us(e, t) {
1933
+ const o = Ft(e.apis).filter(
1878
1934
  (r) => r.operationId != null && r.operationId !== ""
1879
1935
  );
1880
1936
  if (!o.length)
@@ -1882,7 +1938,7 @@ function is(e, t) {
1882
1938
  ok: !1,
1883
1939
  message: "No operations with operationId in loaded APIs."
1884
1940
  };
1885
- const n = re({
1941
+ const n = se({
1886
1942
  items: o,
1887
1943
  id: t,
1888
1944
  messages: {
@@ -1900,7 +1956,7 @@ function is(e, t) {
1900
1956
  });
1901
1957
  return n.ok ? { ok: !0, value: n.value } : n;
1902
1958
  }
1903
- function vt(e, t, o, n) {
1959
+ function gt(e, t, o, n) {
1904
1960
  t = t.trim(), o = o.trim(), n = n.trim();
1905
1961
  const r = !t && !o && !n, s = !!(t && o && n);
1906
1962
  if (!r && !s)
@@ -1909,29 +1965,29 @@ function vt(e, t, o, n) {
1909
1965
  message: "Provide all three ids for a saved step, or three empty strings for the focused unsaved request tab."
1910
1966
  };
1911
1967
  if (s) {
1912
- const m = yt(e, t, o, n);
1968
+ const m = vt(e, t, o, n);
1913
1969
  return m.ok ? { ok: !0, value: m.value.step } : m;
1914
1970
  }
1915
- const a = pe(e);
1916
- if (!a || !fe(a))
1971
+ const a = fe(e);
1972
+ if (!a || !me(a))
1917
1973
  return {
1918
1974
  ok: !1,
1919
1975
  message: "Active tab is not a step tab.",
1920
1976
  details: { tabType: a?.data?.type?.get() }
1921
1977
  };
1922
- const l = a.data.collectionId.get(), i = a.data.workflowId.get(), u = a.data.stepId.get();
1923
- if (!tt(l, i, u, "", "", ""))
1978
+ const l = a.data.collectionId.get(), c = a.data.workflowId.get(), u = a.data.stepId.get();
1979
+ if (!tt(l, c, u, "", "", ""))
1924
1980
  return {
1925
1981
  ok: !1,
1926
1982
  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.",
1927
1983
  details: {
1928
- activeTab: { collectionId: l, workflowId: i, stepId: u }
1984
+ activeTab: { collectionId: l, workflowId: c, stepId: u }
1929
1985
  }
1930
1986
  };
1931
1987
  const d = a.data.draftStep.ornull;
1932
1988
  return d ? { ok: !0, value: d } : { ok: !1, message: "No draft step on the active tab." };
1933
1989
  }
1934
- function cs(e) {
1990
+ function ps(e) {
1935
1991
  return {
1936
1992
  apiId: e.apiId,
1937
1993
  path: e.path,
@@ -1940,32 +1996,32 @@ function cs(e) {
1940
1996
  isAdditionalOperation: e.isAdditionalOperation
1941
1997
  };
1942
1998
  }
1943
- function ls(e, t, o) {
1999
+ function fs(e, t, o) {
1944
2000
  const n = o.getApiOperation(t), s = e.tabsState.tabs.get({ noproxy: !0 }).findIndex((l) => {
1945
- const i = l.data;
1946
- return X(i, O.Step) && i.draftStep?.operation?.apiId === t.apiId && i.draftStep?.operation?.path === t.path && i.draftStep?.operation?.method === t.method;
2001
+ const c = l.data;
2002
+ return Z(c, O.Step) && c.draftStep?.operation?.apiId === t.apiId && c.draftStep?.operation?.path === t.path && c.draftStep?.operation?.method === t.method;
1947
2003
  });
1948
2004
  if (s !== -1)
1949
2005
  return o.handleTabChange(s), "focused";
1950
- const a = Ft(t, n);
2006
+ const a = jt(t, n);
1951
2007
  return o.addNewTab({ ...a, state: ot.Normal }), "opened";
1952
2008
  }
1953
- function ds(e, t) {
2009
+ function ms(e, t) {
1954
2010
  return (o, n) => {
1955
2011
  try {
1956
2012
  switch (o.action) {
1957
2013
  case "focus_tab":
1958
- return us(e, t, o.tabIndex);
2014
+ return hs(e, t, o.tabIndex);
1959
2015
  case "open_operation":
1960
- return ps(e, t, o.operationId);
2016
+ return Is(e, t, o.operationId);
1961
2017
  case "open_collection":
1962
- return fs(e, t, o.collectionId);
2018
+ return ws(e, t, o.collectionId);
1963
2019
  case "open_workflow":
1964
- return ms(e, t, o.collectionId, o.workflowId);
2020
+ return ys(e, t, o.collectionId, o.workflowId);
1965
2021
  case "open_step":
1966
- return hs(e, t, o.collectionId, o.workflowId, o.stepId);
2022
+ return vs(e, t, o.collectionId, o.workflowId, o.stepId);
1967
2023
  case "open_new_request":
1968
- return ws(e, t, o.requestUrl, o.requestMethod);
2024
+ return gs(e, t, o.requestUrl, o.requestMethod);
1969
2025
  default: {
1970
2026
  const r = o.action;
1971
2027
  return C("Unsupported open_tab action.", { action: r });
@@ -1978,7 +2034,7 @@ function ds(e, t) {
1978
2034
  }
1979
2035
  };
1980
2036
  }
1981
- function us(e, t, o) {
2037
+ function hs(e, t, o) {
1982
2038
  if (o === void 0)
1983
2039
  return C("tabIndex is required when action is focus_tab");
1984
2040
  const n = e.tabsState.tabs.get({ noproxy: !0 });
@@ -1987,37 +2043,37 @@ function us(e, t, o) {
1987
2043
  tabCount: n.length
1988
2044
  }) : (t.handleTabChange(o), F(e, "focused"));
1989
2045
  }
1990
- function ps(e, t, o) {
2046
+ function Is(e, t, o) {
1991
2047
  const n = o?.trim();
1992
2048
  if (!n)
1993
2049
  return C("operationId is required when action is open_operation");
1994
- const r = is(e, n);
2050
+ const r = us(e, n);
1995
2051
  if (!r.ok)
1996
2052
  return C(r.message, r.details);
1997
- const s = ls(
2053
+ const s = fs(
1998
2054
  e,
1999
- cs(r.value),
2055
+ ps(r.value),
2000
2056
  t
2001
2057
  );
2002
2058
  return F(e, s);
2003
2059
  }
2004
- function fs(e, t, o) {
2060
+ function ws(e, t, o) {
2005
2061
  const n = o?.trim();
2006
2062
  if (!n)
2007
2063
  return C("collectionId is required when action is open_collection");
2008
- const r = It(e, n);
2064
+ const r = yt(e, n);
2009
2065
  if (!r.ok)
2010
2066
  return C(r.message, r.details);
2011
2067
  const { collectionId: s } = r.value, a = e.tabsState.tabs.findIndex((l) => {
2012
- const i = l.data.get();
2013
- return X(i, O.Collection) && i.collectionId === s;
2068
+ const c = l.data.get();
2069
+ return Z(c, O.Collection) && c.collectionId === s;
2014
2070
  }) !== -1;
2015
2071
  return t.openCollectionTab({
2016
2072
  collectionId: s,
2017
2073
  activeTabName: nt.COLLECTION_SETTINGS
2018
2074
  }), F(e, a ? "focused" : "opened");
2019
2075
  }
2020
- function ms(e, t, o, n) {
2076
+ function ys(e, t, o, n) {
2021
2077
  const r = o?.trim(), s = n?.trim();
2022
2078
  if (!r)
2023
2079
  return C("collectionId is required when action is open_workflow");
@@ -2026,17 +2082,17 @@ function ms(e, t, o, n) {
2026
2082
  const a = ge(e, r, s);
2027
2083
  if (!a.ok)
2028
2084
  return C(a.message, a.details);
2029
- const { collectionId: l, workflowId: i } = a.value, u = e.tabsState.tabs.findIndex((d) => {
2085
+ const { collectionId: l, workflowId: c } = a.value, u = e.tabsState.tabs.findIndex((d) => {
2030
2086
  const m = d.data.get();
2031
- return X(m, O.Workflow) && m.workflowId === i && m.collectionId === l;
2087
+ return Z(m, O.Workflow) && m.workflowId === c && m.collectionId === l;
2032
2088
  }) !== -1;
2033
2089
  return t.openWorkflowTab({
2034
2090
  collectionId: l,
2035
- workflowId: i,
2091
+ workflowId: c,
2036
2092
  activeTabName: nt.WORKFLOW_SETTINGS
2037
2093
  }), F(e, u ? "focused" : "opened");
2038
2094
  }
2039
- function hs(e, t, o, n, r) {
2095
+ function vs(e, t, o, n, r) {
2040
2096
  const s = o?.trim(), a = n?.trim(), l = r?.trim();
2041
2097
  if (!s)
2042
2098
  return C("collectionId is required when action is open_step");
@@ -2044,14 +2100,14 @@ function hs(e, t, o, n, r) {
2044
2100
  return C("workflowId is required when action is open_step");
2045
2101
  if (!l)
2046
2102
  return C("stepId is required when action is open_step");
2047
- const i = yt(e, s, a, l);
2048
- if (!i.ok)
2049
- return C(i.message, i.details);
2103
+ const c = vt(e, s, a, l);
2104
+ if (!c.ok)
2105
+ return C(c.message, c.details);
2050
2106
  const {
2051
2107
  collectionId: u,
2052
2108
  workflowId: d,
2053
2109
  stepId: m
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;
2110
+ } = c.value, f = e.tabsState.tabs.get().find(({ data: y }) => Z(y, O.Step) && y.collectionId === u && y.workflowId === d && y.stepId === m && y.historyId === null) !== void 0;
2055
2111
  return t.openStepTabFromCollection({
2056
2112
  collectionId: u,
2057
2113
  workflowId: d,
@@ -2059,7 +2115,7 @@ function hs(e, t, o, n, r) {
2059
2115
  state: ot.Normal
2060
2116
  }), F(e, f ? "focused" : "opened");
2061
2117
  }
2062
- function ws(e, t, o, n) {
2118
+ function gs(e, t, o, n) {
2063
2119
  return o ? t.openStepTabFromXOperation({
2064
2120
  method: n ?? "GET",
2065
2121
  url: o
@@ -2067,7 +2123,7 @@ function ws(e, t, o, n) {
2067
2123
  }
2068
2124
  function F(e, t) {
2069
2125
  const o = e.tabsState.activeTabIdx.get(), n = e.tabsState.tabs.get({ noproxy: !0 })[o];
2070
- return n ? Is(t, o, n.id, n.data.type) : C("No active tab after navigation.", { activeTabIndex: o });
2126
+ return n ? bs(t, o, n.id, n.data.type) : C("No active tab after navigation.", { activeTabIndex: o });
2071
2127
  }
2072
2128
  function C(e, t) {
2073
2129
  return {
@@ -2075,61 +2131,61 @@ function C(e, t) {
2075
2131
  error: { message: e, ...t !== void 0 ? { details: t } : {} }
2076
2132
  };
2077
2133
  }
2078
- function Is(e, t, o, n) {
2134
+ function bs(e, t, o, n) {
2079
2135
  return { isError: !1, data: { outcome: e, activeTabIndex: t, tabId: o, tabType: n } };
2080
2136
  }
2081
- const ys = {
2137
+ const ks = {
2082
2138
  name: "open_tab",
2083
- definition: as,
2084
- createExecutor: (e) => ds(e.store, e.context)
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.
2139
+ definition: ds,
2140
+ createExecutor: (e) => ms(e.store, e.context)
2141
+ }, Ss = `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.
2086
2142
 
2087
2143
  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.
2088
2144
 
2089
2145
  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.
2090
2146
 
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({
2092
- message: c().trim().min(1).max(220).regex(/^[^\r\n]+$/, "must be a single line").describe(
2147
+ 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.`, Ts = B({
2148
+ message: i().trim().min(1).max(220).regex(/^[^\r\n]+$/, "must be a single line").describe(
2093
2149
  "Short status line for a milestone (plan start, phase boundary, new debug attempt, pivot). Plain text, no markdown. Do not narrate every tool call."
2094
2150
  )
2095
- }), bs = p({
2096
- acknowledged: w(!0)
2097
- }), ks = $(bs), Ss = {
2098
- description: vs,
2099
- inputSchema: gs,
2100
- outputSchema: ks,
2151
+ }), Cs = p({
2152
+ acknowledged: I(!0)
2153
+ }), Os = $(Cs), As = {
2154
+ description: Ss,
2155
+ inputSchema: Ts,
2156
+ outputSchema: Os,
2101
2157
  needsApproval: !1
2102
2158
  };
2103
- function Ts() {
2159
+ function xs() {
2104
2160
  return async () => ({
2105
2161
  isError: !1,
2106
2162
  data: { acknowledged: !0 }
2107
2163
  });
2108
2164
  }
2109
- const Cs = "Duplicate of a previous status - it adds nothing for the user. Do not repeat statuses; take a concrete action instead.";
2110
- function Os(e) {
2165
+ const Es = "Duplicate of a previous status - it adds nothing for the user. Do not repeat statuses; take a concrete action instead.";
2166
+ function $s(e) {
2111
2167
  return `You have reported ${e} statuses in a row with no action between them. Stop reporting status; take a concrete action (edit, run, or read) now.`;
2112
2168
  }
2113
- function As(e) {
2169
+ function _s(e) {
2114
2170
  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.`;
2115
2171
  }
2116
- const Es = [
2172
+ const Rs = [
2117
2173
  pt({
2118
2174
  key: (e) => ut(e.message),
2119
- warn: Cs
2175
+ warn: Es
2120
2176
  }),
2121
- rn({
2177
+ sn({
2122
2178
  warnAfter: 2,
2123
- warnMessage: Os,
2179
+ warnMessage: $s,
2124
2180
  blockAfter: 4,
2125
- blockMessage: As
2181
+ blockMessage: _s
2126
2182
  })
2127
- ], xs = {
2183
+ ], qs = {
2128
2184
  name: "report_status",
2129
- definition: Ss,
2130
- guards: Es,
2131
- createExecutor: (e) => Ts()
2132
- }, $s = `Send the HTTP request for the **currently focused** Replay step tab and return the live response.
2185
+ definition: As,
2186
+ guards: Rs,
2187
+ createExecutor: (e) => xs()
2188
+ }, Ps = `Send the HTTP request for the **currently focused** Replay step tab and return the live response.
2133
2189
 
2134
2190
  **What it does**
2135
2191
  - Executes the request from the active step context (saved step or focused draft step).
@@ -2158,14 +2214,14 @@ const Es = [
2158
2214
  - Execute when you need new runtime evidence, not by default after every edit.
2159
2215
  - Re-run after meaningful request/config changes or when validating a fix/hypothesis.
2160
2216
  - Avoid rapid duplicate runs with unchanged inputs when prior output already answers the question.
2161
- - For endpoint exploration, treat one run per endpoint as default budget unless inputs changed or rerun is explicitly needed.`, Rs = p({
2162
- collectionId: c().describe(
2217
+ - For endpoint exploration, treat one run per endpoint as default budget unless inputs changed or rerun is explicitly needed.`, Ns = p({
2218
+ collectionId: i().describe(
2163
2219
  "Saved step: collection id. Unsaved draft tab on focus: empty string (with empty workflowId and stepId)."
2164
2220
  ),
2165
- workflowId: c().describe(
2221
+ workflowId: i().describe(
2166
2222
  "Saved step: workflow id. Unsaved draft tab: empty string (with empty collectionId and stepId)."
2167
2223
  ),
2168
- stepId: c().describe(
2224
+ stepId: i().describe(
2169
2225
  "Saved step: step id. Unsaved draft tab: empty string (with empty collectionId and workflowId)."
2170
2226
  )
2171
2227
  }).strict().superRefine((e, t) => {
@@ -2175,32 +2231,32 @@ const Es = [
2175
2231
  message: "Provide all three ids for a saved step, or three empty strings for the focused unsaved request tab.",
2176
2232
  path: ["collectionId"]
2177
2233
  });
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."),
2182
- body: c().optional().describe("Response body, truncated if too large."),
2183
- url: c().optional().describe("Final response URL."),
2184
- duration: T().optional().describe("Request duration in milliseconds."),
2185
- size: T().optional().describe("Response size in bytes.")
2186
- }), qs = $(_s), Ps = {
2187
- description: $s,
2188
- inputSchema: Rs,
2189
- outputSchema: qs,
2234
+ }), Us = p({
2235
+ status: S().optional().describe("HTTP status code."),
2236
+ headers: b($e([i(), i()])).optional().describe("Response headers as key-value pairs."),
2237
+ cookies: b($e([i(), i()])).optional().describe("Response cookies as key-value pairs."),
2238
+ body: i().optional().describe("Response body, truncated if too large."),
2239
+ url: i().optional().describe("Final response URL."),
2240
+ duration: S().optional().describe("Request duration in milliseconds."),
2241
+ size: S().optional().describe("Response size in bytes.")
2242
+ }), Ds = $(Us), Ls = {
2243
+ description: Ps,
2244
+ inputSchema: Ns,
2245
+ outputSchema: Ds,
2190
2246
  needsApproval: () => !0
2191
2247
  };
2192
- function Ns(e, t) {
2248
+ function Ws(e, t) {
2193
2249
  return async (n, r) => {
2194
- const s = pe(e);
2195
- if (!s || !fe(s))
2250
+ const s = fe(e);
2251
+ if (!s || !me(s))
2196
2252
  return h("Active tab is not a step tab", {
2197
2253
  tabType: s?.data?.type?.get()
2198
2254
  });
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();
2255
+ const a = s.data.collectionId.get(), l = s.data.workflowId.get(), c = s.data.stepId.get(), u = n.collectionId.trim(), d = n.workflowId.trim(), m = n.stepId.trim();
2200
2256
  if (!tt(
2201
2257
  a,
2202
2258
  l,
2203
- i,
2259
+ c,
2204
2260
  u,
2205
2261
  d,
2206
2262
  m
@@ -2211,9 +2267,9 @@ function Ns(e, t) {
2211
2267
  activeTab: {
2212
2268
  collectionId: a,
2213
2269
  workflowId: l,
2214
- stepId: i
2270
+ stepId: c
2215
2271
  },
2216
- hint: a === null && l === null && i === null ? "Focused tab is an unsaved request; pass empty strings for collectionId, workflowId, and stepId." : void 0
2272
+ hint: a === null && l === null && c === null ? "Focused tab is an unsaved request; pass empty strings for collectionId, workflowId, and stepId." : void 0
2217
2273
  }
2218
2274
  );
2219
2275
  const y = Ze(e, {
@@ -2223,20 +2279,20 @@ function Ns(e, t) {
2223
2279
  }) ?? s.data.draftStep.ornull;
2224
2280
  if (!y)
2225
2281
  return h("No step available for the active tab.");
2226
- await jt(e, y, t);
2282
+ await Bt(e, y, t);
2227
2283
  const v = s.data.response.get();
2228
2284
  return v ? {
2229
2285
  isError: !1,
2230
- data: Us(v)
2286
+ data: Ms(v)
2231
2287
  } : h("Request did not produce a response.");
2232
2288
  };
2233
2289
  }
2234
- function Us(e) {
2290
+ function Ms(e) {
2235
2291
  return {
2236
2292
  status: e.status,
2237
2293
  headers: Ye(e.headers),
2238
2294
  cookies: Ye(e.cookies),
2239
- body: Ds(e.body ?? ""),
2295
+ body: Fs(e.body ?? ""),
2240
2296
  url: e.url ?? "",
2241
2297
  duration: e.duration,
2242
2298
  size: e.size
@@ -2248,14 +2304,14 @@ function Ye(e) {
2248
2304
  t.push([String(o[0]), String(o[1])]);
2249
2305
  return t;
2250
2306
  }
2251
- function Ds(e) {
2307
+ function Fs(e) {
2252
2308
  return e.length <= L ? e : `${e.slice(0, L)}… (truncated, total ${e.length} chars)`;
2253
2309
  }
2254
- const Ls = {
2310
+ const js = {
2255
2311
  name: "run_request",
2256
- definition: Ps,
2257
- createExecutor: (e) => Ns(e.store, e.settingsState)
2258
- }, Ws = `Run an Arazzo workflow and return its result.
2312
+ definition: Ls,
2313
+ createExecutor: (e) => Ws(e.store, e.settingsState)
2314
+ }, Bs = `Run an Arazzo workflow and return its result.
2259
2315
 
2260
2316
  **What it does**
2261
2317
  - Executes the whole workflow (all steps, with cross-step \`$steps.*\` resolution) and waits for it to finish.
@@ -2278,38 +2334,38 @@ const Ls = {
2278
2334
  **After the run**
2279
2335
  - Report the outcome from this tool's result; do not re-read it with other tools.
2280
2336
  - 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(
2337
+ - Each call starts a NEW run. Call it again only when the user wants another run.`, Ys = B({
2338
+ collectionId: i().describe("Id of the collection that holds the workflow."),
2339
+ workflowId: i().describe("Id of the workflow to run.")
2340
+ }), zs = p({
2341
+ stepId: i(),
2342
+ statusCode: S().int().nullable(),
2343
+ passed: E()
2344
+ }), Hs = p({
2345
+ collectionId: i().describe("Resolved id of the collection that was run."),
2346
+ workflowId: i().describe("Resolved id of the workflow that was run."),
2347
+ historyId: i().nullable().describe(
2292
2348
  "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
2349
  ),
2294
- success: x().describe(
2350
+ success: E().describe(
2295
2351
  "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
2352
  ),
2297
- timedOut: x().describe(
2353
+ timedOut: E().describe(
2298
2354
  "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
2355
  ),
2300
- durationMs: T().describe("Total run time in milliseconds."),
2301
- totalSteps: T().int().nonnegative(),
2302
- passedSteps: T().int().nonnegative(),
2303
- steps: b(Fs).describe(
2356
+ durationMs: S().describe("Total run time in milliseconds."),
2357
+ totalSteps: S().int().nonnegative(),
2358
+ passedSteps: S().int().nonnegative(),
2359
+ steps: b(zs).describe(
2304
2360
  "Per-step outcome, in execution order: stepId, HTTP statusCode, and pass/fail only — no check name or failure message."
2305
2361
  )
2306
- }), Bs = $(js), Ys = {
2307
- description: Ws,
2308
- inputSchema: Ms,
2309
- outputSchema: Bs,
2362
+ }), Gs = $(Hs), Vs = {
2363
+ description: Bs,
2364
+ inputSchema: Ys,
2365
+ outputSchema: Gs,
2310
2366
  needsApproval: !1
2311
2367
  };
2312
- function zs(e, t) {
2368
+ function Ks(e, t) {
2313
2369
  return async (o, n) => {
2314
2370
  const r = o.collectionId.trim(), s = o.workflowId.trim();
2315
2371
  if (!r)
@@ -2323,7 +2379,7 @@ function zs(e, t) {
2323
2379
  a.details
2324
2380
  );
2325
2381
  try {
2326
- const { workflowResult: l, historyId: i, verdict: u } = await t({
2382
+ const { workflowResult: l, historyId: c, verdict: u } = await t({
2327
2383
  collectionId: a.value.collectionId,
2328
2384
  workflowId: a.value.workflowId
2329
2385
  });
@@ -2332,7 +2388,7 @@ function zs(e, t) {
2332
2388
  data: {
2333
2389
  collectionId: a.value.collectionId,
2334
2390
  workflowId: a.value.workflowId,
2335
- historyId: i,
2391
+ historyId: c,
2336
2392
  success: u.succeeded,
2337
2393
  timedOut: u.timedOut,
2338
2394
  durationMs: l.totalTimeMs,
@@ -2352,18 +2408,18 @@ function zs(e, t) {
2352
2408
  }
2353
2409
  };
2354
2410
  }
2355
- const Hs = {
2411
+ const Js = {
2356
2412
  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({
2360
- query: c().optional().describe("Natural language search query."),
2361
- count: T().positive().max(Gs).optional().default(10),
2362
- type: S(["api_operation", "api", "collection", "workflow", "step"]).describe(
2413
+ definition: Vs,
2414
+ createExecutor: (e) => Ks(e.store, e.runWorkflow)
2415
+ }, Qs = 25, Xs = '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', Zs = p({
2416
+ query: i().optional().describe("Natural language search query."),
2417
+ count: S().positive().max(Qs).optional().default(10),
2418
+ type: T(["api_operation", "api", "collection", "workflow", "step"]).describe(
2363
2419
  "Scope results to this item type. api = OpenAPI spec; api_operation = API endpoint; collection = Arazzo collection; workflow = Arazzo workflow; step = Arazzo workflow step."
2364
2420
  ),
2365
2421
  include: b(
2366
- S([
2422
+ T([
2367
2423
  "description",
2368
2424
  "path",
2369
2425
  "method",
@@ -2377,28 +2433,28 @@ const Hs = {
2377
2433
  "title"
2378
2434
  ])
2379
2435
  ).describe("Fields to include in the response."),
2380
- apiId: c().optional().describe(
2436
+ apiId: i().optional().describe(
2381
2437
  "OpenAPI API ID (from loaded spec). For one endpoint, pair with operationId or path+method."
2382
2438
  ),
2383
- path: c().optional().describe(
2439
+ path: i().optional().describe(
2384
2440
  "Filter by API path (e.g. /users). Use with method for precise operation matching."
2385
2441
  ),
2386
- method: c().optional().describe(
2442
+ method: i().optional().describe(
2387
2443
  "Filter by HTTP method (GET, POST, PUT, DELETE, etc). Use with path for precise operation matching."
2388
2444
  ),
2389
- operationId: c().optional().describe("OpenAPI operationId. Requires apiId."),
2390
- collectionId: c().optional().describe("Arazzo collection ID."),
2391
- workflowId: c().optional().describe("Workflow ID within the collection. Requires collectionId."),
2392
- stepId: c().optional().describe("Step ID within a workflow. Requires collectionId and workflowId.")
2393
- }).strict(), Js = ee(), Qs = {
2394
- description: Vs,
2395
- inputSchema: Ks,
2396
- outputSchema: Js,
2445
+ operationId: i().optional().describe("OpenAPI operationId. Requires apiId."),
2446
+ collectionId: i().optional().describe("Arazzo collection ID."),
2447
+ workflowId: i().optional().describe("Workflow ID within the collection. Requires collectionId."),
2448
+ stepId: i().optional().describe("Step ID within a workflow. Requires collectionId and workflowId.")
2449
+ }).strict(), ea = te(), ta = {
2450
+ description: Xs,
2451
+ inputSchema: Zs,
2452
+ outputSchema: ea,
2397
2453
  needsApproval: !1
2398
- }, Xs = ["get", "put", "post", "delete", "options", "head", "patch", "trace"], Zs = ["query", "x-query"];
2399
- function ea(e) {
2454
+ }, oa = ["get", "put", "post", "delete", "options", "head", "patch", "trace"], na = ["query", "x-query"];
2455
+ function ra(e) {
2400
2456
  return async (t, o) => {
2401
- const n = Bt(), r = {
2457
+ const n = so(), r = {
2402
2458
  type: t.type,
2403
2459
  apiId: t.apiId,
2404
2460
  operationId: t.operationId,
@@ -2409,21 +2465,21 @@ function ea(e) {
2409
2465
  stepId: t.stepId
2410
2466
  }, s = t.query ?? "";
2411
2467
  let a = await n.search(s, t.count, r);
2412
- return a.length === 0 && (a = sa(e, r)), a.length === 0 ? {
2468
+ return a.length === 0 && (a = la(e, r)), a.length === 0 ? {
2413
2469
  isError: !1,
2414
2470
  data: {
2415
- message: `No results found. ${ta(t)}`
2471
+ message: `No results found. ${sa(t)}`
2416
2472
  }
2417
2473
  } : {
2418
2474
  isError: !1,
2419
2475
  data: {
2420
- message: aa(a, t.include)
2476
+ message: da(a, t.include)
2421
2477
  }
2422
2478
  };
2423
2479
  };
2424
2480
  }
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;
2481
+ function sa(e) {
2482
+ const t = [], { type: o, apiId: n, path: r, method: s, operationId: a, collectionId: l, workflowId: c, stepId: u, query: d } = e;
2427
2483
  switch (o) {
2428
2484
  case "api":
2429
2485
  n || t.push("apiId");
@@ -2441,13 +2497,13 @@ function ta(e) {
2441
2497
  l || t.push("collectionId");
2442
2498
  break;
2443
2499
  case "workflow":
2444
- l ? i || t.push("workflowId") : t.push("collectionId");
2500
+ l ? c || t.push("workflowId") : t.push("collectionId");
2445
2501
  break;
2446
2502
  case "step":
2447
- l ? i ? u || t.push("stepId") : t.push("workflowId") : t.push("collectionId");
2503
+ l ? c ? u || t.push("stepId") : t.push("workflowId") : t.push("collectionId");
2448
2504
  break;
2449
2505
  default:
2450
- if (l != null && l !== "" && (i ? u || t.push("stepId") : t.push("workflowId")), n != null && n !== "") {
2506
+ if (l != null && l !== "" && (c ? u || t.push("stepId") : t.push("workflowId")), n != null && n !== "") {
2451
2507
  const v = a != null && a !== "", A = r != null && r !== "" && s != null && s !== "";
2452
2508
  !v && !A && t.push("operationId", "path", "method");
2453
2509
  }
@@ -2457,70 +2513,70 @@ function ta(e) {
2457
2513
  let y;
2458
2514
  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;
2459
2515
  }
2460
- function oa(e, t) {
2516
+ function aa(e, t) {
2461
2517
  const o = e.paths ?? {};
2462
2518
  for (const [n, r] of Object.entries(o)) {
2463
2519
  if (!r || typeof r != "object") continue;
2464
2520
  const s = r, a = [
2465
- ...Xs.filter((i) => i in r),
2466
- ...Zs.filter((i) => i in r)
2521
+ ...oa.filter((c) => c in r),
2522
+ ...na.filter((c) => c in r)
2467
2523
  ];
2468
- for (const i of a) {
2469
- const u = r[i];
2524
+ for (const c of a) {
2525
+ const u = r[c];
2470
2526
  if (!u || typeof u != "object") continue;
2471
2527
  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 };
2528
+ if (!(t.operationId && (d.operationId ?? "") !== t.operationId) && !(t.path && n !== t.path) && !(t.method && c.toUpperCase() !== t.method.toUpperCase()))
2529
+ return { path: n, method: c, op: d, pathItem: s };
2474
2530
  }
2475
2531
  const l = s.additionalOperations;
2476
2532
  if (l && typeof l == "object")
2477
- for (const [i, u] of Object.entries(l)) {
2533
+ for (const [c, u] of Object.entries(l)) {
2478
2534
  if (!u || typeof u != "object") continue;
2479
2535
  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 };
2536
+ if (!(t.operationId && (d.operationId ?? "") !== t.operationId) && !(t.path && n !== t.path) && !(t.method && c.toUpperCase() !== t.method.toUpperCase()))
2537
+ return { path: n, method: c, op: d, pathItem: s };
2482
2538
  }
2483
2539
  }
2484
2540
  return null;
2485
2541
  }
2486
- function na(e, t) {
2542
+ function ia(e, t) {
2487
2543
  const { type: o, apiId: n, operationId: r, path: s, method: a } = t;
2488
2544
  if (!n) return [];
2489
2545
  const l = e.find((y) => y.id === n);
2490
2546
  if (!l) return [];
2491
2547
  if (o === "api")
2492
- return [{ ...Oe(l).payload, score: 1 }];
2493
- const i = r != null && r !== "", u = s != null && s !== "" && a != null && a !== "";
2494
- if (!(o === "api_operation" || i || u || o == null && (i || u)))
2495
- return o == null ? [{ ...Oe(l).payload, score: 1 }] : [];
2496
- const m = oa(l, { operationId: r, path: s, method: a });
2497
- return m ? [{ ...Yt({
2548
+ return [{ ..._e(l).payload, score: 1 }];
2549
+ const c = r != null && r !== "", u = s != null && s !== "" && a != null && a !== "";
2550
+ if (!(o === "api_operation" || c || u || o == null && (c || u)))
2551
+ return o == null ? [{ ..._e(l).payload, score: 1 }] : [];
2552
+ const m = aa(l, { operationId: r, path: s, method: a });
2553
+ return m ? [{ ...ao({
2498
2554
  apiId: l.id,
2499
2555
  apiTitle: l.info?.title ?? "Untitled API",
2500
2556
  path: m.path,
2501
2557
  method: m.method,
2502
2558
  op: m.op,
2503
2559
  pathItem: m.pathItem,
2504
- globalSchemes: zt(l),
2560
+ globalSchemes: io(l),
2505
2561
  apiSecurity: l.security
2506
2562
  }).payload, score: 1 }] : [];
2507
2563
  }
2508
- function ra(e, t) {
2564
+ function ca(e, t) {
2509
2565
  const { type: o, collectionId: n, workflowId: r, stepId: s } = t;
2510
2566
  if (!n) return [];
2511
2567
  const a = e.find((d) => d.id === n);
2512
2568
  if (!a) return [];
2513
2569
  const l = a.info?.title ?? "Untitled Collection";
2514
2570
  if (o === "collection")
2515
- return [{ ...Ae(a).payload, score: 1 }];
2516
- const i = () => {
2571
+ return [{ ...Re(a).payload, score: 1 }];
2572
+ const c = () => {
2517
2573
  if (!r || !s) return [];
2518
2574
  const d = a.workflows?.find((f) => (f.workflowId ?? "") === r);
2519
2575
  if (!d) return [];
2520
2576
  const m = d.steps?.find((f) => (f.stepId ?? "") === s);
2521
2577
  return m ? [
2522
2578
  {
2523
- ...Ht({
2579
+ ...co({
2524
2580
  collectionId: n,
2525
2581
  collectionTitle: l,
2526
2582
  workflowId: r,
@@ -2535,20 +2591,20 @@ function ra(e, t) {
2535
2591
  const d = a.workflows?.find((m) => (m.workflowId ?? "") === r);
2536
2592
  return d ? [
2537
2593
  {
2538
- ...Gt({ collectionId: n, collectionTitle: l, workflow: d }).payload,
2594
+ ...lo({ collectionId: n, collectionTitle: l, workflow: d }).payload,
2539
2595
  score: 1
2540
2596
  }
2541
2597
  ] : [];
2542
2598
  };
2543
- return o === "step" ? i() : o === "workflow" ? u() : o == null ? s && r ? i() : r ? u() : [{ ...Ae(a).payload, score: 1 }] : [];
2599
+ return o === "step" ? c() : o === "workflow" ? u() : o == null ? s && r ? c() : r ? u() : [{ ...Re(a).payload, score: 1 }] : [];
2544
2600
  }
2545
- function sa(e, t) {
2601
+ function la(e, t) {
2546
2602
  const o = e.apis.get(), n = e.collections.get(), { type: r } = t;
2547
- return r === "api" || r === "api_operation" ? na(o, t) : r === "collection" || r === "workflow" || r === "step" ? ra(n, t) : [];
2603
+ return r === "api" || r === "api_operation" ? ia(o, t) : r === "collection" || r === "workflow" || r === "step" ? ca(n, t) : [];
2548
2604
  }
2549
- function aa(e, t) {
2605
+ function da(e, t) {
2550
2606
  return [
2551
- Bo(e, t).join(`
2607
+ Yo(e, t).join(`
2552
2608
 
2553
2609
  `)
2554
2610
  // ... other parts
@@ -2556,128 +2612,128 @@ function aa(e, t) {
2556
2612
 
2557
2613
  `);
2558
2614
  }
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) {
2615
+ const ua = "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.", pa = 10;
2616
+ function fa(e) {
2561
2617
  const t = [
2562
2618
  e.type,
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)
2619
+ _(e.query),
2620
+ _(e.apiId),
2621
+ _(e.operationId),
2622
+ _(e.path),
2623
+ _(e.method)?.toLowerCase(),
2624
+ _(e.collectionId),
2625
+ _(e.workflowId),
2626
+ _(e.stepId)
2571
2627
  ];
2572
- return t.every((o) => o == null) ? null : JSON.stringify([...t, da(e), ua(e)]);
2628
+ return t.every((o) => o == null) ? null : JSON.stringify([...t, ma(e), ha(e)]);
2573
2629
  }
2574
- function da(e) {
2575
- return typeof e?.count == "number" ? e.count : ca;
2630
+ function ma(e) {
2631
+ return typeof e?.count == "number" ? e.count : pa;
2576
2632
  }
2577
- function ua(e) {
2633
+ function ha(e) {
2578
2634
  return Array.isArray(e?.include) ? [...new Set(e.include)].sort() : [];
2579
2635
  }
2580
- function R(e) {
2636
+ function _(e) {
2581
2637
  if (typeof e != "string") return null;
2582
2638
  const t = ut(e);
2583
2639
  return t === "" ? null : t;
2584
2640
  }
2585
- const pa = [
2641
+ const Ia = [
2586
2642
  pt({
2587
- key: la,
2588
- warn: ia
2643
+ key: fa,
2644
+ warn: ua
2589
2645
  })
2590
- ], fa = {
2646
+ ], wa = {
2591
2647
  name: "search",
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 = [
2648
+ definition: ta,
2649
+ guards: Ia,
2650
+ createExecutor: (e) => ra(e.store)
2651
+ }, ya = "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 }`.", va = [
2596
2652
  "clientCredentials",
2597
2653
  "clientCredentialsWithJwtAssertion",
2598
2654
  "authorizationCode",
2599
2655
  "authorizationCodeWithPkce",
2600
2656
  "implicit",
2601
2657
  "password"
2602
- ], wa = {
2603
- grantType: S(ha).optional().describe("OAuth2 grant type."),
2604
- clientId: c().optional(),
2605
- clientSecret: c().optional(),
2606
- tokenUrl: c().optional(),
2607
- authorizationUrl: c().optional(),
2608
- callbackUrl: c().optional(),
2609
- accessToken: c().optional(),
2610
- username: c().optional().describe("For password grant type."),
2611
- password: c().optional().describe("For password grant type.")
2612
- }, Ia = p({
2613
- username: c().optional(),
2614
- password: c().optional()
2615
- }).strict(), ya = p({
2616
- username: c().optional(),
2617
- password: c().optional()
2618
- }).strict(), va = p({
2619
- token: c().optional()
2620
- }).strict(), ga = p({
2621
- location: S(["header", "query", "cookie"]).optional(),
2622
- name: c().optional().describe(
2658
+ ], ga = {
2659
+ grantType: T(va).optional().describe("OAuth2 grant type."),
2660
+ clientId: i().optional(),
2661
+ clientSecret: i().optional(),
2662
+ tokenUrl: i().optional(),
2663
+ authorizationUrl: i().optional(),
2664
+ callbackUrl: i().optional(),
2665
+ accessToken: i().optional(),
2666
+ username: i().optional().describe("For password grant type."),
2667
+ password: i().optional().describe("For password grant type.")
2668
+ }, ba = p({
2669
+ username: i().optional(),
2670
+ password: i().optional()
2671
+ }).strict(), ka = p({
2672
+ username: i().optional(),
2673
+ password: i().optional()
2674
+ }).strict(), Sa = p({
2675
+ token: i().optional()
2676
+ }).strict(), Ta = p({
2677
+ location: T(["header", "query", "cookie"]).optional(),
2678
+ name: i().optional().describe(
2623
2679
  "Must match the OpenAPI security scheme `name` (header/query/cookie parameter name). Not the scheme component ref id (e.g. UserCookie)."
2624
2680
  ),
2625
- key: c().optional().describe(
2681
+ key: i().optional().describe(
2626
2682
  "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)."
2627
2683
  )
2628
- }).strict(), gt = p({
2629
- ...wa
2630
- }).strict(), ba = gt.extend({
2631
- openIdConnectUrl: c().optional(),
2632
- userInfoUrl: c().optional()
2633
- }).strict(), bt = c().optional().describe(
2684
+ }).strict(), bt = p({
2685
+ ...ga
2686
+ }).strict(), Ca = bt.extend({
2687
+ openIdConnectUrl: i().optional(),
2688
+ userInfoUrl: i().optional()
2689
+ }).strict(), kt = i().optional().describe(
2634
2690
  "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."
2635
- ), N = fn.extend({
2636
- action: S(["add", "update"]),
2637
- schemeId: c().optional(),
2638
- stepId: bt
2639
- }), ka = te("type", [
2691
+ ), N = mn.extend({
2692
+ action: T(["add", "update"]),
2693
+ schemeId: i().optional(),
2694
+ stepId: kt
2695
+ }), Oa = oe("type", [
2640
2696
  N.extend({
2641
- type: w(g.BasicAuth),
2642
- data: Ia.optional()
2697
+ type: I(g.BasicAuth),
2698
+ data: ba.optional()
2643
2699
  }).strict(),
2644
2700
  N.extend({
2645
- type: w(g.DigestAuth),
2646
- data: ya.optional()
2701
+ type: I(g.DigestAuth),
2702
+ data: ka.optional()
2647
2703
  }).strict(),
2648
2704
  N.extend({
2649
- type: w(g.JWT),
2650
- data: va.optional()
2705
+ type: I(g.JWT),
2706
+ data: Sa.optional()
2651
2707
  }).strict(),
2652
2708
  N.extend({
2653
- type: w(g.APIKey),
2654
- data: ga.optional()
2709
+ type: I(g.APIKey),
2710
+ data: Ta.optional()
2655
2711
  }).strict(),
2656
2712
  N.extend({
2657
- type: w(g.OAuth2),
2658
- data: gt.optional()
2713
+ type: I(g.OAuth2),
2714
+ data: bt.optional()
2659
2715
  }).strict(),
2660
2716
  N.extend({
2661
- type: w(g.OpenIDConnect),
2662
- data: ba.optional()
2717
+ type: I(g.OpenIDConnect),
2718
+ data: Ca.optional()
2663
2719
  }).strict()
2664
- ]), Sa = ye.extend({
2665
- action: w("remove"),
2666
- index: T().int().min(0).describe(
2720
+ ]), Aa = ye.extend({
2721
+ action: I("remove"),
2722
+ index: S().int().min(0).describe(
2667
2723
  "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."
2668
2724
  ),
2669
- stepId: bt
2670
- }).strict(), Ta = Ie([ka, Sa]), Ca = p({
2671
- collectionId: c().describe(
2725
+ stepId: kt
2726
+ }).strict(), xa = we([Oa, Aa]), Ea = p({
2727
+ collectionId: i().describe(
2672
2728
  "Saved step: collection id. Unsaved draft tab on focus: empty string (with empty workflowId and stepId)."
2673
2729
  ),
2674
- workflowId: c().describe(
2730
+ workflowId: i().describe(
2675
2731
  "Saved step: workflow id. Unsaved draft tab: empty string (with empty collectionId and stepId)."
2676
2732
  ),
2677
- stepId: c().describe(
2733
+ stepId: i().describe(
2678
2734
  "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)."
2679
2735
  ),
2680
- changes: b(Ta).min(1).describe("List of security changes to apply.")
2736
+ changes: b(xa).min(1).describe("List of security changes to apply.")
2681
2737
  }).strict().superRefine((e, t) => {
2682
2738
  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);
2683
2739
  !(o && n && (r || a)) && !(!o && !n && !r && !l) && t.addIssue({
@@ -2685,23 +2741,23 @@ const pa = [
2685
2741
  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.",
2686
2742
  path: ["collectionId"]
2687
2743
  });
2688
- }), Oa = ft, Aa = {
2689
- description: ma,
2690
- inputSchema: Ca,
2691
- outputSchema: Oa,
2744
+ }), $a = ft, _a = {
2745
+ description: ya,
2746
+ inputSchema: Ea,
2747
+ outputSchema: $a,
2692
2748
  needsApproval: () => !0
2693
- }, E = {
2749
+ }, x = {
2694
2750
  ADD: "add",
2695
2751
  UPDATE: "update",
2696
2752
  REMOVE: "remove"
2697
2753
  };
2698
- function I(e, t) {
2754
+ function w(e, t) {
2699
2755
  return {
2700
2756
  status: e,
2701
2757
  ...t !== void 0 && { summary: t }
2702
2758
  };
2703
2759
  }
2704
- function kt(e) {
2760
+ function St(e) {
2705
2761
  if (!e || typeof e != "object" || !("meta" in e))
2706
2762
  return {};
2707
2763
  const { meta: t } = e;
@@ -2710,14 +2766,14 @@ function kt(e) {
2710
2766
  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;
2711
2767
  return { totalChanges: o, approvedChanges: n };
2712
2768
  }
2713
- function Ea(e, t) {
2769
+ function Ra(e, t) {
2714
2770
  return !Number.isInteger(t.index) || t.index < 0 || t.index >= e.length ? {
2715
2771
  ok: !1,
2716
2772
  message: `Index ${t.index} out of bounds. Step has ${e.length} security entries.`
2717
2773
  } : { ok: !0, entry: e[t.index] };
2718
2774
  }
2719
- const xa = /* @__PURE__ */ new Set(["grantType", "openIdConnectUrl", "userInfoUrl"]);
2720
- function $a(e) {
2775
+ const qa = /* @__PURE__ */ new Set(["grantType", "openIdConnectUrl", "userInfoUrl"]);
2776
+ function Pa(e) {
2721
2777
  return e.type === g.OAuth2 || e.type === g.OpenIDConnect;
2722
2778
  }
2723
2779
  function ze(e, t) {
@@ -2728,19 +2784,19 @@ function ze(e, t) {
2728
2784
  function He(e, t) {
2729
2785
  const o = Object.entries(t);
2730
2786
  for (const [s, a] of o)
2731
- s === "grantType" && typeof a == "string" && xe[a] && (e.grantType = xe[a]);
2732
- const n = e[e.grantType], r = new Set(Object.keys(Kt[e.grantType]));
2787
+ s === "grantType" && typeof a == "string" && Ae[a] && (e.grantType = Ae[a]);
2788
+ const n = e[e.grantType], r = new Set(Object.keys(zt[e.grantType]));
2733
2789
  for (const [s, a] of o)
2734
2790
  s !== "grantType" && a !== void 0 && r.has(s) && (n[s] = a);
2735
2791
  }
2736
- function St(e) {
2792
+ function Tt(e) {
2737
2793
  return e.securityType === g.NoAuth ? null : e[e.securityType]?.schemeName ?? null;
2738
2794
  }
2739
- function Ra(e, t) {
2795
+ function Na(e, t) {
2740
2796
  !t || e.securityType === g.NoAuth || (e.securitySchemeId = t, e[e.securityType].schemeName = t);
2741
2797
  }
2742
- function ae(e, t) {
2743
- if (e.securityType = t.type, Ra(e, t.schemeId), !t.data) return e;
2798
+ function ie(e, t) {
2799
+ if (e.securityType = t.type, Na(e, t.schemeId), !t.data) return e;
2744
2800
  switch (t.type) {
2745
2801
  case g.BasicAuth:
2746
2802
  case g.DigestAuth:
@@ -2749,7 +2805,7 @@ function ae(e, t) {
2749
2805
  break;
2750
2806
  case g.APIKey: {
2751
2807
  const { location: o, ...n } = t.data;
2752
- ze(e[g.APIKey], n), o && (e[g.APIKey].location = Vt(o));
2808
+ ze(e[g.APIKey], n), o && (e[g.APIKey].location = Yt(o));
2753
2809
  break;
2754
2810
  }
2755
2811
  case g.OAuth2:
@@ -2763,17 +2819,17 @@ function ae(e, t) {
2763
2819
  }
2764
2820
  return e;
2765
2821
  }
2766
- function _a(e, t) {
2822
+ function Ua(e, t) {
2767
2823
  return t.schemeId ? e.findIndex(
2768
- (o) => o.securitySchemeId === t.schemeId || St(o) === t.schemeId
2824
+ (o) => o.securitySchemeId === t.schemeId || Tt(o) === t.schemeId
2769
2825
  ) : e.findIndex((o) => o.securityType === t.type);
2770
2826
  }
2771
- function qa(e) {
2827
+ function Da(e) {
2772
2828
  return e.data ? Object.entries(e.data).some(
2773
- ([t, o]) => o !== void 0 && !xa.has(t)
2829
+ ([t, o]) => o !== void 0 && !qa.has(t)
2774
2830
  ) : !1;
2775
2831
  }
2776
- function Pa(e) {
2832
+ function La(e) {
2777
2833
  return e.schemeId ? `${e.type} (scheme '${e.schemeId}')` : e.type;
2778
2834
  }
2779
2835
  function Ge(e, t, o, n) {
@@ -2782,105 +2838,105 @@ function Ge(e, t, o, n) {
2782
2838
  message: `The security entry at index ${o} is targeted by both a mutation and a remove${n}; issue only one action for it.`
2783
2839
  } : null;
2784
2840
  }
2785
- function Na(e, t, o) {
2841
+ function Wa(e, t, o) {
2786
2842
  let n = e;
2787
2843
  const r = [], s = t.filter(
2788
- (i) => i.action !== E.REMOVE
2844
+ (c) => c.action !== x.REMOVE
2789
2845
  ), a = t.filter(
2790
- (i) => i.action === E.REMOVE
2846
+ (c) => c.action === x.REMOVE
2791
2847
  ), l = /* @__PURE__ */ new Set();
2792
- for (const i of a) {
2793
- const u = Ea(e, i);
2848
+ for (const c of a) {
2849
+ const u = Ra(e, c);
2794
2850
  if (!u.ok) return { ok: !1, message: u.message };
2795
2851
  l.add(u.entry);
2796
2852
  }
2797
- for (const i of s) {
2798
- if (i.action === E.ADD) {
2799
- const m = n.length === 1 && n[0].securityType === g.NoAuth, f = m ? -1 : _a(n, i);
2853
+ for (const c of s) {
2854
+ if (c.action === x.ADD) {
2855
+ const m = n.length === 1 && n[0].securityType === g.NoAuth, f = m ? -1 : Ua(n, c);
2800
2856
  if (f >= 0) {
2801
2857
  const v = n[f], A = Ge(l, v, f, o);
2802
2858
  if (A) return A;
2803
- if (v.securityType !== i.type)
2859
+ if (v.securityType !== c.type)
2804
2860
  return {
2805
2861
  ok: !1,
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.`
2862
+ message: `Scheme '${c.schemeId}' already exists${o} as ${v.securityType}, not ${c.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.`
2807
2863
  };
2808
- n = [...n], n[f] = ae(
2864
+ n = [...n], n[f] = ie(
2809
2865
  structuredClone(v),
2810
- i
2866
+ c
2811
2867
  ), r.push(
2812
- I(
2868
+ w(
2813
2869
  "applied",
2814
- `Updated existing ${Pa(i)} in place (index: ${f})${o}`
2870
+ `Updated existing ${La(c)} in place (index: ${f})${o}`
2815
2871
  )
2816
2872
  );
2817
2873
  continue;
2818
2874
  }
2819
- if ($a(i) && qa(i) && !i.data?.grantType)
2875
+ if (Pa(c) && Da(c) && !c.data?.grantType)
2820
2876
  return {
2821
2877
  ok: !1,
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.`
2878
+ message: `grantType is required when adding ${c.type} security with flow values${o}. For a plain http/bearer token use type "${g.JWT}" with data.token instead.`
2823
2879
  };
2824
- const y = ae(Ee(), i);
2880
+ const y = ie(Oe(), c);
2825
2881
  n = m ? [y] : [...n, y], r.push(
2826
- I(
2882
+ w(
2827
2883
  "applied",
2828
- `Added ${i.type} security (index: ${n.length - 1})${o}`
2884
+ `Added ${c.type} security (index: ${n.length - 1})${o}`
2829
2885
  )
2830
2886
  );
2831
2887
  continue;
2832
2888
  }
2833
- if (i.index === void 0)
2889
+ if (c.index === void 0)
2834
2890
  return { ok: !1, message: "index is required for update action." };
2835
- if (i.index >= n.length)
2891
+ if (c.index >= n.length)
2836
2892
  return {
2837
2893
  ok: !1,
2838
- message: `Index ${i.index} out of bounds. Step has ${n.length} security entries.`
2894
+ message: `Index ${c.index} out of bounds. Step has ${n.length} security entries.`
2839
2895
  };
2840
- const u = n[i.index], d = Ge(l, u, i.index, o);
2896
+ const u = n[c.index], d = Ge(l, u, c.index, o);
2841
2897
  if (d) return d;
2842
2898
  if (u.securitySchemeId) {
2843
- const m = St(u);
2844
- if (i.schemeId && m !== i.schemeId)
2899
+ const m = Tt(u);
2900
+ if (c.schemeId && m !== c.schemeId)
2845
2901
  return {
2846
2902
  ok: !1,
2847
- message: `schemeId mismatch at index ${i.index}. Expected ${m ?? "none"}.`
2903
+ message: `schemeId mismatch at index ${c.index}. Expected ${m ?? "none"}.`
2848
2904
  };
2849
2905
  }
2850
- n = [...n], n[i.index] = ae(structuredClone(u), i), r.push(
2851
- I("applied", `Updated ${i.type} at index ${i.index}${o}`)
2906
+ n = [...n], n[c.index] = ie(structuredClone(u), c), r.push(
2907
+ w("applied", `Updated ${c.type} at index ${c.index}${o}`)
2852
2908
  );
2853
2909
  }
2854
2910
  if (l.size > 0) {
2855
- const i = n.filter((d) => !l.has(d)), u = n.length - i.length;
2856
- n = i;
2911
+ const c = n.filter((d) => !l.has(d)), u = n.length - c.length;
2912
+ n = c;
2857
2913
  for (let d = 0; d < u; d++)
2858
- r.push(I("applied"));
2914
+ r.push(w("applied"));
2859
2915
  }
2860
- return n.length === 0 && (n = [Ee()]), { ok: !0, security: n, applied: r };
2916
+ return n.length === 0 && (n = [Oe()]), { ok: !0, security: n, applied: r };
2861
2917
  }
2862
- function Ua(e) {
2918
+ function Ma(e) {
2863
2919
  return async (t) => {
2864
- const { changes: o, collectionId: n, workflowId: r, stepId: s } = t, a = kt(t), l = s.trim(), i = /* @__PURE__ */ new Map();
2920
+ const { changes: o, collectionId: n, workflowId: r, stepId: s } = t, a = St(t), l = s.trim(), c = /* @__PURE__ */ new Map();
2865
2921
  for (const f of o) {
2866
- const y = f.stepId?.trim() || l, v = i.get(y);
2867
- v ? v.push(f) : i.set(y, [f]);
2922
+ const y = f.stepId?.trim() || l, v = c.get(y);
2923
+ v ? v.push(f) : c.set(y, [f]);
2868
2924
  }
2869
2925
  const u = [], d = [];
2870
- for (const [f, y] of i) {
2871
- const v = vt(e, n, r, f);
2926
+ for (const [f, y] of c) {
2927
+ const v = gt(e, n, r, f);
2872
2928
  if (!v.ok)
2873
2929
  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(
2930
+ const A = v.value, Ce = f || A.stepId.get(), At = c.size > 1 ? ` for step '${Ce}'` : "", xt = Array.from(
2875
2931
  A.security.get({ noproxy: !0 })
2876
- ), Y = Na(At, y, Ot);
2932
+ ), Y = Wa(xt, y, At);
2877
2933
  if (!Y.ok) return h(Y.message);
2878
2934
  u.push(...Y.applied), d.push({ step: A, security: Y.security, label: Ce });
2879
2935
  }
2880
2936
  for (const f of d)
2881
2937
  f.step.security.set(f.security);
2882
2938
  const m = d.map((f) => `stepId=${f.label}
2883
- ${Z(f.security)}`).join(`
2939
+ ${ee(f.security)}`).join(`
2884
2940
 
2885
2941
  `);
2886
2942
  return {
@@ -2894,11 +2950,11 @@ ${Z(f.security)}`).join(`
2894
2950
  };
2895
2951
  };
2896
2952
  }
2897
- const Da = {
2953
+ const Fa = {
2898
2954
  name: "update_security",
2899
- definition: Aa,
2900
- createExecutor: (e) => Ua(e.store)
2901
- }, La = `Update an existing Replay step with atomic changes.
2955
+ definition: _a,
2956
+ createExecutor: (e) => Ma(e.store)
2957
+ }, ja = `Update an existing Replay step with atomic changes.
2902
2958
 
2903
2959
  **What it does**
2904
2960
  - Mutates an existing step only (no create/delete).
@@ -2932,68 +2988,68 @@ const Da = {
2932
2988
  - Batch related edits in one call; include all known edits up front.
2933
2989
  - For OpenAPI-linked steps, avoid method/url changes.
2934
2990
  - After changing path/query parameters, decide whether to add a separate URL change.
2935
- `, Wa = ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"], Ma = [
2991
+ `, Ba = ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"], Ya = [
2936
2992
  D.Text,
2937
2993
  D.JSON,
2938
2994
  D.XML
2939
- ], Fa = p({
2940
- name: c().min(1),
2941
- in: S(["path", "query", "header", "cookie"]),
2942
- value: c()
2943
- }).strict(), ja = p({
2944
- condition: c().min(1),
2945
- context: c().optional().describe("Context for the expression."),
2946
- type: S(["simple", "regex", "jsonpath", "xpath"]).optional()
2947
- }).strict(), Ba = _.extend({
2948
- field: w("url"),
2949
- data: c().min(1).describe("New request URL for step.")
2950
- }).strict(), Ya = _.extend({
2951
- field: w("description"),
2952
- data: c().describe("New step description text.")
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"),
2995
+ ], za = p({
2996
+ name: i().min(1),
2997
+ in: T(["path", "query", "header", "cookie"]),
2998
+ value: i()
2999
+ }).strict(), Ha = p({
3000
+ condition: i().min(1),
3001
+ context: i().optional().describe("Context for the expression."),
3002
+ type: T(["simple", "regex", "jsonpath", "xpath"]).optional()
3003
+ }).strict(), Ga = R.extend({
3004
+ field: I("url"),
3005
+ data: i().min(1).describe("New request URL for step.")
3006
+ }).strict(), Va = R.extend({
3007
+ field: I("description"),
3008
+ data: i().describe("New step description text.")
3009
+ }).strict(), Ka = R.extend({
3010
+ field: I("method"),
3011
+ data: T(Ba).describe("New HTTP method for x-operation step.")
3012
+ }).strict(), Ja = R.extend({
3013
+ field: I("parameters"),
3014
+ data: za.optional().describe("Parameter data. Required for add/update actions.")
3015
+ }).strict(), Qa = R.extend({
3016
+ field: I("outputs"),
2961
3017
  data: p({
2962
- name: c().min(1).describe("Output name."),
2963
- expression: c().min(1).describe("Output expression.")
3018
+ name: i().min(1).describe("Output name."),
3019
+ expression: i().min(1).describe("Output expression.")
2964
3020
  }).strict().optional().describe("Output mapping. Required for add/update actions.")
2965
- }).strict(), Va = _.extend({
2966
- field: w("successCriteria"),
2967
- data: ja.optional().describe(
3021
+ }).strict(), Xa = R.extend({
3022
+ field: I("successCriteria"),
3023
+ data: Ha.optional().describe(
2968
3024
  "Success criterion. Required for add/update actions."
2969
3025
  )
2970
- }).strict(), Ka = _.extend({
2971
- field: w("body"),
3026
+ }).strict(), Za = R.extend({
3027
+ field: I("body"),
2972
3028
  data: p({
2973
- contentType: S(Ma).optional().describe(
3029
+ contentType: T(Ya).optional().describe(
2974
3030
  "Request body content type. Allowed: text/plain, application/json, application/xml."
2975
3031
  ),
2976
- content: c().describe("Request body content as string.")
3032
+ content: i().describe("Request body content as string.")
2977
3033
  }).strict().describe("Request body content and optional content type.")
2978
- }).strict(), Ja = te("field", [
2979
- Ba,
2980
- Ya,
2981
- za,
2982
- Ha,
3034
+ }).strict(), ei = oe("field", [
2983
3035
  Ga,
2984
3036
  Va,
2985
- Ka
2986
- ]), Qa = p({
2987
- collectionId: c().describe(
3037
+ Ka,
3038
+ Ja,
3039
+ Qa,
3040
+ Xa,
3041
+ Za
3042
+ ]), ti = p({
3043
+ collectionId: i().describe(
2988
3044
  "Saved step: collection id. Unsaved draft tab on focus: empty string (with empty workflowId and stepId)."
2989
3045
  ),
2990
- workflowId: c().describe(
3046
+ workflowId: i().describe(
2991
3047
  "Saved step: workflow id. Unsaved draft tab: empty string (with empty collectionId and stepId)."
2992
3048
  ),
2993
- stepId: c().describe(
3049
+ stepId: i().describe(
2994
3050
  "Saved step: step id. Unsaved draft tab: empty string (with empty collectionId and workflowId)."
2995
3051
  ),
2996
- changes: b(Ja).min(1).describe("List of individual changes to apply to the step.")
3052
+ changes: b(ei).min(1).describe("List of individual changes to apply to the step.")
2997
3053
  }).strict().superRefine((e, t) => {
2998
3054
  const o = e.collectionId.trim(), n = e.workflowId.trim(), r = e.stepId.trim();
2999
3055
  !(o && n && r) && !(!o && !n && !r) && t.addIssue({
@@ -3001,26 +3057,26 @@ const Da = {
3001
3057
  message: "Provide all three ids for a saved step, or three empty strings for the focused unsaved request tab.",
3002
3058
  path: ["collectionId"]
3003
3059
  });
3004
- }), Xa = ft, Za = {
3005
- description: La,
3006
- inputSchema: Qa,
3007
- outputSchema: Xa,
3060
+ }), oi = ft, ni = {
3061
+ description: ja,
3062
+ inputSchema: ti,
3063
+ outputSchema: oi,
3008
3064
  needsApproval: () => !0
3009
3065
  };
3010
- function ei(e) {
3066
+ function ri(e) {
3011
3067
  return e.replace(/\{\{([^{}\s]+)\}\}/g, "{$1}");
3012
3068
  }
3013
- function ie(e) {
3069
+ function ce(e) {
3014
3070
  return G[e];
3015
3071
  }
3016
- function ce(e, t) {
3072
+ function le(e, t) {
3017
3073
  return e.id === t;
3018
3074
  }
3019
3075
  function Ve(e, t) {
3020
3076
  return e.condition === t;
3021
3077
  }
3022
- function le(e, t) {
3023
- return ue(e) && e.id === t;
3078
+ function de(e, t) {
3079
+ return pe(e) && e.id === t;
3024
3080
  }
3025
3081
  function Ke(e, t, o) {
3026
3082
  return { ...Qe(e), key: t, value: o, active: !0 };
@@ -3044,85 +3100,85 @@ function ke(e, t, o) {
3044
3100
  return n = s.length < r.length, s;
3045
3101
  }), n;
3046
3102
  }
3047
- function ti(e, t) {
3103
+ function si(e, t) {
3048
3104
  switch (e.action) {
3049
- case E.ADD: {
3105
+ case x.ADD: {
3050
3106
  if (!e.data)
3051
- return I("failed", "Failed parameter add because data is missing.");
3052
- const { in: o, name: n, value: r } = e.data, s = ie(o), a = Ke(o, n, r);
3053
- return be(t.parameters[s], [a]), I(
3107
+ return w("failed", "Failed parameter add because data is missing.");
3108
+ const { in: o, name: n, value: r } = e.data, s = ce(o), a = Ke(o, n, r);
3109
+ return be(t.parameters[s], [a]), w(
3054
3110
  "applied",
3055
3111
  `Added ${o} parameter '${n}' (id: ${a.id})`
3056
3112
  );
3057
3113
  }
3058
- case E.UPDATE: {
3114
+ case x.UPDATE: {
3059
3115
  if (!e.id)
3060
- return I("failed", "Failed parameter update because id is missing.");
3116
+ return w("failed", "Failed parameter update because id is missing.");
3061
3117
  if (!e.data)
3062
- return I("failed", "Failed parameter update because data is missing.");
3063
- const { in: o, name: n, value: r } = e.data, s = ie(o);
3118
+ return w("failed", "Failed parameter update because data is missing.");
3119
+ const { in: o, name: n, value: r } = e.data, s = ce(o);
3064
3120
  return Q(t.parameters[s], e.id, {
3065
- find: le,
3066
- produce: (l) => ue(l) ? {
3121
+ find: de,
3122
+ produce: (l) => pe(l) ? {
3067
3123
  ...Ke(o, n, r),
3068
3124
  id: l.id,
3069
3125
  ...l.allowReserved !== void 0 && { allowReserved: l.allowReserved }
3070
3126
  } : l
3071
- }) ? I("applied") : I("failed", `Parameter with id '${e.id}' not found.`);
3127
+ }) ? w("applied") : w("failed", `Parameter with id '${e.id}' not found.`);
3072
3128
  }
3073
- case E.REMOVE: {
3129
+ case x.REMOVE: {
3074
3130
  if (!e.id)
3075
- return I("failed", "Failed parameter remove because id is missing.");
3076
- const o = e.id, n = e.data?.in, r = n ? [ie(n)] : Object.values(G);
3131
+ return w("failed", "Failed parameter remove because id is missing.");
3132
+ const o = e.id, n = e.data?.in, r = n ? [ce(n)] : Object.values(G);
3077
3133
  let s = !1;
3078
3134
  for (const a of r)
3079
- if (t.parameters[a].get({ noproxy: !0 }).some((i) => le(i, o))) {
3080
- s = ke(t.parameters[a], o, le);
3135
+ if (t.parameters[a].get({ noproxy: !0 }).some((c) => de(c, o))) {
3136
+ s = ke(t.parameters[a], o, de);
3081
3137
  break;
3082
3138
  }
3083
- return s ? I("applied") : I("failed", `Parameter with id '${o}' not found.`);
3139
+ return s ? w("applied") : w("failed", `Parameter with id '${o}' not found.`);
3084
3140
  }
3085
3141
  }
3086
3142
  }
3087
- function oi(e, t) {
3143
+ function ai(e, t) {
3088
3144
  switch (e.action) {
3089
- case E.ADD: {
3145
+ case x.ADD: {
3090
3146
  if (!e.data)
3091
- return I("failed", "Failed output add because data is missing.");
3147
+ return w("failed", "Failed output add because data is missing.");
3092
3148
  const { name: o, expression: n } = e.data, r = t.outputs.get({ noproxy: !0 }).find((a) => a.key === o);
3093
3149
  if (r)
3094
3150
  return Q(t.outputs, r.id, {
3095
- find: ce,
3151
+ find: le,
3096
3152
  produce: (a) => ({ ...a, key: o, value: n, active: !0 })
3097
- }), I(
3153
+ }), w(
3098
3154
  "applied",
3099
3155
  `Updated existing output '${o}' in place (id: ${r.id})`
3100
3156
  );
3101
3157
  const s = crypto.randomUUID();
3102
- return be(t.outputs, [{ id: s, key: o, value: n, active: !0 }]), I("applied", `Added output '${o}' (id: ${s})`);
3158
+ return be(t.outputs, [{ id: s, key: o, value: n, active: !0 }]), w("applied", `Added output '${o}' (id: ${s})`);
3103
3159
  }
3104
- case E.UPDATE: {
3160
+ case x.UPDATE: {
3105
3161
  if (!e.id)
3106
- return I("failed", "Failed output update because id is missing.");
3162
+ return w("failed", "Failed output update because id is missing.");
3107
3163
  if (!e.data)
3108
- return I("failed", "Failed output update because data is missing.");
3164
+ return w("failed", "Failed output update because data is missing.");
3109
3165
  const { name: o, expression: n } = e.data;
3110
3166
  return Q(t.outputs, e.id, {
3111
- find: ce,
3167
+ find: le,
3112
3168
  produce: (s) => ({ ...s, key: o, value: n, active: !0 })
3113
- }) ? I("applied") : I("failed", `Output with id '${e.id}' not found.`);
3169
+ }) ? w("applied") : w("failed", `Output with id '${e.id}' not found.`);
3114
3170
  }
3115
- case E.REMOVE:
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.");
3171
+ case x.REMOVE:
3172
+ return e.id ? ke(t.outputs, e.id, le) ? w("applied") : w("failed", `Output with id '${e.id}' not found.`) : w("failed", "Failed output remove because id is missing.");
3117
3173
  }
3118
3174
  }
3119
- function ni(e, t) {
3175
+ function ii(e, t) {
3120
3176
  switch (e.action) {
3121
- case E.ADD: {
3177
+ case x.ADD: {
3122
3178
  if (!e.data)
3123
- return I("failed", "Failed success criteria add because data is missing.");
3179
+ return w("failed", "Failed success criteria add because data is missing.");
3124
3180
  const { condition: o, context: n, type: r } = e.data, s = Je(
3125
- r ?? de.SIMPLE
3181
+ r ?? ue.SIMPLE
3126
3182
  );
3127
3183
  return be(t.successCriteria, [
3128
3184
  {
@@ -3130,16 +3186,16 @@ function ni(e, t) {
3130
3186
  condition: o,
3131
3187
  ...n !== void 0 && { context: n }
3132
3188
  }
3133
- ]), I("applied");
3189
+ ]), w("applied");
3134
3190
  }
3135
- case E.UPDATE: {
3191
+ case x.UPDATE: {
3136
3192
  if (typeof e.id != "string")
3137
- return I(
3193
+ return w(
3138
3194
  "failed",
3139
3195
  "Failed success criteria update because id is missing."
3140
3196
  );
3141
3197
  if (!e.data)
3142
- return I(
3198
+ return w(
3143
3199
  "failed",
3144
3200
  "Failed success criteria update because data is missing."
3145
3201
  );
@@ -3151,36 +3207,36 @@ function ni(e, t) {
3151
3207
  id: a.id || crypto.randomUUID(),
3152
3208
  condition: o,
3153
3209
  context: n ?? a.context,
3154
- type: r ?? a.type ?? de.SIMPLE
3210
+ type: r ?? a.type ?? ue.SIMPLE
3155
3211
  })
3156
- }) ? I("applied") : I(
3212
+ }) ? w("applied") : w(
3157
3213
  "failed",
3158
3214
  `Success criterion with condition '${e.id}' not found.`
3159
3215
  );
3160
3216
  }
3161
- case E.REMOVE:
3162
- return typeof e.id != "string" ? I(
3217
+ case x.REMOVE:
3218
+ return typeof e.id != "string" ? w(
3163
3219
  "failed",
3164
3220
  "Failed success criteria remove because id is missing."
3165
3221
  ) : ke(
3166
3222
  t.successCriteria,
3167
3223
  e.id,
3168
3224
  Ve
3169
- ) ? I("applied") : I(
3225
+ ) ? w("applied") : w(
3170
3226
  "failed",
3171
3227
  `Success criterion with condition '${e.id}' not found.`
3172
3228
  );
3173
3229
  }
3174
3230
  }
3175
- function ri(e) {
3231
+ function ci(e) {
3176
3232
  return async (t) => {
3177
- const { changes: o, collectionId: n, workflowId: r, stepId: s } = t, a = kt(t), l = vt(e, n, r, s);
3233
+ const { changes: o, collectionId: n, workflowId: r, stepId: s } = t, a = St(t), l = gt(e, n, r, s);
3178
3234
  if (!l.ok)
3179
3235
  return h(l.message, l.details);
3180
- const i = l.value;
3236
+ const c = l.value;
3181
3237
  if (o.some(
3182
3238
  (f) => f.field === "method" || f.field === "url"
3183
- ) && i.operation.ornull !== null)
3239
+ ) && c.operation.ornull !== null)
3184
3240
  return h(
3185
3241
  "Cannot update method or url for a step linked to an OpenAPI operation."
3186
3242
  );
@@ -3189,43 +3245,43 @@ function ri(e) {
3189
3245
  switch (f.field) {
3190
3246
  case "method":
3191
3247
  case "url": {
3192
- i.xOperation.ornull === null && i.xOperation.set({ method: "GET", url: "" });
3193
- const y = i.xOperation.ornull;
3248
+ c.xOperation.ornull === null && c.xOperation.set({ method: "GET", url: "" });
3249
+ const y = c.xOperation.ornull;
3194
3250
  if (!y)
3195
3251
  return h("Step xOperation state is unavailable.");
3196
3252
  if (f.field === "method")
3197
3253
  y.method.set(f.data);
3198
3254
  else {
3199
- const v = ei(f.data);
3255
+ const v = ri(f.data);
3200
3256
  y.url.set(v);
3201
- const A = i.parameters.queryParameters.get({ noproxy: !0 });
3202
- i.parameters.queryParameters.set(
3203
- Jt(
3204
- Qt(v),
3257
+ const A = c.parameters.queryParameters.get({ noproxy: !0 });
3258
+ c.parameters.queryParameters.set(
3259
+ Ht(
3260
+ Gt(v),
3205
3261
  A
3206
3262
  )
3207
3263
  );
3208
3264
  }
3209
- d.push(I("applied"));
3265
+ d.push(w("applied"));
3210
3266
  break;
3211
3267
  }
3212
3268
  case "description":
3213
- i.description.set(f.data), d.push(I("applied"));
3269
+ c.description.set(f.data), d.push(w("applied"));
3214
3270
  break;
3215
3271
  case "body":
3216
- i.requestBody.merge({
3272
+ c.requestBody.merge({
3217
3273
  content: f.data.content,
3218
3274
  ...f.data.contentType !== void 0 && { type: f.data.contentType }
3219
- }), d.push(I("applied"));
3275
+ }), d.push(w("applied"));
3220
3276
  break;
3221
3277
  case "parameters":
3222
- d.push(ti(f, i));
3278
+ d.push(si(f, c));
3223
3279
  break;
3224
3280
  case "outputs":
3225
- d.push(oi(f, i));
3281
+ d.push(ai(f, c));
3226
3282
  break;
3227
3283
  case "successCriteria":
3228
- d.push(ni(f, i));
3284
+ d.push(ii(f, c));
3229
3285
  break;
3230
3286
  }
3231
3287
  const m = o.some((f) => f.field === "outputs");
@@ -3236,17 +3292,17 @@ function ri(e) {
3236
3292
  approvedChanges: a.approvedChanges ?? o.length,
3237
3293
  applied: d,
3238
3294
  ...m && {
3239
- resultingState: we(i.outputs.get({ noproxy: !0 })) || "Outputs: (none)"
3295
+ resultingState: Ie(c.outputs.get({ noproxy: !0 })) || "Outputs: (none)"
3240
3296
  }
3241
3297
  }
3242
3298
  };
3243
3299
  };
3244
3300
  }
3245
- const si = {
3301
+ const li = {
3246
3302
  name: "update_step",
3247
- definition: Za,
3248
- createExecutor: (e) => ri(e.store)
3249
- }, ai = `Search the public web via a nested agent and return a consolidated summary.
3303
+ definition: ni,
3304
+ createExecutor: (e) => ci(e.store)
3305
+ }, di = `Search the public web via a nested agent and return a consolidated summary.
3250
3306
 
3251
3307
  **What it does**
3252
3308
  - Runs provider web search (results depend on the active model provider) and synthesizes findings for the parent agent.
@@ -3263,21 +3319,21 @@ const si = {
3263
3319
 
3264
3320
  **Input guidance**
3265
3321
  - State a clear, self-contained query: what to look up and what to return (facts, links, version numbers, etc.).
3266
- - Prefer one web search call per distinct lookup; do not nest web search calls.`, ii = p({
3267
- task: c().describe("What to search for on the web and what to return"),
3268
- url: c().describe("The URL to execute search on")
3269
- }), ci = ee(), li = {
3270
- description: ai,
3271
- inputSchema: ii,
3272
- outputSchema: ci,
3322
+ - Prefer one web search call per distinct lookup; do not nest web search calls.`, ui = p({
3323
+ task: i().describe("What to search for on the web and what to return"),
3324
+ url: i().describe("The URL to execute search on")
3325
+ }), pi = te(), fi = {
3326
+ description: di,
3327
+ inputSchema: ui,
3328
+ outputSchema: pi,
3273
3329
  needsApproval: !0
3274
- }, di = `
3330
+ }, mi = `
3275
3331
  You are a web search subagent inside Replay, invoked by the parent agent to complete a single lookup task.
3276
3332
 
3277
3333
  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.
3278
3334
 
3279
3335
  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.
3280
- `, ui = `
3336
+ `, hi = `
3281
3337
  - Never hallucinate or invent an answer when the information is not available from the web search.
3282
3338
  - 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.
3283
3339
  - 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.
@@ -3286,28 +3342,28 @@ You must use the provider web search tool to gather information. You cannot acce
3286
3342
  - Include source URLs for all claims that are material to the parent agent's next steps.
3287
3343
  - Clearly distinguish between verified findings, inferred conclusions, and information that could not be verified.
3288
3344
  - When sources conflict, report the conflict and cite the competing sources rather than selecting a winner without evidence.
3289
- `, pi = eo(
3345
+ `, Ii = Jt(
3290
3346
  //
3291
- Re("role", di),
3292
- Re("output", ui)
3347
+ Ee("role", mi),
3348
+ Ee("output", hi)
3293
3349
  );
3294
- function fi() {
3295
- return [to(pi)];
3350
+ function wi() {
3351
+ return [Qt(Ii)];
3296
3352
  }
3297
- function mi(e) {
3298
- const t = mo(e), o = ao(e);
3353
+ function yi(e) {
3354
+ const t = ho(e), o = oo(e);
3299
3355
  return async (n, r) => {
3300
3356
  try {
3301
3357
  return {
3302
3358
  isError: !1,
3303
3359
  data: {
3304
- message: await io({
3360
+ message: await no({
3305
3361
  model: o,
3306
- system: fi(),
3307
- prompt: hi(n),
3362
+ system: wi(),
3363
+ prompt: vi(n),
3308
3364
  tools: t,
3309
3365
  toolChoice: "required",
3310
- stopWhen: co("web_search"),
3366
+ stopWhen: ro("web_search"),
3311
3367
  temperature: 0,
3312
3368
  abortSignal: r.abortSignal
3313
3369
  }).text
@@ -3321,7 +3377,7 @@ function mi(e) {
3321
3377
  }
3322
3378
  };
3323
3379
  }
3324
- function hi(e) {
3380
+ function vi(e) {
3325
3381
  return k([
3326
3382
  //
3327
3383
  "[URL]",
@@ -3331,41 +3387,41 @@ function hi(e) {
3331
3387
  e.task
3332
3388
  ]);
3333
3389
  }
3334
- const wi = {
3390
+ const gi = {
3335
3391
  name: "web_search",
3336
- definition: li,
3337
- createExecutor: (e) => mi(e.model)
3338
- }, Tt = [
3339
- ys,
3340
- xs,
3341
- Ls,
3342
- Hs,
3343
- fa,
3344
- Da,
3345
- si,
3346
- Cn,
3347
- vr,
3348
- Zr,
3349
- wi,
3350
- Hn
3392
+ definition: fi,
3393
+ createExecutor: (e) => yi(e.model)
3394
+ }, Ct = [
3395
+ ks,
3396
+ qs,
3397
+ js,
3398
+ Js,
3399
+ wa,
3400
+ Fa,
3401
+ li,
3402
+ On,
3403
+ Sr,
3404
+ ns,
3405
+ gi,
3406
+ Gn
3351
3407
  ];
3352
- function Ii(e) {
3353
- return Tt.some((t) => t.name === e);
3408
+ function bi(e) {
3409
+ return Ct.some((t) => t.name === e);
3354
3410
  }
3355
- function Pi(e, t) {
3356
- for (const o of Tt)
3411
+ function Wi(e, t) {
3412
+ for (const o of Ct)
3357
3413
  e.register(
3358
- ln(
3414
+ dn(
3359
3415
  o,
3360
3416
  t[o.name]
3361
3417
  )
3362
3418
  );
3363
3419
  }
3364
- function yi(e) {
3420
+ function ki(e) {
3365
3421
  const t = e.startsWith("tool-") ? e.slice(5) : e;
3366
- return Ii(t) ? t : void 0;
3422
+ return bi(t) ? t : void 0;
3367
3423
  }
3368
- function vi(e, t) {
3424
+ function Si(e, t) {
3369
3425
  return `${e}::${t}`;
3370
3426
  }
3371
3427
  function Se(e) {
@@ -3374,28 +3430,28 @@ function Se(e) {
3374
3430
  function Te(e) {
3375
3431
  return e.state === "approval-requested" && e.approval?.id != null;
3376
3432
  }
3377
- function gi(e) {
3433
+ function Ti(e) {
3378
3434
  return e.state === "output-denied" ? !0 : e.state === "output-available" && e.approval != null;
3379
3435
  }
3380
- function Ct(e) {
3436
+ function Ot(e) {
3381
3437
  return e.parts.some((t) => Se(t) && Te(t));
3382
3438
  }
3383
- function Ni(e) {
3384
- return e.some(Ct);
3439
+ function Mi(e) {
3440
+ return e.some(Ot);
3385
3441
  }
3386
- function Ui(e) {
3442
+ function Fi(e) {
3387
3443
  return e.map(
3388
- (t) => Ct(t) ? { ...t, parts: t.parts.map(bi) } : t
3444
+ (t) => Ot(t) ? { ...t, parts: t.parts.map(Ci) } : t
3389
3445
  );
3390
3446
  }
3391
- function bi(e) {
3447
+ function Ci(e) {
3392
3448
  return !Se(e) || !Te(e) ? e : {
3393
3449
  ...e,
3394
3450
  state: "output-denied",
3395
3451
  approval: { id: e.approval.id, approved: !1 }
3396
3452
  };
3397
3453
  }
3398
- function Di(e) {
3454
+ function ji(e) {
3399
3455
  const t = [], o = [];
3400
3456
  let n = 0;
3401
3457
  const r = {}, s = () => {
@@ -3405,19 +3461,19 @@ function Di(e) {
3405
3461
  items: [...o]
3406
3462
  }), o.length = 0);
3407
3463
  }, a = (l) => {
3408
- const i = l.trim();
3409
- if (i.length === 0)
3464
+ const c = l.trim();
3465
+ if (c.length === 0)
3410
3466
  return;
3411
3467
  const u = o[o.length - 1];
3412
- u?.kind === "action" && u.text === i || o.push({ kind: "action", text: i });
3468
+ u?.kind === "action" && u.text === c || o.push({ kind: "action", text: c });
3413
3469
  };
3414
3470
  for (let l = 0; l < e.length; l++) {
3415
- const i = e[l];
3416
- if (i.type === "step-start")
3471
+ const c = e[l];
3472
+ if (c.type === "step-start")
3417
3473
  continue;
3418
- if (i.type === "text") {
3474
+ if (c.type === "text") {
3419
3475
  s();
3420
- const d = i.text ?? "";
3476
+ const d = c.text ?? "";
3421
3477
  d.length > 0 && t.push({
3422
3478
  kind: "text",
3423
3479
  text: d,
@@ -3428,43 +3484,43 @@ function Di(e) {
3428
3484
  });
3429
3485
  continue;
3430
3486
  }
3431
- if (!Se(i))
3487
+ if (!Se(c))
3432
3488
  continue;
3433
- const u = yi(i.type);
3434
- if (u === fo) {
3435
- const d = Si(i);
3489
+ const u = ki(c.type);
3490
+ if (u === mo) {
3491
+ const d = Ai(c);
3436
3492
  if (d) {
3437
- const m = vi(d.collectionId, d.workflowId), f = r[m] ??= [];
3493
+ const m = Si(d.collectionId, d.workflowId), f = r[m] ??= [];
3438
3494
  f.includes(d.historyId) || f.push(d.historyId);
3439
3495
  }
3440
3496
  }
3441
- if (u === po) {
3442
- const d = Ti(i.input);
3497
+ if (u === fo) {
3498
+ const d = xi(c.input);
3443
3499
  d && a(d);
3444
3500
  continue;
3445
3501
  }
3446
- if (Te(i) || gi(i)) {
3447
- s(), t.push({ kind: "tool", part: i, key: `tool-${l}` });
3502
+ if (Te(c) || Ti(c)) {
3503
+ s(), t.push({ kind: "tool", part: c, key: `tool-${l}` });
3448
3504
  continue;
3449
3505
  }
3450
3506
  }
3451
3507
  return s(), t;
3452
3508
  }
3453
- const ki = p({
3454
- isError: w(!1),
3509
+ const Oi = p({
3510
+ isError: I(!1),
3455
3511
  data: p({
3456
- collectionId: c().min(1),
3457
- workflowId: c().min(1),
3458
- historyId: c().min(1)
3512
+ collectionId: i().min(1),
3513
+ workflowId: i().min(1),
3514
+ historyId: i().min(1)
3459
3515
  })
3460
3516
  });
3461
- function Si(e) {
3517
+ function Ai(e) {
3462
3518
  if (e.state !== "output-available")
3463
3519
  return;
3464
- const t = ki.safeParse(e.output);
3520
+ const t = Oi.safeParse(e.output);
3465
3521
  return t.success ? t.data.data : void 0;
3466
3522
  }
3467
- function Ti(e) {
3523
+ function xi(e) {
3468
3524
  if (e == null || typeof e != "object")
3469
3525
  return;
3470
3526
  const t = e.message;
@@ -3473,18 +3529,18 @@ function Ti(e) {
3473
3529
  const o = t.trim();
3474
3530
  return o.length > 0 ? o : void 0;
3475
3531
  }
3476
- function Li(e) {
3532
+ function Bi(e) {
3477
3533
  return e.filter((t) => t.type === "text").map((t) => t.text ?? "").join("");
3478
3534
  }
3479
- function Wi(e) {
3480
- return uo({
3535
+ function Yi(e) {
3536
+ return po({
3481
3537
  queryKey: st.detail(e ?? ""),
3482
3538
  queryFn: async () => e ? await rt.getInstance().findOne(e) ?? null : null,
3483
3539
  enabled: !!e
3484
3540
  });
3485
3541
  }
3486
- function Mi(e) {
3487
- return lo({
3542
+ function zi(e) {
3543
+ return uo({
3488
3544
  queryKey: st.infiniteHistory(e),
3489
3545
  initialPageParam: 0,
3490
3546
  queryFn: async ({ pageParam: t }) => rt.getInstance().findRecentChatsPage({
@@ -3495,40 +3551,40 @@ function Mi(e) {
3495
3551
  });
3496
3552
  }
3497
3553
  export {
3498
- un as A,
3499
- qi as B,
3500
- E as C,
3501
- yi as D,
3502
- gi as E,
3503
- Di as F,
3504
- Mi as G,
3505
- _i as H,
3554
+ pn as A,
3555
+ Li as B,
3556
+ x as C,
3557
+ ki as D,
3558
+ Ti as E,
3559
+ ji as F,
3560
+ zi as G,
3561
+ Di as H,
3506
3562
  G as L,
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,
3522
- ys as o,
3523
- cs as p,
3524
- vi as q,
3525
- Pi as r,
3526
- fa as s,
3527
- $i as t,
3528
- si as u,
3563
+ Ui as T,
3564
+ On as a,
3565
+ Sr as b,
3566
+ Fa as c,
3567
+ Js as d,
3568
+ js as e,
3569
+ qs as f,
3570
+ Gn as g,
3571
+ Mi as h,
3572
+ Fi as i,
3573
+ Bi as j,
3574
+ Yi as k,
3575
+ us as l,
3576
+ ns as m,
3577
+ fs as n,
3578
+ ks as o,
3579
+ ps as p,
3580
+ Si as q,
3581
+ Wi as r,
3582
+ wa as s,
3583
+ Ni as t,
3584
+ li as u,
3529
3585
  Se as v,
3530
- wi as w,
3586
+ gi as w,
3531
3587
  Te as x,
3532
- Ea as y,
3533
- vt as z
3588
+ Ra as y,
3589
+ gt as z
3534
3590
  };