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