@redocly/replay 0.29.0-next.6 → 0.29.0-next.7
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-Dp-0hM6u.js → replay-AiChatProvider-CsMz9Ny8.js} +1 -1
- package/dist/{replay-AiChatProvider-_4MWKqjh.js → replay-AiChatProvider-PrZdp8BS.js} +52 -52
- package/dist/{replay-AiChatSqliteDBStorage-UzxSiaa4.js → replay-AiChatSqliteDBStorage-2UcwycP7.js} +1 -1
- package/dist/{replay-AiChatSqliteDBStorage-Oa4hysNI.js → replay-AiChatSqliteDBStorage-Ch8nYYAX.js} +1 -1
- package/dist/{replay-AiPanel-C7V7VEFK.js → replay-AiPanel-BVP0e_Ra.js} +1 -1
- package/dist/{replay-AiPanel-Cng3cFVq.js → replay-AiPanel-jeLVfdPf.js} +4 -4
- package/dist/replay-FileWatcher-ByAuX5yb.js +1 -0
- package/dist/{replay-FileWatcher-B2REfBM5.js → replay-FileWatcher-CCeuRwSI.js} +2 -2
- package/dist/{replay-SemanticSearchService-BhnCT7Z0.js → replay-SemanticSearchService-CWnYSg2x.js} +1 -1
- package/dist/{replay-SemanticSearchService-B027vvCl.js → replay-SemanticSearchService-CqpTIrD8.js} +32 -32
- package/dist/{replay-SqliteDBStorage-SoY4qOnd.js → replay-SqliteDBStorage-8Q5sVT__.js} +2 -2
- package/dist/{replay-SqliteDBStorage-IZ7jCbkY.js → replay-SqliteDBStorage-DlhoTUy-.js} +1 -1
- package/dist/{replay-TauriFileSystemAdapter-BfH97cwK.js → replay-TauriFileSystemAdapter-CsxsNEHS.js} +1 -1
- package/dist/{replay-TauriFileSystemAdapter-C8LC19nl.js → replay-TauriFileSystemAdapter-D2TWeqg4.js} +1 -1
- package/dist/{replay-TauriRootStorage-11a1y8Gt.js → replay-TauriRootStorage-DU5cTkJu.js} +15 -15
- package/dist/{replay-TauriRootStorage-BzJznVb7.js → replay-TauriRootStorage-DVr-1sCz.js} +1 -1
- package/dist/{replay-agent-loop-BjoAr7G_.js → replay-agent-loop-BIWlrZnE.js} +3 -3
- package/dist/{replay-agent-loop-Ck47szY-.js → replay-agent-loop-BclAkqxN.js} +1 -1
- package/dist/{replay-ai-chat-mappers-DQMFqfm5.js → replay-ai-chat-mappers-IIq8wpuk.js} +1 -1
- package/dist/{replay-ai-chat-mappers-B7xdsJNR.js → replay-ai-chat-mappers-tMl4GKpA.js} +1 -1
- package/dist/{replay-create-model-Bli_v8yv.js → replay-create-model-CJJtDY2W.js} +4 -4
- package/dist/{replay-create-model-Dsn4EnHO.js → replay-create-model-Dbu-RKR1.js} +3 -3
- package/dist/{replay-db-CVwyQ9mx.js → replay-db-CiDc3f4H.js} +6 -6
- package/dist/{replay-db-CQ4ZMVoP.js → replay-db-DuJyF4Fr.js} +1 -1
- package/dist/{replay-external-resolver-BTxGCk8J.js → replay-external-resolver-CUHRd2KI.js} +1 -1
- package/dist/{replay-external-resolver-BeVOSP0e.js → replay-external-resolver-hjlmO2_f.js} +2 -2
- package/dist/{replay-index-Cj1st_Mh.js → replay-index-BJkWpnD3.js} +1 -1
- package/dist/{replay-index-GMdv2Mbb.js → replay-index-BKy0VJhC.js} +1 -1
- package/dist/{replay-index-DCXNHuqM.js → replay-index-BRps0K8N.js} +5 -5
- package/dist/{replay-index-BRATjW8A.js → replay-index-BiX81nFD.js} +1 -1
- package/dist/{replay-index-JSdiVy-s.js → replay-index-BvHpl6n6.js} +1 -1
- package/dist/{replay-index-fAxVJ0Lp.js → replay-index-CI5fXezW.js} +1164 -1164
- package/dist/replay-index-DUwBFEXC.js +4 -0
- package/dist/replay-index-DV7TIbcG.js +1 -0
- package/dist/{replay-index-jkDlU0Lx.js → replay-index-MZZGINEM.js} +6 -6
- package/dist/{replay-index-DiSy_1OY.js → replay-index-PvlFMxhx.js} +1 -1
- package/dist/{replay-index-CZKbLR1Q.js → replay-index-jO1drB_G.js} +19812 -19779
- package/dist/replay-index-twpStg_q.js +1 -0
- package/dist/{replay-lint-B5Y0f_xB.js → replay-lint-DG6Bpj__.js} +3 -3
- package/dist/{replay-lint-D9lcI1vl.js → replay-lint-DviuCvyd.js} +3 -3
- package/dist/{replay-lint-graphql-BvBl_3l8.js → replay-lint-graphql-DCVDIu3K.js} +15 -15
- package/dist/{replay-lint-graphql-DKWH5u_B.js → replay-lint-graphql-y5Q8AbLi.js} +1 -1
- package/dist/{replay-periodic-revalidation-VvJSzZwq.js → replay-periodic-revalidation-8ApdHWIQ.js} +1 -1
- package/dist/{replay-periodic-revalidation-COYMnQbs.js → replay-periodic-revalidation-BwkTngTv.js} +1 -1
- package/dist/{replay-resolve-BJBgR5ui.js → replay-resolve-DXK9kMSh.js} +1 -1
- package/dist/{replay-resolve-DnJdXpgd.js → replay-resolve-mFgjNvXW.js} +1 -1
- package/dist/{replay-respect-run-B0VuZsRD.js → replay-respect-run-C_EkBybE.js} +3 -3
- package/dist/{replay-respect-run-DfeDqBey.js → replay-respect-run-Xc6vPsJi.js} +1 -1
- package/dist/{replay-tauri-path-CspwsPg-.js → replay-tauri-path-9izlvCOU.js} +1 -1
- package/dist/{replay-tauri-path-2hh0ihN5.js → replay-tauri-path-DQJXzOyo.js} +2 -2
- package/dist/{replay-useAiChatQueries-npA6uTpu.js → replay-useAiChatQueries-BIfk0TxI.js} +460 -460
- package/dist/{replay-useAiChatQueries-Mu7qBzg7.js → replay-useAiChatQueries-d02SKxxb.js} +43 -43
- package/dist/{replay-validate-key-rnDZ0V6_.js → replay-validate-key-BBw0AkiP.js} +1 -1
- package/dist/{replay-validate-key-BEKlKcuC.js → replay-validate-key-DO3mXt_J.js} +2 -2
- package/dist/replay.cjs +1 -1
- package/dist/replay.js +9 -9
- package/package.json +3 -2
- package/dist/replay-FileWatcher-DlDB2pmS.js +0 -1
- package/dist/replay-core-BJmXmoC5.js +0 -1
- package/dist/replay-core-B_hiOZZr.js +0 -10
- package/dist/replay-index-3lwhSmvi.js +0 -1
- package/dist/replay-index-BUuiEmgb.js +0 -4
- package/dist/replay-index-Oct6Dygd.js +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useContext as
|
|
2
|
-
import { R as
|
|
3
|
-
import { b as C, f as
|
|
4
|
-
import { b as So, o as To, d as Co, e as p, u as
|
|
5
|
-
import { g as xo, e as
|
|
1
|
+
import { useContext as zt, createContext as Ht } from "react";
|
|
2
|
+
import { R as Gt, A as be, aR as se, aS as Vt, aT as Kt, aU as Jt, ac as x, a as ue, aH as Y, aV as pt, aW as Oe, aG as Ae, aX as ft, aY as pe, aZ as ee, c as b, a_ as Qt, an as G, al as V, a$ as mt, b0 as fe, am as Ee, b1 as Xt, b2 as Zt, b3 as eo, b4 as to, b5 as oo, b6 as no, b7 as ro, af as K, b8 as so, ag as te, aa as ao, b9 as io, ba as co, bb as ht, bc as It, bd as lo, be as wt, bf as yt, bg as uo, ai as J, bh as po, ab as vt, bi as $e, aB as gt, bj as fo, bk as mo, bl as Me, F as k, bm as Fe, bn as ho, bo as Be, bp as Io, bq as wo, br as yo, a9 as bt, a8 as kt } from "./replay-index-jO1drB_G.js";
|
|
3
|
+
import { b as C, f as St, a as Tt, c as Ct, d as me, e as Ot, i as je, h as xe, R as z, j as vo, k as go, p as bo, s as Ye, l as ko } from "./replay-db-CiDc3f4H.js";
|
|
4
|
+
import { b as So, o as To, d as Co, e as p, u as he, f as i, h as R, j as E, n as A, k as j, m as I, q as T, r as _e, t as oe, v as Ie, Z as H, w as Oo, x as ze, c as Ao, s as Eo, y as $o } from "./replay-create-model-CJJtDY2W.js";
|
|
5
|
+
import { g as xo, e as He, a as _o, b as Ro, c as Ge, d as Po, f as qo } from "./replay-SemanticSearchService-CqpTIrD8.js";
|
|
6
6
|
import { useInfiniteQuery as No, useQuery as Uo } from "@tanstack/react-query";
|
|
7
|
-
const
|
|
7
|
+
const ae = {
|
|
8
8
|
path: "pathParameters",
|
|
9
9
|
query: "queryParameters",
|
|
10
10
|
header: "headers",
|
|
@@ -40,26 +40,26 @@ const se = {
|
|
|
40
40
|
}, uc = {
|
|
41
41
|
CHAT: "chat",
|
|
42
42
|
HISTORY: "history"
|
|
43
|
-
}, Do = "report_status", Wo = "run_workflow",
|
|
43
|
+
}, Do = "report_status", Wo = "run_workflow", ne = {
|
|
44
44
|
WEB_SEARCH: "web_search"
|
|
45
45
|
};
|
|
46
46
|
function Lo(e) {
|
|
47
47
|
switch (e.provider) {
|
|
48
48
|
case be.GEMINI:
|
|
49
49
|
return {
|
|
50
|
-
[
|
|
50
|
+
[ne.WEB_SEARCH]: Co.tools.googleSearch({})
|
|
51
51
|
};
|
|
52
52
|
case be.OPENAI:
|
|
53
53
|
return {
|
|
54
|
-
[
|
|
54
|
+
[ne.WEB_SEARCH]: To.tools.webSearch({})
|
|
55
55
|
};
|
|
56
56
|
case be.ANTHROPIC:
|
|
57
57
|
return {
|
|
58
|
-
[
|
|
58
|
+
[ne.WEB_SEARCH]: So.tools.webFetch_20250910()
|
|
59
59
|
};
|
|
60
|
-
case
|
|
60
|
+
case Gt:
|
|
61
61
|
return {
|
|
62
|
-
[
|
|
62
|
+
[ne.WEB_SEARCH]: {
|
|
63
63
|
type: "provider",
|
|
64
64
|
id: "reunite.web_search",
|
|
65
65
|
name: "web_search",
|
|
@@ -76,7 +76,7 @@ function Fo(e) {
|
|
|
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 Bo(e) {
|
|
80
80
|
const t = [];
|
|
81
81
|
if (e.collection?.workflows?.length) {
|
|
82
82
|
t.push("Workflows:");
|
|
@@ -86,7 +86,7 @@ function jo(e) {
|
|
|
86
86
|
return C(t, `
|
|
87
87
|
`);
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function jo(e) {
|
|
90
90
|
const t = [];
|
|
91
91
|
if (e.collection?.sourceDescriptions?.length) {
|
|
92
92
|
t.push("Source descriptions:");
|
|
@@ -104,10 +104,10 @@ function Yo(e, t) {
|
|
|
104
104
|
o.push(Fo(e));
|
|
105
105
|
break;
|
|
106
106
|
case "workflows":
|
|
107
|
-
o.push(
|
|
107
|
+
o.push(Bo(e));
|
|
108
108
|
break;
|
|
109
109
|
case "sourceDescriptions":
|
|
110
|
-
o.push(
|
|
110
|
+
o.push(jo(e));
|
|
111
111
|
break;
|
|
112
112
|
}
|
|
113
113
|
return C(o, `
|
|
@@ -135,10 +135,10 @@ function Ho(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: ${St(e.parameterDetails)}` : null,
|
|
139
|
+
t.includes("security") && e.relatedSecuritySchemes ? `Security schemes: ${Tt(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: ${Ct(e.responseSchemas)}` : null
|
|
142
142
|
],
|
|
143
143
|
`
|
|
144
144
|
`
|
|
@@ -164,21 +164,21 @@ ${e.outputs.map(
|
|
|
164
164
|
).join(`
|
|
165
165
|
`)}` : null;
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function At(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
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} ${At(t)}`).join(`
|
|
173
173
|
`)}` : null;
|
|
174
174
|
}
|
|
175
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}${At(o)}`], r = me(o.security);
|
|
179
|
+
r && n.push(je(r, " "));
|
|
180
|
+
const s = xe(o.outputs);
|
|
181
|
+
return s && n.push(je(s, " ")), n.join(`
|
|
182
182
|
`);
|
|
183
183
|
}).join(`
|
|
184
184
|
`)}` : null;
|
|
@@ -188,9 +188,9 @@ function Xo(e, t) {
|
|
|
188
188
|
case "inputs":
|
|
189
189
|
return Vo(e);
|
|
190
190
|
case "parameters":
|
|
191
|
-
return
|
|
191
|
+
return Ot(e.parameters);
|
|
192
192
|
case "security":
|
|
193
|
-
return
|
|
193
|
+
return me(e.security);
|
|
194
194
|
case "outputs":
|
|
195
195
|
return Ko(e);
|
|
196
196
|
case "steps":
|
|
@@ -263,13 +263,13 @@ function sn(e) {
|
|
|
263
263
|
function an(e, t) {
|
|
264
264
|
switch (t) {
|
|
265
265
|
case "parameters":
|
|
266
|
-
return
|
|
266
|
+
return Ot(e.parameters) || null;
|
|
267
267
|
case "requestBody":
|
|
268
268
|
return go(e.requestBody) || null;
|
|
269
269
|
case "security":
|
|
270
|
-
return
|
|
270
|
+
return me(e.security) || null;
|
|
271
271
|
case "outputs":
|
|
272
|
-
return
|
|
272
|
+
return xe(e.outputs) || null;
|
|
273
273
|
case "successCriteria":
|
|
274
274
|
return vo(e.successCriteria) || null;
|
|
275
275
|
default:
|
|
@@ -315,7 +315,7 @@ ${C(o, `
|
|
|
315
315
|
return C(r, `
|
|
316
316
|
`);
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function Ve(e, t) {
|
|
319
319
|
const o = [];
|
|
320
320
|
for (const n of t) {
|
|
321
321
|
const r = an(e, n);
|
|
@@ -326,7 +326,7 @@ function Je(e, t) {
|
|
|
326
326
|
}
|
|
327
327
|
function dn(e, t) {
|
|
328
328
|
const o = ["Current tab (step)"];
|
|
329
|
-
return t.length === 0 ? null : (t.includes("info") && o.push(cn(e)), e.draftStep ? o.push(
|
|
329
|
+
return t.length === 0 ? null : (t.includes("info") && o.push(cn(e)), e.draftStep ? o.push(Ve(e.draftStep, t)) : e.step && o.push(Ve(e.step, t)), t.includes("response") && o.push(ln(e)), C(o, `
|
|
330
330
|
|
|
331
331
|
`));
|
|
332
332
|
}
|
|
@@ -362,11 +362,11 @@ function fn(e, t) {
|
|
|
362
362
|
t.includes("description") ? un(e.description) : null,
|
|
363
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: ${St(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: ${Tt(e.relatedSecuritySchemes)}` : null,
|
|
369
|
+
t.includes("responses") && e.responseSchemas ? `Responses: ${Ct(e.responseSchemas)}` : null
|
|
370
370
|
],
|
|
371
371
|
`
|
|
372
372
|
`
|
|
@@ -391,38 +391,38 @@ ${JSON.stringify(e.severitySettings, null, 2)}`;
|
|
|
391
391
|
function bn(e, t) {
|
|
392
392
|
return e.length > t ? `${e.slice(0, t)}…` : e;
|
|
393
393
|
}
|
|
394
|
-
function
|
|
394
|
+
function Ke(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 bn(
|
|
397
|
+
return bn(se(r, t), o);
|
|
398
398
|
}
|
|
399
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 ? se(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"}`, Kt(e) ? "passed" : "failed");
|
|
405
|
+
const a = e.checks ? Jt(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}: ${se(c.message, t)}` : c.name
|
|
409
409
|
);
|
|
410
410
|
s.push(`(${l.join("; ")})`);
|
|
411
411
|
}
|
|
412
412
|
return s.join(" ");
|
|
413
413
|
}
|
|
414
414
|
function Sn(e, t, o) {
|
|
415
|
-
const { steps: n, totalSteps: r, passedSteps: s, succeeded: a, timedOut: l } =
|
|
415
|
+
const { steps: n, totalSteps: r, passedSteps: s, succeeded: a, timedOut: l } = Vt(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
418
|
let f = yn, m = 0;
|
|
419
|
-
for (const { step:
|
|
420
|
-
if (u.push(` ${kn(
|
|
419
|
+
for (const { step: v } of n) {
|
|
420
|
+
if (u.push(` ${kn(v, t)}`), f <= 0) {
|
|
421
421
|
m++;
|
|
422
422
|
continue;
|
|
423
423
|
}
|
|
424
|
-
const
|
|
425
|
-
f -=
|
|
424
|
+
const w = Ke(v.response?.body, t, wn);
|
|
425
|
+
f -= w.length, u.push(` body: ${w}`);
|
|
426
426
|
}
|
|
427
427
|
m > 0 && u.push(
|
|
428
428
|
` (${m} step body previews omitted to save space; request them via stepIds)`
|
|
@@ -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
|
+
${Ke(
|
|
438
438
|
f.step.response?.body,
|
|
439
439
|
t,
|
|
440
440
|
z,
|
|
@@ -450,7 +450,7 @@ function Tn(e, t) {
|
|
|
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: ${se(
|
|
454
454
|
e.runError || "unknown error",
|
|
455
455
|
o
|
|
456
456
|
)}`;
|
|
@@ -503,7 +503,7 @@ function An(e) {
|
|
|
503
503
|
return In;
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function Et(e) {
|
|
507
507
|
return e.trim().replace(/\s+/g, " ").replace(new RegExp("(?<![.!?:;,…])[.!?:;,…]+$"), "").toLowerCase();
|
|
508
508
|
}
|
|
509
509
|
function En(e, t) {
|
|
@@ -524,14 +524,14 @@ function $n(e, t, o) {
|
|
|
524
524
|
}
|
|
525
525
|
return { blocked: r, notes: n };
|
|
526
526
|
}
|
|
527
|
-
function
|
|
527
|
+
function $t(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 = Je(e.key, n);
|
|
531
|
+
return s === null ? null : r.priorInputs.some((l) => Je(e.key, l) === s) ? { action: t, message: o } : null;
|
|
532
532
|
};
|
|
533
533
|
}
|
|
534
|
-
function
|
|
534
|
+
function Je(e, t) {
|
|
535
535
|
try {
|
|
536
536
|
return e(t);
|
|
537
537
|
} catch {
|
|
@@ -539,7 +539,7 @@ function Xe(e, t) {
|
|
|
539
539
|
}
|
|
540
540
|
}
|
|
541
541
|
function xn(e) {
|
|
542
|
-
const t =
|
|
542
|
+
const t = Qe("warn", e.warnAfter, e.warnMessage), o = Qe("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 xn(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 Qe(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`);
|
|
@@ -610,43 +610,43 @@ const Nn = {
|
|
|
610
610
|
},
|
|
611
611
|
chatStatus: "ready",
|
|
612
612
|
chatError: void 0
|
|
613
|
-
}, Un =
|
|
613
|
+
}, Un = Ht(
|
|
614
614
|
Nn
|
|
615
615
|
);
|
|
616
616
|
function pc() {
|
|
617
|
-
return
|
|
617
|
+
return zt(Un);
|
|
618
618
|
}
|
|
619
619
|
const Dn = p({
|
|
620
620
|
message: i(),
|
|
621
|
-
details:
|
|
622
|
-
}),
|
|
621
|
+
details: he().optional()
|
|
622
|
+
}), Re = p({
|
|
623
623
|
action: E(["add", "update", "remove"]).describe('Action to perform: "add", "update" or "remove".'),
|
|
624
624
|
approved: R().default(!0)
|
|
625
|
-
}),
|
|
625
|
+
}), W = Re.extend({
|
|
626
626
|
id: i().optional().describe("Existing item id. Required for update/remove actions.")
|
|
627
|
-
}), Wn =
|
|
627
|
+
}), Wn = Re.extend({
|
|
628
628
|
index: A().int().min(0).optional().describe("Existing item index. Required for update/remove actions.")
|
|
629
629
|
}), Ln = p({
|
|
630
630
|
isError: I(!1),
|
|
631
631
|
blocked: I(!0),
|
|
632
632
|
note: i(),
|
|
633
|
-
data:
|
|
634
|
-
error:
|
|
633
|
+
data: j().optional(),
|
|
634
|
+
error: j().optional()
|
|
635
635
|
});
|
|
636
|
-
function
|
|
637
|
-
return
|
|
636
|
+
function q(e) {
|
|
637
|
+
return _e([
|
|
638
638
|
p({
|
|
639
639
|
isError: I(!0),
|
|
640
640
|
error: Dn,
|
|
641
|
-
data:
|
|
642
|
-
blocked:
|
|
641
|
+
data: j().optional(),
|
|
642
|
+
blocked: j().optional()
|
|
643
643
|
}),
|
|
644
644
|
p({
|
|
645
645
|
isError: I(!1),
|
|
646
646
|
data: e,
|
|
647
|
-
error:
|
|
647
|
+
error: j().optional(),
|
|
648
648
|
note: i().optional(),
|
|
649
|
-
blocked:
|
|
649
|
+
blocked: j().optional()
|
|
650
650
|
}),
|
|
651
651
|
Ln
|
|
652
652
|
]);
|
|
@@ -659,7 +659,7 @@ const Mn = p({
|
|
|
659
659
|
approvedChanges: A().int().min(0),
|
|
660
660
|
applied: T(Mn),
|
|
661
661
|
resultingState: i().optional().describe("Resulting state of the mutated fields after all changes were applied.")
|
|
662
|
-
}),
|
|
662
|
+
}), xt = q(Fn), Bn = "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.", jn = E([
|
|
663
663
|
"info",
|
|
664
664
|
"workflows",
|
|
665
665
|
"sourceDescriptions",
|
|
@@ -674,8 +674,8 @@ const Mn = p({
|
|
|
674
674
|
"response",
|
|
675
675
|
"result",
|
|
676
676
|
"severity"
|
|
677
|
-
]), Yn =
|
|
678
|
-
sections: T(
|
|
677
|
+
]), Yn = oe({
|
|
678
|
+
sections: T(jn).min(1).describe(
|
|
679
679
|
"Content blocks to include in the response. Use tab-type-specific sections from the tool description; invalid sections for the current tab are ignored."
|
|
680
680
|
),
|
|
681
681
|
stepIds: T(i()).min(1).optional().describe(
|
|
@@ -683,8 +683,8 @@ const Mn = p({
|
|
|
683
683
|
)
|
|
684
684
|
}), zn = p({
|
|
685
685
|
message: i()
|
|
686
|
-
}), Hn =
|
|
687
|
-
description:
|
|
686
|
+
}), Hn = q(zn), Gn = {
|
|
687
|
+
description: Bn,
|
|
688
688
|
inputSchema: Yn,
|
|
689
689
|
outputSchema: Hn,
|
|
690
690
|
needsApproval: !1
|
|
@@ -737,7 +737,7 @@ const Jn = {
|
|
|
737
737
|
|
|
738
738
|
**Input guidance**
|
|
739
739
|
- \`apiId\` is required (the loaded API's id, the same identifier the search tool uses).
|
|
740
|
-
- Read one \`field\` at a time; use \`cursor\` only to continue a section you already started.`, Xn =
|
|
740
|
+
- Read one \`field\` at a time; use \`cursor\` only to continue a section you already started.`, Xn = oe({
|
|
741
741
|
apiId: i().describe(
|
|
742
742
|
"ID of the loaded API document to read (the API URI, the same identifier used by the search tool)."
|
|
743
743
|
),
|
|
@@ -759,31 +759,31 @@ const Jn = {
|
|
|
759
759
|
blocked: T(er)
|
|
760
760
|
}), or = p({
|
|
761
761
|
field: i(),
|
|
762
|
-
value:
|
|
762
|
+
value: he(),
|
|
763
763
|
start: A().int().nonnegative().optional(),
|
|
764
764
|
end: A().int().nonnegative().optional(),
|
|
765
765
|
total: A().int().nonnegative().optional(),
|
|
766
766
|
truncated: R(),
|
|
767
767
|
nextCursor: i().nullable()
|
|
768
|
-
}), nr =
|
|
768
|
+
}), nr = _e([tr, or]), rr = q(nr), sr = {
|
|
769
769
|
description: Qn,
|
|
770
770
|
inputSchema: Xn,
|
|
771
771
|
outputSchema: rr,
|
|
772
772
|
needsApproval: !1
|
|
773
|
-
},
|
|
773
|
+
}, ie = {
|
|
774
774
|
paths: "Use the search tool to read endpoints and operations.",
|
|
775
775
|
webhooks: "Use the search tool to read webhook operations.",
|
|
776
776
|
components: "Use the search tool to read reusable components such as schemas and responses.",
|
|
777
777
|
definitions: "Use the search tool to read reusable schemas.",
|
|
778
778
|
parameters: "Use the search tool to read reusable parameters.",
|
|
779
779
|
responses: "Use the search tool to read reusable responses."
|
|
780
|
-
},
|
|
780
|
+
}, _t = ["id", "srcType", "fileDependencies"], we = [
|
|
781
781
|
{
|
|
782
782
|
name: "securitySchemes",
|
|
783
783
|
sources: ["components.securitySchemes", "securityDefinitions"]
|
|
784
784
|
}
|
|
785
|
-
], ar = 10,
|
|
786
|
-
function
|
|
785
|
+
], ar = 10, Xe = 500;
|
|
786
|
+
function Rt(e, t) {
|
|
787
787
|
for (const o of t.sources) {
|
|
788
788
|
const n = ir(e, o);
|
|
789
789
|
if (cr(n)) return n;
|
|
@@ -800,24 +800,24 @@ function Q(e) {
|
|
|
800
800
|
return !(e === null || typeof e != "object" || Array.isArray(e));
|
|
801
801
|
}
|
|
802
802
|
const lr = new Set(
|
|
803
|
-
|
|
803
|
+
we.flatMap((e) => e.sources.map((t) => t.split(".")[0]))
|
|
804
804
|
);
|
|
805
|
-
function
|
|
805
|
+
function Ze(e) {
|
|
806
806
|
const t = [], o = [];
|
|
807
807
|
for (const [n, r] of Object.entries(e)) {
|
|
808
|
-
if (n in
|
|
809
|
-
o.push({ name: n, hint:
|
|
808
|
+
if (n in ie) {
|
|
809
|
+
o.push({ name: n, hint: ie[n] });
|
|
810
810
|
continue;
|
|
811
811
|
}
|
|
812
|
-
|
|
812
|
+
_t.includes(n) || lr.has(n) || t.push(et(n, r));
|
|
813
813
|
}
|
|
814
|
-
for (const n of
|
|
815
|
-
const r =
|
|
816
|
-
r !== null && t.push(
|
|
814
|
+
for (const n of we) {
|
|
815
|
+
const r = Rt(e, n);
|
|
816
|
+
r !== null && t.push(et(n.name, r));
|
|
817
817
|
}
|
|
818
818
|
return { available: t, blocked: o };
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function et(e, t) {
|
|
821
821
|
const o = { name: e, kind: dr(t) };
|
|
822
822
|
return Array.isArray(t) ? o.count = t.length : Q(t) && (o.count = Object.keys(t).length), o;
|
|
823
823
|
}
|
|
@@ -826,14 +826,14 @@ function dr(e) {
|
|
|
826
826
|
}
|
|
827
827
|
function ur(e, t, o) {
|
|
828
828
|
if (Array.isArray(t))
|
|
829
|
-
return
|
|
829
|
+
return tt(e, t, o, (n) => n);
|
|
830
830
|
if (Q(t)) {
|
|
831
831
|
const n = Object.keys(t).sort().map((r) => [r, t[r]]);
|
|
832
|
-
return
|
|
832
|
+
return tt(e, n, o, (r) => Object.fromEntries(r));
|
|
833
833
|
}
|
|
834
834
|
return {
|
|
835
835
|
field: e,
|
|
836
|
-
value:
|
|
836
|
+
value: ce(t),
|
|
837
837
|
truncated: !1,
|
|
838
838
|
nextCursor: null
|
|
839
839
|
};
|
|
@@ -851,11 +851,11 @@ function pr(e, t) {
|
|
|
851
851
|
const s = Number(o.slice(n + 1));
|
|
852
852
|
return !Number.isInteger(s) || s < 0 ? null : s;
|
|
853
853
|
}
|
|
854
|
-
function
|
|
854
|
+
function tt(e, t, o, n) {
|
|
855
855
|
const r = Math.min(Math.max(o, 0), t.length), s = Math.min(r + ar, t.length), a = s < t.length;
|
|
856
856
|
return {
|
|
857
857
|
field: e,
|
|
858
|
-
value:
|
|
858
|
+
value: ce(n(t.slice(r, s))),
|
|
859
859
|
truncated: a,
|
|
860
860
|
start: r,
|
|
861
861
|
end: s,
|
|
@@ -863,15 +863,15 @@ function nt(e, t, o, n) {
|
|
|
863
863
|
nextCursor: a ? fr(e, s) : null
|
|
864
864
|
};
|
|
865
865
|
}
|
|
866
|
-
function
|
|
866
|
+
function ce(e) {
|
|
867
867
|
if (typeof e == "string")
|
|
868
|
-
return e.length >
|
|
868
|
+
return e.length > Xe ? `${e.slice(0, Xe)}…` : e;
|
|
869
869
|
if (Array.isArray(e))
|
|
870
|
-
return e.map(
|
|
870
|
+
return e.map(ce);
|
|
871
871
|
if (Q(e)) {
|
|
872
872
|
const t = {};
|
|
873
873
|
for (const [o, n] of Object.entries(e))
|
|
874
|
-
t[o] =
|
|
874
|
+
t[o] = ce(n);
|
|
875
875
|
return t;
|
|
876
876
|
}
|
|
877
877
|
return e;
|
|
@@ -880,22 +880,22 @@ function fr(e, t) {
|
|
|
880
880
|
return btoa(`${e}:${t}`);
|
|
881
881
|
}
|
|
882
882
|
const mr = new Map(
|
|
883
|
-
|
|
883
|
+
we.flatMap(
|
|
884
884
|
(e) => e.sources.map((t) => [t.split(".")[0], e.name])
|
|
885
885
|
)
|
|
886
886
|
);
|
|
887
887
|
function hr(e, t, o) {
|
|
888
|
-
const n =
|
|
888
|
+
const n = we.find((a) => a.name === t);
|
|
889
889
|
if (n) {
|
|
890
|
-
const a =
|
|
891
|
-
return a === null ?
|
|
890
|
+
const a = Rt(e, n);
|
|
891
|
+
return a === null ? nt(t) : ot(t, a, o);
|
|
892
892
|
}
|
|
893
|
-
if (t in
|
|
893
|
+
if (t in ie)
|
|
894
894
|
return h(
|
|
895
|
-
`"${t}" is not available from this tool. ${
|
|
895
|
+
`"${t}" is not available from this tool. ${ie[t]}`,
|
|
896
896
|
{ field: t }
|
|
897
897
|
);
|
|
898
|
-
if (
|
|
898
|
+
if (_t.includes(t))
|
|
899
899
|
return h(`"${t}" is not an OpenAPI metadata field.`, { field: t });
|
|
900
900
|
const r = mr.get(t);
|
|
901
901
|
if (r !== void 0)
|
|
@@ -903,9 +903,9 @@ function hr(e, t, o) {
|
|
|
903
903
|
field: t
|
|
904
904
|
});
|
|
905
905
|
const s = e[t];
|
|
906
|
-
return s == null ?
|
|
906
|
+
return s == null ? nt(t) : ot(t, s, o);
|
|
907
907
|
}
|
|
908
|
-
function
|
|
908
|
+
function ot(e, t, o) {
|
|
909
909
|
const n = pr(o, e);
|
|
910
910
|
return n === null ? h(
|
|
911
911
|
`The provided cursor is not valid for field "${e}". Omit the cursor to start from the first page.`,
|
|
@@ -915,7 +915,7 @@ function rt(e, t, o) {
|
|
|
915
915
|
data: ur(e, t, n)
|
|
916
916
|
};
|
|
917
917
|
}
|
|
918
|
-
function
|
|
918
|
+
function nt(e) {
|
|
919
919
|
return h(
|
|
920
920
|
`"${e}" is not present in this API. Call this tool without a "field" to scan the available metadata fields.`,
|
|
921
921
|
{ field: e }
|
|
@@ -923,7 +923,7 @@ function st(e) {
|
|
|
923
923
|
}
|
|
924
924
|
function Ir(e) {
|
|
925
925
|
return async (t) => {
|
|
926
|
-
const o = e.get(
|
|
926
|
+
const o = e.get(ue), n = o.find((s) => s.id === t.apiId);
|
|
927
927
|
if (!n)
|
|
928
928
|
return h(`API "${t.apiId}" is not loaded.`, {
|
|
929
929
|
availableApiIds: o.map((s) => s.id)
|
|
@@ -932,11 +932,11 @@ function Ir(e) {
|
|
|
932
932
|
return t.field == null && t.cursor !== void 0 ? h(
|
|
933
933
|
"`cursor` requires `field` to be set — omit `cursor` and pass `field` to read a specific section, or omit both to scan. Returning scan results.",
|
|
934
934
|
{
|
|
935
|
-
data:
|
|
935
|
+
data: Ze(r)
|
|
936
936
|
}
|
|
937
937
|
) : t.field !== void 0 ? hr(r, t.field, t.cursor) : {
|
|
938
938
|
isError: !1,
|
|
939
|
-
data:
|
|
939
|
+
data: Ze(r)
|
|
940
940
|
};
|
|
941
941
|
};
|
|
942
942
|
}
|
|
@@ -1024,7 +1024,7 @@ const wr = {
|
|
|
1024
1024
|
'Step id / label for the new step, used verbatim, so pass a single camelCase token such as "updateUser".'
|
|
1025
1025
|
)
|
|
1026
1026
|
}).strict(), _r = p({
|
|
1027
|
-
payload:
|
|
1027
|
+
payload: Ie("action", [
|
|
1028
1028
|
vr,
|
|
1029
1029
|
gr,
|
|
1030
1030
|
br,
|
|
@@ -1044,14 +1044,14 @@ const wr = {
|
|
|
1044
1044
|
collectionId: i().optional(),
|
|
1045
1045
|
workflowId: i().optional(),
|
|
1046
1046
|
stepId: i().optional()
|
|
1047
|
-
}), Pr =
|
|
1047
|
+
}), Pr = q(Rr), qr = {
|
|
1048
1048
|
description: yr,
|
|
1049
1049
|
inputSchema: _r,
|
|
1050
1050
|
outputSchema: Pr,
|
|
1051
1051
|
needsApproval: (e) => e.payload.action === "delete_collection" || e.payload.action === "delete_workflow" || e.payload.action === "delete_step" || e.payload.action === "save_tab_to_collection"
|
|
1052
1052
|
};
|
|
1053
|
-
function
|
|
1054
|
-
return { ...
|
|
1053
|
+
function rt(e, t, o) {
|
|
1054
|
+
return { ...ft(e), key: t, value: o, active: !0 };
|
|
1055
1055
|
}
|
|
1056
1056
|
function Nr(e, t, o) {
|
|
1057
1057
|
const n = /* @__PURE__ */ new Map();
|
|
@@ -1059,10 +1059,10 @@ function Nr(e, t, o) {
|
|
|
1059
1059
|
n.set(s.name, s.value);
|
|
1060
1060
|
const r = [];
|
|
1061
1061
|
for (const s of e) {
|
|
1062
|
-
if (
|
|
1062
|
+
if (Ae(s) && s.key && n.has(s.key)) {
|
|
1063
1063
|
const a = n.get(s.key);
|
|
1064
1064
|
n.delete(s.key), r.push({
|
|
1065
|
-
...
|
|
1065
|
+
...rt(t, s.key, a),
|
|
1066
1066
|
id: s.id,
|
|
1067
1067
|
...s.allowReserved !== void 0 && { allowReserved: s.allowReserved }
|
|
1068
1068
|
});
|
|
@@ -1071,7 +1071,7 @@ function Nr(e, t, o) {
|
|
|
1071
1071
|
r.push(s);
|
|
1072
1072
|
}
|
|
1073
1073
|
for (const s of o)
|
|
1074
|
-
n.has(s.name) && (r.push(
|
|
1074
|
+
n.has(s.name) && (r.push(rt(t, s.name, n.get(s.name))), n.delete(s.name));
|
|
1075
1075
|
return r;
|
|
1076
1076
|
}
|
|
1077
1077
|
function Ur(e, t) {
|
|
@@ -1085,11 +1085,11 @@ function Ur(e, t) {
|
|
|
1085
1085
|
const r = o.get(n.in) ?? [];
|
|
1086
1086
|
r.push(n), o.set(n.in, r);
|
|
1087
1087
|
}
|
|
1088
|
-
for (const n of Object.keys(
|
|
1088
|
+
for (const n of Object.keys(ae)) {
|
|
1089
1089
|
const r = o.get(n);
|
|
1090
1090
|
if (!r?.length)
|
|
1091
1091
|
continue;
|
|
1092
|
-
const s =
|
|
1092
|
+
const s = ae[n];
|
|
1093
1093
|
e.parameters[s] = Nr(
|
|
1094
1094
|
e.parameters[s],
|
|
1095
1095
|
n,
|
|
@@ -1111,7 +1111,7 @@ function Ur(e, t) {
|
|
|
1111
1111
|
}
|
|
1112
1112
|
if (t.successCriteria?.length)
|
|
1113
1113
|
for (const o of t.successCriteria) {
|
|
1114
|
-
const n =
|
|
1114
|
+
const n = pt(
|
|
1115
1115
|
o.type ?? Oe.SIMPLE
|
|
1116
1116
|
);
|
|
1117
1117
|
e.successCriteria.push({
|
|
@@ -1134,7 +1134,7 @@ function Dr(e) {
|
|
|
1134
1134
|
case "delete_workflow":
|
|
1135
1135
|
return Fr(t.payload, e);
|
|
1136
1136
|
case "create_step":
|
|
1137
|
-
return
|
|
1137
|
+
return Br(t.payload, e);
|
|
1138
1138
|
case "delete_step":
|
|
1139
1139
|
return Yr(t.payload, e);
|
|
1140
1140
|
case "move_step":
|
|
@@ -1145,7 +1145,7 @@ function Dr(e) {
|
|
|
1145
1145
|
};
|
|
1146
1146
|
}
|
|
1147
1147
|
function Wr(e, { store: t }) {
|
|
1148
|
-
const o =
|
|
1148
|
+
const o = ro({
|
|
1149
1149
|
name: e.title.trim(),
|
|
1150
1150
|
collections: t.get(b)
|
|
1151
1151
|
});
|
|
@@ -1162,7 +1162,7 @@ function Lr(e, { store: t, handleCloseByDataId: o }) {
|
|
|
1162
1162
|
if (!n)
|
|
1163
1163
|
return h("Collection not found.", { collectionId: e.collectionId });
|
|
1164
1164
|
const r = n.info.title;
|
|
1165
|
-
return
|
|
1165
|
+
return le(n, o), t.set(b, (s) => no(s, e.collectionId)), {
|
|
1166
1166
|
isError: !1,
|
|
1167
1167
|
data: {
|
|
1168
1168
|
summary: `Deleted collection "${r}" (${e.collectionId}).`,
|
|
@@ -1174,10 +1174,10 @@ function Mr(e, { store: t }) {
|
|
|
1174
1174
|
const o = G(t.get(b), e.collectionId);
|
|
1175
1175
|
if (!o)
|
|
1176
1176
|
return h("Collection not found.", { collectionId: e.collectionId });
|
|
1177
|
-
const n =
|
|
1177
|
+
const n = to({ name: e.name.trim(), collection: o });
|
|
1178
1178
|
return t.set(
|
|
1179
1179
|
b,
|
|
1180
|
-
(r) =>
|
|
1180
|
+
(r) => oo(r, e.collectionId, (s) => ({
|
|
1181
1181
|
...s,
|
|
1182
1182
|
workflows: [...s.workflows, n]
|
|
1183
1183
|
}))
|
|
@@ -1198,12 +1198,12 @@ function Fr(e, { store: t, handleCloseByDataId: o }) {
|
|
|
1198
1198
|
collectionId: e.collectionId,
|
|
1199
1199
|
workflowId: e.workflowId
|
|
1200
1200
|
});
|
|
1201
|
-
return s ? (
|
|
1201
|
+
return s ? (le(s, o, {
|
|
1202
1202
|
collectionId: e.collectionId,
|
|
1203
1203
|
workflowId: null
|
|
1204
1204
|
}), t.set(
|
|
1205
1205
|
b,
|
|
1206
|
-
(a) =>
|
|
1206
|
+
(a) => eo(a, {
|
|
1207
1207
|
collectionId: e.collectionId,
|
|
1208
1208
|
workflowId: e.workflowId
|
|
1209
1209
|
})
|
|
@@ -1219,7 +1219,7 @@ function Fr(e, { store: t, handleCloseByDataId: o }) {
|
|
|
1219
1219
|
workflowId: e.workflowId
|
|
1220
1220
|
});
|
|
1221
1221
|
}
|
|
1222
|
-
async function
|
|
1222
|
+
async function Br(e, { store: t, attachApiToCollection: o, convertOperationToReplayValue: n }) {
|
|
1223
1223
|
const r = t.get(b);
|
|
1224
1224
|
if (!G(r, e.collectionId))
|
|
1225
1225
|
return h("Collection not found.", { collectionId: e.collectionId });
|
|
@@ -1243,15 +1243,15 @@ async function jr(e, { store: t, attachApiToCollection: o, convertOperationToRep
|
|
|
1243
1243
|
url: e.xOperation.url
|
|
1244
1244
|
} : void 0;
|
|
1245
1245
|
let d;
|
|
1246
|
-
l && (d =
|
|
1247
|
-
t.get(
|
|
1246
|
+
l && (d = Zt(
|
|
1247
|
+
t.get(ue),
|
|
1248
1248
|
l,
|
|
1249
1249
|
n
|
|
1250
1250
|
), d && await o({
|
|
1251
1251
|
collectionId: e.collectionId,
|
|
1252
1252
|
apiId: l.apiId
|
|
1253
1253
|
}));
|
|
1254
|
-
const u =
|
|
1254
|
+
const u = mt({
|
|
1255
1255
|
name: e.stepName?.trim() || "New Step",
|
|
1256
1256
|
workflow: a,
|
|
1257
1257
|
operation: l,
|
|
@@ -1265,7 +1265,7 @@ async function jr(e, { store: t, attachApiToCollection: o, convertOperationToRep
|
|
|
1265
1265
|
outputs: e.outputs,
|
|
1266
1266
|
successCriteria: e.successCriteria
|
|
1267
1267
|
});
|
|
1268
|
-
const f =
|
|
1268
|
+
const f = jr(
|
|
1269
1269
|
t,
|
|
1270
1270
|
{ collectionId: e.collectionId, workflowId: e.workflowId },
|
|
1271
1271
|
u,
|
|
@@ -1281,14 +1281,14 @@ async function jr(e, { store: t, attachApiToCollection: o, convertOperationToRep
|
|
|
1281
1281
|
}
|
|
1282
1282
|
};
|
|
1283
1283
|
}
|
|
1284
|
-
function
|
|
1284
|
+
function Pt(e, t) {
|
|
1285
1285
|
return Math.min(Math.max(e, 0), t);
|
|
1286
1286
|
}
|
|
1287
|
-
function
|
|
1288
|
-
const r = V(e.get(b), t)?.steps.length ?? 0, s = n === void 0 ? r :
|
|
1287
|
+
function jr(e, t, o, n) {
|
|
1288
|
+
const r = V(e.get(b), t)?.steps.length ?? 0, s = n === void 0 ? r : Pt(n, r);
|
|
1289
1289
|
return e.set(
|
|
1290
1290
|
b,
|
|
1291
|
-
(a) =>
|
|
1291
|
+
(a) => fe(a, t, (l) => {
|
|
1292
1292
|
const c = [...l.steps];
|
|
1293
1293
|
return c.splice(s, 0, o), { ...l, steps: c };
|
|
1294
1294
|
})
|
|
@@ -1300,7 +1300,7 @@ function Yr(e, { store: t, handleCloseByDataId: o }) {
|
|
|
1300
1300
|
workflowId: e.workflowId,
|
|
1301
1301
|
stepId: e.stepId
|
|
1302
1302
|
};
|
|
1303
|
-
return
|
|
1303
|
+
return Ee(t.get(b), n) ? (o(n), t.set(b, (s) => Xt(s, n)), {
|
|
1304
1304
|
isError: !1,
|
|
1305
1305
|
data: {
|
|
1306
1306
|
summary: `Deleted step ${e.stepId} from workflow ${e.workflowId}.`,
|
|
@@ -1331,10 +1331,10 @@ function zr(e, { store: t }) {
|
|
|
1331
1331
|
workflowId: e.workflowId,
|
|
1332
1332
|
stepId: e.stepId
|
|
1333
1333
|
});
|
|
1334
|
-
const a =
|
|
1334
|
+
const a = Pt(e.toIndex, r.length - 1);
|
|
1335
1335
|
return t.set(
|
|
1336
1336
|
b,
|
|
1337
|
-
(l) =>
|
|
1337
|
+
(l) => fe(l, o, (c) => {
|
|
1338
1338
|
const d = [...c.steps], [u] = d.splice(s, 1);
|
|
1339
1339
|
return d.splice(a, 0, u), { ...c, steps: d };
|
|
1340
1340
|
})
|
|
@@ -1349,14 +1349,14 @@ function zr(e, { store: t }) {
|
|
|
1349
1349
|
};
|
|
1350
1350
|
}
|
|
1351
1351
|
async function Hr(e, { store: t, attachApiToCollection: o }) {
|
|
1352
|
-
const n =
|
|
1352
|
+
const n = pe(t);
|
|
1353
1353
|
if (!n)
|
|
1354
1354
|
return h("No active tab.");
|
|
1355
|
-
if (!
|
|
1355
|
+
if (!ee(n))
|
|
1356
1356
|
return h("Active tab is not a step tab.", {
|
|
1357
1357
|
tabType: n.data.type
|
|
1358
1358
|
});
|
|
1359
|
-
const r = t.get(b), s =
|
|
1359
|
+
const r = t.get(b), s = Qt(r, n.data);
|
|
1360
1360
|
if (!s)
|
|
1361
1361
|
return h("No step data available on the active tab.");
|
|
1362
1362
|
if (!G(r, e.targetCollectionId))
|
|
@@ -1372,14 +1372,14 @@ async function Hr(e, { store: t, attachApiToCollection: o }) {
|
|
|
1372
1372
|
collectionId: e.targetCollectionId,
|
|
1373
1373
|
workflowId: e.targetWorkflowId
|
|
1374
1374
|
});
|
|
1375
|
-
const d =
|
|
1375
|
+
const d = mt({
|
|
1376
1376
|
name: e.newStepName.trim(),
|
|
1377
1377
|
workflow: c,
|
|
1378
1378
|
fromStep: s
|
|
1379
1379
|
});
|
|
1380
1380
|
return t.set(
|
|
1381
1381
|
b,
|
|
1382
|
-
(u) =>
|
|
1382
|
+
(u) => fe(u, l, (f) => ({
|
|
1383
1383
|
...f,
|
|
1384
1384
|
steps: [...f.steps, d]
|
|
1385
1385
|
}))
|
|
@@ -1396,11 +1396,11 @@ async function Hr(e, { store: t, attachApiToCollection: o }) {
|
|
|
1396
1396
|
}
|
|
1397
1397
|
};
|
|
1398
1398
|
}
|
|
1399
|
-
function
|
|
1399
|
+
function le(e, t, o) {
|
|
1400
1400
|
if ("workflows" in e) {
|
|
1401
1401
|
const n = e.id;
|
|
1402
1402
|
e.workflows.forEach(
|
|
1403
|
-
(r) =>
|
|
1403
|
+
(r) => le(r, t, {
|
|
1404
1404
|
collectionId: n,
|
|
1405
1405
|
workflowId: null
|
|
1406
1406
|
})
|
|
@@ -1410,7 +1410,7 @@ function ce(e, t, o) {
|
|
|
1410
1410
|
if ("steps" in e) {
|
|
1411
1411
|
const n = e.workflowId;
|
|
1412
1412
|
e.steps.forEach(
|
|
1413
|
-
(r) =>
|
|
1413
|
+
(r) => le(r, t, {
|
|
1414
1414
|
collectionId: o?.collectionId,
|
|
1415
1415
|
workflowId: n
|
|
1416
1416
|
})
|
|
@@ -1455,23 +1455,23 @@ const Gr = {
|
|
|
1455
1455
|
**Loop/budget guidance**
|
|
1456
1456
|
- Re-read environment/input data when decisions depend on up-to-date values.
|
|
1457
1457
|
- Batch related input/server changes for the same environment when practical.
|
|
1458
|
-
- After changing the active environment, re-check assumptions that depended on the previous one.`,
|
|
1458
|
+
- After changing the active environment, re-check assumptions that depended on the previous one.`, L = i().min(1).optional().describe("Environment name. Omit to use the active environment."), Kr = p({
|
|
1459
1459
|
action: I("get_environments")
|
|
1460
1460
|
}).strict(), Jr = p({
|
|
1461
1461
|
action: I("get_active_environment")
|
|
1462
1462
|
}).strict(), Qr = p({
|
|
1463
1463
|
action: I("get_inputs"),
|
|
1464
|
-
environment:
|
|
1464
|
+
environment: L
|
|
1465
1465
|
}).strict(), Xr = p({
|
|
1466
1466
|
action: I("get_servers"),
|
|
1467
|
-
environment:
|
|
1467
|
+
environment: L
|
|
1468
1468
|
}).strict(), Zr = p({
|
|
1469
1469
|
action: I("get_input"),
|
|
1470
|
-
environment:
|
|
1470
|
+
environment: L,
|
|
1471
1471
|
inputName: i().min(1)
|
|
1472
1472
|
}).strict(), es = p({
|
|
1473
1473
|
action: I("upsert_input"),
|
|
1474
|
-
environment:
|
|
1474
|
+
environment: L,
|
|
1475
1475
|
name: i().min(1),
|
|
1476
1476
|
value: i(),
|
|
1477
1477
|
isSecret: R().optional().describe(
|
|
@@ -1479,17 +1479,17 @@ const Gr = {
|
|
|
1479
1479
|
)
|
|
1480
1480
|
}).strict(), ts = p({
|
|
1481
1481
|
action: I("remove_input"),
|
|
1482
|
-
environment:
|
|
1482
|
+
environment: L,
|
|
1483
1483
|
inputName: i().min(1)
|
|
1484
|
-
}).strict(),
|
|
1484
|
+
}).strict(), Pe = p({
|
|
1485
1485
|
name: i().min(1),
|
|
1486
1486
|
value: i()
|
|
1487
1487
|
}).strict(), os = p({
|
|
1488
1488
|
action: I("upsert_server"),
|
|
1489
|
-
environment:
|
|
1489
|
+
environment: L,
|
|
1490
1490
|
apiId: i().min(1),
|
|
1491
1491
|
value: i(),
|
|
1492
|
-
variables: T(
|
|
1492
|
+
variables: T(Pe).optional()
|
|
1493
1493
|
}).strict(), ns = p({
|
|
1494
1494
|
name: i().min(1),
|
|
1495
1495
|
value: i(),
|
|
@@ -1497,7 +1497,7 @@ const Gr = {
|
|
|
1497
1497
|
}).strict(), rs = p({
|
|
1498
1498
|
apiId: i().min(1),
|
|
1499
1499
|
value: i(),
|
|
1500
|
-
variables: T(
|
|
1500
|
+
variables: T(Pe).optional()
|
|
1501
1501
|
}).strict(), ss = p({
|
|
1502
1502
|
action: I("add_environment"),
|
|
1503
1503
|
environment: i().min(1).describe("Name of a new environment to create."),
|
|
@@ -1506,13 +1506,13 @@ const Gr = {
|
|
|
1506
1506
|
setActive: R().optional().describe("When true, also set the new environment as active.")
|
|
1507
1507
|
}).strict(), as = p({
|
|
1508
1508
|
action: I("remove_server"),
|
|
1509
|
-
environment:
|
|
1509
|
+
environment: L,
|
|
1510
1510
|
apiId: i().min(1)
|
|
1511
1511
|
}).strict(), is = p({
|
|
1512
1512
|
action: I("set_active_environment"),
|
|
1513
1513
|
environment: i().min(1).describe("Name of the environment to activate.")
|
|
1514
1514
|
}).strict(), cs = p({
|
|
1515
|
-
payload:
|
|
1515
|
+
payload: Ie("action", [
|
|
1516
1516
|
Kr,
|
|
1517
1517
|
ss,
|
|
1518
1518
|
Jr,
|
|
@@ -1539,7 +1539,7 @@ const Gr = {
|
|
|
1539
1539
|
p({
|
|
1540
1540
|
apiId: i(),
|
|
1541
1541
|
value: i(),
|
|
1542
|
-
variables: T(
|
|
1542
|
+
variables: T(Pe)
|
|
1543
1543
|
})
|
|
1544
1544
|
).optional(),
|
|
1545
1545
|
input: p({
|
|
@@ -1549,7 +1549,7 @@ const Gr = {
|
|
|
1549
1549
|
}).optional(),
|
|
1550
1550
|
environment: i().optional(),
|
|
1551
1551
|
apiId: i().optional()
|
|
1552
|
-
}), ds =
|
|
1552
|
+
}), ds = q(ls), us = {
|
|
1553
1553
|
description: Vr,
|
|
1554
1554
|
inputSchema: cs,
|
|
1555
1555
|
outputSchema: ds,
|
|
@@ -1584,7 +1584,7 @@ function ps(e) {
|
|
|
1584
1584
|
};
|
|
1585
1585
|
}
|
|
1586
1586
|
function fs(e) {
|
|
1587
|
-
const t = e.get(K), o = e.get(
|
|
1587
|
+
const t = e.get(K), o = e.get(te).map((n) => n.name);
|
|
1588
1588
|
return {
|
|
1589
1589
|
isError: !1,
|
|
1590
1590
|
data: {
|
|
@@ -1594,11 +1594,11 @@ function fs(e) {
|
|
|
1594
1594
|
};
|
|
1595
1595
|
}
|
|
1596
1596
|
function ms(e, t) {
|
|
1597
|
-
if (
|
|
1597
|
+
if (ye(e, t.environment))
|
|
1598
1598
|
return h("Environment already exists.", {
|
|
1599
1599
|
environment: t.environment
|
|
1600
1600
|
});
|
|
1601
|
-
const n =
|
|
1601
|
+
const n = so(t.environment, /* @__PURE__ */ new Set());
|
|
1602
1602
|
if (n)
|
|
1603
1603
|
return h(n, {
|
|
1604
1604
|
environment: t.environment
|
|
@@ -1614,13 +1614,13 @@ function ms(e, t) {
|
|
|
1614
1614
|
})), a = As(r, s);
|
|
1615
1615
|
return a ? h(a, {
|
|
1616
1616
|
environment: t.environment
|
|
1617
|
-
}) : (e.set(
|
|
1617
|
+
}) : (e.set(te, (l) => [
|
|
1618
1618
|
...l,
|
|
1619
1619
|
{
|
|
1620
1620
|
name: t.environment,
|
|
1621
1621
|
inputs: r,
|
|
1622
1622
|
servers: s,
|
|
1623
|
-
state:
|
|
1623
|
+
state: ao.Normal
|
|
1624
1624
|
}
|
|
1625
1625
|
]), t.setActive && e.set(K, t.environment), {
|
|
1626
1626
|
isError: !1,
|
|
@@ -1632,7 +1632,7 @@ function ms(e, t) {
|
|
|
1632
1632
|
}
|
|
1633
1633
|
function hs(e) {
|
|
1634
1634
|
const t = e.get(K);
|
|
1635
|
-
return
|
|
1635
|
+
return ye(e, t) ? {
|
|
1636
1636
|
isError: !1,
|
|
1637
1637
|
data: {
|
|
1638
1638
|
summary: `Active environment is "${t}".`,
|
|
@@ -1643,7 +1643,7 @@ function hs(e) {
|
|
|
1643
1643
|
});
|
|
1644
1644
|
}
|
|
1645
1645
|
function Is(e, t) {
|
|
1646
|
-
const o =
|
|
1646
|
+
const o = M(e, t.environment);
|
|
1647
1647
|
if (!o.ok)
|
|
1648
1648
|
return o.result;
|
|
1649
1649
|
const { name: n, env: r } = o, s = Cs(r);
|
|
@@ -1657,7 +1657,7 @@ function Is(e, t) {
|
|
|
1657
1657
|
};
|
|
1658
1658
|
}
|
|
1659
1659
|
function ws(e, t) {
|
|
1660
|
-
const o =
|
|
1660
|
+
const o = M(e, t.environment);
|
|
1661
1661
|
if (!o.ok)
|
|
1662
1662
|
return o.result;
|
|
1663
1663
|
const { name: n, env: r } = o, s = Os(r);
|
|
@@ -1671,7 +1671,7 @@ function ws(e, t) {
|
|
|
1671
1671
|
};
|
|
1672
1672
|
}
|
|
1673
1673
|
function ys(e, t) {
|
|
1674
|
-
const o =
|
|
1674
|
+
const o = M(e, t.environment);
|
|
1675
1675
|
if (!o.ok)
|
|
1676
1676
|
return o.result;
|
|
1677
1677
|
const { name: n, env: r } = o, s = r.inputs.find((d) => d.name === t.inputName);
|
|
@@ -1689,23 +1689,23 @@ function ys(e, t) {
|
|
|
1689
1689
|
input: {
|
|
1690
1690
|
name: a,
|
|
1691
1691
|
isSecret: l,
|
|
1692
|
-
value:
|
|
1692
|
+
value: qt(l, c)
|
|
1693
1693
|
}
|
|
1694
1694
|
}
|
|
1695
1695
|
};
|
|
1696
1696
|
}
|
|
1697
1697
|
function vs(e, t) {
|
|
1698
|
-
const o =
|
|
1698
|
+
const o = M(e, t.environment);
|
|
1699
1699
|
if (!o.ok)
|
|
1700
1700
|
return o.result;
|
|
1701
|
-
const { name: n, env: r } = o, s =
|
|
1701
|
+
const { name: n, env: r } = o, s = qe(t.name, "Input names");
|
|
1702
1702
|
if (s)
|
|
1703
1703
|
return h(s, {
|
|
1704
1704
|
environment: n,
|
|
1705
1705
|
inputName: t.name
|
|
1706
1706
|
});
|
|
1707
1707
|
const a = r.inputs.find((c) => c.name === t.name), l = a ? a.isSecret : t.isSecret ?? !1;
|
|
1708
|
-
return
|
|
1708
|
+
return ve(e, n, (c) => ({
|
|
1709
1709
|
...c,
|
|
1710
1710
|
inputs: [
|
|
1711
1711
|
...c.inputs.filter((d) => d.name !== t.name),
|
|
@@ -1720,11 +1720,11 @@ function vs(e, t) {
|
|
|
1720
1720
|
};
|
|
1721
1721
|
}
|
|
1722
1722
|
function gs(e, t) {
|
|
1723
|
-
const o =
|
|
1723
|
+
const o = M(e, t.environment);
|
|
1724
1724
|
if (!o.ok)
|
|
1725
1725
|
return o.result;
|
|
1726
1726
|
const { name: n, env: r } = o;
|
|
1727
|
-
return r.inputs.some((s) => s.name === t.inputName) ? (
|
|
1727
|
+
return r.inputs.some((s) => s.name === t.inputName) ? (ve(e, n, (s) => ({
|
|
1728
1728
|
...s,
|
|
1729
1729
|
inputs: s.inputs.filter((a) => a.name !== t.inputName)
|
|
1730
1730
|
})), {
|
|
@@ -1739,14 +1739,14 @@ function gs(e, t) {
|
|
|
1739
1739
|
});
|
|
1740
1740
|
}
|
|
1741
1741
|
function bs(e, t) {
|
|
1742
|
-
const o =
|
|
1742
|
+
const o = M(e, t.environment);
|
|
1743
1743
|
if (!o.ok)
|
|
1744
1744
|
return o.result;
|
|
1745
|
-
const { name: n } = o, r =
|
|
1745
|
+
const { name: n } = o, r = qe(t.apiId, "Server apiIds") ?? re(
|
|
1746
1746
|
(t.variables ?? []).map((s) => s.name),
|
|
1747
1747
|
"Variable names"
|
|
1748
1748
|
);
|
|
1749
|
-
return r ? h(r, { environment: n, apiId: t.apiId }) : (
|
|
1749
|
+
return r ? h(r, { environment: n, apiId: t.apiId }) : (ve(e, n, (s) => {
|
|
1750
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 = {
|
|
1751
1751
|
apiId: t.apiId,
|
|
1752
1752
|
value: t.value,
|
|
@@ -1766,11 +1766,11 @@ function bs(e, t) {
|
|
|
1766
1766
|
});
|
|
1767
1767
|
}
|
|
1768
1768
|
function ks(e, t) {
|
|
1769
|
-
const o =
|
|
1769
|
+
const o = M(e, t.environment);
|
|
1770
1770
|
if (!o.ok)
|
|
1771
1771
|
return o.result;
|
|
1772
1772
|
const { name: n, env: r } = o;
|
|
1773
|
-
return r.servers.some((s) => s.apiId === t.apiId) ? (
|
|
1773
|
+
return r.servers.some((s) => s.apiId === t.apiId) ? (ve(e, n, (s) => ({
|
|
1774
1774
|
...s,
|
|
1775
1775
|
servers: s.servers.filter((a) => a.apiId !== t.apiId)
|
|
1776
1776
|
})), {
|
|
@@ -1786,7 +1786,7 @@ function ks(e, t) {
|
|
|
1786
1786
|
});
|
|
1787
1787
|
}
|
|
1788
1788
|
function Ss(e, t) {
|
|
1789
|
-
return
|
|
1789
|
+
return ye(e, t.environment) ? (e.set(K, t.environment), {
|
|
1790
1790
|
isError: !1,
|
|
1791
1791
|
data: {
|
|
1792
1792
|
summary: `Active environment is now "${t.environment}".`
|
|
@@ -1796,8 +1796,8 @@ function Ss(e, t) {
|
|
|
1796
1796
|
function Ts(e, t) {
|
|
1797
1797
|
return t ?? e.get(K);
|
|
1798
1798
|
}
|
|
1799
|
-
function
|
|
1800
|
-
const o = Ts(e, t), n =
|
|
1799
|
+
function M(e, t) {
|
|
1800
|
+
const o = Ts(e, t), n = ye(e, o);
|
|
1801
1801
|
return n ? { ok: !0, name: o, env: n } : {
|
|
1802
1802
|
ok: !1,
|
|
1803
1803
|
result: h(
|
|
@@ -1806,12 +1806,12 @@ function F(e, t) {
|
|
|
1806
1806
|
)
|
|
1807
1807
|
};
|
|
1808
1808
|
}
|
|
1809
|
-
function
|
|
1810
|
-
return e.get(
|
|
1809
|
+
function ye(e, t) {
|
|
1810
|
+
return e.get(te).find((o) => o.name === t);
|
|
1811
1811
|
}
|
|
1812
|
-
function
|
|
1812
|
+
function ve(e, t, o) {
|
|
1813
1813
|
e.set(
|
|
1814
|
-
|
|
1814
|
+
te,
|
|
1815
1815
|
(n) => n.map((r) => r.name === t ? o(r) : r)
|
|
1816
1816
|
);
|
|
1817
1817
|
}
|
|
@@ -1819,7 +1819,7 @@ function Cs(e) {
|
|
|
1819
1819
|
return e.inputs.map((t) => ({
|
|
1820
1820
|
name: t.name,
|
|
1821
1821
|
isSecret: t.isSecret,
|
|
1822
|
-
value:
|
|
1822
|
+
value: qt(t.isSecret, t.value)
|
|
1823
1823
|
}));
|
|
1824
1824
|
}
|
|
1825
1825
|
function Os(e) {
|
|
@@ -1829,33 +1829,33 @@ function Os(e) {
|
|
|
1829
1829
|
variables: t.variables.map((o) => ({ name: o.name, value: o.value }))
|
|
1830
1830
|
}));
|
|
1831
1831
|
}
|
|
1832
|
-
function
|
|
1833
|
-
return e ?
|
|
1832
|
+
function qt(e, t) {
|
|
1833
|
+
return e ? co : t;
|
|
1834
1834
|
}
|
|
1835
1835
|
function As(e, t) {
|
|
1836
|
-
return
|
|
1836
|
+
return re(
|
|
1837
1837
|
e.map((o) => o.name),
|
|
1838
1838
|
"Input names"
|
|
1839
|
-
) ??
|
|
1839
|
+
) ?? re(
|
|
1840
1840
|
t.map((o) => o.apiId),
|
|
1841
1841
|
"Server apiIds"
|
|
1842
|
-
) ??
|
|
1842
|
+
) ?? Nt(
|
|
1843
1843
|
t,
|
|
1844
|
-
(o) =>
|
|
1844
|
+
(o) => re(
|
|
1845
1845
|
o.variables.map((n) => n.name),
|
|
1846
1846
|
"Variable names",
|
|
1847
1847
|
` in server "${o.apiId}"`
|
|
1848
1848
|
)
|
|
1849
1849
|
);
|
|
1850
1850
|
}
|
|
1851
|
-
function
|
|
1851
|
+
function re(e, t, o = "") {
|
|
1852
1852
|
const n = Es(e);
|
|
1853
|
-
return n ? `${t}${o} must be unique; "${n}" appears more than once.` :
|
|
1853
|
+
return n ? `${t}${o} must be unique; "${n}" appears more than once.` : Nt(e, (r) => qe(r, t));
|
|
1854
1854
|
}
|
|
1855
|
-
function
|
|
1856
|
-
return e.trim() ?
|
|
1855
|
+
function qe(e, t) {
|
|
1856
|
+
return e.trim() ? io(e) ? `${t} cannot use the reserved key "${e}".` : null : `${t} cannot be blank.`;
|
|
1857
1857
|
}
|
|
1858
|
-
function
|
|
1858
|
+
function Nt(e, t) {
|
|
1859
1859
|
for (const o of e) {
|
|
1860
1860
|
const n = t(o);
|
|
1861
1861
|
if (n) return n;
|
|
@@ -1874,14 +1874,14 @@ const $s = {
|
|
|
1874
1874
|
name: "manage_environment",
|
|
1875
1875
|
definition: us,
|
|
1876
1876
|
createExecutor: (e) => ps(e.store)
|
|
1877
|
-
}, xs =
|
|
1877
|
+
}, xs = ht, _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([
|
|
1878
1878
|
"focus_tab",
|
|
1879
1879
|
"open_operation",
|
|
1880
1880
|
"open_collection",
|
|
1881
1881
|
"open_workflow",
|
|
1882
1882
|
"open_step",
|
|
1883
1883
|
"open_new_request"
|
|
1884
|
-
]), Ps =
|
|
1884
|
+
]), Ps = oe({
|
|
1885
1885
|
action: Rs.describe(
|
|
1886
1886
|
"Tab to open or focus; see tool description for unsaved vs collection actions."
|
|
1887
1887
|
),
|
|
@@ -1912,13 +1912,13 @@ const $s = {
|
|
|
1912
1912
|
activeTabIndex: A().int().nonnegative(),
|
|
1913
1913
|
tabId: i(),
|
|
1914
1914
|
tabType: Oo(x)
|
|
1915
|
-
}), Ns =
|
|
1915
|
+
}), Ns = q(qs), Us = {
|
|
1916
1916
|
description: _s,
|
|
1917
1917
|
inputSchema: Ps,
|
|
1918
1918
|
outputSchema: Ns,
|
|
1919
1919
|
needsApproval: !1
|
|
1920
1920
|
};
|
|
1921
|
-
function
|
|
1921
|
+
function ge({
|
|
1922
1922
|
items: e,
|
|
1923
1923
|
id: t,
|
|
1924
1924
|
messages: o,
|
|
@@ -1935,8 +1935,8 @@ function ve({
|
|
|
1935
1935
|
details: { matches: l.map(r) }
|
|
1936
1936
|
} : { ok: !1, message: o.notFound, details: s(a) };
|
|
1937
1937
|
}
|
|
1938
|
-
function
|
|
1939
|
-
const o =
|
|
1938
|
+
function Ut(e, t) {
|
|
1939
|
+
const o = ge({
|
|
1940
1940
|
items: e,
|
|
1941
1941
|
id: t,
|
|
1942
1942
|
messages: {
|
|
@@ -1958,10 +1958,10 @@ function Dt(e, t) {
|
|
|
1958
1958
|
value: { collectionId: n.id, collection: n }
|
|
1959
1959
|
};
|
|
1960
1960
|
}
|
|
1961
|
-
function
|
|
1962
|
-
const n =
|
|
1961
|
+
function Ne(e, t, o) {
|
|
1962
|
+
const n = Ut(e, t);
|
|
1963
1963
|
if (!n.ok) return n;
|
|
1964
|
-
const r =
|
|
1964
|
+
const r = ge({
|
|
1965
1965
|
items: n.value.collection.workflows,
|
|
1966
1966
|
id: o,
|
|
1967
1967
|
messages: {
|
|
@@ -1990,10 +1990,10 @@ function De(e, t, o) {
|
|
|
1990
1990
|
}
|
|
1991
1991
|
};
|
|
1992
1992
|
}
|
|
1993
|
-
function
|
|
1994
|
-
const r =
|
|
1993
|
+
function Dt(e, t, o, n) {
|
|
1994
|
+
const r = Ne(e, t, o);
|
|
1995
1995
|
if (!r.ok) return r;
|
|
1996
|
-
const s =
|
|
1996
|
+
const s = ge({
|
|
1997
1997
|
items: r.value.workflow.steps,
|
|
1998
1998
|
id: n,
|
|
1999
1999
|
messages: {
|
|
@@ -2025,7 +2025,7 @@ function Wt(e, t, o, n) {
|
|
|
2025
2025
|
};
|
|
2026
2026
|
}
|
|
2027
2027
|
function Ds(e, t) {
|
|
2028
|
-
const o =
|
|
2028
|
+
const o = lo(e).filter(
|
|
2029
2029
|
(r) => r.operationId != null && r.operationId !== ""
|
|
2030
2030
|
);
|
|
2031
2031
|
if (!o.length)
|
|
@@ -2033,7 +2033,7 @@ function Ds(e, t) {
|
|
|
2033
2033
|
ok: !1,
|
|
2034
2034
|
message: "No operations with operationId in loaded APIs."
|
|
2035
2035
|
};
|
|
2036
|
-
const n =
|
|
2036
|
+
const n = ge({
|
|
2037
2037
|
items: o,
|
|
2038
2038
|
id: t,
|
|
2039
2039
|
messages: {
|
|
@@ -2060,7 +2060,7 @@ function Ws(e, t, o, n, r) {
|
|
|
2060
2060
|
message: "Provide all three ids for a saved step, or three empty strings for the focused unsaved request tab."
|
|
2061
2061
|
};
|
|
2062
2062
|
if (a) {
|
|
2063
|
-
const f =
|
|
2063
|
+
const f = Dt(e, o, n, r);
|
|
2064
2064
|
return f.ok ? {
|
|
2065
2065
|
ok: !0,
|
|
2066
2066
|
value: {
|
|
@@ -2069,7 +2069,7 @@ function Ws(e, t, o, n, r) {
|
|
|
2069
2069
|
}
|
|
2070
2070
|
} : f;
|
|
2071
2071
|
}
|
|
2072
|
-
if (!t || !
|
|
2072
|
+
if (!t || !ee(t))
|
|
2073
2073
|
return {
|
|
2074
2074
|
ok: !1,
|
|
2075
2075
|
message: "Active tab is not a step tab.",
|
|
@@ -2080,7 +2080,7 @@ function Ws(e, t, o, n, r) {
|
|
|
2080
2080
|
workflowId: c,
|
|
2081
2081
|
stepId: d
|
|
2082
2082
|
} = t.data;
|
|
2083
|
-
if (!
|
|
2083
|
+
if (!It(l, c, d, "", "", ""))
|
|
2084
2084
|
return {
|
|
2085
2085
|
ok: !1,
|
|
2086
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.",
|
|
@@ -2091,10 +2091,10 @@ function Ws(e, t, o, n, r) {
|
|
|
2091
2091
|
const u = t.data.draftStep;
|
|
2092
2092
|
return u ? { ok: !0, value: { step: u, source: { kind: "draft" } } } : { ok: !1, message: "No draft step on the active tab." };
|
|
2093
2093
|
}
|
|
2094
|
-
function
|
|
2094
|
+
function Wt(e, t, o, n) {
|
|
2095
2095
|
const r = Ws(
|
|
2096
2096
|
e.get(b),
|
|
2097
|
-
|
|
2097
|
+
pe(e) ?? null,
|
|
2098
2098
|
t,
|
|
2099
2099
|
o,
|
|
2100
2100
|
n
|
|
@@ -2107,18 +2107,18 @@ function Lt(e, t, o, n) {
|
|
|
2107
2107
|
ok: !0,
|
|
2108
2108
|
value: {
|
|
2109
2109
|
step: s,
|
|
2110
|
-
readStep: () =>
|
|
2111
|
-
updateStep: (d) => e.set(b, (u) =>
|
|
2110
|
+
readStep: () => Ee(e.get(b), c) ?? s,
|
|
2111
|
+
updateStep: (d) => e.set(b, (u) => wt(u, c, d))
|
|
2112
2112
|
}
|
|
2113
2113
|
};
|
|
2114
2114
|
}
|
|
2115
|
-
const l =
|
|
2115
|
+
const l = yt(e);
|
|
2116
2116
|
return {
|
|
2117
2117
|
ok: !0,
|
|
2118
2118
|
value: {
|
|
2119
2119
|
step: s,
|
|
2120
2120
|
readStep: () => Ls(e, l) ?? s,
|
|
2121
|
-
updateStep: (c) =>
|
|
2121
|
+
updateStep: (c) => uo(e, l, (d) => ({
|
|
2122
2122
|
...d,
|
|
2123
2123
|
draftStep: d.draftStep ? c(d.draftStep) : d.draftStep
|
|
2124
2124
|
}))
|
|
@@ -2127,7 +2127,7 @@ function Lt(e, t, o, n) {
|
|
|
2127
2127
|
}
|
|
2128
2128
|
function Ls(e, t) {
|
|
2129
2129
|
const o = e.get(J)[t];
|
|
2130
|
-
return o &&
|
|
2130
|
+
return o && ee(o) ? o.data.draftStep : null;
|
|
2131
2131
|
}
|
|
2132
2132
|
function Ms(e) {
|
|
2133
2133
|
return {
|
|
@@ -2142,14 +2142,14 @@ function Fs(e, t) {
|
|
|
2142
2142
|
if (t.focusOperationTab(e))
|
|
2143
2143
|
return "focused";
|
|
2144
2144
|
const o = t.getApiOperation(e), n = po(e, o);
|
|
2145
|
-
return t.addNewTab({ ...n, state:
|
|
2145
|
+
return t.addNewTab({ ...n, state: vt.Normal }), "opened";
|
|
2146
2146
|
}
|
|
2147
|
-
function
|
|
2147
|
+
function Bs(e, t) {
|
|
2148
2148
|
return (o, n) => {
|
|
2149
2149
|
try {
|
|
2150
2150
|
switch (o.action) {
|
|
2151
2151
|
case "focus_tab":
|
|
2152
|
-
return
|
|
2152
|
+
return js(e, t, o.tabIndex);
|
|
2153
2153
|
case "open_operation":
|
|
2154
2154
|
return Ys(e, t, o.operationId);
|
|
2155
2155
|
case "open_collection":
|
|
@@ -2185,7 +2185,7 @@ function js(e, t) {
|
|
|
2185
2185
|
}
|
|
2186
2186
|
};
|
|
2187
2187
|
}
|
|
2188
|
-
function
|
|
2188
|
+
function js(e, t, o) {
|
|
2189
2189
|
if (o === void 0)
|
|
2190
2190
|
return $("tabIndex is required when action is focus_tab");
|
|
2191
2191
|
const n = e.get(J);
|
|
@@ -2198,7 +2198,7 @@ function Ys(e, t, o) {
|
|
|
2198
2198
|
const n = o?.trim();
|
|
2199
2199
|
if (!n)
|
|
2200
2200
|
return $("operationId is required when action is open_operation");
|
|
2201
|
-
const r = Ds(e.get(
|
|
2201
|
+
const r = Ds(e.get(ue), n);
|
|
2202
2202
|
if (!r.ok)
|
|
2203
2203
|
return $(r.message, r.details);
|
|
2204
2204
|
const s = Fs(
|
|
@@ -2211,16 +2211,16 @@ function zs(e, t, o, n) {
|
|
|
2211
2211
|
const r = n?.trim();
|
|
2212
2212
|
if (!r)
|
|
2213
2213
|
return $("collectionId is required when action is open_collection");
|
|
2214
|
-
const s =
|
|
2214
|
+
const s = Ut(t, r);
|
|
2215
2215
|
if (!s.ok)
|
|
2216
2216
|
return $(s.message, s.details);
|
|
2217
2217
|
const { collectionId: a } = s.value, l = e.get(J).findIndex((c) => {
|
|
2218
2218
|
const d = c.data;
|
|
2219
|
-
return
|
|
2219
|
+
return $e(d, x.Collection) && d.collectionId === a;
|
|
2220
2220
|
}) !== -1;
|
|
2221
2221
|
return o.openCollectionTab({
|
|
2222
2222
|
collectionId: a,
|
|
2223
|
-
activeTabName:
|
|
2223
|
+
activeTabName: gt.COLLECTION_SETTINGS
|
|
2224
2224
|
}), X(e, l ? "focused" : "opened");
|
|
2225
2225
|
}
|
|
2226
2226
|
function Hs(e, t, o, n, r) {
|
|
@@ -2229,17 +2229,17 @@ function Hs(e, t, o, n, r) {
|
|
|
2229
2229
|
return $("collectionId is required when action is open_workflow");
|
|
2230
2230
|
if (!a)
|
|
2231
2231
|
return $("workflowId is required when action is open_workflow");
|
|
2232
|
-
const l =
|
|
2232
|
+
const l = Ne(t, s, a);
|
|
2233
2233
|
if (!l.ok)
|
|
2234
2234
|
return $(l.message, l.details);
|
|
2235
2235
|
const { collectionId: c, workflowId: d } = l.value, u = e.get(J).findIndex((f) => {
|
|
2236
2236
|
const m = f.data;
|
|
2237
|
-
return
|
|
2237
|
+
return $e(m, x.Workflow) && m.workflowId === d && m.collectionId === c;
|
|
2238
2238
|
}) !== -1;
|
|
2239
2239
|
return o.openWorkflowTab({
|
|
2240
2240
|
collectionId: c,
|
|
2241
2241
|
workflowId: d,
|
|
2242
|
-
activeTabName:
|
|
2242
|
+
activeTabName: gt.WORKFLOW_SETTINGS
|
|
2243
2243
|
}), X(e, u ? "focused" : "opened");
|
|
2244
2244
|
}
|
|
2245
2245
|
function Gs(e, t, o, n, r, s) {
|
|
@@ -2250,7 +2250,7 @@ function Gs(e, t, o, n, r, s) {
|
|
|
2250
2250
|
return $("workflowId is required when action is open_step");
|
|
2251
2251
|
if (!c)
|
|
2252
2252
|
return $("stepId is required when action is open_step");
|
|
2253
|
-
const d =
|
|
2253
|
+
const d = Dt(
|
|
2254
2254
|
t,
|
|
2255
2255
|
a,
|
|
2256
2256
|
l,
|
|
@@ -2262,13 +2262,13 @@ function Gs(e, t, o, n, r, s) {
|
|
|
2262
2262
|
collectionId: u,
|
|
2263
2263
|
workflowId: f,
|
|
2264
2264
|
stepId: m
|
|
2265
|
-
} = d.value,
|
|
2265
|
+
} = d.value, v = e.get(J).find(({ data: w }) => $e(w, x.Step) && w.collectionId === u && w.workflowId === f && w.stepId === m && w.historyId === null) !== void 0;
|
|
2266
2266
|
return o.openStepTabFromCollection({
|
|
2267
2267
|
collectionId: u,
|
|
2268
2268
|
workflowId: f,
|
|
2269
2269
|
stepId: m,
|
|
2270
|
-
state:
|
|
2271
|
-
}), X(e,
|
|
2270
|
+
state: vt.Normal
|
|
2271
|
+
}), X(e, v ? "focused" : "opened");
|
|
2272
2272
|
}
|
|
2273
2273
|
function Vs(e, t, o, n) {
|
|
2274
2274
|
return o ? t.openStepTabFromXOperation({
|
|
@@ -2277,7 +2277,7 @@ function Vs(e, t, o, n) {
|
|
|
2277
2277
|
}) : t.handleNewTabOpen(), X(e, "opened");
|
|
2278
2278
|
}
|
|
2279
2279
|
function X(e, t) {
|
|
2280
|
-
const o =
|
|
2280
|
+
const o = yt(e), n = pe(e);
|
|
2281
2281
|
return n ? Ks(t, o, n.id, n.data.type) : $("No active tab after navigation.", { activeTabIndex: o });
|
|
2282
2282
|
}
|
|
2283
2283
|
function $(e, t) {
|
|
@@ -2292,20 +2292,20 @@ function Ks(e, t, o, n) {
|
|
|
2292
2292
|
const Js = {
|
|
2293
2293
|
name: "open_tab",
|
|
2294
2294
|
definition: Us,
|
|
2295
|
-
createExecutor: (e) =>
|
|
2295
|
+
createExecutor: (e) => Bs(e.store, e.context)
|
|
2296
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.
|
|
2297
2297
|
|
|
2298
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.
|
|
2299
2299
|
|
|
2300
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.
|
|
2301
2301
|
|
|
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 =
|
|
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 = oe({
|
|
2303
2303
|
message: i().trim().min(1).max(220).regex(/^[^\r\n]+$/, "must be a single line").describe(
|
|
2304
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."
|
|
2305
2305
|
)
|
|
2306
2306
|
}), Zs = p({
|
|
2307
2307
|
acknowledged: I(!0)
|
|
2308
|
-
}), ea =
|
|
2308
|
+
}), ea = q(Zs), ta = {
|
|
2309
2309
|
description: Qs,
|
|
2310
2310
|
inputSchema: Xs,
|
|
2311
2311
|
outputSchema: ea,
|
|
@@ -2325,8 +2325,8 @@ function sa(e) {
|
|
|
2325
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.`;
|
|
2326
2326
|
}
|
|
2327
2327
|
const aa = [
|
|
2328
|
-
|
|
2329
|
-
key: (e) =>
|
|
2328
|
+
$t({
|
|
2329
|
+
key: (e) => Et(e.message),
|
|
2330
2330
|
warn: na
|
|
2331
2331
|
}),
|
|
2332
2332
|
xn({
|
|
@@ -2388,13 +2388,13 @@ const aa = [
|
|
|
2388
2388
|
});
|
|
2389
2389
|
}), da = p({
|
|
2390
2390
|
status: A().optional().describe("HTTP status code."),
|
|
2391
|
-
headers: T(
|
|
2392
|
-
cookies: T(
|
|
2391
|
+
headers: T(ze([i(), i()])).optional().describe("Response headers as key-value pairs."),
|
|
2392
|
+
cookies: T(ze([i(), i()])).optional().describe("Response cookies as key-value pairs."),
|
|
2393
2393
|
body: i().optional().describe("Response body, truncated if too large."),
|
|
2394
2394
|
url: i().optional().describe("Final response URL."),
|
|
2395
2395
|
duration: A().optional().describe("Request duration in milliseconds."),
|
|
2396
2396
|
size: A().optional().describe("Response size in bytes.")
|
|
2397
|
-
}), ua =
|
|
2397
|
+
}), ua = q(da), pa = {
|
|
2398
2398
|
description: ca,
|
|
2399
2399
|
inputSchema: la,
|
|
2400
2400
|
outputSchema: ua,
|
|
@@ -2402,94 +2402,94 @@ const aa = [
|
|
|
2402
2402
|
};
|
|
2403
2403
|
function fa(e, t) {
|
|
2404
2404
|
return async (n, r) => {
|
|
2405
|
-
const s =
|
|
2406
|
-
if (!
|
|
2405
|
+
const s = pe(t);
|
|
2406
|
+
if (!s || !ee(s))
|
|
2407
2407
|
return h("Active tab is not a step tab", {
|
|
2408
|
-
tabType:
|
|
2408
|
+
tabType: s?.data?.type
|
|
2409
2409
|
});
|
|
2410
2410
|
const {
|
|
2411
|
-
collectionId:
|
|
2412
|
-
workflowId:
|
|
2413
|
-
stepId:
|
|
2414
|
-
} =
|
|
2415
|
-
if (!
|
|
2411
|
+
collectionId: a,
|
|
2412
|
+
workflowId: l,
|
|
2413
|
+
stepId: c
|
|
2414
|
+
} = s.data, d = n.collectionId.trim(), u = n.workflowId.trim(), f = n.stepId.trim();
|
|
2415
|
+
if (!It(
|
|
2416
|
+
a,
|
|
2416
2417
|
l,
|
|
2417
2418
|
c,
|
|
2418
2419
|
d,
|
|
2419
2420
|
u,
|
|
2420
|
-
f
|
|
2421
|
-
m
|
|
2421
|
+
f
|
|
2422
2422
|
))
|
|
2423
2423
|
return h(
|
|
2424
2424
|
"Active tab does not match the target step. Open the target tab first using open_tab.",
|
|
2425
2425
|
{
|
|
2426
2426
|
activeTab: {
|
|
2427
|
-
collectionId:
|
|
2428
|
-
workflowId:
|
|
2429
|
-
stepId:
|
|
2427
|
+
collectionId: a,
|
|
2428
|
+
workflowId: l,
|
|
2429
|
+
stepId: c
|
|
2430
2430
|
},
|
|
2431
|
-
hint:
|
|
2431
|
+
hint: a === null && l === null && c === null ? "Focused tab is an unsaved request; pass empty strings for collectionId, workflowId, and stepId." : void 0
|
|
2432
2432
|
}
|
|
2433
2433
|
);
|
|
2434
2434
|
const v = t.get(b), w = {
|
|
2435
|
-
collectionId:
|
|
2436
|
-
workflowId:
|
|
2437
|
-
stepId:
|
|
2438
|
-
},
|
|
2439
|
-
let
|
|
2440
|
-
if (
|
|
2441
|
-
|
|
2442
|
-
step:
|
|
2443
|
-
onStepChange: ((
|
|
2435
|
+
collectionId: d || null,
|
|
2436
|
+
workflowId: u || null,
|
|
2437
|
+
stepId: f || null
|
|
2438
|
+
}, g = Ee(v, w), O = s.data.draftStep;
|
|
2439
|
+
let S;
|
|
2440
|
+
if (g)
|
|
2441
|
+
S = {
|
|
2442
|
+
step: g,
|
|
2443
|
+
onStepChange: ((P) => t.set(
|
|
2444
2444
|
b,
|
|
2445
|
-
(
|
|
2445
|
+
(N) => wt(N, w, P)
|
|
2446
2446
|
))
|
|
2447
2447
|
};
|
|
2448
|
-
else if (
|
|
2449
|
-
|
|
2450
|
-
step:
|
|
2451
|
-
onStepChange: ((
|
|
2452
|
-
...
|
|
2453
|
-
draftStep:
|
|
2448
|
+
else if (O)
|
|
2449
|
+
S = {
|
|
2450
|
+
step: O,
|
|
2451
|
+
onStepChange: ((P) => Me(t, s.id, (N) => ({
|
|
2452
|
+
...N,
|
|
2453
|
+
draftStep: N.draftStep ? P(N.draftStep) : N.draftStep
|
|
2454
2454
|
})))
|
|
2455
2455
|
};
|
|
2456
2456
|
else
|
|
2457
2457
|
return h("No step available for the active tab.");
|
|
2458
|
-
const
|
|
2458
|
+
const F = V(v, w);
|
|
2459
2459
|
await fo(
|
|
2460
2460
|
{
|
|
2461
|
-
tabId:
|
|
2462
|
-
updateData: (
|
|
2461
|
+
tabId: s.id,
|
|
2462
|
+
updateData: (P) => Me(t, s.id, P)
|
|
2463
2463
|
},
|
|
2464
2464
|
{
|
|
2465
|
-
...
|
|
2466
|
-
workflow:
|
|
2467
|
-
onWorkflowChange: (
|
|
2465
|
+
...S,
|
|
2466
|
+
workflow: F,
|
|
2467
|
+
onWorkflowChange: (P) => t.set(b, (N) => fe(N, w, P)),
|
|
2468
2468
|
collection: G(v, w.collectionId),
|
|
2469
2469
|
collections: v
|
|
2470
2470
|
},
|
|
2471
2471
|
e,
|
|
2472
|
-
mo(t.get(
|
|
2472
|
+
mo(t.get(te), t.get(K))
|
|
2473
2473
|
);
|
|
2474
|
-
const
|
|
2475
|
-
return
|
|
2474
|
+
const Z = t.get(J).find(({ id: P }) => P === s.id), D = Z && ee(Z) ? Z.data.response : null;
|
|
2475
|
+
return D ? {
|
|
2476
2476
|
isError: !1,
|
|
2477
|
-
data: ma(
|
|
2477
|
+
data: ma(D)
|
|
2478
2478
|
} : h("Request did not produce a response.");
|
|
2479
2479
|
};
|
|
2480
2480
|
}
|
|
2481
2481
|
function ma(e) {
|
|
2482
2482
|
return {
|
|
2483
2483
|
status: e.status,
|
|
2484
|
-
headers:
|
|
2485
|
-
cookies:
|
|
2484
|
+
headers: st(e.headers),
|
|
2485
|
+
cookies: st(e.cookies),
|
|
2486
2486
|
body: ha(e.body ?? ""),
|
|
2487
2487
|
url: e.url ?? "",
|
|
2488
2488
|
duration: e.duration,
|
|
2489
2489
|
size: e.size
|
|
2490
2490
|
};
|
|
2491
2491
|
}
|
|
2492
|
-
function
|
|
2492
|
+
function st(e) {
|
|
2493
2493
|
const t = [];
|
|
2494
2494
|
for (const o of e)
|
|
2495
2495
|
t.push([String(o[0]), String(o[1])]);
|
|
@@ -2525,7 +2525,7 @@ const Ia = {
|
|
|
2525
2525
|
**After the run**
|
|
2526
2526
|
- Report the outcome from this tool's result; do not re-read it with other tools.
|
|
2527
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.
|
|
2528
|
-
- Each call starts a NEW run. Call it again only when the user wants another run.`, ya =
|
|
2528
|
+
- Each call starts a NEW run. Call it again only when the user wants another run.`, ya = oe({
|
|
2529
2529
|
collectionId: i().describe("Id of the collection that holds the workflow."),
|
|
2530
2530
|
workflowId: i().describe("Id of the workflow to run.")
|
|
2531
2531
|
}), va = p({
|
|
@@ -2550,7 +2550,7 @@ const Ia = {
|
|
|
2550
2550
|
steps: T(va).describe(
|
|
2551
2551
|
"Per-step outcome, in execution order: stepId, HTTP statusCode, and pass/fail only — no check name or failure message."
|
|
2552
2552
|
)
|
|
2553
|
-
}), ba =
|
|
2553
|
+
}), ba = q(ga), ka = {
|
|
2554
2554
|
description: wa,
|
|
2555
2555
|
inputSchema: ya,
|
|
2556
2556
|
outputSchema: ba,
|
|
@@ -2563,7 +2563,7 @@ function Sa(e, t) {
|
|
|
2563
2563
|
return h("collectionId is required.");
|
|
2564
2564
|
if (!s)
|
|
2565
2565
|
return h("workflowId is required.");
|
|
2566
|
-
const a =
|
|
2566
|
+
const a = Ne(e.get(b), r, s);
|
|
2567
2567
|
if (!a.ok)
|
|
2568
2568
|
return h(
|
|
2569
2569
|
a.message,
|
|
@@ -2637,7 +2637,7 @@ const Ta = {
|
|
|
2637
2637
|
collectionId: i().optional().describe("Arazzo collection ID."),
|
|
2638
2638
|
workflowId: i().optional().describe("Workflow ID within the collection. Requires collectionId."),
|
|
2639
2639
|
stepId: i().optional().describe("Step ID within a workflow. Requires collectionId and workflowId.")
|
|
2640
|
-
}).strict(), Ea =
|
|
2640
|
+
}).strict(), Ea = he(), $a = {
|
|
2641
2641
|
description: Oa,
|
|
2642
2642
|
inputSchema: Aa,
|
|
2643
2643
|
outputSchema: Ea,
|
|
@@ -2680,8 +2680,8 @@ function Pa(e) {
|
|
|
2680
2680
|
t.push("apiId");
|
|
2681
2681
|
break;
|
|
2682
2682
|
}
|
|
2683
|
-
const
|
|
2684
|
-
!
|
|
2683
|
+
const w = a != null && a !== "", g = r != null && r !== "" && s != null && s !== "";
|
|
2684
|
+
!w && !g && t.push("operationId", "path", "method");
|
|
2685
2685
|
break;
|
|
2686
2686
|
}
|
|
2687
2687
|
case "collection":
|
|
@@ -2695,14 +2695,14 @@ function Pa(e) {
|
|
|
2695
2695
|
break;
|
|
2696
2696
|
default:
|
|
2697
2697
|
if (l != null && l !== "" && (c ? d || t.push("stepId") : t.push("workflowId")), n != null && n !== "") {
|
|
2698
|
-
const
|
|
2699
|
-
!
|
|
2698
|
+
const w = a != null && a !== "", g = r != null && r !== "" && s != null && s !== "";
|
|
2699
|
+
!w && !g && t.push("operationId", "path", "method");
|
|
2700
2700
|
}
|
|
2701
2701
|
}
|
|
2702
2702
|
u != null && u.trim() !== "" || t.push("query");
|
|
2703
2703
|
const m = [...new Set(t)];
|
|
2704
|
-
let
|
|
2705
|
-
return m.length === 0 ?
|
|
2704
|
+
let v;
|
|
2705
|
+
return m.length === 0 ? v = "You already pass strong filters. Try a more specific natural-language query, or confirm IDs and paths match the project." : v = `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.`, v;
|
|
2706
2706
|
}
|
|
2707
2707
|
function qa(e, t) {
|
|
2708
2708
|
const o = e.paths ?? {};
|
|
@@ -2733,13 +2733,13 @@ function qa(e, t) {
|
|
|
2733
2733
|
function Na(e, t) {
|
|
2734
2734
|
const { type: o, apiId: n, operationId: r, path: s, method: a } = t;
|
|
2735
2735
|
if (!n) return [];
|
|
2736
|
-
const l = e.find((
|
|
2736
|
+
const l = e.find((v) => v.id === n);
|
|
2737
2737
|
if (!l) return [];
|
|
2738
2738
|
if (o === "api")
|
|
2739
|
-
return [{ ...
|
|
2739
|
+
return [{ ...He(l).payload, score: 1 }];
|
|
2740
2740
|
const c = r != null && r !== "", d = s != null && s !== "" && a != null && a !== "";
|
|
2741
2741
|
if (!(o === "api_operation" || c || d || o == null && (c || d)))
|
|
2742
|
-
return o == null ? [{ ...
|
|
2742
|
+
return o == null ? [{ ...He(l).payload, score: 1 }] : [];
|
|
2743
2743
|
const f = qa(l, { operationId: r, path: s, method: a });
|
|
2744
2744
|
return f ? [{ ..._o({
|
|
2745
2745
|
apiId: l.id,
|
|
@@ -2759,7 +2759,7 @@ function Ua(e, t) {
|
|
|
2759
2759
|
if (!a) return [];
|
|
2760
2760
|
const l = a.info?.title ?? "Untitled Collection";
|
|
2761
2761
|
if (o === "collection")
|
|
2762
|
-
return [{ ...
|
|
2762
|
+
return [{ ...Ge(a).payload, score: 1 }];
|
|
2763
2763
|
const c = () => {
|
|
2764
2764
|
if (!r || !s) return [];
|
|
2765
2765
|
const u = a.workflows?.find((m) => (m.workflowId ?? "") === r);
|
|
@@ -2787,10 +2787,10 @@ function Ua(e, t) {
|
|
|
2787
2787
|
}
|
|
2788
2788
|
] : [];
|
|
2789
2789
|
};
|
|
2790
|
-
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() : [{ ...Ge(a).payload, score: 1 }] : [];
|
|
2791
2791
|
}
|
|
2792
2792
|
function Da(e, t) {
|
|
2793
|
-
const o = e.get(
|
|
2793
|
+
const o = e.get(ue), n = e.get(b), { type: r } = t;
|
|
2794
2794
|
return r === "api" || r === "api_operation" ? Na(o, t) : r === "collection" || r === "workflow" || r === "step" ? Ua(n, t) : [];
|
|
2795
2795
|
}
|
|
2796
2796
|
function Wa(e, t) {
|
|
@@ -2807,30 +2807,30 @@ const La = "You already ran this exact search earlier in this conversation. If n
|
|
|
2807
2807
|
function Fa(e) {
|
|
2808
2808
|
const t = [
|
|
2809
2809
|
e.type,
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2810
|
+
U(e.query),
|
|
2811
|
+
U(e.apiId),
|
|
2812
|
+
U(e.operationId),
|
|
2813
|
+
U(e.path),
|
|
2814
|
+
U(e.method)?.toLowerCase(),
|
|
2815
|
+
U(e.collectionId),
|
|
2816
|
+
U(e.workflowId),
|
|
2817
|
+
U(e.stepId)
|
|
2818
2818
|
];
|
|
2819
|
-
return t.every((o) => o == null) ? null : JSON.stringify([...t,
|
|
2819
|
+
return t.every((o) => o == null) ? null : JSON.stringify([...t, Ba(e), ja(e)]);
|
|
2820
2820
|
}
|
|
2821
|
-
function
|
|
2821
|
+
function Ba(e) {
|
|
2822
2822
|
return typeof e?.count == "number" ? e.count : Ma;
|
|
2823
2823
|
}
|
|
2824
|
-
function
|
|
2824
|
+
function ja(e) {
|
|
2825
2825
|
return Array.isArray(e?.include) ? [...new Set(e.include)].sort() : [];
|
|
2826
2826
|
}
|
|
2827
|
-
function
|
|
2827
|
+
function U(e) {
|
|
2828
2828
|
if (typeof e != "string") return null;
|
|
2829
|
-
const t =
|
|
2829
|
+
const t = Et(e);
|
|
2830
2830
|
return t === "" ? null : t;
|
|
2831
2831
|
}
|
|
2832
2832
|
const Ya = [
|
|
2833
|
-
|
|
2833
|
+
$t({
|
|
2834
2834
|
key: Fa,
|
|
2835
2835
|
warn: La
|
|
2836
2836
|
})
|
|
@@ -2872,49 +2872,49 @@ const Ya = [
|
|
|
2872
2872
|
key: i().optional().describe(
|
|
2873
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)."
|
|
2874
2874
|
)
|
|
2875
|
-
}).strict(),
|
|
2875
|
+
}).strict(), Lt = p({
|
|
2876
2876
|
...Va
|
|
2877
|
-
}).strict(), Za =
|
|
2877
|
+
}).strict(), Za = Lt.extend({
|
|
2878
2878
|
openIdConnectUrl: i().optional(),
|
|
2879
2879
|
userInfoUrl: i().optional()
|
|
2880
|
-
}).strict(),
|
|
2880
|
+
}).strict(), Mt = i().optional().describe(
|
|
2881
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."
|
|
2882
|
-
),
|
|
2882
|
+
), B = Wn.extend({
|
|
2883
2883
|
action: E(["add", "update"]),
|
|
2884
2884
|
schemeId: i().optional(),
|
|
2885
|
-
stepId:
|
|
2886
|
-
}), ei =
|
|
2887
|
-
|
|
2885
|
+
stepId: Mt
|
|
2886
|
+
}), ei = Ie("type", [
|
|
2887
|
+
B.extend({
|
|
2888
2888
|
type: I(k.BasicAuth),
|
|
2889
2889
|
data: Ka.optional()
|
|
2890
2890
|
}).strict(),
|
|
2891
|
-
|
|
2891
|
+
B.extend({
|
|
2892
2892
|
type: I(k.DigestAuth),
|
|
2893
2893
|
data: Ja.optional()
|
|
2894
2894
|
}).strict(),
|
|
2895
|
-
|
|
2895
|
+
B.extend({
|
|
2896
2896
|
type: I(k.JWT),
|
|
2897
2897
|
data: Qa.optional()
|
|
2898
2898
|
}).strict(),
|
|
2899
|
-
|
|
2899
|
+
B.extend({
|
|
2900
2900
|
type: I(k.APIKey),
|
|
2901
2901
|
data: Xa.optional()
|
|
2902
2902
|
}).strict(),
|
|
2903
|
-
|
|
2903
|
+
B.extend({
|
|
2904
2904
|
type: I(k.OAuth2),
|
|
2905
|
-
data:
|
|
2905
|
+
data: Lt.optional()
|
|
2906
2906
|
}).strict(),
|
|
2907
|
-
|
|
2907
|
+
B.extend({
|
|
2908
2908
|
type: I(k.OpenIDConnect),
|
|
2909
2909
|
data: Za.optional()
|
|
2910
2910
|
}).strict()
|
|
2911
|
-
]), ti =
|
|
2911
|
+
]), ti = Re.extend({
|
|
2912
2912
|
action: I("remove"),
|
|
2913
2913
|
index: A().int().min(0).describe(
|
|
2914
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."
|
|
2915
2915
|
),
|
|
2916
|
-
stepId:
|
|
2917
|
-
}).strict(), oi =
|
|
2916
|
+
stepId: Mt
|
|
2917
|
+
}).strict(), oi = _e([ei, ti]), ni = p({
|
|
2918
2918
|
collectionId: i().describe(
|
|
2919
2919
|
"Saved step: collection id. Unsaved draft tab on focus: empty string (with empty workflowId and stepId)."
|
|
2920
2920
|
),
|
|
@@ -2932,7 +2932,7 @@ const Ya = [
|
|
|
2932
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.",
|
|
2933
2933
|
path: ["collectionId"]
|
|
2934
2934
|
});
|
|
2935
|
-
}), ri =
|
|
2935
|
+
}), ri = xt, si = {
|
|
2936
2936
|
description: Ha,
|
|
2937
2937
|
inputSchema: ni,
|
|
2938
2938
|
outputSchema: ri,
|
|
@@ -2948,7 +2948,7 @@ function y(e, t) {
|
|
|
2948
2948
|
...t !== void 0 && { summary: t }
|
|
2949
2949
|
};
|
|
2950
2950
|
}
|
|
2951
|
-
function
|
|
2951
|
+
function Ft(e) {
|
|
2952
2952
|
if (!e || typeof e != "object" || !("meta" in e))
|
|
2953
2953
|
return {};
|
|
2954
2954
|
const { meta: t } = e;
|
|
@@ -2967,15 +2967,15 @@ const ii = /* @__PURE__ */ new Set(["grantType", "openIdConnectUrl", "userInfoUr
|
|
|
2967
2967
|
function ci(e) {
|
|
2968
2968
|
return e.type === k.OAuth2 || e.type === k.OpenIDConnect;
|
|
2969
2969
|
}
|
|
2970
|
-
function
|
|
2970
|
+
function at(e, t) {
|
|
2971
2971
|
const o = e;
|
|
2972
2972
|
for (const [n, r] of Object.entries(t))
|
|
2973
2973
|
r !== void 0 && n in o && (o[n] = r);
|
|
2974
2974
|
}
|
|
2975
|
-
function
|
|
2975
|
+
function it(e, t) {
|
|
2976
2976
|
const o = Object.entries(t);
|
|
2977
2977
|
for (const [s, a] of o)
|
|
2978
|
-
s === "grantType" && typeof a == "string" &&
|
|
2978
|
+
s === "grantType" && typeof a == "string" && Be[a] && (e.grantType = Be[a]);
|
|
2979
2979
|
const n = e[e.grantType], r = new Set(Object.keys(Io[e.grantType]));
|
|
2980
2980
|
for (const [s, a] of o)
|
|
2981
2981
|
s !== "grantType" && a !== void 0 && r.has(s) && (n[s] = a);
|
|
@@ -2992,19 +2992,19 @@ function ke(e, t) {
|
|
|
2992
2992
|
case k.BasicAuth:
|
|
2993
2993
|
case k.DigestAuth:
|
|
2994
2994
|
case k.JWT:
|
|
2995
|
-
|
|
2995
|
+
at(e[t.type], t.data);
|
|
2996
2996
|
break;
|
|
2997
2997
|
case k.APIKey: {
|
|
2998
2998
|
const { location: o, ...n } = t.data;
|
|
2999
|
-
|
|
2999
|
+
at(e[k.APIKey], n), o && (e[k.APIKey].location = ho(o));
|
|
3000
3000
|
break;
|
|
3001
3001
|
}
|
|
3002
3002
|
case k.OAuth2:
|
|
3003
|
-
|
|
3003
|
+
it(e[k.OAuth2], t.data);
|
|
3004
3004
|
break;
|
|
3005
3005
|
case k.OpenIDConnect: {
|
|
3006
3006
|
const { openIdConnectUrl: o, userInfoUrl: n, ...r } = t.data;
|
|
3007
|
-
|
|
3007
|
+
it(e[k.OpenIDConnect], r), o !== void 0 && (e[k.OpenIDConnect].openIdConnectUrl = o), n !== void 0 && (e[k.OpenIDConnect].userInfoUrl = n);
|
|
3008
3008
|
break;
|
|
3009
3009
|
}
|
|
3010
3010
|
}
|
|
@@ -3023,7 +3023,7 @@ function ui(e) {
|
|
|
3023
3023
|
function pi(e) {
|
|
3024
3024
|
return e.schemeId ? `${e.type} (scheme '${e.schemeId}')` : e.type;
|
|
3025
3025
|
}
|
|
3026
|
-
function
|
|
3026
|
+
function ct(e, t, o, n) {
|
|
3027
3027
|
return e.has(t) ? {
|
|
3028
3028
|
ok: !1,
|
|
3029
3029
|
message: `The security entry at index ${o} is targeted by both a mutation and a remove${n}; issue only one action for it.`
|
|
@@ -3045,15 +3045,15 @@ function fi(e, t, o) {
|
|
|
3045
3045
|
if (c.action === _.ADD) {
|
|
3046
3046
|
const f = n.length === 1 && n[0].securityType === k.NoAuth, m = f ? -1 : di(n, c);
|
|
3047
3047
|
if (m >= 0) {
|
|
3048
|
-
const
|
|
3049
|
-
if (
|
|
3050
|
-
if (
|
|
3048
|
+
const w = n[m], g = ct(l, w, m, o);
|
|
3049
|
+
if (g) return g;
|
|
3050
|
+
if (w.securityType !== c.type)
|
|
3051
3051
|
return {
|
|
3052
3052
|
ok: !1,
|
|
3053
|
-
message: `Scheme '${c.schemeId}' already exists${o} as ${
|
|
3053
|
+
message: `Scheme '${c.schemeId}' already exists${o} as ${w.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.`
|
|
3054
3054
|
};
|
|
3055
3055
|
n = [...n], n[m] = ke(
|
|
3056
|
-
structuredClone(
|
|
3056
|
+
structuredClone(w),
|
|
3057
3057
|
c
|
|
3058
3058
|
), r.push(
|
|
3059
3059
|
y(
|
|
@@ -3068,8 +3068,8 @@ function fi(e, t, o) {
|
|
|
3068
3068
|
ok: !1,
|
|
3069
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.`
|
|
3070
3070
|
};
|
|
3071
|
-
const
|
|
3072
|
-
n = f ? [
|
|
3071
|
+
const v = ke(Fe(), c);
|
|
3072
|
+
n = f ? [v] : [...n, v], r.push(
|
|
3073
3073
|
y(
|
|
3074
3074
|
"applied",
|
|
3075
3075
|
`Added ${c.type} security (index: ${n.length - 1})${o}`
|
|
@@ -3084,7 +3084,7 @@ function fi(e, t, o) {
|
|
|
3084
3084
|
ok: !1,
|
|
3085
3085
|
message: `Index ${c.index} out of bounds. Step has ${n.length} security entries.`
|
|
3086
3086
|
};
|
|
3087
|
-
const d = n[c.index], u =
|
|
3087
|
+
const d = n[c.index], u = ct(l, d, c.index, o);
|
|
3088
3088
|
if (u) return u;
|
|
3089
3089
|
if (d.securitySchemeId) {
|
|
3090
3090
|
const f = Bt(d);
|
|
@@ -3104,28 +3104,28 @@ function fi(e, t, o) {
|
|
|
3104
3104
|
for (let u = 0; u < d; u++)
|
|
3105
3105
|
r.push(y("applied"));
|
|
3106
3106
|
}
|
|
3107
|
-
return n.length === 0 && (n = [
|
|
3107
|
+
return n.length === 0 && (n = [Fe()]), { ok: !0, security: n, applied: r };
|
|
3108
3108
|
}
|
|
3109
3109
|
function mi(e) {
|
|
3110
3110
|
return async (t) => {
|
|
3111
|
-
const { changes: o, collectionId: n, workflowId: r, stepId: s } = t, a =
|
|
3111
|
+
const { changes: o, collectionId: n, workflowId: r, stepId: s } = t, a = Ft(t), l = s.trim(), c = /* @__PURE__ */ new Map();
|
|
3112
3112
|
for (const m of o) {
|
|
3113
|
-
const
|
|
3114
|
-
|
|
3113
|
+
const v = m.stepId?.trim() || l, w = c.get(v);
|
|
3114
|
+
w ? w.push(m) : c.set(v, [m]);
|
|
3115
3115
|
}
|
|
3116
3116
|
const d = [], u = [];
|
|
3117
|
-
for (const [m,
|
|
3118
|
-
const
|
|
3119
|
-
if (!
|
|
3120
|
-
return h(
|
|
3121
|
-
const { readStep:
|
|
3122
|
-
if (!
|
|
3123
|
-
d.push(...
|
|
3117
|
+
for (const [m, v] of c) {
|
|
3118
|
+
const w = Wt(e, n, r, m);
|
|
3119
|
+
if (!w.ok)
|
|
3120
|
+
return h(w.message, w.details);
|
|
3121
|
+
const { readStep: g, updateStep: O } = w.value, S = m || w.value.step.stepId, F = c.size > 1 ? ` for step '${S}'` : "", Z = Array.from(g().security), D = fi(Z, v, F);
|
|
3122
|
+
if (!D.ok) return h(D.message);
|
|
3123
|
+
d.push(...D.applied), u.push({ updateStep: O, security: D.security, label: S });
|
|
3124
3124
|
}
|
|
3125
3125
|
for (const m of u)
|
|
3126
|
-
m.updateStep((
|
|
3126
|
+
m.updateStep((v) => ({ ...v, security: m.security }));
|
|
3127
3127
|
const f = u.map((m) => `stepId=${m.label}
|
|
3128
|
-
${
|
|
3128
|
+
${me(m.security)}`).join(`
|
|
3129
3129
|
|
|
3130
3130
|
`);
|
|
3131
3131
|
return {
|
|
@@ -3166,7 +3166,7 @@ const hi = {
|
|
|
3166
3166
|
- Data shapes:
|
|
3167
3167
|
- \`url\`: string
|
|
3168
3168
|
- \`description\`: string
|
|
3169
|
-
- \`method\`: one of ${
|
|
3169
|
+
- \`method\`: one of ${ht.join(", ")}
|
|
3170
3170
|
- \`parameters\`: \`{ name, in: path|query|header|cookie, value }\`
|
|
3171
3171
|
- \`outputs\`: \`{ name, expression }\`
|
|
3172
3172
|
- \`successCriteria\`: \`{ condition, context?, type? }\`
|
|
@@ -3189,30 +3189,30 @@ const hi = {
|
|
|
3189
3189
|
condition: i().min(1),
|
|
3190
3190
|
context: i().optional().describe("Context for the expression."),
|
|
3191
3191
|
type: E(["simple", "regex", "jsonpath", "xpath"]).optional()
|
|
3192
|
-
}).strict(), bi =
|
|
3192
|
+
}).strict(), bi = W.extend({
|
|
3193
3193
|
field: I("url"),
|
|
3194
3194
|
data: i().min(1).describe("New request URL for step.")
|
|
3195
|
-
}).strict(), ki =
|
|
3195
|
+
}).strict(), ki = W.extend({
|
|
3196
3196
|
field: I("description"),
|
|
3197
3197
|
data: i().describe("New step description text.")
|
|
3198
|
-
}).strict(), Si =
|
|
3198
|
+
}).strict(), Si = W.extend({
|
|
3199
3199
|
field: I("method"),
|
|
3200
3200
|
data: E(wi).describe("New HTTP method for x-operation step.")
|
|
3201
|
-
}).strict(), Ti =
|
|
3201
|
+
}).strict(), Ti = W.extend({
|
|
3202
3202
|
field: I("parameters"),
|
|
3203
3203
|
data: vi.optional().describe("Parameter data. Required for add/update actions.")
|
|
3204
|
-
}).strict(), Ci =
|
|
3204
|
+
}).strict(), Ci = W.extend({
|
|
3205
3205
|
field: I("outputs"),
|
|
3206
3206
|
data: p({
|
|
3207
3207
|
name: i().min(1).describe("Output name."),
|
|
3208
3208
|
expression: i().min(1).describe("Output expression.")
|
|
3209
3209
|
}).strict().optional().describe("Output mapping. Required for add/update actions.")
|
|
3210
|
-
}).strict(), Oi =
|
|
3210
|
+
}).strict(), Oi = W.extend({
|
|
3211
3211
|
field: I("successCriteria"),
|
|
3212
3212
|
data: gi.optional().describe(
|
|
3213
3213
|
"Success criterion. Required for add/update actions."
|
|
3214
3214
|
)
|
|
3215
|
-
}).strict(), Ai =
|
|
3215
|
+
}).strict(), Ai = W.extend({
|
|
3216
3216
|
field: I("body"),
|
|
3217
3217
|
data: p({
|
|
3218
3218
|
contentType: E(yi).optional().describe(
|
|
@@ -3220,7 +3220,7 @@ const hi = {
|
|
|
3220
3220
|
),
|
|
3221
3221
|
content: i().describe("Request body content as string.")
|
|
3222
3222
|
}).strict().describe("Request body content and optional content type.")
|
|
3223
|
-
}).strict(), Ei =
|
|
3223
|
+
}).strict(), Ei = Ie("field", [
|
|
3224
3224
|
bi,
|
|
3225
3225
|
ki,
|
|
3226
3226
|
Si,
|
|
@@ -3246,7 +3246,7 @@ const hi = {
|
|
|
3246
3246
|
message: "Provide all three ids for a saved step, or three empty strings for the focused unsaved request tab.",
|
|
3247
3247
|
path: ["collectionId"]
|
|
3248
3248
|
});
|
|
3249
|
-
}), xi =
|
|
3249
|
+
}), xi = xt, _i = {
|
|
3250
3250
|
description: Ii,
|
|
3251
3251
|
inputSchema: $i,
|
|
3252
3252
|
outputSchema: xi,
|
|
@@ -3256,24 +3256,24 @@ function Ri(e) {
|
|
|
3256
3256
|
return e.replace(/\{\{([^{}\s]+)\}\}/g, "{$1}");
|
|
3257
3257
|
}
|
|
3258
3258
|
function Se(e) {
|
|
3259
|
-
return
|
|
3259
|
+
return ae[e];
|
|
3260
3260
|
}
|
|
3261
3261
|
function Te(e, t) {
|
|
3262
3262
|
return e.id === t;
|
|
3263
3263
|
}
|
|
3264
|
-
function
|
|
3264
|
+
function lt(e, t) {
|
|
3265
3265
|
return e.condition === t;
|
|
3266
3266
|
}
|
|
3267
3267
|
function Ce(e, t) {
|
|
3268
|
-
return
|
|
3268
|
+
return Ae(e) && e.id === t;
|
|
3269
3269
|
}
|
|
3270
|
-
function
|
|
3271
|
-
return { ...
|
|
3270
|
+
function dt(e, t, o) {
|
|
3271
|
+
return { ...ft(e), key: t, value: o, active: !0 };
|
|
3272
3272
|
}
|
|
3273
|
-
function
|
|
3273
|
+
function Ue(e, t) {
|
|
3274
3274
|
e((o) => [...o, ...t]);
|
|
3275
3275
|
}
|
|
3276
|
-
function
|
|
3276
|
+
function de(e, t, o) {
|
|
3277
3277
|
let n = !1;
|
|
3278
3278
|
return e((r) => {
|
|
3279
3279
|
const s = r.findIndex((l) => o.find(l, t));
|
|
@@ -3282,7 +3282,7 @@ function le(e, t, o) {
|
|
|
3282
3282
|
return a[s] = o.produce(r[s]), n = !0, a;
|
|
3283
3283
|
}), n;
|
|
3284
3284
|
}
|
|
3285
|
-
function
|
|
3285
|
+
function De(e, t, o) {
|
|
3286
3286
|
let n = !1;
|
|
3287
3287
|
return e((r) => {
|
|
3288
3288
|
const s = r.filter((a) => !o(a, t));
|
|
@@ -3294,8 +3294,8 @@ function Pi(e, { readStep: t, updateParameters: o }) {
|
|
|
3294
3294
|
case _.ADD: {
|
|
3295
3295
|
if (!e.data)
|
|
3296
3296
|
return y("failed", "Failed parameter add because data is missing.");
|
|
3297
|
-
const { in: n, name: r, value: s } = e.data, a = Se(n), l =
|
|
3298
|
-
return
|
|
3297
|
+
const { in: n, name: r, value: s } = e.data, a = Se(n), l = dt(n, r, s);
|
|
3298
|
+
return Ue(o(a), [l]), y(
|
|
3299
3299
|
"applied",
|
|
3300
3300
|
`Added ${n} parameter '${r}' (id: ${l.id})`
|
|
3301
3301
|
);
|
|
@@ -3306,10 +3306,10 @@ function Pi(e, { readStep: t, updateParameters: o }) {
|
|
|
3306
3306
|
if (!e.data)
|
|
3307
3307
|
return y("failed", "Failed parameter update because data is missing.");
|
|
3308
3308
|
const { in: n, name: r, value: s } = e.data, a = Se(n);
|
|
3309
|
-
return
|
|
3309
|
+
return de(o(a), e.id, {
|
|
3310
3310
|
find: Ce,
|
|
3311
|
-
produce: (c) =>
|
|
3312
|
-
...
|
|
3311
|
+
produce: (c) => Ae(c) ? {
|
|
3312
|
+
...dt(n, r, s),
|
|
3313
3313
|
id: c.id,
|
|
3314
3314
|
...c.allowReserved !== void 0 && { allowReserved: c.allowReserved }
|
|
3315
3315
|
} : c
|
|
@@ -3318,11 +3318,11 @@ function Pi(e, { readStep: t, updateParameters: o }) {
|
|
|
3318
3318
|
case _.REMOVE: {
|
|
3319
3319
|
if (!e.id)
|
|
3320
3320
|
return y("failed", "Failed parameter remove because id is missing.");
|
|
3321
|
-
const n = e.id, r = e.data?.in, s = r ? [Se(r)] : Object.values(
|
|
3321
|
+
const n = e.id, r = e.data?.in, s = r ? [Se(r)] : Object.values(ae);
|
|
3322
3322
|
let a = !1;
|
|
3323
3323
|
for (const l of s)
|
|
3324
3324
|
if (t().parameters[l].some((d) => Ce(d, n))) {
|
|
3325
|
-
a =
|
|
3325
|
+
a = De(o(l), n, Ce);
|
|
3326
3326
|
break;
|
|
3327
3327
|
}
|
|
3328
3328
|
return a ? y("applied") : y("failed", `Parameter with id '${n}' not found.`);
|
|
@@ -3336,7 +3336,7 @@ function qi(e, { readStep: t, updateOutputs: o }) {
|
|
|
3336
3336
|
return y("failed", "Failed output add because data is missing.");
|
|
3337
3337
|
const { name: n, expression: r } = e.data, s = t().outputs.find((l) => l.key === n);
|
|
3338
3338
|
if (s)
|
|
3339
|
-
return
|
|
3339
|
+
return de(o, s.id, {
|
|
3340
3340
|
find: Te,
|
|
3341
3341
|
produce: (l) => ({ ...l, key: n, value: r, active: !0 })
|
|
3342
3342
|
}), y(
|
|
@@ -3344,7 +3344,7 @@ function qi(e, { readStep: t, updateOutputs: o }) {
|
|
|
3344
3344
|
`Updated existing output '${n}' in place (id: ${s.id})`
|
|
3345
3345
|
);
|
|
3346
3346
|
const a = crypto.randomUUID();
|
|
3347
|
-
return
|
|
3347
|
+
return Ue(o, [{ id: a, key: n, value: r, active: !0 }]), y("applied", `Added output '${n}' (id: ${a})`);
|
|
3348
3348
|
}
|
|
3349
3349
|
case _.UPDATE: {
|
|
3350
3350
|
if (!e.id)
|
|
@@ -3352,13 +3352,13 @@ function qi(e, { readStep: t, updateOutputs: o }) {
|
|
|
3352
3352
|
if (!e.data)
|
|
3353
3353
|
return y("failed", "Failed output update because data is missing.");
|
|
3354
3354
|
const { name: n, expression: r } = e.data;
|
|
3355
|
-
return
|
|
3355
|
+
return de(o, e.id, {
|
|
3356
3356
|
find: Te,
|
|
3357
3357
|
produce: (a) => ({ ...a, key: n, value: r, active: !0 })
|
|
3358
3358
|
}) ? y("applied") : y("failed", `Output with id '${e.id}' not found.`);
|
|
3359
3359
|
}
|
|
3360
3360
|
case _.REMOVE:
|
|
3361
|
-
return e.id ?
|
|
3361
|
+
return e.id ? De(o, e.id, Te) ? y("applied") : y("failed", `Output with id '${e.id}' not found.`) : y("failed", "Failed output remove because id is missing.");
|
|
3362
3362
|
}
|
|
3363
3363
|
}
|
|
3364
3364
|
function Ni(e, { updateSuccessCriteria: t }) {
|
|
@@ -3366,10 +3366,10 @@ function Ni(e, { updateSuccessCriteria: t }) {
|
|
|
3366
3366
|
case _.ADD: {
|
|
3367
3367
|
if (!e.data)
|
|
3368
3368
|
return y("failed", "Failed success criteria add because data is missing.");
|
|
3369
|
-
const { condition: o, context: n, type: r } = e.data, s =
|
|
3369
|
+
const { condition: o, context: n, type: r } = e.data, s = pt(
|
|
3370
3370
|
r ?? Oe.SIMPLE
|
|
3371
3371
|
);
|
|
3372
|
-
return
|
|
3372
|
+
return Ue(t, [
|
|
3373
3373
|
{
|
|
3374
3374
|
...s,
|
|
3375
3375
|
condition: o,
|
|
@@ -3389,8 +3389,8 @@ function Ni(e, { updateSuccessCriteria: t }) {
|
|
|
3389
3389
|
"Failed success criteria update because data is missing."
|
|
3390
3390
|
);
|
|
3391
3391
|
const { condition: o, context: n, type: r } = e.data;
|
|
3392
|
-
return
|
|
3393
|
-
find:
|
|
3392
|
+
return de(t, e.id, {
|
|
3393
|
+
find: lt,
|
|
3394
3394
|
produce: (a) => ({
|
|
3395
3395
|
...a,
|
|
3396
3396
|
id: a.id || crypto.randomUUID(),
|
|
@@ -3407,56 +3407,56 @@ function Ni(e, { updateSuccessCriteria: t }) {
|
|
|
3407
3407
|
return typeof e.id != "string" ? y(
|
|
3408
3408
|
"failed",
|
|
3409
3409
|
"Failed success criteria remove because id is missing."
|
|
3410
|
-
) :
|
|
3410
|
+
) : De(
|
|
3411
3411
|
t,
|
|
3412
3412
|
e.id,
|
|
3413
|
-
|
|
3413
|
+
lt
|
|
3414
3414
|
) ? y("applied") : y(
|
|
3415
3415
|
"failed",
|
|
3416
3416
|
`Success criterion with condition '${e.id}' not found.`
|
|
3417
3417
|
);
|
|
3418
3418
|
}
|
|
3419
3419
|
}
|
|
3420
|
-
const
|
|
3420
|
+
const ut = { method: "GET", url: "" };
|
|
3421
3421
|
function Ui(e) {
|
|
3422
3422
|
return async (t) => {
|
|
3423
|
-
const { changes: o, collectionId: n, workflowId: r, stepId: s } = t, a =
|
|
3423
|
+
const { changes: o, collectionId: n, workflowId: r, stepId: s } = t, a = Ft(t), l = Wt(e, n, r, s);
|
|
3424
3424
|
if (!l.ok)
|
|
3425
3425
|
return h(l.message, l.details);
|
|
3426
3426
|
const { step: c, readStep: d, updateStep: u } = l.value, f = {
|
|
3427
3427
|
readStep: d,
|
|
3428
|
-
updateParameters: (
|
|
3428
|
+
updateParameters: (g) => (O) => u((S) => ({
|
|
3429
3429
|
...S,
|
|
3430
|
-
parameters: { ...S.parameters, [
|
|
3430
|
+
parameters: { ...S.parameters, [g]: O(S.parameters[g]) }
|
|
3431
3431
|
})),
|
|
3432
|
-
updateOutputs: (
|
|
3433
|
-
updateSuccessCriteria: (
|
|
3432
|
+
updateOutputs: (g) => u((O) => ({ ...O, outputs: g(O.outputs) })),
|
|
3433
|
+
updateSuccessCriteria: (g) => u((O) => ({
|
|
3434
3434
|
...O,
|
|
3435
|
-
successCriteria:
|
|
3435
|
+
successCriteria: g(O.successCriteria)
|
|
3436
3436
|
}))
|
|
3437
3437
|
};
|
|
3438
3438
|
if (o.some(
|
|
3439
|
-
(
|
|
3439
|
+
(g) => g.field === "method" || g.field === "url"
|
|
3440
3440
|
) && c.operation !== null)
|
|
3441
3441
|
return h(
|
|
3442
3442
|
"Cannot update method or url for a step linked to an OpenAPI operation."
|
|
3443
3443
|
);
|
|
3444
|
-
const
|
|
3445
|
-
for (const
|
|
3446
|
-
switch (
|
|
3444
|
+
const v = [];
|
|
3445
|
+
for (const g of o)
|
|
3446
|
+
switch (g.field) {
|
|
3447
3447
|
case "method":
|
|
3448
3448
|
case "url": {
|
|
3449
|
-
if (
|
|
3450
|
-
const O =
|
|
3449
|
+
if (g.field === "method") {
|
|
3450
|
+
const O = g.data;
|
|
3451
3451
|
u((S) => ({
|
|
3452
3452
|
...S,
|
|
3453
|
-
xOperation: { ...S.xOperation ??
|
|
3453
|
+
xOperation: { ...S.xOperation ?? ut, method: O }
|
|
3454
3454
|
}));
|
|
3455
3455
|
} else {
|
|
3456
|
-
const O = Ri(
|
|
3456
|
+
const O = Ri(g.data);
|
|
3457
3457
|
u((S) => ({
|
|
3458
3458
|
...S,
|
|
3459
|
-
xOperation: { ...S.xOperation ??
|
|
3459
|
+
xOperation: { ...S.xOperation ?? ut, url: O },
|
|
3460
3460
|
parameters: {
|
|
3461
3461
|
...S.parameters,
|
|
3462
3462
|
queryParameters: wo(
|
|
@@ -3466,45 +3466,45 @@ function Ui(e) {
|
|
|
3466
3466
|
}
|
|
3467
3467
|
}));
|
|
3468
3468
|
}
|
|
3469
|
-
|
|
3469
|
+
v.push(y("applied"));
|
|
3470
3470
|
break;
|
|
3471
3471
|
}
|
|
3472
3472
|
case "description": {
|
|
3473
|
-
const O =
|
|
3474
|
-
u((S) => ({ ...S, description: O })),
|
|
3473
|
+
const O = g.data;
|
|
3474
|
+
u((S) => ({ ...S, description: O })), v.push(y("applied"));
|
|
3475
3475
|
break;
|
|
3476
3476
|
}
|
|
3477
3477
|
case "body": {
|
|
3478
|
-
const { content: O, contentType: S } =
|
|
3479
|
-
u((
|
|
3480
|
-
...
|
|
3478
|
+
const { content: O, contentType: S } = g.data;
|
|
3479
|
+
u((F) => ({
|
|
3480
|
+
...F,
|
|
3481
3481
|
requestBody: {
|
|
3482
|
-
...
|
|
3482
|
+
...F.requestBody,
|
|
3483
3483
|
content: O,
|
|
3484
3484
|
...S !== void 0 && { type: S }
|
|
3485
3485
|
}
|
|
3486
|
-
})),
|
|
3486
|
+
})), v.push(y("applied"));
|
|
3487
3487
|
break;
|
|
3488
3488
|
}
|
|
3489
3489
|
case "parameters":
|
|
3490
|
-
|
|
3490
|
+
v.push(Pi(g, f));
|
|
3491
3491
|
break;
|
|
3492
3492
|
case "outputs":
|
|
3493
|
-
|
|
3493
|
+
v.push(qi(g, f));
|
|
3494
3494
|
break;
|
|
3495
3495
|
case "successCriteria":
|
|
3496
|
-
|
|
3496
|
+
v.push(Ni(g, f));
|
|
3497
3497
|
break;
|
|
3498
3498
|
}
|
|
3499
|
-
const
|
|
3499
|
+
const w = o.some((g) => g.field === "outputs");
|
|
3500
3500
|
return {
|
|
3501
3501
|
isError: !1,
|
|
3502
3502
|
data: {
|
|
3503
3503
|
totalChanges: a.totalChanges ?? o.length,
|
|
3504
3504
|
approvedChanges: a.approvedChanges ?? o.length,
|
|
3505
|
-
applied:
|
|
3506
|
-
...
|
|
3507
|
-
resultingState:
|
|
3505
|
+
applied: v,
|
|
3506
|
+
...w && {
|
|
3507
|
+
resultingState: xe(d().outputs) || "Outputs: (none)"
|
|
3508
3508
|
}
|
|
3509
3509
|
}
|
|
3510
3510
|
};
|
|
@@ -3534,18 +3534,18 @@ const Di = {
|
|
|
3534
3534
|
- Prefer one web search call per distinct lookup; do not nest web search calls.`, Li = p({
|
|
3535
3535
|
task: i().describe("What to search for on the web and what to return"),
|
|
3536
3536
|
url: i().describe("The URL to execute search on")
|
|
3537
|
-
}), Mi =
|
|
3537
|
+
}), Mi = he(), Fi = {
|
|
3538
3538
|
description: Wi,
|
|
3539
3539
|
inputSchema: Li,
|
|
3540
3540
|
outputSchema: Mi,
|
|
3541
3541
|
needsApproval: !0
|
|
3542
|
-
},
|
|
3542
|
+
}, Bi = `
|
|
3543
3543
|
You are a web search subagent inside Replay, invoked by the parent agent to complete a single lookup task.
|
|
3544
3544
|
|
|
3545
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.
|
|
3546
3546
|
|
|
3547
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.
|
|
3548
|
-
`,
|
|
3548
|
+
`, ji = `
|
|
3549
3549
|
- Never hallucinate or invent an answer when the information is not available from the web search.
|
|
3550
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.
|
|
3551
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.
|
|
@@ -3556,8 +3556,8 @@ You must use the provider web search tool to gather information. You cannot acce
|
|
|
3556
3556
|
- When sources conflict, report the conflict and cite the competing sources rather than selecting a winner without evidence.
|
|
3557
3557
|
`, Yi = bo(
|
|
3558
3558
|
//
|
|
3559
|
-
|
|
3560
|
-
|
|
3559
|
+
Ye("role", Bi),
|
|
3560
|
+
Ye("output", ji)
|
|
3561
3561
|
);
|
|
3562
3562
|
function zi() {
|
|
3563
3563
|
return [ko(Yi)];
|
|
@@ -3603,7 +3603,7 @@ const Vi = {
|
|
|
3603
3603
|
name: "web_search",
|
|
3604
3604
|
definition: Fi,
|
|
3605
3605
|
createExecutor: (e) => Hi(e.model)
|
|
3606
|
-
},
|
|
3606
|
+
}, jt = [
|
|
3607
3607
|
Js,
|
|
3608
3608
|
ia,
|
|
3609
3609
|
Ia,
|
|
@@ -3618,10 +3618,10 @@ const Vi = {
|
|
|
3618
3618
|
wr
|
|
3619
3619
|
];
|
|
3620
3620
|
function Ki(e) {
|
|
3621
|
-
return
|
|
3621
|
+
return jt.some((t) => t.name === e);
|
|
3622
3622
|
}
|
|
3623
3623
|
function fc(e, t) {
|
|
3624
|
-
for (const o of
|
|
3624
|
+
for (const o of jt)
|
|
3625
3625
|
e.register(
|
|
3626
3626
|
qn(
|
|
3627
3627
|
o,
|
|
@@ -3636,28 +3636,28 @@ function Ji(e) {
|
|
|
3636
3636
|
function Qi(e, t) {
|
|
3637
3637
|
return `${e}::${t}`;
|
|
3638
3638
|
}
|
|
3639
|
-
function
|
|
3639
|
+
function We(e) {
|
|
3640
3640
|
return typeof e == "object" && e !== null && "type" in e && typeof e.type == "string" && e.type.startsWith("tool-") && "toolCallId" in e;
|
|
3641
3641
|
}
|
|
3642
|
-
function
|
|
3642
|
+
function Le(e) {
|
|
3643
3643
|
return e.state === "approval-requested" && e.approval?.id != null;
|
|
3644
3644
|
}
|
|
3645
3645
|
function Xi(e) {
|
|
3646
3646
|
return e.state === "output-denied" ? !0 : e.state === "output-available" && e.approval != null;
|
|
3647
3647
|
}
|
|
3648
|
-
function
|
|
3649
|
-
return e.parts.some((t) =>
|
|
3648
|
+
function Yt(e) {
|
|
3649
|
+
return e.parts.some((t) => We(t) && Le(t));
|
|
3650
3650
|
}
|
|
3651
3651
|
function mc(e) {
|
|
3652
|
-
return e.some(
|
|
3652
|
+
return e.some(Yt);
|
|
3653
3653
|
}
|
|
3654
3654
|
function hc(e) {
|
|
3655
3655
|
return e.map(
|
|
3656
|
-
(t) =>
|
|
3656
|
+
(t) => Yt(t) ? { ...t, parts: t.parts.map(Zi) } : t
|
|
3657
3657
|
);
|
|
3658
3658
|
}
|
|
3659
3659
|
function Zi(e) {
|
|
3660
|
-
return !
|
|
3660
|
+
return !We(e) || !Le(e) ? e : {
|
|
3661
3661
|
...e,
|
|
3662
3662
|
state: "output-denied",
|
|
3663
3663
|
approval: { id: e.approval.id, approved: !1 }
|
|
@@ -3696,7 +3696,7 @@ function Ic(e) {
|
|
|
3696
3696
|
});
|
|
3697
3697
|
continue;
|
|
3698
3698
|
}
|
|
3699
|
-
if (!
|
|
3699
|
+
if (!We(c))
|
|
3700
3700
|
continue;
|
|
3701
3701
|
const d = Ji(c.type);
|
|
3702
3702
|
if (d === Wo) {
|
|
@@ -3711,7 +3711,7 @@ function Ic(e) {
|
|
|
3711
3711
|
u && a(u);
|
|
3712
3712
|
continue;
|
|
3713
3713
|
}
|
|
3714
|
-
if (
|
|
3714
|
+
if (Le(c) || Xi(c)) {
|
|
3715
3715
|
s(), t.push({ kind: "tool", part: c, key: `tool-${l}` });
|
|
3716
3716
|
continue;
|
|
3717
3717
|
}
|
|
@@ -3746,16 +3746,16 @@ function wc(e) {
|
|
|
3746
3746
|
}
|
|
3747
3747
|
function yc(e) {
|
|
3748
3748
|
return Uo({
|
|
3749
|
-
queryKey:
|
|
3750
|
-
queryFn: async () => e ? await
|
|
3749
|
+
queryKey: kt.detail(e ?? ""),
|
|
3750
|
+
queryFn: async () => e ? await bt.getInstance().findOne(e) ?? null : null,
|
|
3751
3751
|
enabled: !!e
|
|
3752
3752
|
});
|
|
3753
3753
|
}
|
|
3754
3754
|
function vc(e) {
|
|
3755
3755
|
return No({
|
|
3756
|
-
queryKey:
|
|
3756
|
+
queryKey: kt.infiniteHistory(e),
|
|
3757
3757
|
initialPageParam: 0,
|
|
3758
|
-
queryFn: async ({ pageParam: t }) =>
|
|
3758
|
+
queryFn: async ({ pageParam: t }) => bt.getInstance().findRecentChatsPage({
|
|
3759
3759
|
offset: t,
|
|
3760
3760
|
limit: e
|
|
3761
3761
|
}),
|
|
@@ -3771,7 +3771,7 @@ export {
|
|
|
3771
3771
|
Ic as F,
|
|
3772
3772
|
vc as G,
|
|
3773
3773
|
uc as H,
|
|
3774
|
-
|
|
3774
|
+
ae as L,
|
|
3775
3775
|
dc as T,
|
|
3776
3776
|
Jn as a,
|
|
3777
3777
|
Gr as b,
|
|
@@ -3794,9 +3794,9 @@ export {
|
|
|
3794
3794
|
za as s,
|
|
3795
3795
|
lc as t,
|
|
3796
3796
|
Di as u,
|
|
3797
|
-
|
|
3797
|
+
We as v,
|
|
3798
3798
|
Vi as w,
|
|
3799
|
-
|
|
3799
|
+
Le as x,
|
|
3800
3800
|
ai as y,
|
|
3801
3801
|
Ws as z
|
|
3802
3802
|
};
|