@redocly/replay 0.28.0-next.9 → 0.28.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 (61) hide show
  1. package/dist/{replay-AiChatProvider-B_f9Wn8a.js → replay-AiChatProvider-BRqjyy2W.js} +2 -2
  2. package/dist/{replay-AiChatProvider-DuTK5g1N.js → replay-AiChatProvider-DUVoLgY2.js} +138 -140
  3. package/dist/{replay-AiChatSqliteDBStorage-cXsRIQfJ.js → replay-AiChatSqliteDBStorage-0evx56pl.js} +1 -1
  4. package/dist/{replay-AiChatSqliteDBStorage-CHfMo6M6.js → replay-AiChatSqliteDBStorage-C5AnRloD.js} +1 -1
  5. package/dist/{replay-AiPanel-CGbGwIMX.js → replay-AiPanel-CMjVD12K.js} +50 -50
  6. package/dist/{replay-AiPanel-C_C52r20.js → replay-AiPanel-PVgJioX3.js} +2 -2
  7. package/dist/replay-FileWatcher-CFYprlWN.js +364 -0
  8. package/dist/replay-FileWatcher-DGLwO5Kd.js +1 -0
  9. package/dist/{replay-SemanticSearchService-BLF1oOOu.js → replay-SemanticSearchService-Bh5xYa91.js} +15 -15
  10. package/dist/{replay-SemanticSearchService-DTc0oxN4.js → replay-SemanticSearchService-CulKCCNl.js} +1 -1
  11. package/dist/{replay-SqliteDBStorage-DF9kKplR.js → replay-SqliteDBStorage-Bz0muHEk.js} +1 -1
  12. package/dist/{replay-SqliteDBStorage-B_kyJ0a3.js → replay-SqliteDBStorage-CVHRAsPD.js} +1 -1
  13. package/dist/replay-TauriFileSystemAdapter-B163-f2D.js +108 -0
  14. package/dist/replay-TauriFileSystemAdapter-D4bOmvzP.js +1 -0
  15. package/dist/{replay-TauriRootStorage-Den8gI4S.js → replay-TauriRootStorage-2MPQE-3f.js} +192 -188
  16. package/dist/replay-TauriRootStorage-CjWUrnWz.js +1 -0
  17. package/dist/{replay-agent-loop-B8Mjb8DU.js → replay-agent-loop-BgYyBo9e.js} +3 -3
  18. package/dist/{replay-agent-loop-Z_nrrmg_.js → replay-agent-loop-DYDFXAZj.js} +1 -1
  19. package/dist/{replay-ai-chat-mappers-D7e8buTk.js → replay-ai-chat-mappers-BEwNRQPV.js} +1 -1
  20. package/dist/{replay-ai-chat-mappers-aJ_VMb6Z.js → replay-ai-chat-mappers-CMtNqQHX.js} +1 -1
  21. package/dist/{replay-create-model-Bw20x80b.js → replay-create-model-B2ZsGTjs.js} +3 -3
  22. package/dist/{replay-create-model-Be3vPVDb.js → replay-create-model-DPxfOEfv.js} +4 -4
  23. package/dist/{replay-db-BQXljNM0.js → replay-db-C9iqyMet.js} +1 -1
  24. package/dist/{replay-db-BmZNrdZM.js → replay-db-D4-LmLRk.js} +1 -1
  25. package/dist/{replay-external-resolver-BQvSDNfH.js → replay-external-resolver-BXgVrfzk.js} +2 -2
  26. package/dist/{replay-external-resolver-BLzbbtnT.js → replay-external-resolver-CTUbNZGW.js} +1 -1
  27. package/dist/{replay-index-BCz452N6.js → replay-index-4TEahAPK.js} +21604 -21055
  28. package/dist/{replay-index-C0kvTxxm.js → replay-index-B4U7iZuq.js} +41 -41
  29. package/dist/{replay-index-DAIwC3ls.js → replay-index-B8O3wYqo.js} +1 -1
  30. package/dist/{replay-index-C7y4K4Cr.js → replay-index-Bdg7noSD.js} +1 -1
  31. package/dist/replay-index-CG9VN2JQ.js +4 -0
  32. package/dist/{replay-index-B-uZhXHj.js → replay-index-DcC173cC.js} +1 -1
  33. package/dist/{replay-index-DYtXcqDk.js → replay-index-Nz5obVS5.js} +1131 -1131
  34. package/dist/{replay-index-wBHsAQEV.js → replay-index-q63USe25.js} +1 -1
  35. package/dist/{replay-lint-BzkTeXqI.js → replay-lint-4XFKTmSY.js} +97 -97
  36. package/dist/{replay-lint-graphql-BZF2eLiZ.js → replay-lint-graphql-BsBWkZ6L.js} +1 -1
  37. package/dist/{replay-lint-graphql-BDBGJSir.js → replay-lint-graphql-De2eDZnT.js} +1 -1
  38. package/dist/{replay-lint-CqDMOMQt.js → replay-lint-s7ylMBWz.js} +6100 -6063
  39. package/dist/{replay-periodic-revalidation-C7SkB1vs.js → replay-periodic-revalidation-BMFP7f-u.js} +1 -1
  40. package/dist/{replay-periodic-revalidation-orCv_JoF.js → replay-periodic-revalidation-DJbblUef.js} +1 -1
  41. package/dist/{replay-resolve-DZMWoig2.js → replay-resolve-BtNxNrKo.js} +1 -1
  42. package/dist/{replay-resolve-0e5f8I7b.js → replay-resolve-BueEsOnR.js} +1 -1
  43. package/dist/{replay-respect-run-ChP63WzG.js → replay-respect-run-B_dJjlti.js} +1 -1
  44. package/dist/{replay-respect-run-CLW3wGhx.js → replay-respect-run-Dfpbcsns.js} +3 -3
  45. package/dist/{replay-tauri-path-DBt1dqkG.js → replay-tauri-path-Bht3XIt7.js} +1 -1
  46. package/dist/{replay-tauri-path-DvLF4Z8f.js → replay-tauri-path-CiuYXh_j.js} +2 -2
  47. package/dist/replay-useAiChatQueries-02CRdEPJ.js +215 -0
  48. package/dist/{replay-useAiChatQueries-S6v5duiJ.js → replay-useAiChatQueries-D2hh5omV.js} +994 -945
  49. package/dist/{replay-validate-key-CNl7BV_v.js → replay-validate-key-ALwOF1Ux.js} +1 -1
  50. package/dist/{replay-validate-key-CMJODIH6.js → replay-validate-key-B7fbWbfv.js} +2 -2
  51. package/dist/replay.cjs +1 -1
  52. package/dist/replay.d.ts +5 -0
  53. package/dist/replay.js +8 -8
  54. package/package.json +5 -5
  55. package/dist/replay-FileWatcher-DEOB0_DG.js +0 -1
  56. package/dist/replay-FileWatcher-Z6eygcBI.js +0 -359
  57. package/dist/replay-TauriFileSystemAdapter-CwSMakdJ.js +0 -1
  58. package/dist/replay-TauriFileSystemAdapter-DcFBYSUW.js +0 -99
  59. package/dist/replay-TauriRootStorage-DEGEIJrz.js +0 -1
  60. package/dist/replay-index-gM6vL6iT.js +0 -4
  61. package/dist/replay-useAiChatQueries-Bypgnkwa.js +0 -215
@@ -1,15 +1,15 @@
1
- import { useContext as Bt, createContext as Yt } from "react";
2
- import { R as zt, A as ge, aH as ne, aI as Ht, aJ as Gt, aK as Vt, a1 as x, a as le, ax as Y, aL as pt, aM as Ce, aw as Ae, aN as ft, aO as de, aP as Z, c as b, aQ as Kt, ac as G, aa as V, aR as mt, aS as ue, ab as Ee, aT as Jt, aU as Qt, aV as Xt, aW as Zt, aX as eo, aY as to, aZ as oo, a4 as K, a_ as no, a5 as ee, $ as ro, a$ as so, b0 as ht, b1 as wt, b2 as ao, b3 as It, b4 as $e, b5 as Oe, a7 as J, b6 as io, a0 as yt, b7 as xe, aq as vt, b8 as co, b9 as lo, S as k, ba as Fe, bb as uo, bc as je, bd as po, be as fo, bf as mo, _ as gt, Z as bt } from "./replay-index-BCz452N6.js";
3
- import { b as C, f as kt, a as St, c as Tt, d as pe, e as Ct, i as Be, h as _e, R as z, j as ho, k as wo, p as Io, s as Ye, l as yo } from "./replay-db-BmZNrdZM.js";
4
- import { b as vo, o as go, d as bo, e as p, u as fe, f as i, h as R, j as E, n as A, k as B, m as w, q as T, r as Re, t as te, v as me, Z as H, w as ko, x as ze, c as So, s as To, y as Co } from "./replay-create-model-Be3vPVDb.js";
5
- import { g as Oo, e as He, a as Ao, b as Eo, c as Ge, d as $o, f as xo } from "./replay-SemanticSearchService-BLF1oOOu.js";
6
- import { useInfiniteQuery as _o, useQuery as Ro } from "@tanstack/react-query";
7
- const re = {
1
+ import { useContext as Ht, createContext as Gt } from "react";
2
+ import { R as Vt, A as be, aJ as re, aK as Kt, aL as Jt, aM as Qt, a4 as x, a as de, az as Y, aN as mt, aO as Oe, ay as Ee, aP as ht, aQ as ue, aR as Z, c as b, aS as Xt, af as G, ad as V, aT as It, aU as pe, ae as $e, aV as Zt, aW as eo, aX as to, aY as oo, aZ as no, a_ as ro, a$ as so, a7 as K, b0 as ao, a8 as ee, a2 as io, b1 as co, b2 as lo, b3 as wt, b4 as yt, b5 as uo, b6 as vt, b7 as xe, b8 as Ae, aa as J, b9 as po, a3 as gt, ba as _e, at as bt, bb as fo, bc as mo, S as k, bd as Be, be as ho, bf as Ye, bg as Io, bh as wo, bi as yo, a1 as kt, a0 as St } from "./replay-index-4TEahAPK.js";
3
+ import { b as C, f as Tt, a as Ct, c as Ot, d as fe, e as At, i as ze, h as Re, R as z, j as vo, k as go, p as bo, s as He, l as ko } from "./replay-db-D4-LmLRk.js";
4
+ import { b as So, o as To, d as Co, e as p, u as me, f as i, h as R, j as E, n as A, k as B, m as I, q as T, r as Pe, t as te, v as he, Z as H, w as Oo, x as Ge, c as Ao, s as Eo, y as $o } from "./replay-create-model-DPxfOEfv.js";
5
+ import { g as xo, e as Ve, a as _o, b as Ro, c as Ke, d as Po, f as qo } from "./replay-SemanticSearchService-Bh5xYa91.js";
6
+ import { useInfiniteQuery as No, useQuery as Uo } from "@tanstack/react-query";
7
+ const se = {
8
8
  path: "pathParameters",
9
9
  query: "queryParameters",
10
10
  header: "headers",
11
11
  cookie: "cookies"
12
- }, nc = {
12
+ }, lc = {
13
13
  run_request: {
14
14
  approveLabel: "Run",
15
15
  denyLabel: "Skip"
@@ -22,7 +22,7 @@ const re = {
22
22
  approveLabel: "Apply",
23
23
  denyLabel: "Dismiss"
24
24
  }
25
- }, rc = {
25
+ }, dc = {
26
26
  set_active_environment: { approveLabel: "Switch", denyLabel: "Cancel" },
27
27
  add_environment: { approveLabel: "Add", denyLabel: "Cancel" },
28
28
  upsert_input: { approveLabel: "Set", denyLabel: "Cancel" },
@@ -37,27 +37,27 @@ const re = {
37
37
  delete_workflow: { approveLabel: "Delete", denyLabel: "Cancel" },
38
38
  delete_step: { approveLabel: "Delete", denyLabel: "Cancel" },
39
39
  save_tab_to_collection: { approveLabel: "Save", denyLabel: "Cancel" }
40
- }, sc = {
40
+ }, uc = {
41
41
  CHAT: "chat",
42
42
  HISTORY: "history"
43
- }, qo = "report_status", Po = "run_workflow", oe = {
43
+ }, Do = "report_status", Wo = "run_workflow", oe = {
44
44
  WEB_SEARCH: "web_search"
45
45
  };
46
- function No(e) {
46
+ function Lo(e) {
47
47
  switch (e.provider) {
48
- case ge.GEMINI:
48
+ case be.GEMINI:
49
49
  return {
50
- [oe.WEB_SEARCH]: bo.tools.googleSearch({})
50
+ [oe.WEB_SEARCH]: Co.tools.googleSearch({})
51
51
  };
52
- case ge.OPENAI:
52
+ case be.OPENAI:
53
53
  return {
54
- [oe.WEB_SEARCH]: go.tools.webSearch({})
54
+ [oe.WEB_SEARCH]: To.tools.webSearch({})
55
55
  };
56
- case ge.ANTHROPIC:
56
+ case be.ANTHROPIC:
57
57
  return {
58
- [oe.WEB_SEARCH]: vo.tools.webFetch_20250910()
58
+ [oe.WEB_SEARCH]: So.tools.webFetch_20250910()
59
59
  };
60
- case zt:
60
+ case Vt:
61
61
  return {
62
62
  [oe.WEB_SEARCH]: {
63
63
  type: "provider",
@@ -70,13 +70,13 @@ function No(e) {
70
70
  return {};
71
71
  }
72
72
  }
73
- const Uo = ["info", "workflows", "sourceDescriptions"];
74
- function Do(e) {
73
+ const Mo = ["info", "workflows", "sourceDescriptions"];
74
+ function Fo(e) {
75
75
  const t = [];
76
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}`), C(t, `
77
77
  `);
78
78
  }
79
- function Wo(e) {
79
+ function jo(e) {
80
80
  const t = [];
81
81
  if (e.collection?.workflows?.length) {
82
82
  t.push("Workflows:");
@@ -86,7 +86,7 @@ function Wo(e) {
86
86
  return C(t, `
87
87
  `);
88
88
  }
89
- function Lo(e) {
89
+ function Bo(e) {
90
90
  const t = [];
91
91
  if (e.collection?.sourceDescriptions?.length) {
92
92
  t.push("Source descriptions:");
@@ -96,25 +96,25 @@ function Lo(e) {
96
96
  return C(t, `
97
97
  `);
98
98
  }
99
- function Mo(e, t) {
99
+ function Yo(e, t) {
100
100
  const o = ["Current tab (collection)"];
101
101
  for (const n of t)
102
102
  switch (n) {
103
103
  case "info":
104
- o.push(Do(e));
104
+ o.push(Fo(e));
105
105
  break;
106
106
  case "workflows":
107
- o.push(Wo(e));
107
+ o.push(jo(e));
108
108
  break;
109
109
  case "sourceDescriptions":
110
- o.push(Lo(e));
110
+ o.push(Bo(e));
111
111
  break;
112
112
  }
113
113
  return C(o, `
114
114
 
115
115
  `);
116
116
  }
117
- function Fo(e, t) {
117
+ function zo(e, t) {
118
118
  return C(
119
119
  [
120
120
  e.collectionId ? `Collection ID: ${e.collectionId}` : null,
@@ -125,7 +125,7 @@ function Fo(e, t) {
125
125
  `
126
126
  );
127
127
  }
128
- function jo(e, t) {
128
+ function Ho(e, t) {
129
129
  return C(
130
130
  [
131
131
  t.includes("title") ? e.title : null,
@@ -135,16 +135,16 @@ function jo(e, t) {
135
135
  t.includes("method") && e.method ? `Method: ${e.method}` : null,
136
136
  t.includes("operationId") && e.operationId ? `Operation ID: ${e.operationId}` : null,
137
137
  t.includes("requestBody") && e.requestBodySchema ? `Request body schema: ${e.requestBodySchema}` : null,
138
- t.includes("parameters") && e.parameterDetails ? `Parameter details: ${kt(e.parameterDetails)}` : null,
139
- t.includes("security") && e.relatedSecuritySchemes ? `Security schemes: ${St(e.relatedSecuritySchemes)}` : null,
138
+ t.includes("parameters") && e.parameterDetails ? `Parameter details: ${Tt(e.parameterDetails)}` : null,
139
+ t.includes("security") && e.relatedSecuritySchemes ? `Security schemes: ${Ct(e.relatedSecuritySchemes)}` : null,
140
140
  t.includes("tags") && e.tags ? `Tags: ${e.tags.join("; ")}` : null,
141
- t.includes("responses") && e.responseSchemas ? `Responses: ${Tt(e.responseSchemas)}` : null
141
+ t.includes("responses") && e.responseSchemas ? `Responses: ${Ot(e.responseSchemas)}` : null
142
142
  ],
143
143
  `
144
144
  `
145
145
  );
146
146
  }
147
- const Bo = [
147
+ const Go = [
148
148
  "info",
149
149
  "inputs",
150
150
  "parameters",
@@ -153,76 +153,76 @@ const Bo = [
153
153
  "steps",
154
154
  "wiring"
155
155
  ];
156
- function Yo(e) {
156
+ function Vo(e) {
157
157
  return !e.inputs || Object.keys(e.inputs).length === 0 ? null : `Workflow inputs (JSON Schema):
158
158
  ${JSON.stringify(e.inputs, null, 2)}`;
159
159
  }
160
- function zo(e) {
160
+ function Ko(e) {
161
161
  return e.outputs?.length ? `Workflow outputs:
162
162
  ${e.outputs.map(
163
163
  (t) => ` id=${t.id} key=${t.key} value=${t.value} active=${t.active}`
164
164
  ).join(`
165
165
  `)}` : null;
166
166
  }
167
- function Ot(e) {
167
+ function Et(e) {
168
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}` : "";
169
169
  }
170
- function Ho(e) {
170
+ function Jo(e) {
171
171
  return e.steps?.length ? `Steps:
172
- ${e.steps.map((t) => ` stepId=${t.stepId} ${Ot(t)}`).join(`
172
+ ${e.steps.map((t) => ` stepId=${t.stepId} ${Et(t)}`).join(`
173
173
  `)}` : null;
174
174
  }
175
- function Go(e) {
175
+ function Qo(e) {
176
176
  return e.steps?.length ? `Step wiring (security + outputs per step):
177
177
  ${e.steps.map((o) => {
178
- const n = [` stepId=${o.stepId}${Ot(o)}`], r = pe(o.security);
179
- r && n.push(Be(r, " "));
180
- const s = _e(o.outputs);
181
- return s && n.push(Be(s, " ")), n.join(`
178
+ const n = [` stepId=${o.stepId}${Et(o)}`], r = fe(o.security);
179
+ r && n.push(ze(r, " "));
180
+ const s = Re(o.outputs);
181
+ return s && n.push(ze(s, " ")), n.join(`
182
182
  `);
183
183
  }).join(`
184
184
  `)}` : null;
185
185
  }
186
- function Vo(e, t) {
186
+ function Xo(e, t) {
187
187
  switch (t) {
188
188
  case "inputs":
189
- return Yo(e);
189
+ return Vo(e);
190
190
  case "parameters":
191
- return Ct(e.parameters);
191
+ return At(e.parameters);
192
192
  case "security":
193
- return pe(e.security);
193
+ return fe(e.security);
194
194
  case "outputs":
195
- return zo(e);
195
+ return Ko(e);
196
196
  case "steps":
197
- return Ho(e);
197
+ return Jo(e);
198
198
  case "wiring":
199
- return Go(e);
199
+ return Qo(e);
200
200
  default:
201
201
  return null;
202
202
  }
203
203
  }
204
- function Ko(e) {
204
+ function Zo(e) {
205
205
  const t = [];
206
206
  return e.collectionId && t.push(`Collection ID: ${e.collectionId}`), e.workflowId && t.push(`Workflow ID: ${e.workflowId}`), e.workflow?.summary && t.push(`Summary: ${e.workflow.summary}`), e.workflow?.description && t.push(`Description: ${e.workflow.description}`), C(t, `
207
207
  `);
208
208
  }
209
- function Jo(e, t) {
209
+ function en(e, t) {
210
210
  const o = ["Current tab (workflow)"], n = e.workflow;
211
211
  for (const r of t) {
212
212
  if (r === "info") {
213
- o.push(Ko(e));
213
+ o.push(Zo(e));
214
214
  continue;
215
215
  }
216
216
  if (!n)
217
217
  continue;
218
- const s = Vo(n, r);
218
+ const s = Xo(n, r);
219
219
  s && o.push(s);
220
220
  }
221
221
  return C(o, `
222
222
 
223
223
  `);
224
224
  }
225
- function Qo(e, t) {
225
+ function tn(e, t) {
226
226
  return C(
227
227
  [
228
228
  e.collectionId ? `Collection ID: ${e.collectionId}` : null,
@@ -234,7 +234,7 @@ function Qo(e, t) {
234
234
  `
235
235
  );
236
236
  }
237
- const Xo = [
237
+ const on = [
238
238
  "info",
239
239
  "parameters",
240
240
  "requestBody",
@@ -243,7 +243,7 @@ const Xo = [
243
243
  "successCriteria",
244
244
  "response"
245
245
  ];
246
- function Zo(e) {
246
+ function nn(e) {
247
247
  const t = [
248
248
  `apiId: ${e.apiId}`,
249
249
  `method: ${e.method}`,
@@ -252,41 +252,41 @@ function Zo(e) {
252
252
  ];
253
253
  return `Step is connected to API (${C(t, ", ")})`;
254
254
  }
255
- function en(e) {
255
+ function rn(e) {
256
256
  const t = [`method: ${e.method}`, `url: ${e.url}`];
257
257
  return `Step is not connected to API (${C(t, ", ")})`;
258
258
  }
259
- function tn(e) {
259
+ function sn(e) {
260
260
  return e.description?.trim() ? `Description:
261
261
  ${e.description}` : null;
262
262
  }
263
- function on(e, t) {
263
+ function an(e, t) {
264
264
  switch (t) {
265
265
  case "parameters":
266
- return Ct(e.parameters) || null;
266
+ return At(e.parameters) || null;
267
267
  case "requestBody":
268
- return wo(e.requestBody) || null;
268
+ return go(e.requestBody) || null;
269
269
  case "security":
270
- return pe(e.security) || null;
270
+ return fe(e.security) || null;
271
271
  case "outputs":
272
- return _e(e.outputs) || null;
272
+ return Re(e.outputs) || null;
273
273
  case "successCriteria":
274
- return ho(e.successCriteria) || null;
274
+ return vo(e.successCriteria) || null;
275
275
  default:
276
276
  return null;
277
277
  }
278
278
  }
279
- function nn(e) {
279
+ function cn(e) {
280
280
  const t = [];
281
281
  e.collectionId && t.push(`Collection ID: ${e.collectionId}`), e.workflowId && t.push(`Workflow ID: ${e.workflowId}`), e.stepId && t.push(`Step ID: ${e.stepId}`), t.push(`Saved in collection: ${e.step ? "yes" : "no"}`);
282
282
  const o = e.draftStep ?? e.step;
283
283
  if (o) {
284
- if (t.push(tn(o)), o.operation) {
284
+ if (t.push(sn(o)), o.operation) {
285
285
  const n = o.operation;
286
- t.push(Zo(n));
286
+ t.push(nn(n));
287
287
  } else if (o.xOperation) {
288
288
  const n = o.xOperation;
289
- t.push(en(n));
289
+ t.push(rn(n));
290
290
  }
291
291
  }
292
292
  return e.response && t.push(
@@ -294,7 +294,7 @@ function nn(e) {
294
294
  ), e.requestError && t.push(`Request error: ${e.requestError}`), C(t, `
295
295
  `);
296
296
  }
297
- function rn(e) {
297
+ function ln(e) {
298
298
  if (!e.response) return null;
299
299
  const t = e.response, o = t.headers?.length ? t.headers.map((s) => ` ${s[0]}: ${s[1]}`) : [];
300
300
  let n = "";
@@ -315,26 +315,26 @@ ${C(o, `
315
315
  return C(r, `
316
316
  `);
317
317
  }
318
- function Ve(e, t) {
318
+ function Je(e, t) {
319
319
  const o = [];
320
320
  for (const n of t) {
321
- const r = on(e, n);
321
+ const r = an(e, n);
322
322
  r && o.push(r);
323
323
  }
324
324
  return o.length ? o.filter(Boolean).join(`
325
325
  `) : "";
326
326
  }
327
- function sn(e, t) {
327
+ function dn(e, t) {
328
328
  const o = ["Current tab (step)"];
329
- return t.length === 0 ? null : (t.includes("info") && o.push(nn(e)), e.draftStep ? o.push(Ve(e.draftStep, t)) : e.step && o.push(Ve(e.step, t)), t.includes("response") && o.push(rn(e)), C(o, `
329
+ return t.length === 0 ? null : (t.includes("info") && o.push(cn(e)), e.draftStep ? o.push(Je(e.draftStep, t)) : e.step && o.push(Je(e.step, t)), t.includes("response") && o.push(ln(e)), C(o, `
330
330
 
331
331
  `));
332
332
  }
333
- function an(e) {
333
+ function un(e) {
334
334
  return e?.trim() ? `Description:
335
335
  ${e}` : null;
336
336
  }
337
- function cn(e, t) {
337
+ function pn(e, t) {
338
338
  if (e.apiId && e.path && e.method) {
339
339
  const o = [
340
340
  `apiId: ${e.apiId}`,
@@ -353,75 +353,75 @@ function cn(e, t) {
353
353
  }
354
354
  return null;
355
355
  }
356
- function ln(e, t) {
356
+ function fn(e, t) {
357
357
  return C(
358
358
  [
359
359
  e.collectionId ? `Collection ID: ${e.collectionId}` : null,
360
360
  e.workflowId ? `Workflow ID: ${e.workflowId}` : null,
361
361
  e.stepId ? `Step ID: ${e.stepId}` : null,
362
- t.includes("description") ? an(e.description) : null,
363
- cn(e, t),
362
+ t.includes("description") ? un(e.description) : null,
363
+ pn(e, t),
364
364
  t.includes("requestBody") && e.requestBodySchema ? `Request body schema: ${e.requestBodySchema}` : null,
365
- t.includes("parameters") && e.parameterDetails ? `Parameter details: ${kt(e.parameterDetails)}` : null,
365
+ t.includes("parameters") && e.parameterDetails ? `Parameter details: ${Tt(e.parameterDetails)}` : null,
366
366
  t.includes("successCriteria") && e.successCriteria?.length ? `Success criteria: ${e.successCriteria.join("; ")}` : null,
367
367
  t.includes("tags") && e.tags ? `Tags: ${e.tags.join("; ")}` : null,
368
- t.includes("security") && e.relatedSecuritySchemes ? `Security schemes: ${St(e.relatedSecuritySchemes)}` : null,
369
- t.includes("responses") && e.responseSchemas ? `Responses: ${Tt(e.responseSchemas)}` : null
368
+ t.includes("security") && e.relatedSecuritySchemes ? `Security schemes: ${Ct(e.relatedSecuritySchemes)}` : null,
369
+ t.includes("responses") && e.responseSchemas ? `Responses: ${Ot(e.responseSchemas)}` : null
370
370
  ],
371
371
  `
372
372
  `
373
373
  );
374
374
  }
375
- function dn(e, t) {
376
- return e.type === "collection" ? Fo(e, t) : e.type === "workflow" ? Qo(e, t) : e.type === "step" ? ln(e, t) : jo(e, t);
375
+ function mn(e, t) {
376
+ return e.type === "collection" ? zo(e, t) : e.type === "workflow" ? tn(e, t) : e.type === "step" ? fn(e, t) : Ho(e, t);
377
377
  }
378
- function un(e, t) {
379
- return e.map((o) => dn(o, t));
378
+ function hn(e, t) {
379
+ return e.map((o) => mn(o, t));
380
380
  }
381
- const pn = ["info", "result", "severity"], fn = 500, mn = z * 2;
382
- function hn(e) {
381
+ const In = ["info", "result", "severity"], wn = 500, yn = z * 2;
382
+ function vn(e) {
383
383
  const t = [];
384
384
  return e.collectionId && t.push(`Collection ID: ${e.collectionId}`), e.workflowId && t.push(`Workflow ID: ${e.workflowId}`), e.workflow?.summary && t.push(`Summary: ${e.workflow.summary}`), e.workflow?.description && t.push(`Description: ${e.workflow.description}`), e.runDate && t.push(`Run date: ${new Date(e.runDate).toISOString()}`), C(t, `
385
385
  `);
386
386
  }
387
- function wn(e) {
387
+ function gn(e) {
388
388
  return `Severity settings:
389
389
  ${JSON.stringify(e.severitySettings, null, 2)}`;
390
390
  }
391
- function In(e, t) {
391
+ function bn(e, t) {
392
392
  return e.length > t ? `${e.slice(0, t)}…` : e;
393
393
  }
394
- function Ke(e, t, o, n = !1) {
394
+ function Qe(e, t, o, n = !1) {
395
395
  if (e == null || e === "") return "(empty)";
396
396
  const r = typeof e == "string" ? e : n ? JSON.stringify(e, null, 2) : JSON.stringify(e);
397
- return In(ne(r, t), o);
397
+ return bn(re(r, t), o);
398
398
  }
399
- function yn(e, t) {
399
+ function kn(e, t) {
400
400
  const o = e.request?.method || e["x-operation"]?.method, n = e.verboseLog ? `${e.verboseLog.host}${e.verboseLog.path}` : e.request?.url || e["x-operation"]?.url, r = e.response?.statusCode, s = [`${e.stepId}:`];
401
401
  (o || n) && s.push(
402
- [o?.toUpperCase(), n ? ne(n, t) : null].filter(Boolean).join(" "),
402
+ [o?.toUpperCase(), n ? re(n, t) : null].filter(Boolean).join(" "),
403
403
  "->"
404
- ), s.push(`status=${r ?? "n/a"}`, Gt(e) ? "passed" : "failed");
405
- const a = e.checks ? Vt(e.checks) : [];
404
+ ), s.push(`status=${r ?? "n/a"}`, Jt(e) ? "passed" : "failed");
405
+ const a = e.checks ? Qt(e.checks) : [];
406
406
  if (a.length > 0) {
407
407
  const l = a.map(
408
- (c) => c.message ? `${c.name}: ${ne(c.message, t)}` : c.name
408
+ (c) => c.message ? `${c.name}: ${re(c.message, t)}` : c.name
409
409
  );
410
410
  s.push(`(${l.join("; ")})`);
411
411
  }
412
412
  return s.join(" ");
413
413
  }
414
- function vn(e, t, o) {
415
- const { steps: n, totalSteps: r, passedSteps: s, succeeded: a, timedOut: l } = Ht(e), d = [`Run status: ${a ? "SUCCEEDED" : "FAILED"} (${s}/${r} steps passed, ${e.totalTimeMs}ms total${l ? ", global timeout reached" : ""})`];
414
+ function Sn(e, t, o) {
415
+ const { steps: n, totalSteps: r, passedSteps: s, succeeded: a, timedOut: l } = Kt(e), d = [`Run status: ${a ? "SUCCEEDED" : "FAILED"} (${s}/${r} steps passed, ${e.totalTimeMs}ms total${l ? ", global timeout reached" : ""})`];
416
416
  if (n.length > 0) {
417
417
  const u = [];
418
- let f = mn, m = 0;
418
+ let f = yn, m = 0;
419
419
  for (const { step: g } of n) {
420
- if (u.push(` ${yn(g, t)}`), f <= 0) {
420
+ if (u.push(` ${kn(g, t)}`), f <= 0) {
421
421
  m++;
422
422
  continue;
423
423
  }
424
- const v = Ke(g.response?.body, t, fn);
424
+ const v = Qe(g.response?.body, t, wn);
425
425
  f -= v.length, u.push(` body: ${v}`);
426
426
  }
427
427
  m > 0 && u.push(
@@ -434,7 +434,7 @@ ${u.join(`
434
434
  const f = n.find((m) => m.step.stepId === u);
435
435
  d.push(
436
436
  f ? `Full response body for step ${u}:
437
- ${Ke(
437
+ ${Qe(
438
438
  f.step.response?.body,
439
439
  t,
440
440
  z,
@@ -445,68 +445,68 @@ ${Ke(
445
445
  return C(d, `
446
446
  `);
447
447
  }
448
- function gn(e, t) {
448
+ function Tn(e, t) {
449
449
  const o = e.secretValues ? [...e.secretValues] : void 0;
450
450
  if (e.runStatus === "running")
451
451
  return "Run status: RUNNING - the workflow is still executing; re-read this section to get the outcome, which will be reported as SUCCEEDED or FAILED once the run finishes.";
452
452
  if (e.runStatus === "error") {
453
- const n = `Run status: FAILED - execution error: ${ne(
453
+ const n = `Run status: FAILED - execution error: ${re(
454
454
  e.runError || "unknown error",
455
455
  o
456
456
  )}`;
457
457
  return e.result ? `${n}
458
458
  (the stored result is from an earlier run and is omitted as stale)` : n;
459
459
  }
460
- return e.result ? vn(e.result, o, t?.stepIds) : "Run status: NOT STARTED - no run has executed on this tab yet.";
460
+ return e.result ? Sn(e.result, o, t?.stepIds) : "Run status: NOT STARTED - no run has executed on this tab yet.";
461
461
  }
462
- function bn(e, t, o) {
462
+ function Cn(e, t, o) {
463
463
  const n = ["Current tab (workflow run)"];
464
464
  for (const r of t)
465
465
  switch (r) {
466
466
  case "info":
467
- n.push(hn(e));
467
+ n.push(vn(e));
468
468
  break;
469
469
  case "severity":
470
- n.push(wn(e));
470
+ n.push(gn(e));
471
471
  break;
472
472
  case "result":
473
- n.push(gn(e, o));
473
+ n.push(Tn(e, o));
474
474
  break;
475
475
  }
476
476
  return C(n, `
477
477
 
478
478
  `);
479
479
  }
480
- function kn(e, t = ["info"], o) {
480
+ function On(e, t = ["info"], o) {
481
481
  if (!e)
482
482
  return null;
483
483
  switch (e.type) {
484
484
  case x.Step:
485
- return sn(e, t);
485
+ return dn(e, t);
486
486
  case x.Workflow:
487
- return Jo(e, t);
487
+ return en(e, t);
488
488
  case x.Collection:
489
- return Mo(e, t);
489
+ return Yo(e, t);
490
490
  case x.WorkflowRun:
491
- return bn(e, t, o);
491
+ return Cn(e, t, o);
492
492
  }
493
493
  }
494
- function Sn(e) {
494
+ function An(e) {
495
495
  switch (e.type) {
496
496
  case x.Collection:
497
- return Uo;
497
+ return Mo;
498
498
  case x.Workflow:
499
- return Bo;
499
+ return Go;
500
500
  case x.Step:
501
- return Xo;
501
+ return on;
502
502
  case x.WorkflowRun:
503
- return pn;
503
+ return In;
504
504
  }
505
505
  }
506
- function At(e) {
506
+ function $t(e) {
507
507
  return e.trim().replace(/\s+/g, " ").replace(/[.!?:;,…]+$/, "").toLowerCase();
508
508
  }
509
- function Tn(e, t) {
509
+ function En(e, t) {
510
510
  const o = [];
511
511
  let n = 0;
512
512
  for (const r of e ?? [])
@@ -515,7 +515,7 @@ function Tn(e, t) {
515
515
  s.type === "tool-call" && (s.toolName === t ? (n += 1, o.push(s.input)) : n = 0);
516
516
  return { priorInputs: o, consecutiveCalls: n };
517
517
  }
518
- function Cn(e, t, o) {
518
+ function $n(e, t, o) {
519
519
  const n = [];
520
520
  let r = !1;
521
521
  for (const s of e) {
@@ -524,22 +524,22 @@ function Cn(e, t, o) {
524
524
  }
525
525
  return { blocked: r, notes: n };
526
526
  }
527
- function Et(e) {
527
+ function xt(e) {
528
528
  const t = e.warn !== void 0 ? "warn" : "block", o = e.warn !== void 0 ? e.warn : e.block;
529
529
  return (n, r) => {
530
- const s = Je(e.key, n);
531
- return s === null ? null : r.priorInputs.some((l) => Je(e.key, l) === s) ? { action: t, message: o } : null;
530
+ const s = Xe(e.key, n);
531
+ return s === null ? null : r.priorInputs.some((l) => Xe(e.key, l) === s) ? { action: t, message: o } : null;
532
532
  };
533
533
  }
534
- function Je(e, t) {
534
+ function Xe(e, t) {
535
535
  try {
536
536
  return e(t);
537
537
  } catch {
538
538
  return null;
539
539
  }
540
540
  }
541
- function On(e) {
542
- const t = Qe("warn", e.warnAfter, e.warnMessage), o = Qe("block", e.blockAfter, e.blockMessage);
541
+ function xn(e) {
542
+ const t = Ze("warn", e.warnAfter, e.warnMessage), o = Ze("block", e.blockAfter, e.blockMessage);
543
543
  if (!t && !o)
544
544
  throw new Error("consecutiveCallsRule requires at least warnAfter or blockAfter");
545
545
  if (t && o && o.after <= t.after)
@@ -549,7 +549,7 @@ function On(e) {
549
549
  return o && s >= o.after ? { action: "block", message: o.message(s) } : t && s >= t.after ? { action: "warn", message: t.message(s) } : null;
550
550
  };
551
551
  }
552
- function Qe(e, t, o) {
552
+ function Ze(e, t, o) {
553
553
  if (!(t === void 0 && o === void 0)) {
554
554
  if (t === void 0 || o === void 0)
555
555
  throw new Error(`consecutiveCallsRule requires ${e}After and ${e}Message together`);
@@ -558,7 +558,7 @@ function Qe(e, t, o) {
558
558
  return { after: t, message: o };
559
559
  }
560
560
  }
561
- function An(e) {
561
+ function _n(e) {
562
562
  if (!e || typeof e.safeParse != "function")
563
563
  return;
564
564
  const t = e;
@@ -567,37 +567,37 @@ function An(e) {
567
567
  return n.success ? n.data : null;
568
568
  };
569
569
  }
570
- function En(e, t, o, n) {
570
+ function Rn(e, t, o, n) {
571
571
  return !t || t.length === 0 ? o : async (r, s) => {
572
- const a = Tn(s?.messages, e), l = {
572
+ const a = En(s?.messages, e), l = {
573
573
  consecutiveCalls: a.consecutiveCalls,
574
574
  priorInputs: n ? a.priorInputs.map(n).filter((u) => u !== null) : a.priorInputs
575
- }, c = Cn(t, r, l);
575
+ }, c = $n(t, r, l);
576
576
  if (c.blocked)
577
577
  return { isError: !1, blocked: !0, note: c.notes.join(" ") };
578
578
  const d = await o(r, s);
579
- return c.notes.length === 0 || !$n(d) ? d : {
579
+ return c.notes.length === 0 || !Pn(d) ? d : {
580
580
  ...d,
581
581
  note: [d.note, ...c.notes].filter(Boolean).join(" ")
582
582
  };
583
583
  };
584
584
  }
585
- function $n(e) {
585
+ function Pn(e) {
586
586
  return e !== null && typeof e == "object" && e.isError === !1;
587
587
  }
588
- function xn(e, t) {
588
+ function qn(e, t) {
589
589
  return {
590
590
  name: e.name,
591
591
  definition: e.definition,
592
- execute: En(
592
+ execute: Rn(
593
593
  e.name,
594
594
  e.guards,
595
595
  e.createExecutor(t),
596
- An(e.definition.inputSchema)
596
+ _n(e.definition.inputSchema)
597
597
  )
598
598
  };
599
599
  }
600
- const _n = {
600
+ const Nn = {
601
601
  messages: [],
602
602
  isStreaming: !1,
603
603
  sendMessage: async () => {
@@ -610,56 +610,56 @@ const _n = {
610
610
  },
611
611
  chatStatus: "ready",
612
612
  chatError: void 0
613
- }, Rn = Yt(
614
- _n
613
+ }, Un = Gt(
614
+ Nn
615
615
  );
616
- function ac() {
617
- return Bt(Rn);
616
+ function pc() {
617
+ return Ht(Un);
618
618
  }
619
- const qn = p({
619
+ const Dn = p({
620
620
  message: i(),
621
- details: fe().optional()
621
+ details: me().optional()
622
622
  }), qe = p({
623
623
  action: E(["add", "update", "remove"]).describe('Action to perform: "add", "update" or "remove".'),
624
624
  approved: R().default(!0)
625
625
  }), L = qe.extend({
626
626
  id: i().optional().describe("Existing item id. Required for update/remove actions.")
627
- }), Pn = qe.extend({
627
+ }), Wn = qe.extend({
628
628
  index: A().int().min(0).optional().describe("Existing item index. Required for update/remove actions.")
629
- }), Nn = p({
630
- isError: w(!1),
631
- blocked: w(!0),
629
+ }), Ln = p({
630
+ isError: I(!1),
631
+ blocked: I(!0),
632
632
  note: i(),
633
633
  data: B().optional(),
634
634
  error: B().optional()
635
635
  });
636
- function q(e) {
637
- return Re([
636
+ function P(e) {
637
+ return Pe([
638
638
  p({
639
- isError: w(!0),
640
- error: qn,
639
+ isError: I(!0),
640
+ error: Dn,
641
641
  data: B().optional(),
642
642
  blocked: B().optional()
643
643
  }),
644
644
  p({
645
- isError: w(!1),
645
+ isError: I(!1),
646
646
  data: e,
647
647
  error: B().optional(),
648
648
  note: i().optional(),
649
649
  blocked: B().optional()
650
650
  }),
651
- Nn
651
+ Ln
652
652
  ]);
653
653
  }
654
- const Un = p({
654
+ const Mn = p({
655
655
  status: E(["applied", "failed"]),
656
656
  summary: i().optional()
657
- }), Dn = p({
657
+ }), Fn = p({
658
658
  totalChanges: A().int().min(0),
659
659
  approvedChanges: A().int().min(0),
660
- applied: T(Un),
660
+ applied: T(Mn),
661
661
  resultingState: i().optional().describe("Resulting state of the mutated fields after all changes were applied.")
662
- }), $t = q(Dn), Wn = "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.", Ln = E([
662
+ }), _t = P(Fn), jn = "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.", Bn = E([
663
663
  "info",
664
664
  "workflows",
665
665
  "sourceDescriptions",
@@ -674,19 +674,19 @@ const Un = p({
674
674
  "response",
675
675
  "result",
676
676
  "severity"
677
- ]), Mn = te({
678
- sections: T(Ln).min(1).describe(
677
+ ]), Yn = te({
678
+ sections: T(Bn).min(1).describe(
679
679
  "Content blocks to include in the response. Use tab-type-specific sections from the tool description; invalid sections for the current tab are ignored."
680
680
  ),
681
681
  stepIds: T(i()).min(1).optional().describe(
682
682
  "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."
683
683
  )
684
- }), Fn = p({
684
+ }), zn = p({
685
685
  message: i()
686
- }), jn = q(Fn), Bn = {
687
- description: Wn,
688
- inputSchema: Mn,
689
- outputSchema: jn,
686
+ }), Hn = P(zn), Gn = {
687
+ description: jn,
688
+ inputSchema: Yn,
689
+ outputSchema: Hn,
690
690
  needsApproval: !1
691
691
  };
692
692
  function h(e, t) {
@@ -695,19 +695,19 @@ function h(e, t) {
695
695
  error: { message: e, details: t }
696
696
  };
697
697
  }
698
- function Yn(e, t) {
699
- const o = Sn(e), n = [], r = [];
698
+ function Vn(e, t) {
699
+ const o = An(e), n = [], r = [];
700
700
  for (const s of t)
701
701
  o.includes(s) ? n.push(s) : r.push(s);
702
702
  return { sections: n, skipped: r };
703
703
  }
704
- function zn(e) {
704
+ function Kn(e) {
705
705
  return async (t, o) => {
706
706
  const n = e();
707
707
  if (!n)
708
708
  return h("No active tab data available.");
709
- const { sections: r, skipped: s } = Yn(n, t.sections), a = r.length > 0 ? r : ["info"];
710
- let c = kn(n, a, { stepIds: t.stepIds }) ?? "Unable to build a summary for the active tab.";
709
+ const { sections: r, skipped: s } = Vn(n, t.sections), a = r.length > 0 ? r : ["info"];
710
+ let c = On(n, a, { stepIds: t.stepIds }) ?? "Unable to build a summary for the active tab.";
711
711
  return s.length > 0 && (c += `
712
712
 
713
713
  (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 !== x.WorkflowRun ? c += `
@@ -718,11 +718,11 @@ function zn(e) {
718
718
  };
719
719
  };
720
720
  }
721
- const Hn = {
721
+ const Jn = {
722
722
  name: "get_current_tab",
723
- definition: Bn,
724
- createExecutor: (e) => zn(e.getActiveTabDetailedData)
725
- }, Gn = `Read top-level metadata of a loaded OpenAPI document in the current Replay project.
723
+ definition: Gn,
724
+ createExecutor: (e) => Kn(e.getActiveTabDetailedData)
725
+ }, Qn = `Read top-level metadata of a loaded OpenAPI document in the current Replay project.
726
726
 
727
727
  **What it does**
728
728
  - Scan: omit \`field\` to list the metadata fields present in the document, each with its shape (and item count for lists/maps).
@@ -737,7 +737,7 @@ const Hn = {
737
737
 
738
738
  **Input guidance**
739
739
  - \`apiId\` is required (the loaded API's id, the same identifier the search tool uses).
740
- - Read one \`field\` at a time; use \`cursor\` only to continue a section you already started.`, Vn = te({
740
+ - Read one \`field\` at a time; use \`cursor\` only to continue a section you already started.`, Xn = te({
741
741
  apiId: i().describe(
742
742
  "ID of the loaded API document to read (the API URI, the same identifier used by the search tool)."
743
743
  ),
@@ -747,98 +747,98 @@ const Hn = {
747
747
  cursor: i().optional().describe(
748
748
  "Opaque cursor to continue a previously truncated section. Only meaningful together with `field`."
749
749
  )
750
- }), Kn = p({
750
+ }), Zn = p({
751
751
  name: i(),
752
752
  kind: E(["scalar", "object", "array"]),
753
753
  count: A().int().nonnegative().optional()
754
- }), Jn = p({
754
+ }), er = p({
755
755
  name: i(),
756
756
  hint: i()
757
- }), Qn = p({
758
- available: T(Kn),
759
- blocked: T(Jn)
760
- }), Xn = p({
757
+ }), tr = p({
758
+ available: T(Zn),
759
+ blocked: T(er)
760
+ }), or = p({
761
761
  field: i(),
762
- value: fe(),
762
+ value: me(),
763
763
  start: A().int().nonnegative().optional(),
764
764
  end: A().int().nonnegative().optional(),
765
765
  total: A().int().nonnegative().optional(),
766
766
  truncated: R(),
767
767
  nextCursor: i().nullable()
768
- }), Zn = Re([Qn, Xn]), er = q(Zn), tr = {
769
- description: Gn,
770
- inputSchema: Vn,
771
- outputSchema: er,
768
+ }), nr = Pe([tr, or]), rr = P(nr), sr = {
769
+ description: Qn,
770
+ inputSchema: Xn,
771
+ outputSchema: rr,
772
772
  needsApproval: !1
773
- }, se = {
773
+ }, ae = {
774
774
  paths: "Use the search tool to read endpoints and operations.",
775
775
  webhooks: "Use the search tool to read webhook operations.",
776
776
  components: "Use the search tool to read reusable components such as schemas and responses.",
777
777
  definitions: "Use the search tool to read reusable schemas.",
778
778
  parameters: "Use the search tool to read reusable parameters.",
779
779
  responses: "Use the search tool to read reusable responses."
780
- }, xt = ["id", "srcType", "fileDependencies"], he = [
780
+ }, Rt = ["id", "srcType", "fileDependencies"], Ie = [
781
781
  {
782
782
  name: "securitySchemes",
783
783
  sources: ["components.securitySchemes", "securityDefinitions"]
784
784
  }
785
- ], or = 10, Xe = 500;
786
- function _t(e, t) {
785
+ ], ar = 10, et = 500;
786
+ function Pt(e, t) {
787
787
  for (const o of t.sources) {
788
- const n = nr(e, o);
789
- if (rr(n)) return n;
788
+ const n = ir(e, o);
789
+ if (cr(n)) return n;
790
790
  }
791
791
  return null;
792
792
  }
793
- function nr(e, t) {
793
+ function ir(e, t) {
794
794
  return t.split(".").reduce((o, n) => Q(o) ? o[n] : void 0, e);
795
795
  }
796
- function rr(e) {
796
+ function cr(e) {
797
797
  return e == null ? !1 : Array.isArray(e) ? e.length > 0 : Q(e) ? Object.keys(e).length > 0 : !0;
798
798
  }
799
799
  function Q(e) {
800
800
  return !(e === null || typeof e != "object" || Array.isArray(e));
801
801
  }
802
- const sr = new Set(
803
- he.flatMap((e) => e.sources.map((t) => t.split(".")[0]))
802
+ const lr = new Set(
803
+ Ie.flatMap((e) => e.sources.map((t) => t.split(".")[0]))
804
804
  );
805
- function Ze(e) {
805
+ function tt(e) {
806
806
  const t = [], o = [];
807
807
  for (const [n, r] of Object.entries(e)) {
808
- if (n in se) {
809
- o.push({ name: n, hint: se[n] });
808
+ if (n in ae) {
809
+ o.push({ name: n, hint: ae[n] });
810
810
  continue;
811
811
  }
812
- xt.includes(n) || sr.has(n) || t.push(et(n, r));
812
+ Rt.includes(n) || lr.has(n) || t.push(ot(n, r));
813
813
  }
814
- for (const n of he) {
815
- const r = _t(e, n);
816
- r !== null && t.push(et(n.name, r));
814
+ for (const n of Ie) {
815
+ const r = Pt(e, n);
816
+ r !== null && t.push(ot(n.name, r));
817
817
  }
818
818
  return { available: t, blocked: o };
819
819
  }
820
- function et(e, t) {
821
- const o = { name: e, kind: ar(t) };
820
+ function ot(e, t) {
821
+ const o = { name: e, kind: dr(t) };
822
822
  return Array.isArray(t) ? o.count = t.length : Q(t) && (o.count = Object.keys(t).length), o;
823
823
  }
824
- function ar(e) {
824
+ function dr(e) {
825
825
  return Array.isArray(e) ? "array" : Q(e) ? "object" : "scalar";
826
826
  }
827
- function ir(e, t, o) {
827
+ function ur(e, t, o) {
828
828
  if (Array.isArray(t))
829
- return tt(e, t, o, (n) => n);
829
+ return nt(e, t, o, (n) => n);
830
830
  if (Q(t)) {
831
831
  const n = Object.keys(t).sort().map((r) => [r, t[r]]);
832
- return tt(e, n, o, (r) => Object.fromEntries(r));
832
+ return nt(e, n, o, (r) => Object.fromEntries(r));
833
833
  }
834
834
  return {
835
835
  field: e,
836
- value: ae(t),
836
+ value: ie(t),
837
837
  truncated: !1,
838
838
  nextCursor: null
839
839
  };
840
840
  }
841
- function cr(e, t) {
841
+ function pr(e, t) {
842
842
  if (!e) return 0;
843
843
  let o;
844
844
  try {
@@ -851,79 +851,79 @@ function cr(e, t) {
851
851
  const s = Number(o.slice(n + 1));
852
852
  return !Number.isInteger(s) || s < 0 ? null : s;
853
853
  }
854
- function tt(e, t, o, n) {
855
- const r = Math.min(Math.max(o, 0), t.length), s = Math.min(r + or, t.length), a = s < t.length;
854
+ function nt(e, t, o, n) {
855
+ const r = Math.min(Math.max(o, 0), t.length), s = Math.min(r + ar, t.length), a = s < t.length;
856
856
  return {
857
857
  field: e,
858
- value: ae(n(t.slice(r, s))),
858
+ value: ie(n(t.slice(r, s))),
859
859
  truncated: a,
860
860
  start: r,
861
861
  end: s,
862
862
  total: t.length,
863
- nextCursor: a ? lr(e, s) : null
863
+ nextCursor: a ? fr(e, s) : null
864
864
  };
865
865
  }
866
- function ae(e) {
866
+ function ie(e) {
867
867
  if (typeof e == "string")
868
- return e.length > Xe ? `${e.slice(0, Xe)}…` : e;
868
+ return e.length > et ? `${e.slice(0, et)}…` : e;
869
869
  if (Array.isArray(e))
870
- return e.map(ae);
870
+ return e.map(ie);
871
871
  if (Q(e)) {
872
872
  const t = {};
873
873
  for (const [o, n] of Object.entries(e))
874
- t[o] = ae(n);
874
+ t[o] = ie(n);
875
875
  return t;
876
876
  }
877
877
  return e;
878
878
  }
879
- function lr(e, t) {
879
+ function fr(e, t) {
880
880
  return btoa(`${e}:${t}`);
881
881
  }
882
- const dr = new Map(
883
- he.flatMap(
882
+ const mr = new Map(
883
+ Ie.flatMap(
884
884
  (e) => e.sources.map((t) => [t.split(".")[0], e.name])
885
885
  )
886
886
  );
887
- function ur(e, t, o) {
888
- const n = he.find((a) => a.name === t);
887
+ function hr(e, t, o) {
888
+ const n = Ie.find((a) => a.name === t);
889
889
  if (n) {
890
- const a = _t(e, n);
891
- return a === null ? nt(t) : ot(t, a, o);
890
+ const a = Pt(e, n);
891
+ return a === null ? st(t) : rt(t, a, o);
892
892
  }
893
- if (t in se)
893
+ if (t in ae)
894
894
  return h(
895
- `"${t}" is not available from this tool. ${se[t]}`,
895
+ `"${t}" is not available from this tool. ${ae[t]}`,
896
896
  { field: t }
897
897
  );
898
- if (xt.includes(t))
898
+ if (Rt.includes(t))
899
899
  return h(`"${t}" is not an OpenAPI metadata field.`, { field: t });
900
- const r = dr.get(t);
900
+ const r = mr.get(t);
901
901
  if (r !== void 0)
902
902
  return h(`"${t}" is not a valid field name. Use "${r}" instead.`, {
903
903
  field: t
904
904
  });
905
905
  const s = e[t];
906
- return s == null ? nt(t) : ot(t, s, o);
906
+ return s == null ? st(t) : rt(t, s, o);
907
907
  }
908
- function ot(e, t, o) {
909
- const n = cr(o, e);
908
+ function rt(e, t, o) {
909
+ const n = pr(o, e);
910
910
  return n === null ? h(
911
911
  `The provided cursor is not valid for field "${e}". Omit the cursor to start from the first page.`,
912
912
  { field: e }
913
913
  ) : {
914
914
  isError: !1,
915
- data: ir(e, t, n)
915
+ data: ur(e, t, n)
916
916
  };
917
917
  }
918
- function nt(e) {
918
+ function st(e) {
919
919
  return h(
920
920
  `"${e}" is not present in this API. Call this tool without a "field" to scan the available metadata fields.`,
921
921
  { field: e }
922
922
  );
923
923
  }
924
- function pr(e) {
924
+ function Ir(e) {
925
925
  return async (t) => {
926
- const o = e.get(le), n = o.find((s) => s.id === t.apiId);
926
+ const o = e.get(de), n = o.find((s) => s.id === t.apiId);
927
927
  if (!n)
928
928
  return h(`API "${t.apiId}" is not loaded.`, {
929
929
  availableApiIds: o.map((s) => s.id)
@@ -932,62 +932,62 @@ function pr(e) {
932
932
  return t.field == null && t.cursor !== void 0 ? h(
933
933
  "`cursor` requires `field` to be set — omit `cursor` and pass `field` to read a specific section, or omit both to scan. Returning scan results.",
934
934
  {
935
- data: Ze(r)
935
+ data: tt(r)
936
936
  }
937
- ) : t.field !== void 0 ? ur(r, t.field, t.cursor) : {
937
+ ) : t.field !== void 0 ? hr(r, t.field, t.cursor) : {
938
938
  isError: !1,
939
- data: Ze(r)
939
+ data: tt(r)
940
940
  };
941
941
  };
942
942
  }
943
- const fr = {
943
+ const wr = {
944
944
  name: "get_api_metadata",
945
- definition: tr,
946
- createExecutor: (e) => pr(e.store)
947
- }, mr = "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.", hr = p({
948
- action: w("create_collection"),
945
+ definition: sr,
946
+ createExecutor: (e) => Ir(e.store)
947
+ }, yr = "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.", vr = p({
948
+ action: I("create_collection"),
949
949
  title: i().min(1).describe("Collection display title (also used to derive the file id).")
950
- }).strict(), wr = p({
951
- action: w("delete_collection"),
950
+ }).strict(), gr = p({
951
+ action: I("delete_collection"),
952
952
  collectionId: i().min(1).describe("Target collection id.")
953
- }).strict(), Ir = p({
954
- action: w("create_workflow"),
953
+ }).strict(), br = p({
954
+ action: I("create_workflow"),
955
955
  collectionId: i().min(1).describe("Parent collection id."),
956
956
  name: i().min(1).describe("Workflow summary / display name.")
957
- }).strict(), yr = p({
958
- action: w("delete_workflow"),
957
+ }).strict(), kr = p({
958
+ action: I("delete_workflow"),
959
959
  collectionId: i().min(1),
960
960
  workflowId: i().min(1)
961
- }).strict(), vr = [
961
+ }).strict(), Sr = [
962
962
  Y.Text,
963
963
  Y.JSON,
964
964
  Y.XML
965
- ], gr = p({
965
+ ], Tr = p({
966
966
  name: i().min(1),
967
967
  in: E(["path", "query", "header", "cookie"]),
968
968
  value: i()
969
- }).strict(), br = p({
969
+ }).strict(), Cr = p({
970
970
  name: i().min(1).describe("Output name."),
971
971
  expression: i().min(1).describe("Output expression.")
972
- }).strict(), kr = p({
972
+ }).strict(), Or = p({
973
973
  condition: i().min(1),
974
974
  context: i().optional(),
975
975
  type: E(["simple", "regex", "jsonpath", "xpath"]).optional()
976
- }).strict(), Sr = p({
977
- action: w("create_step"),
976
+ }).strict(), Ar = p({
977
+ action: I("create_step"),
978
978
  collectionId: i().min(1),
979
979
  workflowId: i().min(1),
980
980
  stepName: i().min(1).optional().describe(
981
981
  '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").'
982
982
  ),
983
983
  description: i().min(1).optional().describe("Step description text (overrides default derived from stepName)."),
984
- parameters: T(gr).optional().describe("Initial request parameters (path, query, header, cookie)."),
984
+ parameters: T(Tr).optional().describe("Initial request parameters (path, query, header, cookie)."),
985
985
  body: p({
986
986
  content: i().describe("Request body content as string."),
987
- contentType: E(vr).optional().describe("Request body content type.")
987
+ contentType: E(Sr).optional().describe("Request body content type.")
988
988
  }).strict().optional().describe("Initial request body."),
989
- outputs: T(br).optional().describe("Initial step outputs (mappings for later steps)."),
990
- successCriteria: T(kr).optional().describe("Initial success criteria rows."),
989
+ outputs: T(Cr).optional().describe("Initial step outputs (mappings for later steps)."),
990
+ successCriteria: T(Or).optional().describe("Initial success criteria rows."),
991
991
  operation: p({
992
992
  apiId: i().min(1).describe("API id."),
993
993
  path: i().min(1).describe("Request path."),
@@ -1003,66 +1003,66 @@ const fr = {
1003
1003
  index: A().int().min(0).optional().describe(
1004
1004
  "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."
1005
1005
  )
1006
- }).strict(), Tr = p({
1007
- action: w("delete_step"),
1006
+ }).strict(), Er = p({
1007
+ action: I("delete_step"),
1008
1008
  collectionId: i().min(1),
1009
1009
  workflowId: i().min(1),
1010
1010
  stepId: i().min(1)
1011
- }).strict(), Cr = p({
1012
- action: w("move_step"),
1011
+ }).strict(), $r = p({
1012
+ action: I("move_step"),
1013
1013
  collectionId: i().min(1),
1014
1014
  workflowId: i().min(1),
1015
1015
  stepId: i().min(1).describe("Id of the existing step to move."),
1016
1016
  toIndex: A().int().min(0).describe(
1017
1017
  "0-based target position for the step within the same workflow. Out-of-range values clamp to the nearest valid position."
1018
1018
  )
1019
- }).strict(), Or = p({
1020
- action: w("save_tab_to_collection"),
1019
+ }).strict(), xr = p({
1020
+ action: I("save_tab_to_collection"),
1021
1021
  targetCollectionId: i().min(1),
1022
1022
  targetWorkflowId: i().min(1),
1023
1023
  newStepName: i().min(1).describe(
1024
1024
  'Step id / label for the new step, used verbatim, so pass a single camelCase token such as "updateUser".'
1025
1025
  )
1026
- }).strict(), Ar = p({
1027
- payload: me("action", [
1028
- hr,
1029
- wr,
1030
- Ir,
1031
- yr,
1032
- Sr,
1033
- Tr,
1034
- Cr,
1035
- Or
1026
+ }).strict(), _r = p({
1027
+ payload: he("action", [
1028
+ vr,
1029
+ gr,
1030
+ br,
1031
+ kr,
1032
+ Ar,
1033
+ Er,
1034
+ $r,
1035
+ xr
1036
1036
  ])
1037
1037
  }).superRefine((e, t) => {
1038
1038
  e.payload.action === "create_step" && e.payload.operation && e.payload.xOperation && t.addIssue({
1039
1039
  code: H.custom,
1040
1040
  message: "Only one of `operation` or `xOperation` may be specified."
1041
1041
  });
1042
- }), Er = p({
1042
+ }), Rr = p({
1043
1043
  summary: i(),
1044
1044
  collectionId: i().optional(),
1045
1045
  workflowId: i().optional(),
1046
1046
  stepId: i().optional()
1047
- }), $r = q(Er), xr = {
1048
- description: mr,
1049
- inputSchema: Ar,
1050
- outputSchema: $r,
1047
+ }), Pr = P(Rr), qr = {
1048
+ description: yr,
1049
+ inputSchema: _r,
1050
+ outputSchema: Pr,
1051
1051
  needsApproval: (e) => e.payload.action === "delete_collection" || e.payload.action === "delete_workflow" || e.payload.action === "delete_step" || e.payload.action === "save_tab_to_collection"
1052
1052
  };
1053
- function rt(e, t, o) {
1054
- return { ...ft(e), key: t, value: o, active: !0 };
1053
+ function at(e, t, o) {
1054
+ return { ...ht(e), key: t, value: o, active: !0 };
1055
1055
  }
1056
- function _r(e, t, o) {
1056
+ function Nr(e, t, o) {
1057
1057
  const n = /* @__PURE__ */ new Map();
1058
1058
  for (const s of o)
1059
1059
  n.set(s.name, s.value);
1060
1060
  const r = [];
1061
1061
  for (const s of e) {
1062
- if (Ae(s) && s.key && n.has(s.key)) {
1062
+ if (Ee(s) && s.key && n.has(s.key)) {
1063
1063
  const a = n.get(s.key);
1064
1064
  n.delete(s.key), r.push({
1065
- ...rt(t, s.key, a),
1065
+ ...at(t, s.key, a),
1066
1066
  id: s.id,
1067
1067
  ...s.allowReserved !== void 0 && { allowReserved: s.allowReserved }
1068
1068
  });
@@ -1071,10 +1071,10 @@ function _r(e, t, o) {
1071
1071
  r.push(s);
1072
1072
  }
1073
1073
  for (const s of o)
1074
- n.has(s.name) && (r.push(rt(t, s.name, n.get(s.name))), n.delete(s.name));
1074
+ n.has(s.name) && (r.push(at(t, s.name, n.get(s.name))), n.delete(s.name));
1075
1075
  return r;
1076
1076
  }
1077
- function Rr(e, t) {
1077
+ function Ur(e, t) {
1078
1078
  if (t.description !== void 0 && (e.description = t.description), t.body && (e.requestBody = {
1079
1079
  ...e.requestBody,
1080
1080
  content: t.body.content,
@@ -1085,12 +1085,12 @@ function Rr(e, t) {
1085
1085
  const r = o.get(n.in) ?? [];
1086
1086
  r.push(n), o.set(n.in, r);
1087
1087
  }
1088
- for (const n of Object.keys(re)) {
1088
+ for (const n of Object.keys(se)) {
1089
1089
  const r = o.get(n);
1090
1090
  if (!r?.length)
1091
1091
  continue;
1092
- const s = re[n];
1093
- e.parameters[s] = _r(
1092
+ const s = se[n];
1093
+ e.parameters[s] = Nr(
1094
1094
  e.parameters[s],
1095
1095
  n,
1096
1096
  r
@@ -1111,8 +1111,8 @@ function Rr(e, t) {
1111
1111
  }
1112
1112
  if (t.successCriteria?.length)
1113
1113
  for (const o of t.successCriteria) {
1114
- const n = pt(
1115
- o.type ?? Ce.SIMPLE
1114
+ const n = mt(
1115
+ o.type ?? Oe.SIMPLE
1116
1116
  );
1117
1117
  e.successCriteria.push({
1118
1118
  ...n,
@@ -1122,30 +1122,30 @@ function Rr(e, t) {
1122
1122
  }
1123
1123
  return e;
1124
1124
  }
1125
- function qr(e) {
1125
+ function Dr(e) {
1126
1126
  return async (t) => {
1127
1127
  switch (t.payload.action) {
1128
1128
  case "create_collection":
1129
- return Pr(t.payload, e);
1129
+ return Wr(t.payload, e);
1130
1130
  case "delete_collection":
1131
- return Nr(t.payload, e);
1131
+ return Lr(t.payload, e);
1132
1132
  case "create_workflow":
1133
- return Ur(t.payload, e);
1133
+ return Mr(t.payload, e);
1134
1134
  case "delete_workflow":
1135
- return Dr(t.payload, e);
1135
+ return Fr(t.payload, e);
1136
1136
  case "create_step":
1137
- return Wr(t.payload, e);
1137
+ return jr(t.payload, e);
1138
1138
  case "delete_step":
1139
- return Mr(t.payload, e);
1139
+ return Yr(t.payload, e);
1140
1140
  case "move_step":
1141
- return Fr(t.payload, e);
1141
+ return zr(t.payload, e);
1142
1142
  case "save_tab_to_collection":
1143
- return jr(t.payload, e);
1143
+ return Hr(t.payload, e);
1144
1144
  }
1145
1145
  };
1146
1146
  }
1147
- function Pr(e, { store: t }) {
1148
- const o = oo({
1147
+ function Wr(e, { store: t }) {
1148
+ const o = so({
1149
1149
  name: e.title.trim(),
1150
1150
  collections: t.get(b)
1151
1151
  });
@@ -1157,12 +1157,12 @@ function Pr(e, { store: t }) {
1157
1157
  }
1158
1158
  };
1159
1159
  }
1160
- function Nr(e, { store: t, handleCloseByDataId: o }) {
1160
+ function Lr(e, { store: t, handleCloseByDataId: o }) {
1161
1161
  const n = G(t.get(b), e.collectionId);
1162
1162
  if (!n)
1163
1163
  return h("Collection not found.", { collectionId: e.collectionId });
1164
1164
  const r = n.info.title;
1165
- return ie(n, o), t.set(b, (s) => to(s, e.collectionId)), {
1165
+ return ce(n, o), t.set(b, (s) => ro(s, e.collectionId)), {
1166
1166
  isError: !1,
1167
1167
  data: {
1168
1168
  summary: `Deleted collection "${r}" (${e.collectionId}).`,
@@ -1170,14 +1170,14 @@ function Nr(e, { store: t, handleCloseByDataId: o }) {
1170
1170
  }
1171
1171
  };
1172
1172
  }
1173
- function Ur(e, { store: t }) {
1173
+ function Mr(e, { store: t }) {
1174
1174
  const o = G(t.get(b), e.collectionId);
1175
1175
  if (!o)
1176
1176
  return h("Collection not found.", { collectionId: e.collectionId });
1177
- const n = Zt({ name: e.name.trim(), collection: o });
1177
+ const n = oo({ name: e.name.trim(), collection: o });
1178
1178
  return t.set(
1179
1179
  b,
1180
- (r) => eo(r, e.collectionId, (s) => ({
1180
+ (r) => no(r, e.collectionId, (s) => ({
1181
1181
  ...s,
1182
1182
  workflows: [...s.workflows, n]
1183
1183
  }))
@@ -1190,7 +1190,7 @@ function Ur(e, { store: t }) {
1190
1190
  }
1191
1191
  };
1192
1192
  }
1193
- function Dr(e, { store: t, handleCloseByDataId: o }) {
1193
+ function Fr(e, { store: t, handleCloseByDataId: o }) {
1194
1194
  const n = t.get(b);
1195
1195
  if (!G(n, e.collectionId))
1196
1196
  return h("Collection not found.", { collectionId: e.collectionId });
@@ -1198,12 +1198,12 @@ function Dr(e, { store: t, handleCloseByDataId: o }) {
1198
1198
  collectionId: e.collectionId,
1199
1199
  workflowId: e.workflowId
1200
1200
  });
1201
- return s ? (ie(s, o, {
1201
+ return s ? (ce(s, o, {
1202
1202
  collectionId: e.collectionId,
1203
1203
  workflowId: null
1204
1204
  }), t.set(
1205
1205
  b,
1206
- (a) => Xt(a, {
1206
+ (a) => to(a, {
1207
1207
  collectionId: e.collectionId,
1208
1208
  workflowId: e.workflowId
1209
1209
  })
@@ -1219,7 +1219,7 @@ function Dr(e, { store: t, handleCloseByDataId: o }) {
1219
1219
  workflowId: e.workflowId
1220
1220
  });
1221
1221
  }
1222
- async function Wr(e, { store: t, attachApiToCollection: o, convertOperationToReplayValue: n }) {
1222
+ async function jr(e, { store: t, attachApiToCollection: o, convertOperationToReplayValue: n }) {
1223
1223
  const r = t.get(b);
1224
1224
  if (!G(r, e.collectionId))
1225
1225
  return h("Collection not found.", { collectionId: e.collectionId });
@@ -1243,29 +1243,29 @@ async function Wr(e, { store: t, attachApiToCollection: o, convertOperationToRep
1243
1243
  url: e.xOperation.url
1244
1244
  } : void 0;
1245
1245
  let d;
1246
- l && (d = Qt(
1247
- t.get(le),
1246
+ l && (d = eo(
1247
+ t.get(de),
1248
1248
  l,
1249
1249
  n
1250
1250
  ), d && await o({
1251
1251
  collectionId: e.collectionId,
1252
1252
  apiId: l.apiId
1253
1253
  }));
1254
- const u = mt({
1254
+ const u = It({
1255
1255
  name: e.stepName?.trim() || "New Step",
1256
1256
  workflow: a,
1257
1257
  operation: l,
1258
1258
  xOperation: c,
1259
1259
  apiOperation: d
1260
1260
  });
1261
- Rr(u, {
1261
+ Ur(u, {
1262
1262
  description: e.description,
1263
1263
  parameters: e.parameters,
1264
1264
  body: e.body,
1265
1265
  outputs: e.outputs,
1266
1266
  successCriteria: e.successCriteria
1267
1267
  });
1268
- const f = Lr(
1268
+ const f = Br(
1269
1269
  t,
1270
1270
  { collectionId: e.collectionId, workflowId: e.workflowId },
1271
1271
  u,
@@ -1281,26 +1281,26 @@ async function Wr(e, { store: t, attachApiToCollection: o, convertOperationToRep
1281
1281
  }
1282
1282
  };
1283
1283
  }
1284
- function Rt(e, t) {
1284
+ function qt(e, t) {
1285
1285
  return Math.min(Math.max(e, 0), t);
1286
1286
  }
1287
- function Lr(e, t, o, n) {
1288
- const r = V(e.get(b), t)?.steps.length ?? 0, s = n === void 0 ? r : Rt(n, r);
1287
+ function Br(e, t, o, n) {
1288
+ const r = V(e.get(b), t)?.steps.length ?? 0, s = n === void 0 ? r : qt(n, r);
1289
1289
  return e.set(
1290
1290
  b,
1291
- (a) => ue(a, t, (l) => {
1291
+ (a) => pe(a, t, (l) => {
1292
1292
  const c = [...l.steps];
1293
1293
  return c.splice(s, 0, o), { ...l, steps: c };
1294
1294
  })
1295
1295
  ), s;
1296
1296
  }
1297
- function Mr(e, { store: t, handleCloseByDataId: o }) {
1297
+ function Yr(e, { store: t, handleCloseByDataId: o }) {
1298
1298
  const n = {
1299
1299
  collectionId: e.collectionId,
1300
1300
  workflowId: e.workflowId,
1301
1301
  stepId: e.stepId
1302
1302
  };
1303
- return Ee(t.get(b), n) ? (o(n), t.set(b, (s) => Jt(s, n)), {
1303
+ return $e(t.get(b), n) ? (o(n), t.set(b, (s) => Zt(s, n)), {
1304
1304
  isError: !1,
1305
1305
  data: {
1306
1306
  summary: `Deleted step ${e.stepId} from workflow ${e.workflowId}.`,
@@ -1314,7 +1314,7 @@ function Mr(e, { store: t, handleCloseByDataId: o }) {
1314
1314
  stepId: e.stepId
1315
1315
  });
1316
1316
  }
1317
- function Fr(e, { store: t }) {
1317
+ function zr(e, { store: t }) {
1318
1318
  const o = {
1319
1319
  collectionId: e.collectionId,
1320
1320
  workflowId: e.workflowId
@@ -1331,10 +1331,10 @@ function Fr(e, { store: t }) {
1331
1331
  workflowId: e.workflowId,
1332
1332
  stepId: e.stepId
1333
1333
  });
1334
- const a = Rt(e.toIndex, r.length - 1);
1334
+ const a = qt(e.toIndex, r.length - 1);
1335
1335
  return t.set(
1336
1336
  b,
1337
- (l) => ue(l, o, (c) => {
1337
+ (l) => pe(l, o, (c) => {
1338
1338
  const d = [...c.steps], [u] = d.splice(s, 1);
1339
1339
  return d.splice(a, 0, u), { ...c, steps: d };
1340
1340
  })
@@ -1348,15 +1348,15 @@ function Fr(e, { store: t }) {
1348
1348
  }
1349
1349
  };
1350
1350
  }
1351
- async function jr(e, { store: t, attachApiToCollection: o }) {
1352
- const n = de(t);
1351
+ async function Hr(e, { store: t, attachApiToCollection: o }) {
1352
+ const n = ue(t);
1353
1353
  if (!n)
1354
1354
  return h("No active tab.");
1355
1355
  if (!Z(n))
1356
1356
  return h("Active tab is not a step tab.", {
1357
1357
  tabType: n.data.type
1358
1358
  });
1359
- const r = t.get(b), s = Kt(r, n.data);
1359
+ const r = t.get(b), s = Xt(r, n.data);
1360
1360
  if (!s)
1361
1361
  return h("No step data available on the active tab.");
1362
1362
  if (!G(r, e.targetCollectionId))
@@ -1372,14 +1372,14 @@ async function jr(e, { store: t, attachApiToCollection: o }) {
1372
1372
  collectionId: e.targetCollectionId,
1373
1373
  workflowId: e.targetWorkflowId
1374
1374
  });
1375
- const d = mt({
1375
+ const d = It({
1376
1376
  name: e.newStepName.trim(),
1377
1377
  workflow: c,
1378
1378
  fromStep: s
1379
1379
  });
1380
1380
  return t.set(
1381
1381
  b,
1382
- (u) => ue(u, l, (f) => ({
1382
+ (u) => pe(u, l, (f) => ({
1383
1383
  ...f,
1384
1384
  steps: [...f.steps, d]
1385
1385
  }))
@@ -1396,11 +1396,11 @@ async function jr(e, { store: t, attachApiToCollection: o }) {
1396
1396
  }
1397
1397
  };
1398
1398
  }
1399
- function ie(e, t, o) {
1399
+ function ce(e, t, o) {
1400
1400
  if ("workflows" in e) {
1401
1401
  const n = e.id;
1402
1402
  e.workflows.forEach(
1403
- (r) => ie(r, t, {
1403
+ (r) => ce(r, t, {
1404
1404
  collectionId: n,
1405
1405
  workflowId: null
1406
1406
  })
@@ -1410,7 +1410,7 @@ function ie(e, t, o) {
1410
1410
  if ("steps" in e) {
1411
1411
  const n = e.workflowId;
1412
1412
  e.steps.forEach(
1413
- (r) => ie(r, t, {
1413
+ (r) => ce(r, t, {
1414
1414
  collectionId: o?.collectionId,
1415
1415
  workflowId: n
1416
1416
  })
@@ -1427,11 +1427,11 @@ function ie(e, t, o) {
1427
1427
  stepId: e.stepId
1428
1428
  });
1429
1429
  }
1430
- const Br = {
1430
+ const Gr = {
1431
1431
  name: "manage_collection",
1432
- definition: xr,
1433
- createExecutor: (e) => qr(e)
1434
- }, Yr = `Read, add, or change Replay environments (inputs and server mappings).
1432
+ definition: qr,
1433
+ createExecutor: (e) => Dr(e)
1434
+ }, Vr = `Read, add, or change Replay environments (inputs and server mappings).
1435
1435
 
1436
1436
  **What it does**
1437
1437
  - Manages Replay project environments: inputs (values and secrecy) and per-\`apiId\` server URLs/variables.
@@ -1455,77 +1455,77 @@ const Br = {
1455
1455
  **Loop/budget guidance**
1456
1456
  - Re-read environment/input data when decisions depend on up-to-date values.
1457
1457
  - Batch related input/server changes for the same environment when practical.
1458
- - After changing the active environment, re-check assumptions that depended on the previous one.`, M = i().min(1).optional().describe("Environment name. Omit to use the active environment."), zr = p({
1459
- action: w("get_environments")
1460
- }).strict(), Hr = p({
1461
- action: w("get_active_environment")
1462
- }).strict(), Gr = p({
1463
- action: w("get_inputs"),
1458
+ - After changing the active environment, re-check assumptions that depended on the previous one.`, M = i().min(1).optional().describe("Environment name. Omit to use the active environment."), Kr = p({
1459
+ action: I("get_environments")
1460
+ }).strict(), Jr = p({
1461
+ action: I("get_active_environment")
1462
+ }).strict(), Qr = p({
1463
+ action: I("get_inputs"),
1464
1464
  environment: M
1465
- }).strict(), Vr = p({
1466
- action: w("get_servers"),
1465
+ }).strict(), Xr = p({
1466
+ action: I("get_servers"),
1467
1467
  environment: M
1468
- }).strict(), Kr = p({
1469
- action: w("get_input"),
1468
+ }).strict(), Zr = p({
1469
+ action: I("get_input"),
1470
1470
  environment: M,
1471
1471
  inputName: i().min(1)
1472
- }).strict(), Jr = p({
1473
- action: w("upsert_input"),
1472
+ }).strict(), es = p({
1473
+ action: I("upsert_input"),
1474
1474
  environment: M,
1475
1475
  name: i().min(1),
1476
1476
  value: i(),
1477
1477
  isSecret: R().optional().describe(
1478
1478
  "Only when creating a new input name: whether the value is secret (default false). Ignored when the name already exists."
1479
1479
  )
1480
- }).strict(), Qr = p({
1481
- action: w("remove_input"),
1480
+ }).strict(), ts = p({
1481
+ action: I("remove_input"),
1482
1482
  environment: M,
1483
1483
  inputName: i().min(1)
1484
- }).strict(), Pe = p({
1484
+ }).strict(), Ne = p({
1485
1485
  name: i().min(1),
1486
1486
  value: i()
1487
- }).strict(), Xr = p({
1488
- action: w("upsert_server"),
1487
+ }).strict(), os = p({
1488
+ action: I("upsert_server"),
1489
1489
  environment: M,
1490
1490
  apiId: i().min(1),
1491
1491
  value: i(),
1492
- variables: T(Pe).optional()
1493
- }).strict(), Zr = p({
1492
+ variables: T(Ne).optional()
1493
+ }).strict(), ns = p({
1494
1494
  name: i().min(1),
1495
1495
  value: i(),
1496
1496
  isSecret: R().optional().describe("Defaults to false when omitted.")
1497
- }).strict(), es = p({
1497
+ }).strict(), rs = p({
1498
1498
  apiId: i().min(1),
1499
1499
  value: i(),
1500
- variables: T(Pe).optional()
1501
- }).strict(), ts = p({
1502
- action: w("add_environment"),
1500
+ variables: T(Ne).optional()
1501
+ }).strict(), ss = p({
1502
+ action: I("add_environment"),
1503
1503
  environment: i().min(1).describe("Name of a new environment to create."),
1504
- inputs: T(Zr).optional().describe("Optional initial inputs for the new environment."),
1505
- servers: T(es).optional().describe("Optional initial server mappings for the new environment."),
1504
+ inputs: T(ns).optional().describe("Optional initial inputs for the new environment."),
1505
+ servers: T(rs).optional().describe("Optional initial server mappings for the new environment."),
1506
1506
  setActive: R().optional().describe("When true, also set the new environment as active.")
1507
- }).strict(), os = p({
1508
- action: w("remove_server"),
1507
+ }).strict(), as = p({
1508
+ action: I("remove_server"),
1509
1509
  environment: M,
1510
1510
  apiId: i().min(1)
1511
- }).strict(), ns = p({
1512
- action: w("set_active_environment"),
1511
+ }).strict(), is = p({
1512
+ action: I("set_active_environment"),
1513
1513
  environment: i().min(1).describe("Name of the environment to activate.")
1514
- }).strict(), rs = p({
1515
- payload: me("action", [
1516
- zr,
1517
- ts,
1518
- Hr,
1519
- Gr,
1520
- Vr,
1514
+ }).strict(), cs = p({
1515
+ payload: he("action", [
1521
1516
  Kr,
1517
+ ss,
1522
1518
  Jr,
1523
1519
  Qr,
1524
1520
  Xr,
1521
+ Zr,
1522
+ es,
1523
+ ts,
1525
1524
  os,
1526
- ns
1525
+ as,
1526
+ is
1527
1527
  ])
1528
- }), ss = p({
1528
+ }), ls = p({
1529
1529
  summary: i(),
1530
1530
  environmentNames: T(i()).optional(),
1531
1531
  inputs: T(
@@ -1539,7 +1539,7 @@ const Br = {
1539
1539
  p({
1540
1540
  apiId: i(),
1541
1541
  value: i(),
1542
- variables: T(Pe)
1542
+ variables: T(Ne)
1543
1543
  })
1544
1544
  ).optional(),
1545
1545
  input: p({
@@ -1549,41 +1549,41 @@ const Br = {
1549
1549
  }).optional(),
1550
1550
  environment: i().optional(),
1551
1551
  apiId: i().optional()
1552
- }), as = q(ss), is = {
1553
- description: Yr,
1554
- inputSchema: rs,
1555
- outputSchema: as,
1552
+ }), ds = P(ls), us = {
1553
+ description: Vr,
1554
+ inputSchema: cs,
1555
+ outputSchema: ds,
1556
1556
  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"
1557
1557
  };
1558
- function cs(e) {
1558
+ function ps(e) {
1559
1559
  return async (t, o) => {
1560
1560
  switch (t.payload.action) {
1561
1561
  case "get_environments":
1562
- return ls(e);
1562
+ return fs(e);
1563
1563
  case "add_environment":
1564
- return ds(e, t.payload);
1564
+ return ms(e, t.payload);
1565
1565
  case "get_active_environment":
1566
- return us(e);
1566
+ return hs(e);
1567
1567
  case "set_active_environment":
1568
- return vs(e, t.payload);
1568
+ return Ss(e, t.payload);
1569
1569
  case "get_inputs":
1570
- return ps(e, t.payload);
1570
+ return Is(e, t.payload);
1571
1571
  case "get_servers":
1572
- return fs(e, t.payload);
1572
+ return ws(e, t.payload);
1573
1573
  case "get_input":
1574
- return ms(e, t.payload);
1574
+ return ys(e, t.payload);
1575
1575
  case "upsert_input":
1576
- return hs(e, t.payload);
1576
+ return vs(e, t.payload);
1577
1577
  case "remove_input":
1578
- return ws(e, t.payload);
1578
+ return gs(e, t.payload);
1579
1579
  case "upsert_server":
1580
- return Is(e, t.payload);
1580
+ return bs(e, t.payload);
1581
1581
  case "remove_server":
1582
- return ys(e, t.payload);
1582
+ return ks(e, t.payload);
1583
1583
  }
1584
1584
  };
1585
1585
  }
1586
- function ls(e) {
1586
+ function fs(e) {
1587
1587
  const t = e.get(K), o = e.get(ee).map((n) => n.name);
1588
1588
  return {
1589
1589
  isError: !1,
@@ -1593,32 +1593,34 @@ function ls(e) {
1593
1593
  }
1594
1594
  };
1595
1595
  }
1596
- function ds(e, t) {
1596
+ function ms(e, t) {
1597
1597
  if (we(e, t.environment))
1598
1598
  return h("Environment already exists.", {
1599
1599
  environment: t.environment
1600
1600
  });
1601
- const n = no(t.environment, /* @__PURE__ */ new Set());
1601
+ const n = ao(t.environment, /* @__PURE__ */ new Set());
1602
1602
  if (n)
1603
1603
  return h(n, {
1604
1604
  environment: t.environment
1605
1605
  });
1606
- const r = (t.inputs ?? []).map((a) => ({
1607
- name: a.name,
1608
- value: a.value,
1609
- isSecret: a.isSecret ?? !1
1610
- })), s = (t.servers ?? []).map((a) => ({
1611
- apiId: a.apiId,
1612
- value: a.value,
1613
- variables: a.variables ?? []
1614
- }));
1615
- return e.set(ee, (a) => [
1616
- ...a,
1606
+ const r = (t.inputs ?? []).map((l) => ({
1607
+ name: l.name,
1608
+ value: l.value,
1609
+ isSecret: l.isSecret ?? !1
1610
+ })), s = (t.servers ?? []).map((l) => ({
1611
+ apiId: l.apiId,
1612
+ value: l.value,
1613
+ variables: l.variables ?? []
1614
+ })), a = As(r, s);
1615
+ return a ? h(a, {
1616
+ environment: t.environment
1617
+ }) : (e.set(ee, (l) => [
1618
+ ...l,
1617
1619
  {
1618
1620
  name: t.environment,
1619
1621
  inputs: r,
1620
1622
  servers: s,
1621
- state: ro.Normal
1623
+ state: io.Normal
1622
1624
  }
1623
1625
  ]), t.setActive && e.set(K, t.environment), {
1624
1626
  isError: !1,
@@ -1626,9 +1628,9 @@ function ds(e, t) {
1626
1628
  summary: t.setActive ? `Added environment "${t.environment}" and set it active.` : `Added environment "${t.environment}".`,
1627
1629
  environment: t.environment
1628
1630
  }
1629
- };
1631
+ });
1630
1632
  }
1631
- function us(e) {
1633
+ function hs(e) {
1632
1634
  const t = e.get(K);
1633
1635
  return we(e, t) ? {
1634
1636
  isError: !1,
@@ -1640,11 +1642,11 @@ function us(e) {
1640
1642
  environment: t
1641
1643
  });
1642
1644
  }
1643
- function ps(e, t) {
1645
+ function Is(e, t) {
1644
1646
  const o = F(e, t.environment);
1645
1647
  if (!o.ok)
1646
1648
  return o.result;
1647
- const { name: n, env: r } = o, s = bs(r);
1649
+ const { name: n, env: r } = o, s = Cs(r);
1648
1650
  return {
1649
1651
  isError: !1,
1650
1652
  data: {
@@ -1654,11 +1656,11 @@ function ps(e, t) {
1654
1656
  }
1655
1657
  };
1656
1658
  }
1657
- function fs(e, t) {
1659
+ function ws(e, t) {
1658
1660
  const o = F(e, t.environment);
1659
1661
  if (!o.ok)
1660
1662
  return o.result;
1661
- const { name: n, env: r } = o, s = ks(r);
1663
+ const { name: n, env: r } = o, s = Os(r);
1662
1664
  return {
1663
1665
  isError: !1,
1664
1666
  data: {
@@ -1668,7 +1670,7 @@ function fs(e, t) {
1668
1670
  }
1669
1671
  };
1670
1672
  }
1671
- function ms(e, t) {
1673
+ function ys(e, t) {
1672
1674
  const o = F(e, t.environment);
1673
1675
  if (!o.ok)
1674
1676
  return o.result;
@@ -1687,36 +1689,42 @@ function ms(e, t) {
1687
1689
  input: {
1688
1690
  name: a,
1689
1691
  isSecret: l,
1690
- value: qt(l, c)
1692
+ value: Nt(l, c)
1691
1693
  }
1692
1694
  }
1693
1695
  };
1694
1696
  }
1695
- function hs(e, t) {
1697
+ function vs(e, t) {
1696
1698
  const o = F(e, t.environment);
1697
1699
  if (!o.ok)
1698
1700
  return o.result;
1699
- const { name: n, env: r } = o, s = r.inputs.find((l) => l.name === t.name), a = s ? s.isSecret : t.isSecret ?? !1;
1700
- return Ie(e, n, (l) => ({
1701
- ...l,
1701
+ const { name: n, env: r } = o, s = Ue(t.name, "Input names");
1702
+ if (s)
1703
+ return h(s, {
1704
+ environment: n,
1705
+ inputName: t.name
1706
+ });
1707
+ const a = r.inputs.find((c) => c.name === t.name), l = a ? a.isSecret : t.isSecret ?? !1;
1708
+ return ye(e, n, (c) => ({
1709
+ ...c,
1702
1710
  inputs: [
1703
- ...l.inputs.filter((c) => c.name !== t.name),
1704
- { name: t.name, value: t.value, isSecret: a }
1711
+ ...c.inputs.filter((d) => d.name !== t.name),
1712
+ { name: t.name, value: t.value, isSecret: l }
1705
1713
  ]
1706
1714
  })), {
1707
1715
  isError: !1,
1708
1716
  data: {
1709
- summary: `Upserted input "${t.name}" in "${n}" (${a ? "secret" : "plain"}).`,
1717
+ summary: `Upserted input "${t.name}" in "${n}" (${l ? "secret" : "plain"}).`,
1710
1718
  environment: n
1711
1719
  }
1712
1720
  };
1713
1721
  }
1714
- function ws(e, t) {
1722
+ function gs(e, t) {
1715
1723
  const o = F(e, t.environment);
1716
1724
  if (!o.ok)
1717
1725
  return o.result;
1718
1726
  const { name: n, env: r } = o;
1719
- return r.inputs.some((s) => s.name === t.inputName) ? (Ie(e, n, (s) => ({
1727
+ return r.inputs.some((s) => s.name === t.inputName) ? (ye(e, n, (s) => ({
1720
1728
  ...s,
1721
1729
  inputs: s.inputs.filter((a) => a.name !== t.inputName)
1722
1730
  })), {
@@ -1730,20 +1738,23 @@ function ws(e, t) {
1730
1738
  inputName: t.inputName
1731
1739
  });
1732
1740
  }
1733
- function Is(e, t) {
1741
+ function bs(e, t) {
1734
1742
  const o = F(e, t.environment);
1735
1743
  if (!o.ok)
1736
1744
  return o.result;
1737
- const { name: n } = o;
1738
- return Ie(e, n, (r) => {
1739
- const s = r.servers, a = s.findIndex((d) => d.apiId === t.apiId), l = a >= 0 && t.variables === void 0 ? s[a].variables : t.variables ?? [], c = {
1745
+ const { name: n } = o, r = Ue(t.apiId, "Server apiIds") ?? ne(
1746
+ (t.variables ?? []).map((s) => s.name),
1747
+ "Variable names"
1748
+ );
1749
+ return r ? h(r, { environment: n, apiId: t.apiId }) : (ye(e, n, (s) => {
1750
+ const a = s.servers, l = a.findIndex((u) => u.apiId === t.apiId), c = l >= 0 && t.variables === void 0 ? a[l].variables : t.variables ?? [], d = {
1740
1751
  apiId: t.apiId,
1741
1752
  value: t.value,
1742
- variables: l
1753
+ variables: c
1743
1754
  };
1744
1755
  return {
1745
- ...r,
1746
- servers: a >= 0 ? s.toSpliced(a, 1, c) : [c, ...s]
1756
+ ...s,
1757
+ servers: l >= 0 ? a.toSpliced(l, 1, d) : [d, ...a]
1747
1758
  };
1748
1759
  }), {
1749
1760
  isError: !1,
@@ -1752,14 +1763,14 @@ function Is(e, t) {
1752
1763
  environment: n,
1753
1764
  apiId: t.apiId
1754
1765
  }
1755
- };
1766
+ });
1756
1767
  }
1757
- function ys(e, t) {
1768
+ function ks(e, t) {
1758
1769
  const o = F(e, t.environment);
1759
1770
  if (!o.ok)
1760
1771
  return o.result;
1761
1772
  const { name: n, env: r } = o;
1762
- return r.servers.some((s) => s.apiId === t.apiId) ? (Ie(e, n, (s) => ({
1773
+ return r.servers.some((s) => s.apiId === t.apiId) ? (ye(e, n, (s) => ({
1763
1774
  ...s,
1764
1775
  servers: s.servers.filter((a) => a.apiId !== t.apiId)
1765
1776
  })), {
@@ -1774,7 +1785,7 @@ function ys(e, t) {
1774
1785
  apiId: t.apiId
1775
1786
  });
1776
1787
  }
1777
- function vs(e, t) {
1788
+ function Ss(e, t) {
1778
1789
  return we(e, t.environment) ? (e.set(K, t.environment), {
1779
1790
  isError: !1,
1780
1791
  data: {
@@ -1782,11 +1793,11 @@ function vs(e, t) {
1782
1793
  }
1783
1794
  }) : h("Environment not found.", { environment: t.environment });
1784
1795
  }
1785
- function gs(e, t) {
1796
+ function Ts(e, t) {
1786
1797
  return t ?? e.get(K);
1787
1798
  }
1788
1799
  function F(e, t) {
1789
- const o = gs(e, t), n = we(e, o);
1800
+ const o = Ts(e, t), n = we(e, o);
1790
1801
  return n ? { ok: !0, name: o, env: n } : {
1791
1802
  ok: !1,
1792
1803
  result: h(
@@ -1798,42 +1809,80 @@ function F(e, t) {
1798
1809
  function we(e, t) {
1799
1810
  return e.get(ee).find((o) => o.name === t);
1800
1811
  }
1801
- function Ie(e, t, o) {
1812
+ function ye(e, t, o) {
1802
1813
  e.set(
1803
1814
  ee,
1804
1815
  (n) => n.map((r) => r.name === t ? o(r) : r)
1805
1816
  );
1806
1817
  }
1807
- function bs(e) {
1818
+ function Cs(e) {
1808
1819
  return e.inputs.map((t) => ({
1809
1820
  name: t.name,
1810
1821
  isSecret: t.isSecret,
1811
- value: qt(t.isSecret, t.value)
1822
+ value: Nt(t.isSecret, t.value)
1812
1823
  }));
1813
1824
  }
1814
- function ks(e) {
1825
+ function Os(e) {
1815
1826
  return e.servers.map((t) => ({
1816
1827
  apiId: t.apiId,
1817
1828
  value: t.value,
1818
1829
  variables: t.variables.map((o) => ({ name: o.name, value: o.value }))
1819
1830
  }));
1820
1831
  }
1821
- function qt(e, t) {
1822
- return e ? so : t;
1832
+ function Nt(e, t) {
1833
+ return e ? lo : t;
1834
+ }
1835
+ function As(e, t) {
1836
+ return ne(
1837
+ e.map((o) => o.name),
1838
+ "Input names"
1839
+ ) ?? ne(
1840
+ t.map((o) => o.apiId),
1841
+ "Server apiIds"
1842
+ ) ?? Ut(
1843
+ t,
1844
+ (o) => ne(
1845
+ o.variables.map((n) => n.name),
1846
+ "Variable names",
1847
+ ` in server "${o.apiId}"`
1848
+ )
1849
+ );
1850
+ }
1851
+ function ne(e, t, o = "") {
1852
+ const n = Es(e);
1853
+ return n ? `${t}${o} must be unique; "${n}" appears more than once.` : Ut(e, (r) => Ue(r, t));
1823
1854
  }
1824
- const Ss = {
1855
+ function Ue(e, t) {
1856
+ return e.trim() ? co(e) ? `${t} cannot use the reserved key "${e}".` : null : `${t} cannot be blank.`;
1857
+ }
1858
+ function Ut(e, t) {
1859
+ for (const o of e) {
1860
+ const n = t(o);
1861
+ if (n) return n;
1862
+ }
1863
+ return null;
1864
+ }
1865
+ function Es(e) {
1866
+ const t = /* @__PURE__ */ new Set();
1867
+ for (const o of e) {
1868
+ if (t.has(o)) return o;
1869
+ t.add(o);
1870
+ }
1871
+ return null;
1872
+ }
1873
+ const $s = {
1825
1874
  name: "manage_environment",
1826
- definition: is,
1827
- createExecutor: (e) => cs(e.store)
1828
- }, Ts = ht, Cs = "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 = E([
1875
+ definition: us,
1876
+ createExecutor: (e) => ps(e.store)
1877
+ }, xs = wt, _s = "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.", Rs = E([
1829
1878
  "focus_tab",
1830
1879
  "open_operation",
1831
1880
  "open_collection",
1832
1881
  "open_workflow",
1833
1882
  "open_step",
1834
1883
  "open_new_request"
1835
- ]), As = te({
1836
- action: Os.describe(
1884
+ ]), Ps = te({
1885
+ action: Rs.describe(
1837
1886
  "Tab to open or focus; see tool description for unsaved vs collection actions."
1838
1887
  ),
1839
1888
  tabIndex: A().optional().describe("focus_tab only: zero-based index of an already open tab."),
@@ -1846,7 +1895,7 @@ const Ss = {
1846
1895
  requestUrl: i().optional().describe(
1847
1896
  "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."
1848
1897
  ),
1849
- requestMethod: E(Ts).optional().describe("open_new_request with requestUrl: HTTP method; defaults to GET if omitted.")
1898
+ requestMethod: E(xs).optional().describe("open_new_request with requestUrl: HTTP method; defaults to GET if omitted.")
1850
1899
  }).superRefine((e, t) => {
1851
1900
  const n = (e.requestUrl?.trim() ?? "").length > 0, r = e.requestMethod !== void 0;
1852
1901
  (n || r) && e.action !== "open_new_request" && t.addIssue({
@@ -1858,18 +1907,18 @@ const Ss = {
1858
1907
  message: "requestMethod requires a non-empty requestUrl.",
1859
1908
  path: ["requestMethod"]
1860
1909
  });
1861
- }), Es = p({
1910
+ }), qs = p({
1862
1911
  outcome: E(["focused", "opened"]),
1863
1912
  activeTabIndex: A().int().nonnegative(),
1864
1913
  tabId: i(),
1865
- tabType: ko(x)
1866
- }), $s = q(Es), xs = {
1867
- description: Cs,
1868
- inputSchema: As,
1869
- outputSchema: $s,
1914
+ tabType: Oo(x)
1915
+ }), Ns = P(qs), Us = {
1916
+ description: _s,
1917
+ inputSchema: Ps,
1918
+ outputSchema: Ns,
1870
1919
  needsApproval: !1
1871
1920
  };
1872
- function ye({
1921
+ function ve({
1873
1922
  items: e,
1874
1923
  id: t,
1875
1924
  messages: o,
@@ -1886,8 +1935,8 @@ function ye({
1886
1935
  details: { matches: l.map(r) }
1887
1936
  } : { ok: !1, message: o.notFound, details: s(a) };
1888
1937
  }
1889
- function Pt(e, t) {
1890
- const o = ye({
1938
+ function Dt(e, t) {
1939
+ const o = ve({
1891
1940
  items: e,
1892
1941
  id: t,
1893
1942
  messages: {
@@ -1909,10 +1958,10 @@ function Pt(e, t) {
1909
1958
  value: { collectionId: n.id, collection: n }
1910
1959
  };
1911
1960
  }
1912
- function Ne(e, t, o) {
1913
- const n = Pt(e, t);
1961
+ function De(e, t, o) {
1962
+ const n = Dt(e, t);
1914
1963
  if (!n.ok) return n;
1915
- const r = ye({
1964
+ const r = ve({
1916
1965
  items: n.value.collection.workflows,
1917
1966
  id: o,
1918
1967
  messages: {
@@ -1941,10 +1990,10 @@ function Ne(e, t, o) {
1941
1990
  }
1942
1991
  };
1943
1992
  }
1944
- function Nt(e, t, o, n) {
1945
- const r = Ne(e, t, o);
1993
+ function Wt(e, t, o, n) {
1994
+ const r = De(e, t, o);
1946
1995
  if (!r.ok) return r;
1947
- const s = ye({
1996
+ const s = ve({
1948
1997
  items: r.value.workflow.steps,
1949
1998
  id: n,
1950
1999
  messages: {
@@ -1975,8 +2024,8 @@ function Nt(e, t, o, n) {
1975
2024
  }
1976
2025
  };
1977
2026
  }
1978
- function _s(e, t) {
1979
- const o = ao(e).filter(
2027
+ function Ds(e, t) {
2028
+ const o = uo(e).filter(
1980
2029
  (r) => r.operationId != null && r.operationId !== ""
1981
2030
  );
1982
2031
  if (!o.length)
@@ -1984,7 +2033,7 @@ function _s(e, t) {
1984
2033
  ok: !1,
1985
2034
  message: "No operations with operationId in loaded APIs."
1986
2035
  };
1987
- const n = ye({
2036
+ const n = ve({
1988
2037
  items: o,
1989
2038
  id: t,
1990
2039
  messages: {
@@ -2002,7 +2051,7 @@ function _s(e, t) {
2002
2051
  });
2003
2052
  return n.ok ? { ok: !0, value: n.value } : n;
2004
2053
  }
2005
- function Rs(e, t, o, n, r) {
2054
+ function Ws(e, t, o, n, r) {
2006
2055
  o = o.trim(), n = n.trim(), r = r.trim();
2007
2056
  const s = !o && !n && !r, a = !!(o && n && r);
2008
2057
  if (!s && !a)
@@ -2011,7 +2060,7 @@ function Rs(e, t, o, n, r) {
2011
2060
  message: "Provide all three ids for a saved step, or three empty strings for the focused unsaved request tab."
2012
2061
  };
2013
2062
  if (a) {
2014
- const f = Nt(e, o, n, r);
2063
+ const f = Wt(e, o, n, r);
2015
2064
  return f.ok ? {
2016
2065
  ok: !0,
2017
2066
  value: {
@@ -2031,7 +2080,7 @@ function Rs(e, t, o, n, r) {
2031
2080
  workflowId: c,
2032
2081
  stepId: d
2033
2082
  } = t.data;
2034
- if (!wt(l, c, d, "", "", ""))
2083
+ if (!yt(l, c, d, "", "", ""))
2035
2084
  return {
2036
2085
  ok: !1,
2037
2086
  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.",
@@ -2042,10 +2091,10 @@ function Rs(e, t, o, n, r) {
2042
2091
  const u = t.data.draftStep;
2043
2092
  return u ? { ok: !0, value: { step: u, source: { kind: "draft" } } } : { ok: !1, message: "No draft step on the active tab." };
2044
2093
  }
2045
- function Ut(e, t, o, n) {
2046
- const r = Rs(
2094
+ function Lt(e, t, o, n) {
2095
+ const r = Ws(
2047
2096
  e.get(b),
2048
- de(e) ?? null,
2097
+ ue(e) ?? null,
2049
2098
  t,
2050
2099
  o,
2051
2100
  n
@@ -2058,29 +2107,29 @@ function Ut(e, t, o, n) {
2058
2107
  ok: !0,
2059
2108
  value: {
2060
2109
  step: s,
2061
- readStep: () => Ee(e.get(b), c) ?? s,
2062
- updateStep: (d) => e.set(b, (u) => It(u, c, d))
2110
+ readStep: () => $e(e.get(b), c) ?? s,
2111
+ updateStep: (d) => e.set(b, (u) => vt(u, c, d))
2063
2112
  }
2064
2113
  };
2065
2114
  }
2066
- const l = $e(e);
2115
+ const l = xe(e);
2067
2116
  return {
2068
2117
  ok: !0,
2069
2118
  value: {
2070
2119
  step: s,
2071
- readStep: () => qs(e, l) ?? s,
2072
- updateStep: (c) => Oe(e, l, (d) => ({
2120
+ readStep: () => Ls(e, l) ?? s,
2121
+ updateStep: (c) => Ae(e, l, (d) => ({
2073
2122
  ...d,
2074
2123
  draftStep: d.draftStep ? c(d.draftStep) : d.draftStep
2075
2124
  }))
2076
2125
  }
2077
2126
  };
2078
2127
  }
2079
- function qs(e, t) {
2128
+ function Ls(e, t) {
2080
2129
  const o = e.get(J)[t];
2081
2130
  return o && Z(o) ? o.data.draftStep : null;
2082
2131
  }
2083
- function Ps(e) {
2132
+ function Ms(e) {
2084
2133
  return {
2085
2134
  apiId: e.apiId,
2086
2135
  path: e.path,
@@ -2089,24 +2138,24 @@ function Ps(e) {
2089
2138
  isAdditionalOperation: e.isAdditionalOperation
2090
2139
  };
2091
2140
  }
2092
- function Ns(e, t) {
2141
+ function Fs(e, t) {
2093
2142
  if (t.focusOperationTab(e))
2094
2143
  return "focused";
2095
- const o = t.getApiOperation(e), n = io(e, o);
2096
- return t.addNewTab({ ...n, state: yt.Normal }), "opened";
2144
+ const o = t.getApiOperation(e), n = po(e, o);
2145
+ return t.addNewTab({ ...n, state: gt.Normal }), "opened";
2097
2146
  }
2098
- function Us(e, t) {
2147
+ function js(e, t) {
2099
2148
  return (o, n) => {
2100
2149
  try {
2101
2150
  switch (o.action) {
2102
2151
  case "focus_tab":
2103
- return Ds(e, t, o.tabIndex);
2152
+ return Bs(e, t, o.tabIndex);
2104
2153
  case "open_operation":
2105
- return Ws(e, t, o.operationId);
2154
+ return Ys(e, t, o.operationId);
2106
2155
  case "open_collection":
2107
- return Ls(e, e.get(b), t, o.collectionId);
2156
+ return zs(e, e.get(b), t, o.collectionId);
2108
2157
  case "open_workflow":
2109
- return Ms(
2158
+ return Hs(
2110
2159
  e,
2111
2160
  e.get(b),
2112
2161
  t,
@@ -2114,7 +2163,7 @@ function Us(e, t) {
2114
2163
  o.workflowId
2115
2164
  );
2116
2165
  case "open_step":
2117
- return Fs(
2166
+ return Gs(
2118
2167
  e,
2119
2168
  e.get(b),
2120
2169
  t,
@@ -2123,7 +2172,7 @@ function Us(e, t) {
2123
2172
  o.stepId
2124
2173
  );
2125
2174
  case "open_new_request":
2126
- return js(e, t, o.requestUrl, o.requestMethod);
2175
+ return Vs(e, t, o.requestUrl, o.requestMethod);
2127
2176
  default: {
2128
2177
  const r = o.action;
2129
2178
  return $("Unsupported open_tab action.", { action: r });
@@ -2136,7 +2185,7 @@ function Us(e, t) {
2136
2185
  }
2137
2186
  };
2138
2187
  }
2139
- function Ds(e, t, o) {
2188
+ function Bs(e, t, o) {
2140
2189
  if (o === void 0)
2141
2190
  return $("tabIndex is required when action is focus_tab");
2142
2191
  const n = e.get(J);
@@ -2145,55 +2194,55 @@ function Ds(e, t, o) {
2145
2194
  tabCount: n.length
2146
2195
  }) : (t.handleTabChange(o), X(e, "focused"));
2147
2196
  }
2148
- function Ws(e, t, o) {
2197
+ function Ys(e, t, o) {
2149
2198
  const n = o?.trim();
2150
2199
  if (!n)
2151
2200
  return $("operationId is required when action is open_operation");
2152
- const r = _s(e.get(le), n);
2201
+ const r = Ds(e.get(de), n);
2153
2202
  if (!r.ok)
2154
2203
  return $(r.message, r.details);
2155
- const s = Ns(
2156
- Ps(r.value),
2204
+ const s = Fs(
2205
+ Ms(r.value),
2157
2206
  t
2158
2207
  );
2159
2208
  return X(e, s);
2160
2209
  }
2161
- function Ls(e, t, o, n) {
2210
+ function zs(e, t, o, n) {
2162
2211
  const r = n?.trim();
2163
2212
  if (!r)
2164
2213
  return $("collectionId is required when action is open_collection");
2165
- const s = Pt(t, r);
2214
+ const s = Dt(t, r);
2166
2215
  if (!s.ok)
2167
2216
  return $(s.message, s.details);
2168
2217
  const { collectionId: a } = s.value, l = e.get(J).findIndex((c) => {
2169
2218
  const d = c.data;
2170
- return xe(d, x.Collection) && d.collectionId === a;
2219
+ return _e(d, x.Collection) && d.collectionId === a;
2171
2220
  }) !== -1;
2172
2221
  return o.openCollectionTab({
2173
2222
  collectionId: a,
2174
- activeTabName: vt.COLLECTION_SETTINGS
2223
+ activeTabName: bt.COLLECTION_SETTINGS
2175
2224
  }), X(e, l ? "focused" : "opened");
2176
2225
  }
2177
- function Ms(e, t, o, n, r) {
2226
+ function Hs(e, t, o, n, r) {
2178
2227
  const s = n?.trim(), a = r?.trim();
2179
2228
  if (!s)
2180
2229
  return $("collectionId is required when action is open_workflow");
2181
2230
  if (!a)
2182
2231
  return $("workflowId is required when action is open_workflow");
2183
- const l = Ne(t, s, a);
2232
+ const l = De(t, s, a);
2184
2233
  if (!l.ok)
2185
2234
  return $(l.message, l.details);
2186
2235
  const { collectionId: c, workflowId: d } = l.value, u = e.get(J).findIndex((f) => {
2187
2236
  const m = f.data;
2188
- return xe(m, x.Workflow) && m.workflowId === d && m.collectionId === c;
2237
+ return _e(m, x.Workflow) && m.workflowId === d && m.collectionId === c;
2189
2238
  }) !== -1;
2190
2239
  return o.openWorkflowTab({
2191
2240
  collectionId: c,
2192
2241
  workflowId: d,
2193
- activeTabName: vt.WORKFLOW_SETTINGS
2242
+ activeTabName: bt.WORKFLOW_SETTINGS
2194
2243
  }), X(e, u ? "focused" : "opened");
2195
2244
  }
2196
- function Fs(e, t, o, n, r, s) {
2245
+ function Gs(e, t, o, n, r, s) {
2197
2246
  const a = n?.trim(), l = r?.trim(), c = s?.trim();
2198
2247
  if (!a)
2199
2248
  return $("collectionId is required when action is open_step");
@@ -2201,7 +2250,7 @@ function Fs(e, t, o, n, r, s) {
2201
2250
  return $("workflowId is required when action is open_step");
2202
2251
  if (!c)
2203
2252
  return $("stepId is required when action is open_step");
2204
- const d = Nt(
2253
+ const d = Wt(
2205
2254
  t,
2206
2255
  a,
2207
2256
  l,
@@ -2213,23 +2262,23 @@ function Fs(e, t, o, n, r, s) {
2213
2262
  collectionId: u,
2214
2263
  workflowId: f,
2215
2264
  stepId: m
2216
- } = d.value, g = e.get(J).find(({ data: v }) => xe(v, x.Step) && v.collectionId === u && v.workflowId === f && v.stepId === m && v.historyId === null) !== void 0;
2265
+ } = d.value, g = e.get(J).find(({ data: v }) => _e(v, x.Step) && v.collectionId === u && v.workflowId === f && v.stepId === m && v.historyId === null) !== void 0;
2217
2266
  return o.openStepTabFromCollection({
2218
2267
  collectionId: u,
2219
2268
  workflowId: f,
2220
2269
  stepId: m,
2221
- state: yt.Normal
2270
+ state: gt.Normal
2222
2271
  }), X(e, g ? "focused" : "opened");
2223
2272
  }
2224
- function js(e, t, o, n) {
2273
+ function Vs(e, t, o, n) {
2225
2274
  return o ? t.openStepTabFromXOperation({
2226
2275
  method: n ?? "GET",
2227
2276
  url: o
2228
2277
  }) : t.handleNewTabOpen(), X(e, "opened");
2229
2278
  }
2230
2279
  function X(e, t) {
2231
- const o = $e(e), n = de(e);
2232
- return n ? Bs(t, o, n.id, n.data.type) : $("No active tab after navigation.", { activeTabIndex: o });
2280
+ const o = xe(e), n = ue(e);
2281
+ return n ? Ks(t, o, n.id, n.data.type) : $("No active tab after navigation.", { activeTabIndex: o });
2233
2282
  }
2234
2283
  function $(e, t) {
2235
2284
  return {
@@ -2237,61 +2286,61 @@ function $(e, t) {
2237
2286
  error: { message: e, ...t !== void 0 ? { details: t } : {} }
2238
2287
  };
2239
2288
  }
2240
- function Bs(e, t, o, n) {
2289
+ function Ks(e, t, o, n) {
2241
2290
  return { isError: !1, data: { outcome: e, activeTabIndex: t, tabId: o, tabType: n } };
2242
2291
  }
2243
- const Ys = {
2292
+ const Js = {
2244
2293
  name: "open_tab",
2245
- definition: xs,
2246
- createExecutor: (e) => Us(e.store, e.context)
2247
- }, zs = `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.
2294
+ definition: Us,
2295
+ createExecutor: (e) => js(e.store, e.context)
2296
+ }, Qs = `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.
2248
2297
 
2249
2298
  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.
2250
2299
 
2251
2300
  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.
2252
2301
 
2253
- 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.`, Hs = te({
2302
+ 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.`, Xs = te({
2254
2303
  message: i().trim().min(1).max(220).regex(/^[^\r\n]+$/, "must be a single line").describe(
2255
2304
  "Short status line for a milestone (plan start, phase boundary, new debug attempt, pivot). Plain text, no markdown. Do not narrate every tool call."
2256
2305
  )
2257
- }), Gs = p({
2258
- acknowledged: w(!0)
2259
- }), Vs = q(Gs), Ks = {
2260
- description: zs,
2261
- inputSchema: Hs,
2262
- outputSchema: Vs,
2306
+ }), Zs = p({
2307
+ acknowledged: I(!0)
2308
+ }), ea = P(Zs), ta = {
2309
+ description: Qs,
2310
+ inputSchema: Xs,
2311
+ outputSchema: ea,
2263
2312
  needsApproval: !1
2264
2313
  };
2265
- function Js() {
2314
+ function oa() {
2266
2315
  return async () => ({
2267
2316
  isError: !1,
2268
2317
  data: { acknowledged: !0 }
2269
2318
  });
2270
2319
  }
2271
- const Qs = "Duplicate of a previous status - it adds nothing for the user. Do not repeat statuses; take a concrete action instead.";
2272
- function Xs(e) {
2320
+ const na = "Duplicate of a previous status - it adds nothing for the user. Do not repeat statuses; take a concrete action instead.";
2321
+ function ra(e) {
2273
2322
  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.`;
2274
2323
  }
2275
- function Zs(e) {
2324
+ function sa(e) {
2276
2325
  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.`;
2277
2326
  }
2278
- const ea = [
2279
- Et({
2280
- key: (e) => At(e.message),
2281
- warn: Qs
2327
+ const aa = [
2328
+ xt({
2329
+ key: (e) => $t(e.message),
2330
+ warn: na
2282
2331
  }),
2283
- On({
2332
+ xn({
2284
2333
  warnAfter: 2,
2285
- warnMessage: Xs,
2334
+ warnMessage: ra,
2286
2335
  blockAfter: 4,
2287
- blockMessage: Zs
2336
+ blockMessage: sa
2288
2337
  })
2289
- ], ta = {
2338
+ ], ia = {
2290
2339
  name: "report_status",
2291
- definition: Ks,
2292
- guards: ea,
2293
- createExecutor: (e) => Js()
2294
- }, oa = `Send the HTTP request for the **currently focused** Replay step tab and return the live response.
2340
+ definition: ta,
2341
+ guards: aa,
2342
+ createExecutor: (e) => oa()
2343
+ }, ca = `Send the HTTP request for the **currently focused** Replay step tab and return the live response.
2295
2344
 
2296
2345
  **What it does**
2297
2346
  - Executes the request from the active step context (saved step or focused draft step).
@@ -2320,7 +2369,7 @@ const ea = [
2320
2369
  - Execute when you need new runtime evidence, not by default after every edit.
2321
2370
  - Re-run after meaningful request/config changes or when validating a fix/hypothesis.
2322
2371
  - Avoid rapid duplicate runs with unchanged inputs when prior output already answers the question.
2323
- - For endpoint exploration, treat one run per endpoint as default budget unless inputs changed or rerun is explicitly needed.`, na = p({
2372
+ - For endpoint exploration, treat one run per endpoint as default budget unless inputs changed or rerun is explicitly needed.`, la = p({
2324
2373
  collectionId: i().describe(
2325
2374
  "Saved step: collection id. Unsaved draft tab on focus: empty string (with empty workflowId and stepId)."
2326
2375
  ),
@@ -2337,23 +2386,23 @@ const ea = [
2337
2386
  message: "Provide all three ids for a saved step, or three empty strings for the focused unsaved request tab.",
2338
2387
  path: ["collectionId"]
2339
2388
  });
2340
- }), ra = p({
2389
+ }), da = p({
2341
2390
  status: A().optional().describe("HTTP status code."),
2342
- headers: T(ze([i(), i()])).optional().describe("Response headers as key-value pairs."),
2343
- cookies: T(ze([i(), i()])).optional().describe("Response cookies as key-value pairs."),
2391
+ headers: T(Ge([i(), i()])).optional().describe("Response headers as key-value pairs."),
2392
+ cookies: T(Ge([i(), i()])).optional().describe("Response cookies as key-value pairs."),
2344
2393
  body: i().optional().describe("Response body, truncated if too large."),
2345
2394
  url: i().optional().describe("Final response URL."),
2346
2395
  duration: A().optional().describe("Request duration in milliseconds."),
2347
2396
  size: A().optional().describe("Response size in bytes.")
2348
- }), sa = q(ra), aa = {
2349
- description: oa,
2350
- inputSchema: na,
2351
- outputSchema: sa,
2397
+ }), ua = P(da), pa = {
2398
+ description: ca,
2399
+ inputSchema: la,
2400
+ outputSchema: ua,
2352
2401
  needsApproval: () => !0
2353
2402
  };
2354
- function ia(e, t) {
2403
+ function fa(e, t) {
2355
2404
  return async (n, r) => {
2356
- const s = $e(t), a = de(t);
2405
+ const s = xe(t), a = ue(t);
2357
2406
  if (!a || !Z(a))
2358
2407
  return h("Active tab is not a step tab", {
2359
2408
  tabType: a?.data?.type
@@ -2363,7 +2412,7 @@ function ia(e, t) {
2363
2412
  workflowId: c,
2364
2413
  stepId: d
2365
2414
  } = a.data, u = n.collectionId.trim(), f = n.workflowId.trim(), m = n.stepId.trim();
2366
- if (!wt(
2415
+ if (!yt(
2367
2416
  l,
2368
2417
  c,
2369
2418
  d,
@@ -2382,78 +2431,78 @@ function ia(e, t) {
2382
2431
  hint: l === null && c === null && d === null ? "Focused tab is an unsaved request; pass empty strings for collectionId, workflowId, and stepId." : void 0
2383
2432
  }
2384
2433
  );
2385
- const v = t.get(b), I = {
2434
+ const v = t.get(b), w = {
2386
2435
  collectionId: u || null,
2387
2436
  workflowId: f || null,
2388
2437
  stepId: m || null
2389
- }, O = Ee(v, I), S = a.data.draftStep;
2390
- let P;
2438
+ }, O = $e(v, w), S = a.data.draftStep;
2439
+ let q;
2391
2440
  if (O)
2392
- P = {
2441
+ q = {
2393
2442
  step: O,
2394
2443
  onStepChange: ((W) => t.set(
2395
2444
  b,
2396
- (U) => It(U, I, W)
2445
+ (U) => vt(U, w, W)
2397
2446
  ))
2398
2447
  };
2399
2448
  else if (S)
2400
- P = {
2449
+ q = {
2401
2450
  step: S,
2402
- onStepChange: ((W) => Oe(t, s, (U) => ({
2451
+ onStepChange: ((W) => Ae(t, s, (U) => ({
2403
2452
  ...U,
2404
2453
  draftStep: U.draftStep ? W(U.draftStep) : U.draftStep
2405
2454
  })))
2406
2455
  };
2407
2456
  else
2408
2457
  return h("No step available for the active tab.");
2409
- const ve = V(v, I);
2410
- await co(
2458
+ const ge = V(v, w);
2459
+ await fo(
2411
2460
  {
2412
2461
  tabId: a.id,
2413
- updateData: (W) => Oe(t, s, W)
2462
+ updateData: (W) => Ae(t, s, W)
2414
2463
  },
2415
2464
  {
2416
- ...P,
2417
- workflow: ve,
2418
- onWorkflowChange: (W) => t.set(b, (U) => ue(U, I, W)),
2419
- collection: G(v, I.collectionId),
2465
+ ...q,
2466
+ workflow: ge,
2467
+ onWorkflowChange: (W) => t.set(b, (U) => pe(U, w, W)),
2468
+ collection: G(v, w.collectionId),
2420
2469
  collections: v
2421
2470
  },
2422
2471
  e,
2423
- lo(t.get(ee), t.get(K))
2472
+ mo(t.get(ee), t.get(K))
2424
2473
  );
2425
- const N = t.get(J)[s], Me = N && Z(N) ? N.data.response : null;
2426
- return Me ? {
2474
+ const N = t.get(J)[s], je = N && Z(N) ? N.data.response : null;
2475
+ return je ? {
2427
2476
  isError: !1,
2428
- data: ca(Me)
2477
+ data: ma(je)
2429
2478
  } : h("Request did not produce a response.");
2430
2479
  };
2431
2480
  }
2432
- function ca(e) {
2481
+ function ma(e) {
2433
2482
  return {
2434
2483
  status: e.status,
2435
- headers: st(e.headers),
2436
- cookies: st(e.cookies),
2437
- body: la(e.body ?? ""),
2484
+ headers: it(e.headers),
2485
+ cookies: it(e.cookies),
2486
+ body: ha(e.body ?? ""),
2438
2487
  url: e.url ?? "",
2439
2488
  duration: e.duration,
2440
2489
  size: e.size
2441
2490
  };
2442
2491
  }
2443
- function st(e) {
2492
+ function it(e) {
2444
2493
  const t = [];
2445
2494
  for (const o of e)
2446
2495
  t.push([String(o[0]), String(o[1])]);
2447
2496
  return t;
2448
2497
  }
2449
- function la(e) {
2498
+ function ha(e) {
2450
2499
  return e.length <= z ? e : `${e.slice(0, z)}… (truncated, total ${e.length} chars)`;
2451
2500
  }
2452
- const da = {
2501
+ const Ia = {
2453
2502
  name: "run_request",
2454
- definition: aa,
2455
- createExecutor: (e) => ia(e.settings, e.store)
2456
- }, ua = `Run an Arazzo workflow and return its result.
2503
+ definition: pa,
2504
+ createExecutor: (e) => fa(e.settings, e.store)
2505
+ }, wa = `Run an Arazzo workflow and return its result.
2457
2506
 
2458
2507
  **What it does**
2459
2508
  - Executes the whole workflow (all steps, with cross-step \`$steps.*\` resolution) and waits for it to finish.
@@ -2476,14 +2525,14 @@ const da = {
2476
2525
  **After the run**
2477
2526
  - Report the outcome from this tool's result; do not re-read it with other tools.
2478
2527
  - 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.
2479
- - Each call starts a NEW run. Call it again only when the user wants another run.`, pa = te({
2528
+ - Each call starts a NEW run. Call it again only when the user wants another run.`, ya = te({
2480
2529
  collectionId: i().describe("Id of the collection that holds the workflow."),
2481
2530
  workflowId: i().describe("Id of the workflow to run.")
2482
- }), fa = p({
2531
+ }), va = p({
2483
2532
  stepId: i(),
2484
2533
  statusCode: A().int().nullable(),
2485
2534
  passed: R()
2486
- }), ma = p({
2535
+ }), ga = p({
2487
2536
  collectionId: i().describe("Resolved id of the collection that was run."),
2488
2537
  workflowId: i().describe("Resolved id of the workflow that was run."),
2489
2538
  historyId: i().nullable().describe(
@@ -2498,23 +2547,23 @@ const da = {
2498
2547
  durationMs: A().describe("Total run time in milliseconds."),
2499
2548
  totalSteps: A().int().nonnegative(),
2500
2549
  passedSteps: A().int().nonnegative(),
2501
- steps: T(fa).describe(
2550
+ steps: T(va).describe(
2502
2551
  "Per-step outcome, in execution order: stepId, HTTP statusCode, and pass/fail only — no check name or failure message."
2503
2552
  )
2504
- }), ha = q(ma), wa = {
2505
- description: ua,
2506
- inputSchema: pa,
2507
- outputSchema: ha,
2553
+ }), ba = P(ga), ka = {
2554
+ description: wa,
2555
+ inputSchema: ya,
2556
+ outputSchema: ba,
2508
2557
  needsApproval: !1
2509
2558
  };
2510
- function Ia(e, t) {
2559
+ function Sa(e, t) {
2511
2560
  return async (o, n) => {
2512
2561
  const r = o.collectionId.trim(), s = o.workflowId.trim();
2513
2562
  if (!r)
2514
2563
  return h("collectionId is required.");
2515
2564
  if (!s)
2516
2565
  return h("workflowId is required.");
2517
- const a = Ne(e.get(b), r, s);
2566
+ const a = De(e.get(b), r, s);
2518
2567
  if (!a.ok)
2519
2568
  return h(
2520
2569
  a.message,
@@ -2550,13 +2599,13 @@ function Ia(e, t) {
2550
2599
  }
2551
2600
  };
2552
2601
  }
2553
- const ya = {
2602
+ const Ta = {
2554
2603
  name: "run_workflow",
2555
- definition: wa,
2556
- createExecutor: (e) => Ia(e.store, e.runWorkflow)
2557
- }, va = 25, ga = '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', ba = p({
2604
+ definition: ka,
2605
+ createExecutor: (e) => Sa(e.store, e.runWorkflow)
2606
+ }, Ca = 25, Oa = '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', Aa = p({
2558
2607
  query: i().optional().describe("Natural language search query."),
2559
- count: A().positive().max(va).optional().default(10),
2608
+ count: A().positive().max(Ca).optional().default(10),
2560
2609
  type: E(["api_operation", "api", "collection", "workflow", "step"]).describe(
2561
2610
  "Scope results to this item type. api = OpenAPI spec; api_operation = API endpoint; collection = Arazzo collection; workflow = Arazzo workflow; step = Arazzo workflow step."
2562
2611
  ),
@@ -2588,15 +2637,15 @@ const ya = {
2588
2637
  collectionId: i().optional().describe("Arazzo collection ID."),
2589
2638
  workflowId: i().optional().describe("Workflow ID within the collection. Requires collectionId."),
2590
2639
  stepId: i().optional().describe("Step ID within a workflow. Requires collectionId and workflowId.")
2591
- }).strict(), ka = fe(), Sa = {
2592
- description: ga,
2593
- inputSchema: ba,
2594
- outputSchema: ka,
2640
+ }).strict(), Ea = me(), $a = {
2641
+ description: Oa,
2642
+ inputSchema: Aa,
2643
+ outputSchema: Ea,
2595
2644
  needsApproval: !1
2596
- }, Ta = ["get", "put", "post", "delete", "options", "head", "patch", "trace"], Ca = ["query", "x-query"];
2597
- function Oa(e) {
2645
+ }, xa = ["get", "put", "post", "delete", "options", "head", "patch", "trace"], _a = ["query", "x-query"];
2646
+ function Ra(e) {
2598
2647
  return async (t, o) => {
2599
- const n = Oo(), r = {
2648
+ const n = xo(), r = {
2600
2649
  type: t.type,
2601
2650
  apiId: t.apiId,
2602
2651
  operationId: t.operationId,
@@ -2607,20 +2656,20 @@ function Oa(e) {
2607
2656
  stepId: t.stepId
2608
2657
  }, s = t.query ?? "";
2609
2658
  let a = await n.search(s, t.count, r);
2610
- return a.length === 0 && (a = _a(e, r)), a.length === 0 ? {
2659
+ return a.length === 0 && (a = Da(e, r)), a.length === 0 ? {
2611
2660
  isError: !1,
2612
2661
  data: {
2613
- message: `No results found. ${Aa(t)}`
2662
+ message: `No results found. ${Pa(t)}`
2614
2663
  }
2615
2664
  } : {
2616
2665
  isError: !1,
2617
2666
  data: {
2618
- message: Ra(a, t.include)
2667
+ message: Wa(a, t.include)
2619
2668
  }
2620
2669
  };
2621
2670
  };
2622
2671
  }
2623
- function Aa(e) {
2672
+ function Pa(e) {
2624
2673
  const t = [], { type: o, apiId: n, path: r, method: s, operationId: a, collectionId: l, workflowId: c, stepId: d, query: u } = e;
2625
2674
  switch (o) {
2626
2675
  case "api":
@@ -2631,8 +2680,8 @@ function Aa(e) {
2631
2680
  t.push("apiId");
2632
2681
  break;
2633
2682
  }
2634
- const v = a != null && a !== "", I = r != null && r !== "" && s != null && s !== "";
2635
- !v && !I && t.push("operationId", "path", "method");
2683
+ const v = a != null && a !== "", w = r != null && r !== "" && s != null && s !== "";
2684
+ !v && !w && t.push("operationId", "path", "method");
2636
2685
  break;
2637
2686
  }
2638
2687
  case "collection":
@@ -2646,8 +2695,8 @@ function Aa(e) {
2646
2695
  break;
2647
2696
  default:
2648
2697
  if (l != null && l !== "" && (c ? d || t.push("stepId") : t.push("workflowId")), n != null && n !== "") {
2649
- const v = a != null && a !== "", I = r != null && r !== "" && s != null && s !== "";
2650
- !v && !I && t.push("operationId", "path", "method");
2698
+ const v = a != null && a !== "", w = r != null && r !== "" && s != null && s !== "";
2699
+ !v && !w && t.push("operationId", "path", "method");
2651
2700
  }
2652
2701
  }
2653
2702
  u != null && u.trim() !== "" || t.push("query");
@@ -2655,13 +2704,13 @@ function Aa(e) {
2655
2704
  let g;
2656
2705
  return m.length === 0 ? g = "You already pass strong filters. Try a more specific natural-language query, or confirm IDs and paths match the project." : g = `To improve results, prefer adding (in order): ${m.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.`, g;
2657
2706
  }
2658
- function Ea(e, t) {
2707
+ function qa(e, t) {
2659
2708
  const o = e.paths ?? {};
2660
2709
  for (const [n, r] of Object.entries(o)) {
2661
2710
  if (!r || typeof r != "object") continue;
2662
2711
  const s = r, a = [
2663
- ...Ta.filter((c) => c in r),
2664
- ...Ca.filter((c) => c in r)
2712
+ ...xa.filter((c) => c in r),
2713
+ ..._a.filter((c) => c in r)
2665
2714
  ];
2666
2715
  for (const c of a) {
2667
2716
  const d = r[c];
@@ -2681,36 +2730,36 @@ function Ea(e, t) {
2681
2730
  }
2682
2731
  return null;
2683
2732
  }
2684
- function $a(e, t) {
2733
+ function Na(e, t) {
2685
2734
  const { type: o, apiId: n, operationId: r, path: s, method: a } = t;
2686
2735
  if (!n) return [];
2687
2736
  const l = e.find((g) => g.id === n);
2688
2737
  if (!l) return [];
2689
2738
  if (o === "api")
2690
- return [{ ...He(l).payload, score: 1 }];
2739
+ return [{ ...Ve(l).payload, score: 1 }];
2691
2740
  const c = r != null && r !== "", d = s != null && s !== "" && a != null && a !== "";
2692
2741
  if (!(o === "api_operation" || c || d || o == null && (c || d)))
2693
- return o == null ? [{ ...He(l).payload, score: 1 }] : [];
2694
- const f = Ea(l, { operationId: r, path: s, method: a });
2695
- return f ? [{ ...Ao({
2742
+ return o == null ? [{ ...Ve(l).payload, score: 1 }] : [];
2743
+ const f = qa(l, { operationId: r, path: s, method: a });
2744
+ return f ? [{ ..._o({
2696
2745
  apiId: l.id,
2697
2746
  apiTitle: l.info?.title ?? "Untitled API",
2698
2747
  path: f.path,
2699
2748
  method: f.method,
2700
2749
  op: f.op,
2701
2750
  pathItem: f.pathItem,
2702
- globalSchemes: Eo(l),
2751
+ globalSchemes: Ro(l),
2703
2752
  apiSecurity: l.security
2704
2753
  }).payload, score: 1 }] : [];
2705
2754
  }
2706
- function xa(e, t) {
2755
+ function Ua(e, t) {
2707
2756
  const { type: o, collectionId: n, workflowId: r, stepId: s } = t;
2708
2757
  if (!n) return [];
2709
2758
  const a = e.find((u) => u.id === n);
2710
2759
  if (!a) return [];
2711
2760
  const l = a.info?.title ?? "Untitled Collection";
2712
2761
  if (o === "collection")
2713
- return [{ ...Ge(a).payload, score: 1 }];
2762
+ return [{ ...Ke(a).payload, score: 1 }];
2714
2763
  const c = () => {
2715
2764
  if (!r || !s) return [];
2716
2765
  const u = a.workflows?.find((m) => (m.workflowId ?? "") === r);
@@ -2718,7 +2767,7 @@ function xa(e, t) {
2718
2767
  const f = u.steps?.find((m) => (m.stepId ?? "") === s);
2719
2768
  return f ? [
2720
2769
  {
2721
- ...$o({
2770
+ ...Po({
2722
2771
  collectionId: n,
2723
2772
  collectionTitle: l,
2724
2773
  workflowId: r,
@@ -2733,20 +2782,20 @@ function xa(e, t) {
2733
2782
  const u = a.workflows?.find((f) => (f.workflowId ?? "") === r);
2734
2783
  return u ? [
2735
2784
  {
2736
- ...xo({ collectionId: n, collectionTitle: l, workflow: u }).payload,
2785
+ ...qo({ collectionId: n, collectionTitle: l, workflow: u }).payload,
2737
2786
  score: 1
2738
2787
  }
2739
2788
  ] : [];
2740
2789
  };
2741
- return o === "step" ? c() : o === "workflow" ? d() : o == null ? s && r ? c() : r ? d() : [{ ...Ge(a).payload, score: 1 }] : [];
2790
+ return o === "step" ? c() : o === "workflow" ? d() : o == null ? s && r ? c() : r ? d() : [{ ...Ke(a).payload, score: 1 }] : [];
2742
2791
  }
2743
- function _a(e, t) {
2744
- const o = e.get(le), n = e.get(b), { type: r } = t;
2745
- return r === "api" || r === "api_operation" ? $a(o, t) : r === "collection" || r === "workflow" || r === "step" ? xa(n, t) : [];
2792
+ function Da(e, t) {
2793
+ const o = e.get(de), n = e.get(b), { type: r } = t;
2794
+ return r === "api" || r === "api_operation" ? Na(o, t) : r === "collection" || r === "workflow" || r === "step" ? Ua(n, t) : [];
2746
2795
  }
2747
- function Ra(e, t) {
2796
+ function Wa(e, t) {
2748
2797
  return [
2749
- un(e, t).join(`
2798
+ hn(e, t).join(`
2750
2799
 
2751
2800
  `)
2752
2801
  // ... other parts
@@ -2754,8 +2803,8 @@ function Ra(e, t) {
2754
2803
 
2755
2804
  `);
2756
2805
  }
2757
- const qa = "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;
2758
- function Na(e) {
2806
+ const La = "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.", Ma = 10;
2807
+ function Fa(e) {
2759
2808
  const t = [
2760
2809
  e.type,
2761
2810
  D(e.query),
@@ -2767,38 +2816,38 @@ function Na(e) {
2767
2816
  D(e.workflowId),
2768
2817
  D(e.stepId)
2769
2818
  ];
2770
- return t.every((o) => o == null) ? null : JSON.stringify([...t, Ua(e), Da(e)]);
2819
+ return t.every((o) => o == null) ? null : JSON.stringify([...t, ja(e), Ba(e)]);
2771
2820
  }
2772
- function Ua(e) {
2773
- return typeof e?.count == "number" ? e.count : Pa;
2821
+ function ja(e) {
2822
+ return typeof e?.count == "number" ? e.count : Ma;
2774
2823
  }
2775
- function Da(e) {
2824
+ function Ba(e) {
2776
2825
  return Array.isArray(e?.include) ? [...new Set(e.include)].sort() : [];
2777
2826
  }
2778
2827
  function D(e) {
2779
2828
  if (typeof e != "string") return null;
2780
- const t = At(e);
2829
+ const t = $t(e);
2781
2830
  return t === "" ? null : t;
2782
2831
  }
2783
- const Wa = [
2784
- Et({
2785
- key: Na,
2786
- warn: qa
2832
+ const Ya = [
2833
+ xt({
2834
+ key: Fa,
2835
+ warn: La
2787
2836
  })
2788
- ], La = {
2837
+ ], za = {
2789
2838
  name: "search",
2790
- definition: Sa,
2791
- guards: Wa,
2792
- createExecutor: (e) => Oa(e.store)
2793
- }, 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 }`.", Fa = [
2839
+ definition: $a,
2840
+ guards: Ya,
2841
+ createExecutor: (e) => Ra(e.store)
2842
+ }, Ha = "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 }`.", Ga = [
2794
2843
  "clientCredentials",
2795
2844
  "clientCredentialsWithJwtAssertion",
2796
2845
  "authorizationCode",
2797
2846
  "authorizationCodeWithPkce",
2798
2847
  "implicit",
2799
2848
  "password"
2800
- ], ja = {
2801
- grantType: E(Fa).optional().describe("OAuth2 grant type."),
2849
+ ], Va = {
2850
+ grantType: E(Ga).optional().describe("OAuth2 grant type."),
2802
2851
  clientId: i().optional(),
2803
2852
  clientSecret: i().optional(),
2804
2853
  tokenUrl: i().optional(),
@@ -2807,15 +2856,15 @@ const Wa = [
2807
2856
  accessToken: i().optional(),
2808
2857
  username: i().optional().describe("For password grant type."),
2809
2858
  password: i().optional().describe("For password grant type.")
2810
- }, Ba = p({
2859
+ }, Ka = p({
2811
2860
  username: i().optional(),
2812
2861
  password: i().optional()
2813
- }).strict(), Ya = p({
2862
+ }).strict(), Ja = p({
2814
2863
  username: i().optional(),
2815
2864
  password: i().optional()
2816
- }).strict(), za = p({
2865
+ }).strict(), Qa = p({
2817
2866
  token: i().optional()
2818
- }).strict(), Ha = p({
2867
+ }).strict(), Xa = p({
2819
2868
  location: E(["header", "query", "cookie"]).optional(),
2820
2869
  name: i().optional().describe(
2821
2870
  "Must match the OpenAPI security scheme `name` (header/query/cookie parameter name). Not the scheme component ref id (e.g. UserCookie)."
@@ -2823,49 +2872,49 @@ const Wa = [
2823
2872
  key: i().optional().describe(
2824
2873
  "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)."
2825
2874
  )
2826
- }).strict(), Dt = p({
2827
- ...ja
2828
- }).strict(), Ga = Dt.extend({
2875
+ }).strict(), Mt = p({
2876
+ ...Va
2877
+ }).strict(), Za = Mt.extend({
2829
2878
  openIdConnectUrl: i().optional(),
2830
2879
  userInfoUrl: i().optional()
2831
- }).strict(), Wt = i().optional().describe(
2880
+ }).strict(), Ft = i().optional().describe(
2832
2881
  "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."
2833
- ), j = Pn.extend({
2882
+ ), j = Wn.extend({
2834
2883
  action: E(["add", "update"]),
2835
2884
  schemeId: i().optional(),
2836
- stepId: Wt
2837
- }), Va = me("type", [
2885
+ stepId: Ft
2886
+ }), ei = he("type", [
2838
2887
  j.extend({
2839
- type: w(k.BasicAuth),
2840
- data: Ba.optional()
2888
+ type: I(k.BasicAuth),
2889
+ data: Ka.optional()
2841
2890
  }).strict(),
2842
2891
  j.extend({
2843
- type: w(k.DigestAuth),
2844
- data: Ya.optional()
2892
+ type: I(k.DigestAuth),
2893
+ data: Ja.optional()
2845
2894
  }).strict(),
2846
2895
  j.extend({
2847
- type: w(k.JWT),
2848
- data: za.optional()
2896
+ type: I(k.JWT),
2897
+ data: Qa.optional()
2849
2898
  }).strict(),
2850
2899
  j.extend({
2851
- type: w(k.APIKey),
2852
- data: Ha.optional()
2900
+ type: I(k.APIKey),
2901
+ data: Xa.optional()
2853
2902
  }).strict(),
2854
2903
  j.extend({
2855
- type: w(k.OAuth2),
2856
- data: Dt.optional()
2904
+ type: I(k.OAuth2),
2905
+ data: Mt.optional()
2857
2906
  }).strict(),
2858
2907
  j.extend({
2859
- type: w(k.OpenIDConnect),
2860
- data: Ga.optional()
2908
+ type: I(k.OpenIDConnect),
2909
+ data: Za.optional()
2861
2910
  }).strict()
2862
- ]), Ka = qe.extend({
2863
- action: w("remove"),
2911
+ ]), ti = qe.extend({
2912
+ action: I("remove"),
2864
2913
  index: A().int().min(0).describe(
2865
2914
  "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."
2866
2915
  ),
2867
- stepId: Wt
2868
- }).strict(), Ja = Re([Va, Ka]), Qa = p({
2916
+ stepId: Ft
2917
+ }).strict(), oi = Pe([ei, ti]), ni = p({
2869
2918
  collectionId: i().describe(
2870
2919
  "Saved step: collection id. Unsaved draft tab on focus: empty string (with empty workflowId and stepId)."
2871
2920
  ),
@@ -2875,7 +2924,7 @@ const Wa = [
2875
2924
  stepId: i().describe(
2876
2925
  "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)."
2877
2926
  ),
2878
- changes: T(Ja).min(1).describe("List of security changes to apply.")
2927
+ changes: T(oi).min(1).describe("List of security changes to apply.")
2879
2928
  }).strict().superRefine((e, t) => {
2880
2929
  const o = e.collectionId.trim(), n = e.workflowId.trim(), r = e.stepId.trim(), s = e.changes.map((u) => u.stepId?.trim()), a = s.every(Boolean), l = s.some(Boolean);
2881
2930
  !(o && n && (r || a)) && !(!o && !n && !r && !l) && t.addIssue({
@@ -2883,10 +2932,10 @@ const Wa = [
2883
2932
  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.",
2884
2933
  path: ["collectionId"]
2885
2934
  });
2886
- }), Xa = $t, Za = {
2887
- description: Ma,
2888
- inputSchema: Qa,
2889
- outputSchema: Xa,
2935
+ }), ri = _t, si = {
2936
+ description: Ha,
2937
+ inputSchema: ni,
2938
+ outputSchema: ri,
2890
2939
  needsApproval: () => !0
2891
2940
  }, _ = {
2892
2941
  ADD: "add",
@@ -2899,7 +2948,7 @@ function y(e, t) {
2899
2948
  ...t !== void 0 && { summary: t }
2900
2949
  };
2901
2950
  }
2902
- function Lt(e) {
2951
+ function jt(e) {
2903
2952
  if (!e || typeof e != "object" || !("meta" in e))
2904
2953
  return {};
2905
2954
  const { meta: t } = e;
@@ -2908,79 +2957,79 @@ function Lt(e) {
2908
2957
  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;
2909
2958
  return { totalChanges: o, approvedChanges: n };
2910
2959
  }
2911
- function ei(e, t) {
2960
+ function ai(e, t) {
2912
2961
  return !Number.isInteger(t.index) || t.index < 0 || t.index >= e.length ? {
2913
2962
  ok: !1,
2914
2963
  message: `Index ${t.index} out of bounds. Step has ${e.length} security entries.`
2915
2964
  } : { ok: !0, entry: e[t.index] };
2916
2965
  }
2917
- const ti = /* @__PURE__ */ new Set(["grantType", "openIdConnectUrl", "userInfoUrl"]);
2918
- function oi(e) {
2966
+ const ii = /* @__PURE__ */ new Set(["grantType", "openIdConnectUrl", "userInfoUrl"]);
2967
+ function ci(e) {
2919
2968
  return e.type === k.OAuth2 || e.type === k.OpenIDConnect;
2920
2969
  }
2921
- function at(e, t) {
2970
+ function ct(e, t) {
2922
2971
  const o = e;
2923
2972
  for (const [n, r] of Object.entries(t))
2924
2973
  r !== void 0 && n in o && (o[n] = r);
2925
2974
  }
2926
- function it(e, t) {
2975
+ function lt(e, t) {
2927
2976
  const o = Object.entries(t);
2928
2977
  for (const [s, a] of o)
2929
- s === "grantType" && typeof a == "string" && je[a] && (e.grantType = je[a]);
2930
- const n = e[e.grantType], r = new Set(Object.keys(po[e.grantType]));
2978
+ s === "grantType" && typeof a == "string" && Ye[a] && (e.grantType = Ye[a]);
2979
+ const n = e[e.grantType], r = new Set(Object.keys(Io[e.grantType]));
2931
2980
  for (const [s, a] of o)
2932
2981
  s !== "grantType" && a !== void 0 && r.has(s) && (n[s] = a);
2933
2982
  }
2934
- function Mt(e) {
2983
+ function Bt(e) {
2935
2984
  return e.securityType === k.NoAuth ? null : e[e.securityType]?.schemeName ?? null;
2936
2985
  }
2937
- function ni(e, t) {
2986
+ function li(e, t) {
2938
2987
  !t || e.securityType === k.NoAuth || (e.securitySchemeId = t, e[e.securityType].schemeName = t);
2939
2988
  }
2940
- function be(e, t) {
2941
- if (e.securityType = t.type, ni(e, t.schemeId), !t.data) return e;
2989
+ function ke(e, t) {
2990
+ if (e.securityType = t.type, li(e, t.schemeId), !t.data) return e;
2942
2991
  switch (t.type) {
2943
2992
  case k.BasicAuth:
2944
2993
  case k.DigestAuth:
2945
2994
  case k.JWT:
2946
- at(e[t.type], t.data);
2995
+ ct(e[t.type], t.data);
2947
2996
  break;
2948
2997
  case k.APIKey: {
2949
2998
  const { location: o, ...n } = t.data;
2950
- at(e[k.APIKey], n), o && (e[k.APIKey].location = uo(o));
2999
+ ct(e[k.APIKey], n), o && (e[k.APIKey].location = ho(o));
2951
3000
  break;
2952
3001
  }
2953
3002
  case k.OAuth2:
2954
- it(e[k.OAuth2], t.data);
3003
+ lt(e[k.OAuth2], t.data);
2955
3004
  break;
2956
3005
  case k.OpenIDConnect: {
2957
3006
  const { openIdConnectUrl: o, userInfoUrl: n, ...r } = t.data;
2958
- it(e[k.OpenIDConnect], r), o !== void 0 && (e[k.OpenIDConnect].openIdConnectUrl = o), n !== void 0 && (e[k.OpenIDConnect].userInfoUrl = n);
3007
+ lt(e[k.OpenIDConnect], r), o !== void 0 && (e[k.OpenIDConnect].openIdConnectUrl = o), n !== void 0 && (e[k.OpenIDConnect].userInfoUrl = n);
2959
3008
  break;
2960
3009
  }
2961
3010
  }
2962
3011
  return e;
2963
3012
  }
2964
- function ri(e, t) {
3013
+ function di(e, t) {
2965
3014
  return t.schemeId ? e.findIndex(
2966
- (o) => o.securitySchemeId === t.schemeId || Mt(o) === t.schemeId
3015
+ (o) => o.securitySchemeId === t.schemeId || Bt(o) === t.schemeId
2967
3016
  ) : e.findIndex((o) => o.securityType === t.type);
2968
3017
  }
2969
- function si(e) {
3018
+ function ui(e) {
2970
3019
  return e.data ? Object.entries(e.data).some(
2971
- ([t, o]) => o !== void 0 && !ti.has(t)
3020
+ ([t, o]) => o !== void 0 && !ii.has(t)
2972
3021
  ) : !1;
2973
3022
  }
2974
- function ai(e) {
3023
+ function pi(e) {
2975
3024
  return e.schemeId ? `${e.type} (scheme '${e.schemeId}')` : e.type;
2976
3025
  }
2977
- function ct(e, t, o, n) {
3026
+ function dt(e, t, o, n) {
2978
3027
  return e.has(t) ? {
2979
3028
  ok: !1,
2980
3029
  message: `The security entry at index ${o} is targeted by both a mutation and a remove${n}; issue only one action for it.`
2981
3030
  } : null;
2982
3031
  }
2983
- function ii(e, t, o) {
3032
+ function fi(e, t, o) {
2984
3033
  let n = e;
2985
3034
  const r = [], s = t.filter(
2986
3035
  (c) => c.action !== _.REMOVE
@@ -2988,38 +3037,38 @@ function ii(e, t, o) {
2988
3037
  (c) => c.action === _.REMOVE
2989
3038
  ), l = /* @__PURE__ */ new Set();
2990
3039
  for (const c of a) {
2991
- const d = ei(e, c);
3040
+ const d = ai(e, c);
2992
3041
  if (!d.ok) return { ok: !1, message: d.message };
2993
3042
  l.add(d.entry);
2994
3043
  }
2995
3044
  for (const c of s) {
2996
3045
  if (c.action === _.ADD) {
2997
- const f = n.length === 1 && n[0].securityType === k.NoAuth, m = f ? -1 : ri(n, c);
3046
+ const f = n.length === 1 && n[0].securityType === k.NoAuth, m = f ? -1 : di(n, c);
2998
3047
  if (m >= 0) {
2999
- const v = n[m], I = ct(l, v, m, o);
3000
- if (I) return I;
3048
+ const v = n[m], w = dt(l, v, m, o);
3049
+ if (w) return w;
3001
3050
  if (v.securityType !== c.type)
3002
3051
  return {
3003
3052
  ok: !1,
3004
3053
  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 ${m} to intentionally change the type.`
3005
3054
  };
3006
- n = [...n], n[m] = be(
3055
+ n = [...n], n[m] = ke(
3007
3056
  structuredClone(v),
3008
3057
  c
3009
3058
  ), r.push(
3010
3059
  y(
3011
3060
  "applied",
3012
- `Updated existing ${ai(c)} in place (index: ${m})${o}`
3061
+ `Updated existing ${pi(c)} in place (index: ${m})${o}`
3013
3062
  )
3014
3063
  );
3015
3064
  continue;
3016
3065
  }
3017
- if (oi(c) && si(c) && !c.data?.grantType)
3066
+ if (ci(c) && ui(c) && !c.data?.grantType)
3018
3067
  return {
3019
3068
  ok: !1,
3020
3069
  message: `grantType is required when adding ${c.type} security with flow values${o}. For a plain http/bearer token use type "${k.JWT}" with data.token instead.`
3021
3070
  };
3022
- const g = be(Fe(), c);
3071
+ const g = ke(Be(), c);
3023
3072
  n = f ? [g] : [...n, g], r.push(
3024
3073
  y(
3025
3074
  "applied",
@@ -3035,17 +3084,17 @@ function ii(e, t, o) {
3035
3084
  ok: !1,
3036
3085
  message: `Index ${c.index} out of bounds. Step has ${n.length} security entries.`
3037
3086
  };
3038
- const d = n[c.index], u = ct(l, d, c.index, o);
3087
+ const d = n[c.index], u = dt(l, d, c.index, o);
3039
3088
  if (u) return u;
3040
3089
  if (d.securitySchemeId) {
3041
- const f = Mt(d);
3090
+ const f = Bt(d);
3042
3091
  if (c.schemeId && f !== c.schemeId)
3043
3092
  return {
3044
3093
  ok: !1,
3045
3094
  message: `schemeId mismatch at index ${c.index}. Expected ${f ?? "none"}.`
3046
3095
  };
3047
3096
  }
3048
- n = [...n], n[c.index] = be(structuredClone(d), c), r.push(
3097
+ n = [...n], n[c.index] = ke(structuredClone(d), c), r.push(
3049
3098
  y("applied", `Updated ${c.type} at index ${c.index}${o}`)
3050
3099
  );
3051
3100
  }
@@ -3055,28 +3104,28 @@ function ii(e, t, o) {
3055
3104
  for (let u = 0; u < d; u++)
3056
3105
  r.push(y("applied"));
3057
3106
  }
3058
- return n.length === 0 && (n = [Fe()]), { ok: !0, security: n, applied: r };
3107
+ return n.length === 0 && (n = [Be()]), { ok: !0, security: n, applied: r };
3059
3108
  }
3060
- function ci(e) {
3109
+ function mi(e) {
3061
3110
  return async (t) => {
3062
- const { changes: o, collectionId: n, workflowId: r, stepId: s } = t, a = Lt(t), l = s.trim(), c = /* @__PURE__ */ new Map();
3111
+ const { changes: o, collectionId: n, workflowId: r, stepId: s } = t, a = jt(t), l = s.trim(), c = /* @__PURE__ */ new Map();
3063
3112
  for (const m of o) {
3064
3113
  const g = m.stepId?.trim() || l, v = c.get(g);
3065
3114
  v ? v.push(m) : c.set(g, [m]);
3066
3115
  }
3067
3116
  const d = [], u = [];
3068
3117
  for (const [m, g] of c) {
3069
- const v = Ut(e, n, r, m);
3118
+ const v = Lt(e, n, r, m);
3070
3119
  if (!v.ok)
3071
3120
  return h(v.message, v.details);
3072
- const { readStep: I, updateStep: O } = v.value, S = m || v.value.step.stepId, P = c.size > 1 ? ` for step '${S}'` : "", ve = Array.from(I().security), N = ii(ve, g, P);
3121
+ const { readStep: w, updateStep: O } = v.value, S = m || v.value.step.stepId, q = c.size > 1 ? ` for step '${S}'` : "", ge = Array.from(w().security), N = fi(ge, g, q);
3073
3122
  if (!N.ok) return h(N.message);
3074
3123
  d.push(...N.applied), u.push({ updateStep: O, security: N.security, label: S });
3075
3124
  }
3076
3125
  for (const m of u)
3077
3126
  m.updateStep((g) => ({ ...g, security: m.security }));
3078
3127
  const f = u.map((m) => `stepId=${m.label}
3079
- ${pe(m.security)}`).join(`
3128
+ ${fe(m.security)}`).join(`
3080
3129
 
3081
3130
  `);
3082
3131
  return {
@@ -3090,11 +3139,11 @@ ${pe(m.security)}`).join(`
3090
3139
  };
3091
3140
  };
3092
3141
  }
3093
- const li = {
3142
+ const hi = {
3094
3143
  name: "update_security",
3095
- definition: Za,
3096
- createExecutor: (e) => ci(e.store)
3097
- }, di = `Update an existing Replay step with atomic changes.
3144
+ definition: si,
3145
+ createExecutor: (e) => mi(e.store)
3146
+ }, Ii = `Update an existing Replay step with atomic changes.
3098
3147
 
3099
3148
  **What it does**
3100
3149
  - Mutates an existing step only (no create/delete).
@@ -3117,7 +3166,7 @@ const li = {
3117
3166
  - Data shapes:
3118
3167
  - \`url\`: string
3119
3168
  - \`description\`: string
3120
- - \`method\`: one of ${ht.join(", ")}
3169
+ - \`method\`: one of ${wt.join(", ")}
3121
3170
  - \`parameters\`: \`{ name, in: path|query|header|cookie, value }\`
3122
3171
  - \`outputs\`: \`{ name, expression }\`
3123
3172
  - \`successCriteria\`: \`{ condition, context?, type? }\`
@@ -3128,58 +3177,58 @@ const li = {
3128
3177
  - Batch related edits in one call; include all known edits up front.
3129
3178
  - For OpenAPI-linked steps, avoid method/url changes.
3130
3179
  - After changing path/query parameters, decide whether to add a separate URL change.
3131
- `, ui = ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"], pi = [
3180
+ `, wi = ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"], yi = [
3132
3181
  Y.Text,
3133
3182
  Y.JSON,
3134
3183
  Y.XML
3135
- ], fi = p({
3184
+ ], vi = p({
3136
3185
  name: i().min(1),
3137
3186
  in: E(["path", "query", "header", "cookie"]),
3138
3187
  value: i()
3139
- }).strict(), mi = p({
3188
+ }).strict(), gi = p({
3140
3189
  condition: i().min(1),
3141
3190
  context: i().optional().describe("Context for the expression."),
3142
3191
  type: E(["simple", "regex", "jsonpath", "xpath"]).optional()
3143
- }).strict(), hi = L.extend({
3144
- field: w("url"),
3192
+ }).strict(), bi = L.extend({
3193
+ field: I("url"),
3145
3194
  data: i().min(1).describe("New request URL for step.")
3146
- }).strict(), wi = L.extend({
3147
- field: w("description"),
3195
+ }).strict(), ki = L.extend({
3196
+ field: I("description"),
3148
3197
  data: i().describe("New step description text.")
3149
- }).strict(), Ii = L.extend({
3150
- field: w("method"),
3151
- data: E(ui).describe("New HTTP method for x-operation step.")
3152
- }).strict(), yi = L.extend({
3153
- field: w("parameters"),
3154
- data: fi.optional().describe("Parameter data. Required for add/update actions.")
3155
- }).strict(), vi = L.extend({
3156
- field: w("outputs"),
3198
+ }).strict(), Si = L.extend({
3199
+ field: I("method"),
3200
+ data: E(wi).describe("New HTTP method for x-operation step.")
3201
+ }).strict(), Ti = L.extend({
3202
+ field: I("parameters"),
3203
+ data: vi.optional().describe("Parameter data. Required for add/update actions.")
3204
+ }).strict(), Ci = L.extend({
3205
+ field: I("outputs"),
3157
3206
  data: p({
3158
3207
  name: i().min(1).describe("Output name."),
3159
3208
  expression: i().min(1).describe("Output expression.")
3160
3209
  }).strict().optional().describe("Output mapping. Required for add/update actions.")
3161
- }).strict(), gi = L.extend({
3162
- field: w("successCriteria"),
3163
- data: mi.optional().describe(
3210
+ }).strict(), Oi = L.extend({
3211
+ field: I("successCriteria"),
3212
+ data: gi.optional().describe(
3164
3213
  "Success criterion. Required for add/update actions."
3165
3214
  )
3166
- }).strict(), bi = L.extend({
3167
- field: w("body"),
3215
+ }).strict(), Ai = L.extend({
3216
+ field: I("body"),
3168
3217
  data: p({
3169
- contentType: E(pi).optional().describe(
3218
+ contentType: E(yi).optional().describe(
3170
3219
  "Request body content type. Allowed: text/plain, application/json, application/xml."
3171
3220
  ),
3172
3221
  content: i().describe("Request body content as string.")
3173
3222
  }).strict().describe("Request body content and optional content type.")
3174
- }).strict(), ki = me("field", [
3175
- hi,
3176
- wi,
3177
- Ii,
3178
- yi,
3179
- vi,
3180
- gi,
3181
- bi
3182
- ]), Si = p({
3223
+ }).strict(), Ei = he("field", [
3224
+ bi,
3225
+ ki,
3226
+ Si,
3227
+ Ti,
3228
+ Ci,
3229
+ Oi,
3230
+ Ai
3231
+ ]), $i = p({
3183
3232
  collectionId: i().describe(
3184
3233
  "Saved step: collection id. Unsaved draft tab on focus: empty string (with empty workflowId and stepId)."
3185
3234
  ),
@@ -3189,7 +3238,7 @@ const li = {
3189
3238
  stepId: i().describe(
3190
3239
  "Saved step: step id. Unsaved draft tab: empty string (with empty collectionId and workflowId)."
3191
3240
  ),
3192
- changes: T(ki).min(1).describe("List of individual changes to apply to the step.")
3241
+ changes: T(Ei).min(1).describe("List of individual changes to apply to the step.")
3193
3242
  }).strict().superRefine((e, t) => {
3194
3243
  const o = e.collectionId.trim(), n = e.workflowId.trim(), r = e.stepId.trim();
3195
3244
  !(o && n && r) && !(!o && !n && !r) && t.addIssue({
@@ -3197,34 +3246,34 @@ const li = {
3197
3246
  message: "Provide all three ids for a saved step, or three empty strings for the focused unsaved request tab.",
3198
3247
  path: ["collectionId"]
3199
3248
  });
3200
- }), Ti = $t, Ci = {
3201
- description: di,
3202
- inputSchema: Si,
3203
- outputSchema: Ti,
3249
+ }), xi = _t, _i = {
3250
+ description: Ii,
3251
+ inputSchema: $i,
3252
+ outputSchema: xi,
3204
3253
  needsApproval: () => !0
3205
3254
  };
3206
- function Oi(e) {
3255
+ function Ri(e) {
3207
3256
  return e.replace(/\{\{([^{}\s]+)\}\}/g, "{$1}");
3208
3257
  }
3209
- function ke(e) {
3210
- return re[e];
3258
+ function Se(e) {
3259
+ return se[e];
3211
3260
  }
3212
- function Se(e, t) {
3261
+ function Te(e, t) {
3213
3262
  return e.id === t;
3214
3263
  }
3215
- function lt(e, t) {
3264
+ function ut(e, t) {
3216
3265
  return e.condition === t;
3217
3266
  }
3218
- function Te(e, t) {
3219
- return Ae(e) && e.id === t;
3267
+ function Ce(e, t) {
3268
+ return Ee(e) && e.id === t;
3220
3269
  }
3221
- function dt(e, t, o) {
3222
- return { ...ft(e), key: t, value: o, active: !0 };
3270
+ function pt(e, t, o) {
3271
+ return { ...ht(e), key: t, value: o, active: !0 };
3223
3272
  }
3224
- function Ue(e, t) {
3273
+ function We(e, t) {
3225
3274
  e((o) => [...o, ...t]);
3226
3275
  }
3227
- function ce(e, t, o) {
3276
+ function le(e, t, o) {
3228
3277
  let n = !1;
3229
3278
  return e((r) => {
3230
3279
  const s = r.findIndex((l) => o.find(l, t));
@@ -3233,20 +3282,20 @@ function ce(e, t, o) {
3233
3282
  return a[s] = o.produce(r[s]), n = !0, a;
3234
3283
  }), n;
3235
3284
  }
3236
- function De(e, t, o) {
3285
+ function Le(e, t, o) {
3237
3286
  let n = !1;
3238
3287
  return e((r) => {
3239
3288
  const s = r.filter((a) => !o(a, t));
3240
3289
  return n = s.length < r.length, s;
3241
3290
  }), n;
3242
3291
  }
3243
- function Ai(e, { readStep: t, updateParameters: o }) {
3292
+ function Pi(e, { readStep: t, updateParameters: o }) {
3244
3293
  switch (e.action) {
3245
3294
  case _.ADD: {
3246
3295
  if (!e.data)
3247
3296
  return y("failed", "Failed parameter add because data is missing.");
3248
- const { in: n, name: r, value: s } = e.data, a = ke(n), l = dt(n, r, s);
3249
- return Ue(o(a), [l]), y(
3297
+ const { in: n, name: r, value: s } = e.data, a = Se(n), l = pt(n, r, s);
3298
+ return We(o(a), [l]), y(
3250
3299
  "applied",
3251
3300
  `Added ${n} parameter '${r}' (id: ${l.id})`
3252
3301
  );
@@ -3256,11 +3305,11 @@ function Ai(e, { readStep: t, updateParameters: o }) {
3256
3305
  return y("failed", "Failed parameter update because id is missing.");
3257
3306
  if (!e.data)
3258
3307
  return y("failed", "Failed parameter update because data is missing.");
3259
- const { in: n, name: r, value: s } = e.data, a = ke(n);
3260
- return ce(o(a), e.id, {
3261
- find: Te,
3262
- produce: (c) => Ae(c) ? {
3263
- ...dt(n, r, s),
3308
+ const { in: n, name: r, value: s } = e.data, a = Se(n);
3309
+ return le(o(a), e.id, {
3310
+ find: Ce,
3311
+ produce: (c) => Ee(c) ? {
3312
+ ...pt(n, r, s),
3264
3313
  id: c.id,
3265
3314
  ...c.allowReserved !== void 0 && { allowReserved: c.allowReserved }
3266
3315
  } : c
@@ -3269,33 +3318,33 @@ function Ai(e, { readStep: t, updateParameters: o }) {
3269
3318
  case _.REMOVE: {
3270
3319
  if (!e.id)
3271
3320
  return y("failed", "Failed parameter remove because id is missing.");
3272
- const n = e.id, r = e.data?.in, s = r ? [ke(r)] : Object.values(re);
3321
+ const n = e.id, r = e.data?.in, s = r ? [Se(r)] : Object.values(se);
3273
3322
  let a = !1;
3274
3323
  for (const l of s)
3275
- if (t().parameters[l].some((d) => Te(d, n))) {
3276
- a = De(o(l), n, Te);
3324
+ if (t().parameters[l].some((d) => Ce(d, n))) {
3325
+ a = Le(o(l), n, Ce);
3277
3326
  break;
3278
3327
  }
3279
3328
  return a ? y("applied") : y("failed", `Parameter with id '${n}' not found.`);
3280
3329
  }
3281
3330
  }
3282
3331
  }
3283
- function Ei(e, { readStep: t, updateOutputs: o }) {
3332
+ function qi(e, { readStep: t, updateOutputs: o }) {
3284
3333
  switch (e.action) {
3285
3334
  case _.ADD: {
3286
3335
  if (!e.data)
3287
3336
  return y("failed", "Failed output add because data is missing.");
3288
3337
  const { name: n, expression: r } = e.data, s = t().outputs.find((l) => l.key === n);
3289
3338
  if (s)
3290
- return ce(o, s.id, {
3291
- find: Se,
3339
+ return le(o, s.id, {
3340
+ find: Te,
3292
3341
  produce: (l) => ({ ...l, key: n, value: r, active: !0 })
3293
3342
  }), y(
3294
3343
  "applied",
3295
3344
  `Updated existing output '${n}' in place (id: ${s.id})`
3296
3345
  );
3297
3346
  const a = crypto.randomUUID();
3298
- return Ue(o, [{ id: a, key: n, value: r, active: !0 }]), y("applied", `Added output '${n}' (id: ${a})`);
3347
+ return We(o, [{ id: a, key: n, value: r, active: !0 }]), y("applied", `Added output '${n}' (id: ${a})`);
3299
3348
  }
3300
3349
  case _.UPDATE: {
3301
3350
  if (!e.id)
@@ -3303,24 +3352,24 @@ function Ei(e, { readStep: t, updateOutputs: o }) {
3303
3352
  if (!e.data)
3304
3353
  return y("failed", "Failed output update because data is missing.");
3305
3354
  const { name: n, expression: r } = e.data;
3306
- return ce(o, e.id, {
3307
- find: Se,
3355
+ return le(o, e.id, {
3356
+ find: Te,
3308
3357
  produce: (a) => ({ ...a, key: n, value: r, active: !0 })
3309
3358
  }) ? y("applied") : y("failed", `Output with id '${e.id}' not found.`);
3310
3359
  }
3311
3360
  case _.REMOVE:
3312
- return e.id ? De(o, e.id, Se) ? y("applied") : y("failed", `Output with id '${e.id}' not found.`) : y("failed", "Failed output remove because id is missing.");
3361
+ return e.id ? Le(o, e.id, Te) ? y("applied") : y("failed", `Output with id '${e.id}' not found.`) : y("failed", "Failed output remove because id is missing.");
3313
3362
  }
3314
3363
  }
3315
- function $i(e, { updateSuccessCriteria: t }) {
3364
+ function Ni(e, { updateSuccessCriteria: t }) {
3316
3365
  switch (e.action) {
3317
3366
  case _.ADD: {
3318
3367
  if (!e.data)
3319
3368
  return y("failed", "Failed success criteria add because data is missing.");
3320
- const { condition: o, context: n, type: r } = e.data, s = pt(
3321
- r ?? Ce.SIMPLE
3369
+ const { condition: o, context: n, type: r } = e.data, s = mt(
3370
+ r ?? Oe.SIMPLE
3322
3371
  );
3323
- return Ue(t, [
3372
+ return We(t, [
3324
3373
  {
3325
3374
  ...s,
3326
3375
  condition: o,
@@ -3340,14 +3389,14 @@ function $i(e, { updateSuccessCriteria: t }) {
3340
3389
  "Failed success criteria update because data is missing."
3341
3390
  );
3342
3391
  const { condition: o, context: n, type: r } = e.data;
3343
- return ce(t, e.id, {
3344
- find: lt,
3392
+ return le(t, e.id, {
3393
+ find: ut,
3345
3394
  produce: (a) => ({
3346
3395
  ...a,
3347
3396
  id: a.id || crypto.randomUUID(),
3348
3397
  condition: o,
3349
3398
  context: n ?? a.context,
3350
- type: r ?? a.type ?? Ce.SIMPLE
3399
+ type: r ?? a.type ?? Oe.SIMPLE
3351
3400
  })
3352
3401
  }) ? y("applied") : y(
3353
3402
  "failed",
@@ -3358,60 +3407,60 @@ function $i(e, { updateSuccessCriteria: t }) {
3358
3407
  return typeof e.id != "string" ? y(
3359
3408
  "failed",
3360
3409
  "Failed success criteria remove because id is missing."
3361
- ) : De(
3410
+ ) : Le(
3362
3411
  t,
3363
3412
  e.id,
3364
- lt
3413
+ ut
3365
3414
  ) ? y("applied") : y(
3366
3415
  "failed",
3367
3416
  `Success criterion with condition '${e.id}' not found.`
3368
3417
  );
3369
3418
  }
3370
3419
  }
3371
- const ut = { method: "GET", url: "" };
3372
- function xi(e) {
3420
+ const ft = { method: "GET", url: "" };
3421
+ function Ui(e) {
3373
3422
  return async (t) => {
3374
- const { changes: o, collectionId: n, workflowId: r, stepId: s } = t, a = Lt(t), l = Ut(e, n, r, s);
3423
+ const { changes: o, collectionId: n, workflowId: r, stepId: s } = t, a = jt(t), l = Lt(e, n, r, s);
3375
3424
  if (!l.ok)
3376
3425
  return h(l.message, l.details);
3377
3426
  const { step: c, readStep: d, updateStep: u } = l.value, f = {
3378
3427
  readStep: d,
3379
- updateParameters: (I) => (O) => u((S) => ({
3428
+ updateParameters: (w) => (O) => u((S) => ({
3380
3429
  ...S,
3381
- parameters: { ...S.parameters, [I]: O(S.parameters[I]) }
3430
+ parameters: { ...S.parameters, [w]: O(S.parameters[w]) }
3382
3431
  })),
3383
- updateOutputs: (I) => u((O) => ({ ...O, outputs: I(O.outputs) })),
3384
- updateSuccessCriteria: (I) => u((O) => ({
3432
+ updateOutputs: (w) => u((O) => ({ ...O, outputs: w(O.outputs) })),
3433
+ updateSuccessCriteria: (w) => u((O) => ({
3385
3434
  ...O,
3386
- successCriteria: I(O.successCriteria)
3435
+ successCriteria: w(O.successCriteria)
3387
3436
  }))
3388
3437
  };
3389
3438
  if (o.some(
3390
- (I) => I.field === "method" || I.field === "url"
3439
+ (w) => w.field === "method" || w.field === "url"
3391
3440
  ) && c.operation !== null)
3392
3441
  return h(
3393
3442
  "Cannot update method or url for a step linked to an OpenAPI operation."
3394
3443
  );
3395
3444
  const g = [];
3396
- for (const I of o)
3397
- switch (I.field) {
3445
+ for (const w of o)
3446
+ switch (w.field) {
3398
3447
  case "method":
3399
3448
  case "url": {
3400
- if (I.field === "method") {
3401
- const O = I.data;
3449
+ if (w.field === "method") {
3450
+ const O = w.data;
3402
3451
  u((S) => ({
3403
3452
  ...S,
3404
- xOperation: { ...S.xOperation ?? ut, method: O }
3453
+ xOperation: { ...S.xOperation ?? ft, method: O }
3405
3454
  }));
3406
3455
  } else {
3407
- const O = Oi(I.data);
3456
+ const O = Ri(w.data);
3408
3457
  u((S) => ({
3409
3458
  ...S,
3410
- xOperation: { ...S.xOperation ?? ut, url: O },
3459
+ xOperation: { ...S.xOperation ?? ft, url: O },
3411
3460
  parameters: {
3412
3461
  ...S.parameters,
3413
- queryParameters: fo(
3414
- mo(O),
3462
+ queryParameters: wo(
3463
+ yo(O),
3415
3464
  S.parameters.queryParameters
3416
3465
  )
3417
3466
  }
@@ -3421,16 +3470,16 @@ function xi(e) {
3421
3470
  break;
3422
3471
  }
3423
3472
  case "description": {
3424
- const O = I.data;
3473
+ const O = w.data;
3425
3474
  u((S) => ({ ...S, description: O })), g.push(y("applied"));
3426
3475
  break;
3427
3476
  }
3428
3477
  case "body": {
3429
- const { content: O, contentType: S } = I.data;
3430
- u((P) => ({
3431
- ...P,
3478
+ const { content: O, contentType: S } = w.data;
3479
+ u((q) => ({
3480
+ ...q,
3432
3481
  requestBody: {
3433
- ...P.requestBody,
3482
+ ...q.requestBody,
3434
3483
  content: O,
3435
3484
  ...S !== void 0 && { type: S }
3436
3485
  }
@@ -3438,16 +3487,16 @@ function xi(e) {
3438
3487
  break;
3439
3488
  }
3440
3489
  case "parameters":
3441
- g.push(Ai(I, f));
3490
+ g.push(Pi(w, f));
3442
3491
  break;
3443
3492
  case "outputs":
3444
- g.push(Ei(I, f));
3493
+ g.push(qi(w, f));
3445
3494
  break;
3446
3495
  case "successCriteria":
3447
- g.push($i(I, f));
3496
+ g.push(Ni(w, f));
3448
3497
  break;
3449
3498
  }
3450
- const v = o.some((I) => I.field === "outputs");
3499
+ const v = o.some((w) => w.field === "outputs");
3451
3500
  return {
3452
3501
  isError: !1,
3453
3502
  data: {
@@ -3455,17 +3504,17 @@ function xi(e) {
3455
3504
  approvedChanges: a.approvedChanges ?? o.length,
3456
3505
  applied: g,
3457
3506
  ...v && {
3458
- resultingState: _e(d().outputs) || "Outputs: (none)"
3507
+ resultingState: Re(d().outputs) || "Outputs: (none)"
3459
3508
  }
3460
3509
  }
3461
3510
  };
3462
3511
  };
3463
3512
  }
3464
- const _i = {
3513
+ const Di = {
3465
3514
  name: "update_step",
3466
- definition: Ci,
3467
- createExecutor: (e) => xi(e.store)
3468
- }, Ri = `Search the public web via a nested agent and return a consolidated summary.
3515
+ definition: _i,
3516
+ createExecutor: (e) => Ui(e.store)
3517
+ }, Wi = `Search the public web via a nested agent and return a consolidated summary.
3469
3518
 
3470
3519
  **What it does**
3471
3520
  - Runs provider web search (results depend on the active model provider) and synthesizes findings for the parent agent.
@@ -3482,21 +3531,21 @@ const _i = {
3482
3531
 
3483
3532
  **Input guidance**
3484
3533
  - State a clear, self-contained query: what to look up and what to return (facts, links, version numbers, etc.).
3485
- - Prefer one web search call per distinct lookup; do not nest web search calls.`, qi = p({
3534
+ - Prefer one web search call per distinct lookup; do not nest web search calls.`, Li = p({
3486
3535
  task: i().describe("What to search for on the web and what to return"),
3487
3536
  url: i().describe("The URL to execute search on")
3488
- }), Pi = fe(), Ni = {
3489
- description: Ri,
3490
- inputSchema: qi,
3491
- outputSchema: Pi,
3537
+ }), Mi = me(), Fi = {
3538
+ description: Wi,
3539
+ inputSchema: Li,
3540
+ outputSchema: Mi,
3492
3541
  needsApproval: !0
3493
- }, Ui = `
3542
+ }, ji = `
3494
3543
  You are a web search subagent inside Replay, invoked by the parent agent to complete a single lookup task.
3495
3544
 
3496
3545
  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.
3497
3546
 
3498
3547
  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.
3499
- `, Di = `
3548
+ `, Bi = `
3500
3549
  - Never hallucinate or invent an answer when the information is not available from the web search.
3501
3550
  - 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.
3502
3551
  - 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.
@@ -3505,28 +3554,28 @@ You must use the provider web search tool to gather information. You cannot acce
3505
3554
  - Include source URLs for all claims that are material to the parent agent's next steps.
3506
3555
  - Clearly distinguish between verified findings, inferred conclusions, and information that could not be verified.
3507
3556
  - When sources conflict, report the conflict and cite the competing sources rather than selecting a winner without evidence.
3508
- `, Wi = Io(
3557
+ `, Yi = bo(
3509
3558
  //
3510
- Ye("role", Ui),
3511
- Ye("output", Di)
3559
+ He("role", ji),
3560
+ He("output", Bi)
3512
3561
  );
3513
- function Li() {
3514
- return [yo(Wi)];
3562
+ function zi() {
3563
+ return [ko(Yi)];
3515
3564
  }
3516
- function Mi(e) {
3517
- const t = No(e), o = So(e);
3565
+ function Hi(e) {
3566
+ const t = Lo(e), o = Ao(e);
3518
3567
  return async (n, r) => {
3519
3568
  try {
3520
3569
  return {
3521
3570
  isError: !1,
3522
3571
  data: {
3523
- message: await To({
3572
+ message: await Eo({
3524
3573
  model: o,
3525
- system: Li(),
3526
- prompt: Fi(n),
3574
+ system: zi(),
3575
+ prompt: Gi(n),
3527
3576
  tools: t,
3528
3577
  toolChoice: "required",
3529
- stopWhen: Co("web_search"),
3578
+ stopWhen: $o("web_search"),
3530
3579
  temperature: 0,
3531
3580
  abortSignal: r.abortSignal
3532
3581
  }).text
@@ -3540,7 +3589,7 @@ function Mi(e) {
3540
3589
  }
3541
3590
  };
3542
3591
  }
3543
- function Fi(e) {
3592
+ function Gi(e) {
3544
3593
  return C([
3545
3594
  //
3546
3595
  "[URL]",
@@ -3550,71 +3599,71 @@ function Fi(e) {
3550
3599
  e.task
3551
3600
  ]);
3552
3601
  }
3553
- const ji = {
3602
+ const Vi = {
3554
3603
  name: "web_search",
3555
- definition: Ni,
3556
- createExecutor: (e) => Mi(e.model)
3557
- }, Ft = [
3558
- Ys,
3559
- ta,
3560
- da,
3561
- ya,
3562
- La,
3563
- li,
3564
- _i,
3565
- Hn,
3566
- Br,
3567
- Ss,
3568
- ji,
3569
- fr
3604
+ definition: Fi,
3605
+ createExecutor: (e) => Hi(e.model)
3606
+ }, Yt = [
3607
+ Js,
3608
+ ia,
3609
+ Ia,
3610
+ Ta,
3611
+ za,
3612
+ hi,
3613
+ Di,
3614
+ Jn,
3615
+ Gr,
3616
+ $s,
3617
+ Vi,
3618
+ wr
3570
3619
  ];
3571
- function Bi(e) {
3572
- return Ft.some((t) => t.name === e);
3620
+ function Ki(e) {
3621
+ return Yt.some((t) => t.name === e);
3573
3622
  }
3574
- function ic(e, t) {
3575
- for (const o of Ft)
3623
+ function fc(e, t) {
3624
+ for (const o of Yt)
3576
3625
  e.register(
3577
- xn(
3626
+ qn(
3578
3627
  o,
3579
3628
  t[o.name]
3580
3629
  )
3581
3630
  );
3582
3631
  }
3583
- function Yi(e) {
3632
+ function Ji(e) {
3584
3633
  const t = e.startsWith("tool-") ? e.slice(5) : e;
3585
- return Bi(t) ? t : void 0;
3634
+ return Ki(t) ? t : void 0;
3586
3635
  }
3587
- function zi(e, t) {
3636
+ function Qi(e, t) {
3588
3637
  return `${e}::${t}`;
3589
3638
  }
3590
- function We(e) {
3639
+ function Me(e) {
3591
3640
  return typeof e == "object" && e !== null && "type" in e && typeof e.type == "string" && e.type.startsWith("tool-") && "toolCallId" in e;
3592
3641
  }
3593
- function Le(e) {
3642
+ function Fe(e) {
3594
3643
  return e.state === "approval-requested" && e.approval?.id != null;
3595
3644
  }
3596
- function Hi(e) {
3645
+ function Xi(e) {
3597
3646
  return e.state === "output-denied" ? !0 : e.state === "output-available" && e.approval != null;
3598
3647
  }
3599
- function jt(e) {
3600
- return e.parts.some((t) => We(t) && Le(t));
3648
+ function zt(e) {
3649
+ return e.parts.some((t) => Me(t) && Fe(t));
3601
3650
  }
3602
- function cc(e) {
3603
- return e.some(jt);
3651
+ function mc(e) {
3652
+ return e.some(zt);
3604
3653
  }
3605
- function lc(e) {
3654
+ function hc(e) {
3606
3655
  return e.map(
3607
- (t) => jt(t) ? { ...t, parts: t.parts.map(Gi) } : t
3656
+ (t) => zt(t) ? { ...t, parts: t.parts.map(Zi) } : t
3608
3657
  );
3609
3658
  }
3610
- function Gi(e) {
3611
- return !We(e) || !Le(e) ? e : {
3659
+ function Zi(e) {
3660
+ return !Me(e) || !Fe(e) ? e : {
3612
3661
  ...e,
3613
3662
  state: "output-denied",
3614
3663
  approval: { id: e.approval.id, approved: !1 }
3615
3664
  };
3616
3665
  }
3617
- function dc(e) {
3666
+ function Ic(e) {
3618
3667
  const t = [], o = [];
3619
3668
  let n = 0;
3620
3669
  const r = {}, s = () => {
@@ -3647,43 +3696,43 @@ function dc(e) {
3647
3696
  });
3648
3697
  continue;
3649
3698
  }
3650
- if (!We(c))
3699
+ if (!Me(c))
3651
3700
  continue;
3652
- const d = Yi(c.type);
3653
- if (d === Po) {
3654
- const u = Ki(c);
3701
+ const d = Ji(c.type);
3702
+ if (d === Wo) {
3703
+ const u = tc(c);
3655
3704
  if (u) {
3656
- const f = zi(u.collectionId, u.workflowId), m = r[f] ??= [];
3705
+ const f = Qi(u.collectionId, u.workflowId), m = r[f] ??= [];
3657
3706
  m.includes(u.historyId) || m.push(u.historyId);
3658
3707
  }
3659
3708
  }
3660
- if (d === qo) {
3661
- const u = Ji(c.input);
3709
+ if (d === Do) {
3710
+ const u = oc(c.input);
3662
3711
  u && a(u);
3663
3712
  continue;
3664
3713
  }
3665
- if (Le(c) || Hi(c)) {
3714
+ if (Fe(c) || Xi(c)) {
3666
3715
  s(), t.push({ kind: "tool", part: c, key: `tool-${l}` });
3667
3716
  continue;
3668
3717
  }
3669
3718
  }
3670
3719
  return s(), t;
3671
3720
  }
3672
- const Vi = p({
3673
- isError: w(!1),
3721
+ const ec = p({
3722
+ isError: I(!1),
3674
3723
  data: p({
3675
3724
  collectionId: i().min(1),
3676
3725
  workflowId: i().min(1),
3677
3726
  historyId: i().min(1)
3678
3727
  })
3679
3728
  });
3680
- function Ki(e) {
3729
+ function tc(e) {
3681
3730
  if (e.state !== "output-available")
3682
3731
  return;
3683
- const t = Vi.safeParse(e.output);
3732
+ const t = ec.safeParse(e.output);
3684
3733
  return t.success ? t.data.data : void 0;
3685
3734
  }
3686
- function Ji(e) {
3735
+ function oc(e) {
3687
3736
  if (e == null || typeof e != "object")
3688
3737
  return;
3689
3738
  const t = e.message;
@@ -3692,21 +3741,21 @@ function Ji(e) {
3692
3741
  const o = t.trim();
3693
3742
  return o.length > 0 ? o : void 0;
3694
3743
  }
3695
- function uc(e) {
3744
+ function wc(e) {
3696
3745
  return e.filter((t) => t.type === "text").map((t) => t.text ?? "").join("");
3697
3746
  }
3698
- function pc(e) {
3699
- return Ro({
3700
- queryKey: bt.detail(e ?? ""),
3701
- queryFn: async () => e ? await gt.getInstance().findOne(e) ?? null : null,
3747
+ function yc(e) {
3748
+ return Uo({
3749
+ queryKey: St.detail(e ?? ""),
3750
+ queryFn: async () => e ? await kt.getInstance().findOne(e) ?? null : null,
3702
3751
  enabled: !!e
3703
3752
  });
3704
3753
  }
3705
- function fc(e) {
3706
- return _o({
3707
- queryKey: bt.infiniteHistory(e),
3754
+ function vc(e) {
3755
+ return No({
3756
+ queryKey: St.infiniteHistory(e),
3708
3757
  initialPageParam: 0,
3709
- queryFn: async ({ pageParam: t }) => gt.getInstance().findRecentChatsPage({
3758
+ queryFn: async ({ pageParam: t }) => kt.getInstance().findRecentChatsPage({
3710
3759
  offset: t,
3711
3760
  limit: e
3712
3761
  }),
@@ -3714,40 +3763,40 @@ function fc(e) {
3714
3763
  });
3715
3764
  }
3716
3765
  export {
3717
- Rn as A,
3718
- ac as B,
3766
+ Un as A,
3767
+ pc as B,
3719
3768
  _ as C,
3720
- Yi as D,
3721
- Hi as E,
3722
- dc as F,
3723
- fc as G,
3724
- sc as H,
3725
- re as L,
3726
- rc as T,
3727
- Hn as a,
3728
- Br as b,
3729
- li as c,
3730
- ya as d,
3731
- da as e,
3732
- ta as f,
3733
- fr as g,
3734
- cc as h,
3735
- lc as i,
3736
- uc as j,
3737
- pc as k,
3738
- _s as l,
3739
- Ss as m,
3740
- Ns as n,
3741
- Ys as o,
3742
- Ps as p,
3743
- zi as q,
3744
- ic as r,
3745
- La as s,
3746
- nc as t,
3747
- _i as u,
3748
- We as v,
3749
- ji as w,
3750
- Le as x,
3751
- ei as y,
3752
- Rs as z
3769
+ Ji as D,
3770
+ Xi as E,
3771
+ Ic as F,
3772
+ vc as G,
3773
+ uc as H,
3774
+ se as L,
3775
+ dc as T,
3776
+ Jn as a,
3777
+ Gr as b,
3778
+ hi as c,
3779
+ Ta as d,
3780
+ Ia as e,
3781
+ ia as f,
3782
+ wr as g,
3783
+ mc as h,
3784
+ hc as i,
3785
+ wc as j,
3786
+ yc as k,
3787
+ Ds as l,
3788
+ $s as m,
3789
+ Fs as n,
3790
+ Js as o,
3791
+ Ms as p,
3792
+ Qi as q,
3793
+ fc as r,
3794
+ za as s,
3795
+ lc as t,
3796
+ Di as u,
3797
+ Me as v,
3798
+ Vi as w,
3799
+ Fe as x,
3800
+ ai as y,
3801
+ Ws as z
3753
3802
  };