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