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