@redocly/replay 0.28.0-next.8 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{replay-AiChatProvider--1WugvKf.js → replay-AiChatProvider-BRqjyy2W.js} +2 -2
- package/dist/{replay-AiChatProvider-BJdxRVOc.js → replay-AiChatProvider-DUVoLgY2.js} +128 -130
- package/dist/{replay-AiChatSqliteDBStorage-D9fgt_9s.js → replay-AiChatSqliteDBStorage-0evx56pl.js} +6 -6
- package/dist/{replay-AiChatSqliteDBStorage-DbGtw6xx.js → replay-AiChatSqliteDBStorage-C5AnRloD.js} +1 -1
- package/dist/{replay-AiPanel-BU8oG0pD.js → replay-AiPanel-CMjVD12K.js} +77 -77
- package/dist/{replay-AiPanel-BYOLZjQX.js → replay-AiPanel-PVgJioX3.js} +2 -2
- package/dist/replay-FileWatcher-CFYprlWN.js +364 -0
- package/dist/replay-FileWatcher-DGLwO5Kd.js +1 -0
- package/dist/{replay-HistorySqliteDBStorage-CtF6-vY8.js → replay-HistorySqliteDBStorage-Bi5vBQ2T.js} +2 -2
- package/dist/{replay-SemanticSearchService-DRDdGJkI.js → replay-SemanticSearchService-Bh5xYa91.js} +22 -26
- package/dist/replay-SemanticSearchService-CulKCCNl.js +1 -0
- package/dist/{replay-SqliteDBStorage-D9Oeu_XC.js → replay-SqliteDBStorage-Bz0muHEk.js} +49 -49
- package/dist/{replay-SqliteDBStorage-B3zO7RGD.js → replay-SqliteDBStorage-CVHRAsPD.js} +1 -1
- package/dist/{replay-StepContextSqliteDBStorage-BfAAKDwA.js → replay-StepContextSqliteDBStorage-BkB2NM27.js} +2 -2
- package/dist/replay-TauriFileSystemAdapter-B163-f2D.js +108 -0
- package/dist/replay-TauriFileSystemAdapter-D4bOmvzP.js +1 -0
- package/dist/{replay-TauriRootStorage-XIJpsp6_.js → replay-TauriRootStorage-2MPQE-3f.js} +159 -155
- package/dist/replay-TauriRootStorage-CjWUrnWz.js +1 -0
- package/dist/{replay-agent-loop-DxK1tiVw.js → replay-agent-loop-BgYyBo9e.js} +9 -9
- package/dist/{replay-agent-loop-IDavXm8f.js → replay-agent-loop-DYDFXAZj.js} +1 -1
- package/dist/{replay-ai-chat-mappers-B-_eSMi4.js → replay-ai-chat-mappers-BEwNRQPV.js} +3 -3
- package/dist/{replay-ai-chat-mappers-BmvAc4xt.js → replay-ai-chat-mappers-CMtNqQHX.js} +1 -1
- package/dist/{replay-ai-message-parts.schema-E9u9-nqr.js → replay-ai-message-parts.schema-DKLf0SiG.js} +1 -1
- package/dist/{replay-create-model-CscK0cT1.js → replay-create-model-B2ZsGTjs.js} +3 -3
- package/dist/{replay-create-model-CIY7WZ1P.js → replay-create-model-DPxfOEfv.js} +4 -4
- package/dist/{replay-db-e_3o5e3f.js → replay-db-C9iqyMet.js} +1 -1
- package/dist/{replay-db-C_cdHXEt.js → replay-db-D4-LmLRk.js} +5 -5
- package/dist/{replay-external-resolver-nuL3ajF5.js → replay-external-resolver-BXgVrfzk.js} +7 -7
- package/dist/{replay-external-resolver-BmOmF-DG.js → replay-external-resolver-CTUbNZGW.js} +1 -1
- package/dist/{replay-history.schema-5ce6X0R1.js → replay-history.schema-B0lLwmdG.js} +3 -3
- package/dist/{replay-index-DDt4LOBo.js → replay-index-4TEahAPK.js} +21968 -21367
- package/dist/{replay-index-DjdDUkfV.js → replay-index-B4U7iZuq.js} +46 -46
- package/dist/replay-index-B8O3wYqo.js +1 -0
- package/dist/{replay-index-etIeWhnn.js → replay-index-Bdg7noSD.js} +1 -1
- package/dist/replay-index-CG9VN2JQ.js +4 -0
- package/dist/{replay-index-E3Eu6_jY.js → replay-index-DcC173cC.js} +1 -1
- package/dist/{replay-index-B8Zfn7JD.js → replay-index-Nz5obVS5.js} +1139 -1141
- package/dist/{replay-index-DcbwI4wD.js → replay-index-q63USe25.js} +1 -1
- package/dist/{replay-indexes-CfsvVMi_.js → replay-indexes-B3PJtgeh.js} +43 -43
- package/dist/{replay-lint-DVAifLdU.js → replay-lint-4XFKTmSY.js} +97 -97
- package/dist/{replay-lint-graphql-U_VxwRr1.js → replay-lint-graphql-BsBWkZ6L.js} +1 -1
- package/dist/{replay-lint-graphql-D1qaeEmu.js → replay-lint-graphql-De2eDZnT.js} +1 -1
- package/dist/{replay-lint-BjrmIhuZ.js → replay-lint-s7ylMBWz.js} +6111 -6074
- package/dist/replay-periodic-revalidation-BMFP7f-u.js +1 -0
- package/dist/{replay-periodic-revalidation-BtEKdEKa.js → replay-periodic-revalidation-DJbblUef.js} +4 -5
- package/dist/{replay-resolve-C97SfUAB.js → replay-resolve-BtNxNrKo.js} +123 -123
- package/dist/{replay-resolve-BYJosLqD.js → replay-resolve-BueEsOnR.js} +1 -1
- package/dist/{replay-respect-run-CW5xFLKz.js → replay-respect-run-B_dJjlti.js} +1 -1
- package/dist/{replay-respect-run-3FHTVHvs.js → replay-respect-run-Dfpbcsns.js} +3 -3
- package/dist/replay-step-context.schema-BOprzd6Z.js +21 -0
- package/dist/{replay-tauri-path-CMpWmGvW.js → replay-tauri-path-Bht3XIt7.js} +1 -1
- package/dist/replay-tauri-path-CiuYXh_j.js +22 -0
- package/dist/replay-useAiChatQueries-02CRdEPJ.js +215 -0
- package/dist/{replay-useAiChatQueries-DhTcllVx.js → replay-useAiChatQueries-D2hh5omV.js} +1039 -996
- package/dist/{replay-validate-key-Dj_UT2WG.js → replay-validate-key-ALwOF1Ux.js} +1 -1
- package/dist/{replay-validate-key-DJ_1khxq.js → replay-validate-key-B7fbWbfv.js} +2 -2
- package/dist/replay.cjs +1 -1
- package/dist/replay.d.ts +5 -0
- package/dist/replay.js +15 -15
- package/package.json +6 -6
- package/dist/replay-FileWatcher-BrhE0AP6.js +0 -1
- package/dist/replay-FileWatcher-JoqPJECh.js +0 -360
- package/dist/replay-SemanticSearchService-BgQ1HMcT.js +0 -1
- package/dist/replay-TauriFileSystemAdapter-CxHFFCmk.js +0 -1
- package/dist/replay-TauriFileSystemAdapter-DJETGEY7.js +0 -99
- package/dist/replay-TauriRootStorage-BSQQcFgG.js +0 -1
- package/dist/replay-index-C_DfEx-H.js +0 -1
- package/dist/replay-index-Da2H-hpA.js +0 -25
- package/dist/replay-periodic-revalidation-C3eLm7Mw.js +0 -1
- package/dist/replay-step-context.schema-DBk4jufr.js +0 -21
- package/dist/replay-tauri-path-C-vLbl1V.js +0 -22
- package/dist/replay-useAiChatQueries-CEYDGx9f.js +0 -215
package/dist/{replay-AiChatSqliteDBStorage-D9fgt_9s.js → replay-AiChatSqliteDBStorage-0evx56pl.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "./replay-history.schema-
|
|
2
|
-
import "./replay-step-context.schema-
|
|
3
|
-
import { a as h, b as r, c as n } from "./replay-ai-message-parts.schema-
|
|
4
|
-
import { c, a as u,
|
|
5
|
-
import {
|
|
1
|
+
import "./replay-history.schema-B0lLwmdG.js";
|
|
2
|
+
import "./replay-step-context.schema-BOprzd6Z.js";
|
|
3
|
+
import { a as h, b as r, c as n } from "./replay-ai-message-parts.schema-DKLf0SiG.js";
|
|
4
|
+
import { c, a as u, b as m } from "./replay-ai-chat-mappers-BEwNRQPV.js";
|
|
5
|
+
import { b as l, e, c as b } from "./replay-indexes-B3PJtgeh.js";
|
|
6
6
|
const g = {
|
|
7
7
|
orderBy: [l(r.createdAt), l(r.indexWithinInsertBatch)],
|
|
8
8
|
with: {
|
|
@@ -64,7 +64,7 @@ class A {
|
|
|
64
64
|
}
|
|
65
65
|
async upsertMessageRowAndParts(i, s, d) {
|
|
66
66
|
const t = await this.db.query.aiMessages.findFirst({
|
|
67
|
-
where:
|
|
67
|
+
where: b(e(r.aiChatId, i), e(r.uiId, d.id))
|
|
68
68
|
}), a = m(
|
|
69
69
|
i,
|
|
70
70
|
s,
|
package/dist/{replay-AiChatSqliteDBStorage-DbGtw6xx.js → replay-AiChatSqliteDBStorage-C5AnRloD.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./replay-history.schema-miM3Etuf.js");require("./replay-step-context.schema-BuuXkAck.js");const i=require("./replay-ai-message-parts.schema-BBdjwldJ.js"),h=require("./replay-ai-chat-mappers-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./replay-history.schema-miM3Etuf.js");require("./replay-step-context.schema-BuuXkAck.js");const i=require("./replay-ai-message-parts.schema-BBdjwldJ.js"),h=require("./replay-ai-chat-mappers-CMtNqQHX.js"),s=require("./replay-indexes-Dqjl8m6C.js"),c={orderBy:[s.asc(i.aiMessages.createdAt),s.asc(i.aiMessages.indexWithinInsertBatch)],with:{parts:{orderBy:[s.asc(i.aiMessageParts.index)]}}};class g{constructor(e){this.sqliteDB=e}sqliteDB;async findAll(){return await this.initialize(),(await this.db.query.aiChats.findMany({with:{messages:c}})).map(h.convertAiChatRowToUiChat)}async findRecentChatsPage(e){await this.initialize();const a=e.limit+1,r=await this.db.query.aiChats.findMany({orderBy:(d,{desc:o})=>o(d.updatedAt),limit:a,offset:e.offset}),t=r.slice(0,e.limit),n=r.length>e.limit,w=e.offset+t.length;return{items:t.map(d=>{const o={...d,messages:[]};return h.convertAiChatRowToUiChat(o)}),hasMore:n,nextOffset:w}}async findOne(e){await this.initialize();const a=await this.db.query.aiChats.findFirst({where:s.eq(i.aiChats.id,e),with:{messages:c}});return a&&h.convertAiChatRowToUiChat(a)}async upsert(e){await this.initialize();const a=h.convertUiChatToAiChatRow(e);await this.db.query.aiChats.findFirst({where:s.eq(i.aiChats.id,a.id),columns:{id:!0}})?await this.db.update(i.aiChats).set(a).where(s.eq(i.aiChats.id,a.id)):await this.db.insert(i.aiChats).values(a);for(let t=0;t<e.messages.length;t++)await this.upsertMessageRowAndParts(e.id,t,e.messages[t])}async remove(e){await this.initialize(),await this.db.delete(i.aiChats).where(s.eq(i.aiChats.id,e))}async upsertMessageRowAndParts(e,a,r){const t=await this.db.query.aiMessages.findFirst({where:s.and(s.eq(i.aiMessages.aiChatId,e),s.eq(i.aiMessages.uiId,r.id))}),n=h.convertUiMessageToAiChatMessage(e,a,r,t?.id);t?await this.db.update(i.aiMessages).set({...n,indexWithinInsertBatch:t.indexWithinInsertBatch}).where(s.eq(i.aiMessages.id,t.id)):await this.db.insert(i.aiMessages).values(n),await this.db.delete(i.aiMessageParts).where(s.eq(i.aiMessageParts.aiMessageId,n.id)),n.parts.length>0&&await this.db.insert(i.aiMessageParts).values(n.parts)}get db(){return this.sqliteDB.db}async initialize(){await this.sqliteDB.initialize()}}exports.AiChatSqliteDBStorage=g;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { jsxs as m, jsx as i, Fragment as
|
|
2
|
-
import { useCallback as _, useMemo as A, useState as
|
|
1
|
+
import { jsxs as m, jsx as i, Fragment as Ne } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as _, useMemo as A, useState as Y, Fragment as ht, useRef as F, useEffect as B, useLayoutEffect as je } from "react";
|
|
3
3
|
import c, { css as ue } from "styled-components";
|
|
4
|
-
import {
|
|
5
|
-
import { l as At, n as St, p as Lt, q as Pt, T as Et, t as Rt, v as Ot, x as
|
|
4
|
+
import { a3 as be, at as Ce, au as mt, ag as gt, ah as vt, u as yt, av as fe, aw as pe, S as V, ax as xe, ay as xt, az as wt, aA as ke, c as bt, aB as Ct, aC as Ue, aD as kt, aE as Tt, R as he, A as le, aF as We, ao as Ge, aG as we, aH as U, aI as It } from "./replay-index-4TEahAPK.js";
|
|
5
|
+
import { l as At, n as St, p as Lt, q as Pt, T as Et, t as Rt, v as Ot, x as Ye, C as I, y as Dt, z as qe, L as Mt, B as Q, D as _t, E as zt, F as Vt, G as $t, H as N } from "./replay-useAiChatQueries-D2hh5omV.js";
|
|
6
6
|
import { AI_SEARCH_MAX_MESSAGE_LENGTH as Ht } from "@redocly/theme/core/constants/search";
|
|
7
7
|
import { Button as P } from "@redocly/theme/components/Button/Button";
|
|
8
8
|
import { SendIcon as Bt } from "@redocly/theme/icons/SendIcon/SendIcon";
|
|
9
|
-
import { StopIcon as
|
|
10
|
-
import { M as z } from "./replay-db-
|
|
11
|
-
import { CheckboxIcon as
|
|
9
|
+
import { StopIcon as Ft } from "@redocly/theme/icons/StopIcon/StopIcon";
|
|
10
|
+
import { M as z } from "./replay-db-D4-LmLRk.js";
|
|
11
|
+
import { CheckboxIcon as Nt } from "@redocly/theme/icons/CheckboxIcon/CheckboxIcon";
|
|
12
12
|
import { CheckmarkFilledIcon as jt } from "@redocly/theme/icons/CheckmarkFilledIcon/CheckmarkFilledIcon";
|
|
13
13
|
import { CloseFilledIcon as Ut } from "@redocly/theme/icons/CloseFilledIcon/CloseFilledIcon";
|
|
14
14
|
import { AddIcon as Wt } from "@redocly/theme/icons/AddIcon/AddIcon";
|
|
15
|
-
import { SubtractIcon as
|
|
15
|
+
import { SubtractIcon as Gt } from "@redocly/theme/icons/SubtractIcon/SubtractIcon";
|
|
16
16
|
import { capitalize as re } from "@redocly/theme/core/utils";
|
|
17
|
-
import { ChevronDownIcon as
|
|
18
|
-
import { ChevronRightIcon as
|
|
17
|
+
import { ChevronDownIcon as Yt } from "@redocly/theme/icons/ChevronDownIcon/ChevronDownIcon";
|
|
18
|
+
import { ChevronRightIcon as qt } from "@redocly/theme/icons/ChevronRightIcon/ChevronRightIcon";
|
|
19
19
|
import { Dropdown as Kt } from "@redocly/theme/components/Dropdown/Dropdown";
|
|
20
20
|
import { DropdownMenu as Jt } from "@redocly/theme/components/Dropdown/DropdownMenu";
|
|
21
21
|
import { DropdownMenuItem as Ke } from "@redocly/theme/components/Dropdown/DropdownMenuItem";
|
|
@@ -25,7 +25,7 @@ import { ChatGptIcon as Qt } from "@redocly/theme/icons/ChatGptIcon/ChatGptIcon"
|
|
|
25
25
|
import { GeminiIcon as en } from "@redocly/theme/icons/GeminiIcon/GeminiIcon";
|
|
26
26
|
import { ClaudeIcon as tn } from "@redocly/theme/icons/ClaudeIcon/ClaudeIcon";
|
|
27
27
|
import { Tooltip as W } from "@redocly/theme/components/Tooltip/Tooltip";
|
|
28
|
-
import { g as Te } from "./replay-SemanticSearchService-
|
|
28
|
+
import { g as Te } from "./replay-SemanticSearchService-Bh5xYa91.js";
|
|
29
29
|
import "@tanstack/react-query";
|
|
30
30
|
import { Typography as Z } from "@redocly/theme/components/Typography/Typography";
|
|
31
31
|
import { TrashCanIcon as nn } from "@redocly/theme/icons/TrashCanIcon/TrashCanIcon";
|
|
@@ -78,7 +78,7 @@ function ln({
|
|
|
78
78
|
type: "button",
|
|
79
79
|
size: "small",
|
|
80
80
|
"aria-label": "Stop generating",
|
|
81
|
-
icon: /* @__PURE__ */ i(
|
|
81
|
+
icon: /* @__PURE__ */ i(Ft, { color: "var(--icon-color-on-color)" }),
|
|
82
82
|
onClick: x
|
|
83
83
|
}
|
|
84
84
|
) : /* @__PURE__ */ i(
|
|
@@ -359,17 +359,17 @@ class xn {
|
|
|
359
359
|
let S;
|
|
360
360
|
const R = y[v - 1], O = y[v + 1];
|
|
361
361
|
R && (y[v - 1] = void 0);
|
|
362
|
-
let
|
|
362
|
+
let q = !1;
|
|
363
363
|
if (O) {
|
|
364
364
|
const ee = O.oldPos - v;
|
|
365
|
-
|
|
365
|
+
q = O && 0 <= ee && ee < l;
|
|
366
366
|
}
|
|
367
367
|
const $ = R && R.oldPos + 1 < d;
|
|
368
|
-
if (!
|
|
368
|
+
if (!q && !$) {
|
|
369
369
|
y[v] = void 0;
|
|
370
370
|
continue;
|
|
371
371
|
}
|
|
372
|
-
if (!$ ||
|
|
372
|
+
if (!$ || q && R.oldPos < O.oldPos ? S = this.addToPath(O, !0, !1, 0, r) : S = this.addToPath(R, !1, !0, 1, r), g = this.extractCommon(S, n, t, v, r), S.oldPos + 1 >= d && g + 1 >= l)
|
|
373
373
|
return s(this.buildValues(S.lastComponent, n, t)) || !0;
|
|
374
374
|
y[v] = S, S.oldPos + 1 >= d && (b = Math.min(b, v - 1)), g + 1 >= l && (x = Math.max(x, v + 1));
|
|
375
375
|
}
|
|
@@ -554,7 +554,7 @@ function Le({ oldValue: e, newValue: t }) {
|
|
|
554
554
|
const { row: l } = a, d = En(l.type);
|
|
555
555
|
return /* @__PURE__ */ m(d, { children: [
|
|
556
556
|
/* @__PURE__ */ m(_n, { children: [
|
|
557
|
-
l.type === "remove" && /* @__PURE__ */ i(
|
|
557
|
+
l.type === "remove" && /* @__PURE__ */ i(Gt, { size: "12px" }),
|
|
558
558
|
l.type === "add" && /* @__PURE__ */ i(Wt, { size: "12px" })
|
|
559
559
|
] }),
|
|
560
560
|
/* @__PURE__ */ i(Pe, { children: l.text === "" ? " " : l.text })
|
|
@@ -638,7 +638,7 @@ function ne(e, t) {
|
|
|
638
638
|
function Bn(e) {
|
|
639
639
|
return e ? "changes" in e ? Array.isArray(e.changes) ? e.changes.map((t) => !t || typeof t != "object" || !("approved" in t) ? !1 : t.approved === !0) : [] : [] : [];
|
|
640
640
|
}
|
|
641
|
-
function
|
|
641
|
+
function Fn(e, t) {
|
|
642
642
|
if (!e || typeof e != "object") return;
|
|
643
643
|
const n = ie(e, fe), r = ie(n, pe);
|
|
644
644
|
if (!(t in r)) return;
|
|
@@ -647,9 +647,9 @@ function Nn(e, t) {
|
|
|
647
647
|
return o;
|
|
648
648
|
}
|
|
649
649
|
function Xe(e, t) {
|
|
650
|
-
return Ot(e) &&
|
|
650
|
+
return Ot(e) && Ye(e) && e.toolCallId === t;
|
|
651
651
|
}
|
|
652
|
-
function
|
|
652
|
+
function Nn(e, t, n) {
|
|
653
653
|
const r = e.parts.map((d) => Xe(d, t) ? { ...d, input: jn(d.input, n) } : d), o = e.metadata && typeof e.metadata == "object" ? e.metadata : {}, a = ie(o, fe), l = { ...ie(a, pe), [t]: yt(n) };
|
|
654
654
|
return {
|
|
655
655
|
...e,
|
|
@@ -686,7 +686,7 @@ function Un({
|
|
|
686
686
|
}) {
|
|
687
687
|
const { primaryLabel: o, categoryLabel: a, diffLineKey: s } = Wn(e.target);
|
|
688
688
|
return /* @__PURE__ */ i(
|
|
689
|
-
|
|
689
|
+
Gn,
|
|
690
690
|
{
|
|
691
691
|
isIncluded: t,
|
|
692
692
|
onToggle: n,
|
|
@@ -722,7 +722,7 @@ function Wn(e) {
|
|
|
722
722
|
diffLineKey: void 0
|
|
723
723
|
};
|
|
724
724
|
}
|
|
725
|
-
function
|
|
725
|
+
function Gn({
|
|
726
726
|
isIncluded: e,
|
|
727
727
|
onToggle: t,
|
|
728
728
|
readOnly: n,
|
|
@@ -730,8 +730,8 @@ function Yn({
|
|
|
730
730
|
categoryLabel: o,
|
|
731
731
|
children: a
|
|
732
732
|
}) {
|
|
733
|
-
return /* @__PURE__ */ m(
|
|
734
|
-
/* @__PURE__ */ m(
|
|
733
|
+
return /* @__PURE__ */ m(Yn, { $dimmed: n && !e, children: [
|
|
734
|
+
/* @__PURE__ */ m(qn, { children: [
|
|
735
735
|
n ? /* @__PURE__ */ i(er, { children: e ? /* @__PURE__ */ i(tr, { size: "16px" }) : /* @__PURE__ */ i(nr, { size: "16px" }) }) : /* @__PURE__ */ m(Zn, { children: [
|
|
736
736
|
/* @__PURE__ */ i(Xn, { checked: e }),
|
|
737
737
|
/* @__PURE__ */ i(Qn, { type: "checkbox", checked: e, onChange: t })
|
|
@@ -742,7 +742,7 @@ function Yn({
|
|
|
742
742
|
a
|
|
743
743
|
] });
|
|
744
744
|
}
|
|
745
|
-
const
|
|
745
|
+
const Yn = c.div`
|
|
746
746
|
display: flex;
|
|
747
747
|
flex-direction: column;
|
|
748
748
|
gap: var(--spacing-xs);
|
|
@@ -754,7 +754,7 @@ const qn = c.div`
|
|
|
754
754
|
&:last-child {
|
|
755
755
|
border-bottom: none;
|
|
756
756
|
}
|
|
757
|
-
`,
|
|
757
|
+
`, qn = c.div`
|
|
758
758
|
display: flex;
|
|
759
759
|
align-items: center;
|
|
760
760
|
gap: var(--spacing-xs);
|
|
@@ -776,7 +776,7 @@ const qn = c.div`
|
|
|
776
776
|
font-weight: var(--font-weight-regular);
|
|
777
777
|
line-height: var(--line-height-sm);
|
|
778
778
|
color: var(--text-color-secondary);
|
|
779
|
-
`, Xn = c(
|
|
779
|
+
`, Xn = c(Nt).attrs({ "aria-hidden": !0 })`
|
|
780
780
|
--checkbox-border-color: var(--color-blueberry-6);
|
|
781
781
|
--checkbox-box-color: var(--color-blueberry-6);
|
|
782
782
|
--checkbox-box-color-active: var(--color-blueberry-6);
|
|
@@ -1026,7 +1026,7 @@ function k({
|
|
|
1026
1026
|
function H(e, t, n) {
|
|
1027
1027
|
return k({ id: e, targetType: t, targetStepId: n, oldValue: void 0, newValue: void 0 });
|
|
1028
1028
|
}
|
|
1029
|
-
function
|
|
1029
|
+
function G({
|
|
1030
1030
|
data: e,
|
|
1031
1031
|
baseId: t,
|
|
1032
1032
|
targetType: n,
|
|
@@ -1076,7 +1076,7 @@ function xr({
|
|
|
1076
1076
|
const r = /* @__PURE__ */ new Map(), o = (a) => {
|
|
1077
1077
|
const s = r.get(a);
|
|
1078
1078
|
if (s) return s;
|
|
1079
|
-
const l =
|
|
1079
|
+
const l = qe(
|
|
1080
1080
|
e,
|
|
1081
1081
|
t,
|
|
1082
1082
|
n.collectionId,
|
|
@@ -1110,7 +1110,7 @@ function br(e, t, n, r) {
|
|
|
1110
1110
|
}),
|
|
1111
1111
|
s
|
|
1112
1112
|
) : K(
|
|
1113
|
-
|
|
1113
|
+
G({
|
|
1114
1114
|
data: l,
|
|
1115
1115
|
baseId: o,
|
|
1116
1116
|
targetType: a,
|
|
@@ -1133,7 +1133,7 @@ function br(e, t, n, r) {
|
|
|
1133
1133
|
}),
|
|
1134
1134
|
d
|
|
1135
1135
|
) : K(
|
|
1136
|
-
|
|
1136
|
+
G({
|
|
1137
1137
|
data: s,
|
|
1138
1138
|
baseId: o,
|
|
1139
1139
|
targetType: a,
|
|
@@ -1205,7 +1205,7 @@ function kr({
|
|
|
1205
1205
|
input: n
|
|
1206
1206
|
}) {
|
|
1207
1207
|
if (!Tr(n)) return [];
|
|
1208
|
-
const r =
|
|
1208
|
+
const r = qe(
|
|
1209
1209
|
e,
|
|
1210
1210
|
t,
|
|
1211
1211
|
n.collectionId,
|
|
@@ -1346,7 +1346,7 @@ function Pr(e, t, n) {
|
|
|
1346
1346
|
const { data: r } = t;
|
|
1347
1347
|
switch (t.action) {
|
|
1348
1348
|
case I.ADD:
|
|
1349
|
-
return
|
|
1349
|
+
return G({
|
|
1350
1350
|
data: r,
|
|
1351
1351
|
baseId: n,
|
|
1352
1352
|
targetType: "Body",
|
|
@@ -1357,7 +1357,7 @@ function Pr(e, t, n) {
|
|
|
1357
1357
|
});
|
|
1358
1358
|
case I.UPDATE: {
|
|
1359
1359
|
const o = e?.requestBody.type, a = r.contentType ?? o;
|
|
1360
|
-
return
|
|
1360
|
+
return G({
|
|
1361
1361
|
data: r,
|
|
1362
1362
|
baseId: n,
|
|
1363
1363
|
targetType: "Body",
|
|
@@ -1389,7 +1389,7 @@ function Pr(e, t, n) {
|
|
|
1389
1389
|
function Er(e, t, n) {
|
|
1390
1390
|
switch (t.action) {
|
|
1391
1391
|
case I.ADD:
|
|
1392
|
-
return t.data ?
|
|
1392
|
+
return t.data ? G({
|
|
1393
1393
|
data: t.data,
|
|
1394
1394
|
baseId: n,
|
|
1395
1395
|
targetType: "successCriteria",
|
|
@@ -1400,7 +1400,7 @@ function Er(e, t, n) {
|
|
|
1400
1400
|
case I.UPDATE: {
|
|
1401
1401
|
if (!t.data) return H(n, "successCriteria");
|
|
1402
1402
|
const r = typeof t.id == "string" && e ? _e(e, t.id) : void 0;
|
|
1403
|
-
return
|
|
1403
|
+
return G({
|
|
1404
1404
|
data: t.data,
|
|
1405
1405
|
baseId: n,
|
|
1406
1406
|
targetType: "successCriteria",
|
|
@@ -1495,7 +1495,7 @@ function ot(e, t) {
|
|
|
1495
1495
|
} catch (f) {
|
|
1496
1496
|
return console.error("Unable to build change previews", f), [];
|
|
1497
1497
|
}
|
|
1498
|
-
}, [e, n, r, t]), [a, s] =
|
|
1498
|
+
}, [e, n, r, t]), [a, s] = Y(
|
|
1499
1499
|
() => Object.fromEntries(o.map((u) => [u.id, u.included]))
|
|
1500
1500
|
), l = A(
|
|
1501
1501
|
() => o.map((u) => ({ ...u, included: a[u.id] ?? u.included })),
|
|
@@ -1538,7 +1538,7 @@ function _r({
|
|
|
1538
1538
|
(O) => Xe(O, e)
|
|
1539
1539
|
);
|
|
1540
1540
|
if (S && R) {
|
|
1541
|
-
const O =
|
|
1541
|
+
const O = Nn(w, e, s);
|
|
1542
1542
|
x.push({ index: b, message: O });
|
|
1543
1543
|
}
|
|
1544
1544
|
}
|
|
@@ -1567,7 +1567,7 @@ function _r({
|
|
|
1567
1567
|
] }) : null,
|
|
1568
1568
|
/* @__PURE__ */ i(Br, { size: "small", variant: "secondary", onClick: o, children: h }),
|
|
1569
1569
|
/* @__PURE__ */ i(
|
|
1570
|
-
|
|
1570
|
+
Fr,
|
|
1571
1571
|
{
|
|
1572
1572
|
size: "small",
|
|
1573
1573
|
variant: "primary",
|
|
@@ -1610,7 +1610,7 @@ const zr = c.div`
|
|
|
1610
1610
|
color: var(--text-color-secondary);
|
|
1611
1611
|
`, Br = c(P)`
|
|
1612
1612
|
background: none;
|
|
1613
|
-
`,
|
|
1613
|
+
`, Fr = c(P)`
|
|
1614
1614
|
border: 1px solid var(--button-bg-color);
|
|
1615
1615
|
padding-top: 0;
|
|
1616
1616
|
padding-bottom: 0;
|
|
@@ -1618,7 +1618,7 @@ const zr = c.div`
|
|
|
1618
1618
|
border: 1px solid var(--button-border-color-disabled);
|
|
1619
1619
|
}
|
|
1620
1620
|
`;
|
|
1621
|
-
function
|
|
1621
|
+
function Nr({
|
|
1622
1622
|
approvalId: e,
|
|
1623
1623
|
toolCallId: t,
|
|
1624
1624
|
toolName: n,
|
|
@@ -1649,7 +1649,7 @@ function jr({
|
|
|
1649
1649
|
onUndo: a
|
|
1650
1650
|
}) {
|
|
1651
1651
|
const s = A(
|
|
1652
|
-
() =>
|
|
1652
|
+
() => Fn(o, t),
|
|
1653
1653
|
[o, t]
|
|
1654
1654
|
), { previews: l } = ot(
|
|
1655
1655
|
s ? void 0 : e,
|
|
@@ -1671,9 +1671,9 @@ function jr({
|
|
|
1671
1671
|
/* @__PURE__ */ i(et, { toolName: e, input: n }),
|
|
1672
1672
|
/* @__PURE__ */ i(Wr, { children: /* @__PURE__ */ i(Ze, { previews: d, readOnly: !0 }) }),
|
|
1673
1673
|
/* @__PURE__ */ i(Ue, {}),
|
|
1674
|
-
/* @__PURE__ */ m(
|
|
1675
|
-
/* @__PURE__ */ i(
|
|
1676
|
-
a ? /* @__PURE__ */ i(
|
|
1674
|
+
/* @__PURE__ */ m(Gr, { children: [
|
|
1675
|
+
/* @__PURE__ */ i(Yr, { children: h }),
|
|
1676
|
+
a ? /* @__PURE__ */ i(qr, { size: "small", variant: "outlined", onClick: a, children: "Undo" }) : null
|
|
1677
1677
|
] })
|
|
1678
1678
|
] });
|
|
1679
1679
|
}
|
|
@@ -1691,28 +1691,28 @@ const Ur = c.div`
|
|
|
1691
1691
|
display: flex;
|
|
1692
1692
|
flex-direction: column;
|
|
1693
1693
|
min-width: 0;
|
|
1694
|
-
`,
|
|
1694
|
+
`, Gr = c.div`
|
|
1695
1695
|
display: flex;
|
|
1696
1696
|
justify-content: space-between;
|
|
1697
1697
|
align-items: center;
|
|
1698
1698
|
padding: var(--spacing-xs) var(--spacing-sm);
|
|
1699
1699
|
gap: var(--spacing-xs);
|
|
1700
|
-
`,
|
|
1700
|
+
`, Yr = c.span`
|
|
1701
1701
|
font-size: var(--font-size-sm);
|
|
1702
1702
|
font-weight: var(--font-weight-regular);
|
|
1703
1703
|
line-height: var(--line-height-sm);
|
|
1704
1704
|
color: var(--text-color-secondary);
|
|
1705
|
-
`,
|
|
1705
|
+
`, qr = c(P)`
|
|
1706
1706
|
padding-top: 0;
|
|
1707
1707
|
padding-bottom: 0;
|
|
1708
1708
|
`;
|
|
1709
1709
|
function Kr({ items: e, isLast: t }) {
|
|
1710
|
-
const [n, r] =
|
|
1710
|
+
const [n, r] = Y(t), o = _(() => {
|
|
1711
1711
|
r((s) => !s);
|
|
1712
1712
|
}, []), a = A(() => e.filter((s) => s.kind === "action"), [e]);
|
|
1713
1713
|
return /* @__PURE__ */ m(Xr, { children: [
|
|
1714
1714
|
/* @__PURE__ */ m(Zr, { type: "button", onClick: o, "aria-expanded": n, children: [
|
|
1715
|
-
/* @__PURE__ */ i(Qr, { children: n ? /* @__PURE__ */ i(
|
|
1715
|
+
/* @__PURE__ */ i(Qr, { children: n ? /* @__PURE__ */ i(Yt, { size: "12px", color: "var(--icon-color-additional)" }) : /* @__PURE__ */ i(qt, { size: "12px", color: "var(--icon-color-additional)" }) }),
|
|
1716
1716
|
/* @__PURE__ */ m(eo, { children: [
|
|
1717
1717
|
a.length,
|
|
1718
1718
|
" ",
|
|
@@ -1837,8 +1837,8 @@ function co({
|
|
|
1837
1837
|
n.key
|
|
1838
1838
|
);
|
|
1839
1839
|
const { part: o } = n, a = _t(o.type);
|
|
1840
|
-
return a &&
|
|
1841
|
-
|
|
1840
|
+
return a && Ye(o) ? /* @__PURE__ */ i(
|
|
1841
|
+
Nr,
|
|
1842
1842
|
{
|
|
1843
1843
|
approvalId: o.approval.id,
|
|
1844
1844
|
toolCallId: o.toolCallId,
|
|
@@ -2034,7 +2034,7 @@ const Io = c.div`
|
|
|
2034
2034
|
max-width: 100%;
|
|
2035
2035
|
`;
|
|
2036
2036
|
function Ao(e) {
|
|
2037
|
-
const t =
|
|
2037
|
+
const t = F(void 0);
|
|
2038
2038
|
return B(() => {
|
|
2039
2039
|
t.current = e;
|
|
2040
2040
|
}), t.current;
|
|
@@ -2122,7 +2122,7 @@ function Eo({
|
|
|
2122
2122
|
h.id
|
|
2123
2123
|
)),
|
|
2124
2124
|
f && /* @__PURE__ */ i(Be, { "aria-hidden": !0 }),
|
|
2125
|
-
u.length > 0 && /* @__PURE__ */ i(
|
|
2125
|
+
u.length > 0 && /* @__PURE__ */ i(Ne, { children: u.map((h) => /* @__PURE__ */ i(
|
|
2126
2126
|
He,
|
|
2127
2127
|
{
|
|
2128
2128
|
model: h,
|
|
@@ -2241,14 +2241,14 @@ const Oo = c.div`
|
|
|
2241
2241
|
overflow-y: auto;
|
|
2242
2242
|
`, Bo = c(Ke)`
|
|
2243
2243
|
flex-shrink: 0;
|
|
2244
|
-
`,
|
|
2244
|
+
`, Fo = 280;
|
|
2245
2245
|
function lt({ pinToBottom: e = !1 }) {
|
|
2246
|
-
const [t, n] =
|
|
2246
|
+
const [t, n] = Y(
|
|
2247
2247
|
() => Te().getIndexingActivityState().inProgress
|
|
2248
2248
|
);
|
|
2249
2249
|
return B(() => Te().subscribe("indexing-activity", (o) => {
|
|
2250
2250
|
n(o.inProgress);
|
|
2251
|
-
}), []), /* @__PURE__ */ i(
|
|
2251
|
+
}), []), /* @__PURE__ */ i(No, { $open: t, $pinToBottom: e, "aria-hidden": !t, children: /* @__PURE__ */ i(
|
|
2252
2252
|
W,
|
|
2253
2253
|
{
|
|
2254
2254
|
tip: "We're building a search index of your project. Until it's ready, the assistant may need more context in each reply to stay accurate, which can use more tokens.",
|
|
@@ -2262,7 +2262,7 @@ function lt({ pinToBottom: e = !1 }) {
|
|
|
2262
2262
|
}
|
|
2263
2263
|
) });
|
|
2264
2264
|
}
|
|
2265
|
-
const
|
|
2265
|
+
const No = c.div`
|
|
2266
2266
|
width: 100%;
|
|
2267
2267
|
display: block;
|
|
2268
2268
|
|
|
@@ -2279,7 +2279,7 @@ const Fo = c.div`
|
|
|
2279
2279
|
`}
|
|
2280
2280
|
|
|
2281
2281
|
opacity: ${({ $open: e }) => e ? 1 : 0};
|
|
2282
|
-
transition: opacity ${
|
|
2282
|
+
transition: opacity ${Fo}ms ease-out;
|
|
2283
2283
|
pointer-events: ${({ $open: e }) => e ? "auto" : "none"};
|
|
2284
2284
|
|
|
2285
2285
|
${X} {
|
|
@@ -2309,7 +2309,7 @@ function Wo() {
|
|
|
2309
2309
|
selectedModelId: a,
|
|
2310
2310
|
selectModel: s,
|
|
2311
2311
|
onSettingsOpen: l
|
|
2312
|
-
} = We(), { messages: d, isStreaming: u, sendMessage: f, stopGeneration: h } = Q(), { isOpen: p } =
|
|
2312
|
+
} = We(), { messages: d, isStreaming: u, sendMessage: f, stopGeneration: h } = Q(), { isOpen: p } = Ge(), [y, g] = Y(""), x = F(null), b = F(null), w = F(!0), v = d.length > 0, S = t || v, R = Ao(d.length), q = R !== void 0 && R > 0 && !v, $ = _((L = "smooth") => {
|
|
2313
2313
|
b.current && b.current.scrollTo({
|
|
2314
2314
|
top: b.current.scrollHeight,
|
|
2315
2315
|
behavior: L
|
|
@@ -2346,16 +2346,16 @@ function Wo() {
|
|
|
2346
2346
|
[p, n, r]
|
|
2347
2347
|
), /* @__PURE__ */ m(ct, { children: [
|
|
2348
2348
|
/* @__PURE__ */ i(
|
|
2349
|
-
|
|
2349
|
+
Go,
|
|
2350
2350
|
{
|
|
2351
2351
|
ref: b,
|
|
2352
2352
|
$isExpanded: S,
|
|
2353
|
-
$isAnimated: u ||
|
|
2353
|
+
$isAnimated: u || q,
|
|
2354
2354
|
onScroll: ee,
|
|
2355
|
-
children: t ? /* @__PURE__ */ i(
|
|
2355
|
+
children: t ? /* @__PURE__ */ i(qo, { children: /* @__PURE__ */ i(we, { size: "20px" }) }) : /* @__PURE__ */ i(To, {})
|
|
2356
2356
|
}
|
|
2357
2357
|
),
|
|
2358
|
-
/* @__PURE__ */ m(
|
|
2358
|
+
/* @__PURE__ */ m(Yo, { $isExpanded: !S, children: [
|
|
2359
2359
|
/* @__PURE__ */ i(lt, { pinToBottom: !S }),
|
|
2360
2360
|
/* @__PURE__ */ i(
|
|
2361
2361
|
ln,
|
|
@@ -2381,7 +2381,7 @@ function Wo() {
|
|
|
2381
2381
|
] })
|
|
2382
2382
|
] });
|
|
2383
2383
|
}
|
|
2384
|
-
const
|
|
2384
|
+
const Go = c.div`
|
|
2385
2385
|
flex: ${({ $isExpanded: e }) => e ? 1 : 0};
|
|
2386
2386
|
width: 100%;
|
|
2387
2387
|
overflow: auto;
|
|
@@ -2389,13 +2389,13 @@ const Yo = c.div`
|
|
|
2389
2389
|
transition-property: flex;
|
|
2390
2390
|
transition-duration: ${(e) => e.$isAnimated ? "var(--replay-transition-duration)" : "0s"};
|
|
2391
2391
|
transition-timing-function: var(--replay-transition-timing-function);
|
|
2392
|
-
`,
|
|
2392
|
+
`, Yo = c.div`
|
|
2393
2393
|
position: relative;
|
|
2394
2394
|
display: flex;
|
|
2395
2395
|
flex-direction: column;
|
|
2396
2396
|
width: 100%;
|
|
2397
2397
|
flex: ${({ $isExpanded: e }) => e ? 1 : 0};
|
|
2398
|
-
`,
|
|
2398
|
+
`, qo = c.div`
|
|
2399
2399
|
display: flex;
|
|
2400
2400
|
justify-content: center;
|
|
2401
2401
|
height: 100%;
|
|
@@ -2568,7 +2568,7 @@ function pi() {
|
|
|
2568
2568
|
}
|
|
2569
2569
|
const hi = 50;
|
|
2570
2570
|
function mi(e) {
|
|
2571
|
-
const { onChatSelect: t, onChatRemove: n } = e, r =
|
|
2571
|
+
const { onChatSelect: t, onChatRemove: n } = e, r = F(null), o = F(null), { data: a, isPending: s, hasNextPage: l, isFetchingNextPage: d, fetchNextPage: u } = $t(hi), f = A(() => (a?.pages ?? []).flatMap((p) => p.items), [a?.pages]), h = A(() => Xo(f), [f]);
|
|
2572
2572
|
return Zo({
|
|
2573
2573
|
scrollRef: r,
|
|
2574
2574
|
sentinelRef: o,
|
|
@@ -2591,7 +2591,7 @@ function mi(e) {
|
|
|
2591
2591
|
] });
|
|
2592
2592
|
}
|
|
2593
2593
|
function gi() {
|
|
2594
|
-
const e =
|
|
2594
|
+
const e = F(null), [t, n] = Y(!1);
|
|
2595
2595
|
return je(() => {
|
|
2596
2596
|
if (!e.current) return;
|
|
2597
2597
|
const r = e.current;
|
|
@@ -2652,7 +2652,7 @@ const wi = c.div`
|
|
|
2652
2652
|
`;
|
|
2653
2653
|
function ki(e) {
|
|
2654
2654
|
const { title: t, onCreateNewChat: n, onViewHistory: r, onClose: o } = e;
|
|
2655
|
-
return /* @__PURE__ */ m(ut, { buttons: /* @__PURE__ */ m(
|
|
2655
|
+
return /* @__PURE__ */ m(ut, { buttons: /* @__PURE__ */ m(Ne, { children: [
|
|
2656
2656
|
/* @__PURE__ */ i(W, { tip: "New chat", children: /* @__PURE__ */ i(
|
|
2657
2657
|
P,
|
|
2658
2658
|
{
|
|
@@ -2715,15 +2715,15 @@ const Si = c.div`
|
|
|
2715
2715
|
user-select: none;
|
|
2716
2716
|
`;
|
|
2717
2717
|
function ma() {
|
|
2718
|
-
const [e, t] =
|
|
2719
|
-
t(
|
|
2718
|
+
const [e, t] = Y(N.CHAT), n = Ge(), r = We(), o = () => {
|
|
2719
|
+
t(N.HISTORY);
|
|
2720
2720
|
}, a = () => {
|
|
2721
|
-
t(
|
|
2721
|
+
t(N.CHAT);
|
|
2722
2722
|
}, s = async (l) => {
|
|
2723
|
-
r.selectChat(l), t(
|
|
2723
|
+
r.selectChat(l), t(N.CHAT);
|
|
2724
2724
|
};
|
|
2725
2725
|
return /* @__PURE__ */ m(Li, { children: [
|
|
2726
|
-
/* @__PURE__ */ m(
|
|
2726
|
+
/* @__PURE__ */ m(Fe, { isActive: e === N.CHAT, children: [
|
|
2727
2727
|
/* @__PURE__ */ i(
|
|
2728
2728
|
ki,
|
|
2729
2729
|
{
|
|
@@ -2735,14 +2735,14 @@ function ma() {
|
|
|
2735
2735
|
),
|
|
2736
2736
|
/* @__PURE__ */ i(Wo, {})
|
|
2737
2737
|
] }),
|
|
2738
|
-
/* @__PURE__ */ m(
|
|
2738
|
+
/* @__PURE__ */ m(Fe, { isActive: e === N.HISTORY, isSliding: !0, children: [
|
|
2739
2739
|
/* @__PURE__ */ i(Ai, { onReturnFromHistory: a }),
|
|
2740
2740
|
/* @__PURE__ */ i(mi, { onChatSelect: s, onChatRemove: r.removeChat }),
|
|
2741
2741
|
/* @__PURE__ */ i(Ei, { children: /* @__PURE__ */ i(lt, { pinToBottom: !0 }) })
|
|
2742
2742
|
] })
|
|
2743
2743
|
] });
|
|
2744
2744
|
}
|
|
2745
|
-
function
|
|
2745
|
+
function Fe(e) {
|
|
2746
2746
|
const { children: t, isActive: n, isSliding: r = !1 } = e, o = /* @__PURE__ */ i(Pi, { inert: !n, children: t });
|
|
2747
2747
|
return r ? /* @__PURE__ */ i(Ri, { $isExpanded: n, children: o }) : o;
|
|
2748
2748
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),h=require("react"),X=require("styled-components"),f=require("./replay-index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),h=require("react"),X=require("styled-components"),f=require("./replay-index-Nz5obVS5.js"),x=require("./replay-useAiChatQueries-02CRdEPJ.js"),Ge=require("@redocly/theme/core/constants/search"),E=require("@redocly/theme/components/Button/Button"),Ue=require("@redocly/theme/icons/SendIcon/SendIcon"),We=require("@redocly/theme/icons/StopIcon/StopIcon"),M=require("./replay-db-C9iqyMet.js"),Ye=require("@redocly/theme/icons/CheckboxIcon/CheckboxIcon"),Ke=require("@redocly/theme/icons/CheckmarkFilledIcon/CheckmarkFilledIcon"),Je=require("@redocly/theme/icons/CloseFilledIcon/CloseFilledIcon"),Xe=require("@redocly/theme/icons/AddIcon/AddIcon"),Ze=require("@redocly/theme/icons/SubtractIcon/SubtractIcon"),K=require("@redocly/theme/core/utils"),Qe=require("@redocly/theme/icons/ChevronDownIcon/ChevronDownIcon"),et=require("@redocly/theme/icons/ChevronRightIcon/ChevronRightIcon"),tt=require("@redocly/theme/components/Dropdown/Dropdown"),nt=require("@redocly/theme/components/Dropdown/DropdownMenu"),Ie=require("@redocly/theme/components/Dropdown/DropdownMenuItem"),rt=require("@redocly/theme/icons/CheckmarkIcon/CheckmarkIcon"),ot=require("@redocly/theme/icons/SettingsCogIcon/SettingsCogIcon"),it=require("@redocly/theme/icons/ChatGptIcon/ChatGptIcon"),st=require("@redocly/theme/icons/GeminiIcon/GeminiIcon"),at=require("@redocly/theme/icons/ClaudeIcon/ClaudeIcon"),B=require("@redocly/theme/components/Tooltip/Tooltip"),ae=require("./replay-SemanticSearchService-CulKCCNl.js");require("@tanstack/react-query");const G=require("@redocly/theme/components/Typography/Typography"),lt=require("@redocly/theme/icons/TrashCanIcon/TrashCanIcon"),ct=require("@redocly/theme/icons/AiStarsGradientIcon/AiStarsGradientIcon"),dt=require("@redocly/theme/icons/CloseIcon/CloseIcon"),ut=require("@redocly/theme/icons/NewChatIcon/NewChatIcon"),ft=require("@redocly/theme/icons/RecentlyViewedIcon/RecentlyViewedIcon"),pt=require("@redocly/theme/icons/ArrowLeftIcon/ArrowLeftIcon"),ht=e=>e&&e.__esModule?e:{default:e},l=ht(X);function xt({placeholder:e="Ask anything...",className:t,disabled:n,isStreaming:r=!1,onStop:o,modelSelector:s,value:a,onValueChange:c,onSubmit:d,textareaRef:u}){const p=a.trim(),v=!n&&p.length>0&&!r,g=!n&&p.length>0,w=A=>{c(A.target.value)},m=()=>{!p||n||r||d()},b=()=>{!r||!o||o()},C=A=>{A.key==="Enter"&&!A.shiftKey&&!A.nativeEvent.isComposing&&(A.preventDefault(),r&&o?b():m())};return i.jsxs(gt,{className:t,$isActive:g,children:[i.jsx(vt,{ref:u,rows:1,maxLength:Ge.AI_SEARCH_MAX_MESSAGE_LENGTH,placeholder:e,value:a,disabled:n,spellCheck:!1,onChange:w,onKeyDown:C}),i.jsxs(mt,{children:[s,r&&o?i.jsx(wt,{type:"button",size:"small","aria-label":"Stop generating",icon:i.jsx(We.StopIcon,{color:"var(--icon-color-on-color)"}),onClick:b}):i.jsx(yt,{type:"button",size:"small","aria-label":"Send message",icon:i.jsx(Ue.SendIcon,{color:"var(--icon-color-on-color)"}),onClick:m,disabled:!v})]})]})}const gt=l.default.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: var(--spacing-xs);
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
box-sizing: border-box;
|
|
63
63
|
background: var(--color-warm-grey-9);
|
|
64
64
|
border-radius: var(--border-radius-xxl);
|
|
65
|
-
`,bt=new Set(["collection","workflow","step","operation","workflow-run"]);function re(e){return`replay://step?${new URLSearchParams({collectionId:e.collectionId.trim(),workflowId:e.workflowId.trim(),stepId:e.stepId.trim()}).toString()}`}function O(e,t){const n=e.get(t);if(n==null)return null;const r=n.trim();return r.length>0?r:null}function Ct(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!=="replay:")return null;const n=t.hostname.toLowerCase();if(!bt.has(n))return null;const r=t.searchParams;switch(n){case"collection":{const o=O(r,"collectionId");return o?{kind:"collection",collectionId:o}:null}case"workflow":{const o=O(r,"collectionId"),s=O(r,"workflowId");return!o||!s?null:{kind:"workflow",collectionId:o,workflowId:s}}case"step":{const o=O(r,"collectionId"),s=O(r,"workflowId"),a=O(r,"stepId");return!o||!s||!a?null:{kind:"step",collectionId:o,workflowId:s,stepId:a}}case"operation":{const o=O(r,"operationId");return o?{kind:"operation",operationId:o}:null}case"workflow-run":{const o=O(r,"collectionId"),s=O(r,"workflowId");if(!o||!s)return null;const a=O(r,"historyId"),c=a==="null"||a==="undefined"?null:a;return{kind:"workflow-run",collectionId:o,workflowId:s,...c?{historyId:c}:{}}}default:return null}}function At(e,t,n={}){switch(t.kind){case"collection":e.openCollectionTab({collectionId:t.collectionId,activeTabName:f.TAB_NAMES.COLLECTION_SETTINGS});break;case"workflow":e.openWorkflowTab({collectionId:t.collectionId,workflowId:t.workflowId,activeTabName:f.TAB_NAMES.WORKFLOW_SETTINGS});break;case"step":e.openStepTabFromCollection({collectionId:t.collectionId,workflowId:t.workflowId,stepId:t.stepId,state:f.TabState.Normal});break;case"workflow-run":{const r=n.workflowRunHistoryIds?.[x.workflowRunKey(t.collectionId,t.workflowId)]??[],o=t.historyId&&r.includes(t.historyId)?t.historyId:r.at(-1)??t.historyId;if(o){e.openWorkflowRunTabFromHistory(o,{state:f.TabState.Normal});break}e.focusWorkflowRunTab({collectionId:t.collectionId,workflowId:t.workflowId})||e.openWorkflowRunTab({collectionId:t.collectionId,workflowId:t.workflowId});break}case"operation":{const r=x.resolveOperation(e.apis,t.operationId);if(!r.ok){console.warn("[executeReplayChatLink] Operation not resolved",{operationId:t.operationId,message:r.message});return}x.openOrFocusOperationEditorTab(x.operationListItemToCollectionOperation(r.value),e);break}}}function Tt(e,t,n={}){const r=Ct(t);r&&At(e,r,n)}function je({workflowRunHistoryIds:e}={}){const t=f.useApis(),{getApiOperation:n}=f.
|
|
65
|
+
`,bt=new Set(["collection","workflow","step","operation","workflow-run"]);function re(e){return`replay://step?${new URLSearchParams({collectionId:e.collectionId.trim(),workflowId:e.workflowId.trim(),stepId:e.stepId.trim()}).toString()}`}function O(e,t){const n=e.get(t);if(n==null)return null;const r=n.trim();return r.length>0?r:null}function Ct(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!=="replay:")return null;const n=t.hostname.toLowerCase();if(!bt.has(n))return null;const r=t.searchParams;switch(n){case"collection":{const o=O(r,"collectionId");return o?{kind:"collection",collectionId:o}:null}case"workflow":{const o=O(r,"collectionId"),s=O(r,"workflowId");return!o||!s?null:{kind:"workflow",collectionId:o,workflowId:s}}case"step":{const o=O(r,"collectionId"),s=O(r,"workflowId"),a=O(r,"stepId");return!o||!s||!a?null:{kind:"step",collectionId:o,workflowId:s,stepId:a}}case"operation":{const o=O(r,"operationId");return o?{kind:"operation",operationId:o}:null}case"workflow-run":{const o=O(r,"collectionId"),s=O(r,"workflowId");if(!o||!s)return null;const a=O(r,"historyId"),c=a==="null"||a==="undefined"?null:a;return{kind:"workflow-run",collectionId:o,workflowId:s,...c?{historyId:c}:{}}}default:return null}}function At(e,t,n={}){switch(t.kind){case"collection":e.openCollectionTab({collectionId:t.collectionId,activeTabName:f.TAB_NAMES.COLLECTION_SETTINGS});break;case"workflow":e.openWorkflowTab({collectionId:t.collectionId,workflowId:t.workflowId,activeTabName:f.TAB_NAMES.WORKFLOW_SETTINGS});break;case"step":e.openStepTabFromCollection({collectionId:t.collectionId,workflowId:t.workflowId,stepId:t.stepId,state:f.TabState.Normal});break;case"workflow-run":{const r=n.workflowRunHistoryIds?.[x.workflowRunKey(t.collectionId,t.workflowId)]??[],o=t.historyId&&r.includes(t.historyId)?t.historyId:r.at(-1)??t.historyId;if(o){e.openWorkflowRunTabFromHistory(o,{state:f.TabState.Normal});break}e.focusWorkflowRunTab({collectionId:t.collectionId,workflowId:t.workflowId})||e.openWorkflowRunTab({collectionId:t.collectionId,workflowId:t.workflowId});break}case"operation":{const r=x.resolveOperation(e.apis,t.operationId);if(!r.ok){console.warn("[executeReplayChatLink] Operation not resolved",{operationId:t.operationId,message:r.message});return}x.openOrFocusOperationEditorTab(x.operationListItemToCollectionOperation(r.value),e);break}}}function Tt(e,t,n={}){const r=Ct(t);r&&At(e,r,n)}function je({workflowRunHistoryIds:e}={}){const t=f.useApis(),{getApiOperation:n}=f.useApiOperationGetter(),{focusOperationTab:r,addNewTab:o,openCollectionTab:s,openWorkflowTab:a,openStepTabFromCollection:c,openWorkflowRunTab:d,openWorkflowRunTabFromHistory:u,focusWorkflowRunTab:p}=f.useTabHandlers();return h.useCallback(v=>{const g=v.target;if(!(g instanceof Element))return;const w=g.closest("a[href]");if(!(w instanceof HTMLAnchorElement))return;const m=w.getAttribute("href");m?.startsWith("replay:")&&(v.preventDefault(),v.stopPropagation(),Tt({apis:t,getApiOperation:n,focusOperationTab:r,addNewTab:o,openCollectionTab:s,openWorkflowTab:a,openStepTabFromCollection:c,openWorkflowRunTab:d,openWorkflowRunTabFromHistory:u,focusWorkflowRunTab:p},m,{workflowRunHistoryIds:e}))},[e,t,n,r,o,s,a,c,d,u,p])}class It{diff(t,n,r={}){let o;typeof r=="function"?(o=r,r={}):"callback"in r&&(o=r.callback);const s=this.castInput(t,r),a=this.castInput(n,r),c=this.removeEmpty(this.tokenize(s,r)),d=this.removeEmpty(this.tokenize(a,r));return this.diffWithOptionsObj(c,d,r,o)}diffWithOptionsObj(t,n,r,o){var s;const a=y=>{if(y=this.postProcess(y,r),o){setTimeout(function(){o(y)},0);return}else return y},c=n.length,d=t.length;let u=1,p=c+d;r.maxEditLength!=null&&(p=Math.min(p,r.maxEditLength));const v=(s=r.timeout)!==null&&s!==void 0?s:1/0,g=Date.now()+v,w=[{oldPos:-1,lastComponent:void 0}];let m=this.extractCommon(w[0],n,t,0,r);if(w[0].oldPos+1>=d&&m+1>=c)return a(this.buildValues(w[0].lastComponent,n,t));let b=-1/0,C=1/0;const A=()=>{for(let y=Math.max(b,-u);y<=Math.min(C,u);y+=2){let S;const R=w[y-1],P=w[y+1];R&&(w[y-1]=void 0);let z=!1;if(P){const U=P.oldPos-y;z=P&&0<=U&&U<c}const D=R&&R.oldPos+1<d;if(!z&&!D){w[y]=void 0;continue}if(!D||z&&R.oldPos<P.oldPos?S=this.addToPath(P,!0,!1,0,r):S=this.addToPath(R,!1,!0,1,r),m=this.extractCommon(S,n,t,y,r),S.oldPos+1>=d&&m+1>=c)return a(this.buildValues(S.lastComponent,n,t))||!0;w[y]=S,S.oldPos+1>=d&&(C=Math.min(C,y-1)),m+1>=c&&(b=Math.max(b,y+1))}u++};if(o)(function y(){setTimeout(function(){if(u>p||Date.now()>g)return o(void 0);A()||y()},0)})();else for(;u<=p&&Date.now()<=g;){const y=A();if(y)return y}}addToPath(t,n,r,o,s){const a=t.lastComponent;return a&&!s.oneChangePerToken&&a.added===n&&a.removed===r?{oldPos:t.oldPos+o,lastComponent:{count:a.count+1,added:n,removed:r,previousComponent:a.previousComponent}}:{oldPos:t.oldPos+o,lastComponent:{count:1,added:n,removed:r,previousComponent:a}}}extractCommon(t,n,r,o,s){const a=n.length,c=r.length;let d=t.oldPos,u=d-o,p=0;for(;u+1<a&&d+1<c&&this.equals(r[d+1],n[u+1],s);)u++,d++,p++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return p&&!s.oneChangePerToken&&(t.lastComponent={count:p,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=d,u}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){const o=[];let s;for(;t;)o.push(t),s=t.previousComponent,delete t.previousComponent,t=s;o.reverse();const a=o.length;let c=0,d=0,u=0;for(;c<a;c++){const p=o[c];if(p.removed)p.value=this.join(r.slice(u,u+p.count)),u+=p.count;else{if(!p.added&&this.useLongestToken){let v=n.slice(d,d+p.count);v=v.map(function(g,w){const m=r[u+w];return m.length>g.length?m:g}),p.value=this.join(v)}else p.value=this.join(n.slice(d,d+p.count));d+=p.count,p.added||(u+=p.count)}}return o}}class jt extends It{constructor(){super(...arguments),this.tokenize=Et}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
|
|
66
66
|
`))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(`
|
|
67
67
|
`))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(`
|
|
68
68
|
`)&&(t=t.slice(0,-1)),n.endsWith(`
|