@bikdotai/bik-component-library 0.0.853 → 0.0.855
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/cjs/components/add-variableV2/AddDataPill.js +10 -0
- package/dist/cjs/components/add-variableV2/AddDataPill.js.map +1 -0
- package/dist/cjs/components/agent-builder/AgentBuilder.js +1 -1
- package/dist/cjs/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js +11 -11
- package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js +5 -5
- package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionEditor.js +7 -1
- package/dist/cjs/components/agent-builder/components/MentionEditor.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionField.js +1 -1
- package/dist/cjs/components/agent-builder/components/MentionField.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionPicker.js +41 -14
- package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js +6 -5
- package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/ToolInstructionsField.js +2 -2
- package/dist/cjs/components/agent-builder/components/ToolInstructionsField.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/VariableInlineField.js +65 -0
- package/dist/cjs/components/agent-builder/components/VariableInlineField.js.map +1 -0
- package/dist/cjs/components/agent-builder/components/VariableTriggerArea.js +10 -0
- package/dist/cjs/components/agent-builder/components/VariableTriggerArea.js.map +1 -0
- package/dist/cjs/components/agent-builder/constants/tools.js +1 -1
- package/dist/cjs/components/agent-builder/constants/tools.js.map +1 -1
- package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js +1 -1
- package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
- package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js +1 -1
- package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
- package/dist/cjs/components/agent-builder/utils/mentionSerialization.js +4 -4
- package/dist/cjs/components/agent-builder/utils/mentionSerialization.js.map +1 -1
- package/dist/cjs/components/toaster/Toaster.js +1 -1
- package/dist/cjs/components/toaster/Toaster.js.map +1 -1
- package/dist/cjs/components/toaster/Toaster.styled.js +7 -7
- package/dist/cjs/components/toaster/Toaster.styled.js.map +1 -1
- package/dist/cjs/components/variable-picker-v3/Content.js +1 -1
- package/dist/cjs/components/variable-picker-v3/Content.js.map +1 -1
- package/dist/cjs/editor/BikEditor.js +1 -1
- package/dist/cjs/editor/BikEditor.js.map +1 -1
- package/dist/cjs/editor/BikEditor.styles.js +8 -0
- package/dist/cjs/editor/BikEditor.styles.js.map +1 -1
- package/dist/cjs/editor/BikEditor.types.js.map +1 -1
- package/dist/cjs/editor/extensions/mention/MentionDropdown.js +1 -1
- package/dist/cjs/editor/extensions/mention/MentionDropdown.js.map +1 -1
- package/dist/cjs/editor/extensions/mention/MentionExtension.js +1 -1
- package/dist/cjs/editor/extensions/mention/MentionExtension.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/add-variableV2/AddDataPill.d.ts +24 -0
- package/dist/esm/components/add-variableV2/AddDataPill.js +33 -0
- package/dist/esm/components/add-variableV2/AddDataPill.js.map +1 -0
- package/dist/esm/components/add-variableV2/index.d.ts +1 -0
- package/dist/esm/components/agent-builder/AgentBuilder.js +76 -74
- package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.model.d.ts +8 -0
- package/dist/esm/components/agent-builder/components/ConfigToolPanel.d.ts +8 -0
- package/dist/esm/components/agent-builder/components/ConfigToolPanel.js +182 -136
- package/dist/esm/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.d.ts +3 -0
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +195 -188
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionEditor.d.ts +12 -0
- package/dist/esm/components/agent-builder/components/MentionEditor.js +144 -103
- package/dist/esm/components/agent-builder/components/MentionEditor.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionField.js +48 -45
- package/dist/esm/components/agent-builder/components/MentionField.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionPicker.d.ts +14 -1
- package/dist/esm/components/agent-builder/components/MentionPicker.js +286 -218
- package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.d.ts +8 -0
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.js +192 -176
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/ToolInstructionsField.d.ts +9 -0
- package/dist/esm/components/agent-builder/components/ToolInstructionsField.js +67 -48
- package/dist/esm/components/agent-builder/components/ToolInstructionsField.js.map +1 -1
- package/dist/esm/components/agent-builder/components/VariableInlineField.d.ts +26 -0
- package/dist/esm/components/agent-builder/components/VariableInlineField.js +149 -0
- package/dist/esm/components/agent-builder/components/VariableInlineField.js.map +1 -0
- package/dist/esm/components/agent-builder/components/VariableTriggerArea.d.ts +46 -0
- package/dist/esm/components/agent-builder/components/VariableTriggerArea.js +118 -0
- package/dist/esm/components/agent-builder/components/VariableTriggerArea.js.map +1 -0
- package/dist/esm/components/agent-builder/constants/tools.d.ts +1 -1
- package/dist/esm/components/agent-builder/constants/tools.js +14 -13
- package/dist/esm/components/agent-builder/constants/tools.js.map +1 -1
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.d.ts +7 -0
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +99 -96
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +164 -160
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
- package/dist/esm/components/agent-builder/utils/mentionSerialization.d.ts +14 -4
- package/dist/esm/components/agent-builder/utils/mentionSerialization.js +54 -36
- package/dist/esm/components/agent-builder/utils/mentionSerialization.js.map +1 -1
- package/dist/esm/components/toaster/Toaster.js +30 -25
- package/dist/esm/components/toaster/Toaster.js.map +1 -1
- package/dist/esm/components/toaster/Toaster.styled.js +5 -5
- package/dist/esm/components/toaster/Toaster.styled.js.map +1 -1
- package/dist/esm/components/variable-picker-v3/Content.js +16 -15
- package/dist/esm/components/variable-picker-v3/Content.js.map +1 -1
- package/dist/esm/editor/BikEditor.js +40 -34
- package/dist/esm/editor/BikEditor.js.map +1 -1
- package/dist/esm/editor/BikEditor.styles.js +20 -12
- package/dist/esm/editor/BikEditor.styles.js.map +1 -1
- package/dist/esm/editor/BikEditor.types.d.ts +9 -0
- package/dist/esm/editor/BikEditor.types.js.map +1 -1
- package/dist/esm/editor/extensions/mention/MentionDropdown.js +28 -28
- package/dist/esm/editor/extensions/mention/MentionDropdown.js.map +1 -1
- package/dist/esm/editor/extensions/mention/MentionExtension.js +23 -19
- package/dist/esm/editor/extensions/mention/MentionExtension.js.map +1 -1
- package/dist/esm/icons/index.d.ts +25 -25
- package/dist/esm/index.js +543 -541
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,66 +1,67 @@
|
|
|
1
|
-
import { jsxs as u, jsx as i, Fragment as
|
|
2
|
-
import { useState as w, useRef as
|
|
3
|
-
import { TitleSmall as
|
|
1
|
+
import { jsxs as u, jsx as i, Fragment as We } from "react/jsx-runtime";
|
|
2
|
+
import { useState as w, useRef as ne, useCallback as c, useEffect as $ } from "react";
|
|
3
|
+
import { TitleSmall as ie, BodyCaption as ze, BodySecondary as le } from "../../TypographyStyle.js";
|
|
4
4
|
import { COLORS as R } from "../../../constants/Theme.js";
|
|
5
|
-
import { Step3Root as
|
|
6
|
-
import { ConfigToolPanel as
|
|
7
|
-
import { CreateSubAgentPanel as
|
|
8
|
-
import { MentionField as
|
|
9
|
-
import { RequireVerificationModal as
|
|
10
|
-
import { RestApiToolPanel as
|
|
11
|
-
import { SelectableListSection as
|
|
12
|
-
import { StepSectionHeader as
|
|
13
|
-
import { STEP_DEFINITIONS as
|
|
14
|
-
import { ToolSource as p, CONFIG_TOOL_SOURCES as
|
|
15
|
-
import { useAgentBuilderContext as
|
|
16
|
-
import { restApiMentionItem as
|
|
17
|
-
import { sourceIcon as
|
|
18
|
-
import { buildToolActions as
|
|
19
|
-
import
|
|
20
|
-
import { Dropdown as
|
|
21
|
-
import { unwrapDropdownValue as
|
|
22
|
-
import { Tooltip as
|
|
23
|
-
import { Switch as
|
|
24
|
-
const
|
|
5
|
+
import { Step3Root as Ve, Step3Grid as je, SectionBodyWrap as ae, Step3Divider as $e, SideSection as se, SideSectionHeader as Je } from "../AgentBuilder.styled.js";
|
|
6
|
+
import { ConfigToolPanel as Qe } from "../components/ConfigToolPanel.js";
|
|
7
|
+
import { CreateSubAgentPanel as Xe } from "../components/CreateSubAgentPanel.js";
|
|
8
|
+
import { MentionField as re } from "../components/MentionField.js";
|
|
9
|
+
import { RequireVerificationModal as Ye } from "../components/RequireVerificationModal.js";
|
|
10
|
+
import { RestApiToolPanel as Ze } from "../components/RestApiToolPanel.js";
|
|
11
|
+
import { SelectableListSection as ce } from "../components/SelectableListSection.js";
|
|
12
|
+
import { StepSectionHeader as et } from "../components/StepSectionHeader.js";
|
|
13
|
+
import { STEP_DEFINITIONS as tt } from "../constants/steps.js";
|
|
14
|
+
import { ToolSource as p, CONFIG_TOOL_SOURCES as ot } from "../constants/tools.js";
|
|
15
|
+
import { useAgentBuilderContext as nt } from "../context/AgentBuilderContext.js";
|
|
16
|
+
import { restApiMentionItem as it, configToolMentionItem as lt, restApiToolName as at, configToolName as st, toolSourceLabel as rt, buildAgentMentionItems as de, buildCustomToolMentionItems as ct, appTypeLabel as ue } from "../utils/mentionSerialization.js";
|
|
17
|
+
import { sourceIcon as Se, SOURCE_ICONS as pe, renderSourceIcon as dt } from "../utils/sourceIcons.js";
|
|
18
|
+
import { buildToolActions as ut } from "../utils/toolActions.js";
|
|
19
|
+
import pt from "../../../icons/Informational/Common UI/Shield.js";
|
|
20
|
+
import { Dropdown as me } from "../../dropdown/Dropdown.js";
|
|
21
|
+
import { unwrapDropdownValue as ge } from "../../dropdown/utils.js";
|
|
22
|
+
import { Tooltip as mt } from "../../tooltips/Tooltip.js";
|
|
23
|
+
import { Switch as gt } from "../../switch/Switch.js";
|
|
24
|
+
const ft = (n) => dt(Se(n)) ?? void 0, fe = (n) => ({
|
|
25
25
|
label: n.display_name,
|
|
26
26
|
value: n.tool_id,
|
|
27
|
-
leadingIcon:
|
|
28
|
-
}),
|
|
27
|
+
leadingIcon: ft(n.source ?? p.Manifest)
|
|
28
|
+
}), he = tt[2], J = [
|
|
29
29
|
{ label: "OTP to phone", value: "phone_otp" },
|
|
30
30
|
{ label: "OTP to email", value: "email_otp" }
|
|
31
|
-
],
|
|
31
|
+
], be = (n, l) => {
|
|
32
32
|
const y = n ?? [];
|
|
33
33
|
return y.some((m) => m.id === l.id) ? y.map((m) => m.id === l.id ? l : m) : [...y, l];
|
|
34
|
-
},
|
|
34
|
+
}, Kt = () => {
|
|
35
35
|
const {
|
|
36
36
|
value: n,
|
|
37
37
|
patch: l,
|
|
38
38
|
updateField: y,
|
|
39
39
|
addReference: m,
|
|
40
|
-
removeReference:
|
|
40
|
+
removeReference: Q,
|
|
41
41
|
availableTools: s,
|
|
42
|
-
availableSubAgents:
|
|
42
|
+
availableSubAgents: Te,
|
|
43
43
|
availableModels: E,
|
|
44
44
|
configToolTemplates: N,
|
|
45
|
-
applicationType:
|
|
45
|
+
applicationType: X,
|
|
46
46
|
charLimits: v,
|
|
47
47
|
insertMention: d,
|
|
48
48
|
onCreateSubAgent: h,
|
|
49
49
|
onFetchSubAgent: _,
|
|
50
50
|
onUpdateSubAgent: q,
|
|
51
|
-
onImproveSubAgent:
|
|
52
|
-
onImproveToolInstructions:
|
|
53
|
-
registerSubAgentCreator:
|
|
51
|
+
onImproveSubAgent: ye,
|
|
52
|
+
onImproveToolInstructions: D,
|
|
53
|
+
registerSubAgentCreator: P,
|
|
54
54
|
registerToolActionHandler: H,
|
|
55
55
|
integrationStatus: L,
|
|
56
|
-
onConnectIntegration: K
|
|
57
|
-
|
|
56
|
+
onConnectIntegration: K,
|
|
57
|
+
variablesData: B
|
|
58
|
+
} = nt(), [g, O] = w(null), k = ne(0), [a, b] = w(null), x = ne(0), F = c((e) => {
|
|
58
59
|
x.current += 1, b({
|
|
59
60
|
key: x.current,
|
|
60
61
|
kind: "restapi",
|
|
61
62
|
initialRest: e
|
|
62
63
|
});
|
|
63
|
-
}, []),
|
|
64
|
+
}, []), G = c(
|
|
64
65
|
(e, t) => {
|
|
65
66
|
x.current += 1, b({
|
|
66
67
|
key: x.current,
|
|
@@ -70,50 +71,50 @@ const gt = (n) => ct(be(n)) ?? void 0, ge = (n) => ({
|
|
|
70
71
|
});
|
|
71
72
|
},
|
|
72
73
|
[]
|
|
73
|
-
),
|
|
74
|
+
), ve = c(
|
|
74
75
|
(e) => {
|
|
75
76
|
const t = !(n.restApiTools ?? []).some((o) => o.id === e.id);
|
|
76
|
-
l({ restApiTools:
|
|
77
|
+
l({ restApiTools: be(n.restApiTools, e) }), t && d(
|
|
77
78
|
"tool",
|
|
78
79
|
e.id,
|
|
79
|
-
|
|
80
|
+
it(e).label,
|
|
80
81
|
p.RestApi
|
|
81
82
|
), b(null);
|
|
82
83
|
},
|
|
83
84
|
[l, n.restApiTools, d]
|
|
84
|
-
),
|
|
85
|
+
), Ae = c(
|
|
85
86
|
(e) => {
|
|
86
87
|
const t = !(n.configTools ?? []).some((o) => o.id === e.id);
|
|
87
|
-
if (l({ configTools:
|
|
88
|
+
if (l({ configTools: be(n.configTools, e) }), t) {
|
|
88
89
|
const o = e.tool_key === "send_slack_message" ? p.Slack : p.EmailHandover;
|
|
89
90
|
d(
|
|
90
91
|
"tool",
|
|
91
92
|
e.id,
|
|
92
|
-
|
|
93
|
+
lt(e).label,
|
|
93
94
|
o
|
|
94
95
|
);
|
|
95
96
|
}
|
|
96
97
|
b(null);
|
|
97
98
|
},
|
|
98
99
|
[l, n.configTools, d]
|
|
99
|
-
),
|
|
100
|
+
), U = c(
|
|
100
101
|
(e) => {
|
|
101
|
-
const t =
|
|
102
|
-
t ?
|
|
102
|
+
const t = ot[e];
|
|
103
|
+
t ? G(t) : F();
|
|
103
104
|
},
|
|
104
|
-
[
|
|
105
|
+
[G, F]
|
|
105
106
|
);
|
|
106
|
-
|
|
107
|
-
const [
|
|
108
|
-
|
|
109
|
-
const
|
|
107
|
+
$(() => (H(U), () => H(null)), [H, U]);
|
|
108
|
+
const [Ie, Y] = w([]), [Ce, we] = w(() => /* @__PURE__ */ new Set()), A = /* @__PURE__ */ new Map();
|
|
109
|
+
Te.forEach((e) => A.set(e.id, e)), Ie.forEach((e) => A.set(e.id, e));
|
|
110
|
+
const Z = Array.from(A.values()), W = c(() => {
|
|
110
111
|
k.current += 1, O({ key: k.current, title: "Create sub-agent" });
|
|
111
112
|
}, []);
|
|
112
|
-
|
|
113
|
+
$(() => {
|
|
113
114
|
if (h)
|
|
114
|
-
return
|
|
115
|
-
}, [
|
|
116
|
-
const
|
|
115
|
+
return P(W), () => P(null);
|
|
116
|
+
}, [P, W, h]);
|
|
117
|
+
const Re = c(
|
|
117
118
|
async (e) => {
|
|
118
119
|
if (!_)
|
|
119
120
|
return;
|
|
@@ -126,30 +127,30 @@ const gt = (n) => ct(be(n)) ?? void 0, ge = (n) => ({
|
|
|
126
127
|
});
|
|
127
128
|
},
|
|
128
129
|
[_]
|
|
129
|
-
),
|
|
130
|
+
), _e = n.tools.some(
|
|
130
131
|
(e) => s.find((t) => t.tool_id === e)?.auth_required
|
|
131
|
-
),
|
|
132
|
-
(e) =>
|
|
133
|
-
), f =
|
|
132
|
+
), Oe = n.subagents.some(
|
|
133
|
+
(e) => Ce.has(e)
|
|
134
|
+
), f = _e || Oe, S = n.authentication?.enabled ?? !1, T = n.authentication?.type ?? "email_otp", ke = c(
|
|
134
135
|
async (e) => {
|
|
135
136
|
let t;
|
|
136
137
|
if (g?.editingId) {
|
|
137
138
|
if (q) {
|
|
138
139
|
const o = await q(g.editingId, e);
|
|
139
|
-
t = o.id,
|
|
140
|
+
t = o.id, Y((r) => [
|
|
140
141
|
...r.filter((I) => I.id !== o.id),
|
|
141
142
|
o
|
|
142
143
|
]);
|
|
143
144
|
}
|
|
144
145
|
} else if (h) {
|
|
145
146
|
const o = await h(e);
|
|
146
|
-
t = o.id,
|
|
147
|
+
t = o.id, Y((r) => [...r, o]), l({ subagents: [...n.subagents, o.id] }), d("subagent", o.id, `sub-agent: ${o.name}`);
|
|
147
148
|
}
|
|
148
149
|
if (t) {
|
|
149
150
|
const o = t, r = e.tools.some(
|
|
150
151
|
(I) => s.find((C) => C.tool_id === I)?.auth_required
|
|
151
152
|
);
|
|
152
|
-
|
|
153
|
+
we((I) => {
|
|
153
154
|
const C = new Set(I);
|
|
154
155
|
return r ? C.add(o) : C.delete(o), C;
|
|
155
156
|
});
|
|
@@ -166,87 +167,87 @@ const gt = (n) => ct(be(n)) ?? void 0, ge = (n) => ({
|
|
|
166
167
|
s
|
|
167
168
|
]
|
|
168
169
|
);
|
|
169
|
-
|
|
170
|
+
$(() => {
|
|
170
171
|
f && !S && l({ authentication: { enabled: !0, type: T } });
|
|
171
172
|
}, [f, S, T, l]);
|
|
172
|
-
const [M,
|
|
173
|
+
const [M, z] = w(null), V = c(
|
|
173
174
|
(e) => {
|
|
174
175
|
d("tool", e), m("tool", e);
|
|
175
176
|
},
|
|
176
177
|
[d, m]
|
|
177
|
-
),
|
|
178
|
+
), xe = c(
|
|
178
179
|
(e) => {
|
|
179
180
|
if (s.find((o) => o.tool_id === e)?.auth_required && !S) {
|
|
180
|
-
|
|
181
|
+
z(e);
|
|
181
182
|
return;
|
|
182
183
|
}
|
|
183
|
-
|
|
184
|
+
V(e);
|
|
184
185
|
},
|
|
185
|
-
[s, S,
|
|
186
|
-
),
|
|
186
|
+
[s, S, V]
|
|
187
|
+
), Me = n.tools.map((e) => {
|
|
187
188
|
const t = s.find((o) => o.tool_id === e);
|
|
188
189
|
return t ? {
|
|
189
190
|
id: e,
|
|
190
191
|
label: t.display_name,
|
|
191
|
-
icon:
|
|
192
|
+
icon: Se(t.source ?? p.Manifest),
|
|
192
193
|
authRequired: t.auth_required
|
|
193
194
|
} : null;
|
|
194
|
-
}).filter((e) => e !== null),
|
|
195
|
+
}).filter((e) => e !== null), Ee = (n.restApiTools ?? []).map(
|
|
195
196
|
(e) => ({
|
|
196
197
|
id: e.id,
|
|
197
|
-
label:
|
|
198
|
-
icon:
|
|
199
|
-
onConfigure: () =>
|
|
198
|
+
label: at(e),
|
|
199
|
+
icon: pe[p.RestApi],
|
|
200
|
+
onConfigure: () => F(e)
|
|
200
201
|
})
|
|
201
|
-
),
|
|
202
|
+
), Ne = (n.configTools ?? []).map(
|
|
202
203
|
(e) => ({
|
|
203
204
|
id: e.id,
|
|
204
|
-
label:
|
|
205
|
-
icon:
|
|
206
|
-
onConfigure: () =>
|
|
205
|
+
label: st(e),
|
|
206
|
+
icon: pe[e.tool_key === "send_slack_message" ? p.Slack : p.EmailHandover],
|
|
207
|
+
onConfigure: () => G(e.tool_key, e)
|
|
207
208
|
})
|
|
208
|
-
),
|
|
209
|
-
...xe,
|
|
209
|
+
), qe = [
|
|
210
210
|
...Me,
|
|
211
|
-
...Ee
|
|
212
|
-
|
|
211
|
+
...Ee,
|
|
212
|
+
...Ne
|
|
213
|
+
], De = ut(
|
|
213
214
|
N,
|
|
214
|
-
|
|
215
|
+
U,
|
|
215
216
|
L,
|
|
216
217
|
K
|
|
217
|
-
), Pe = s.map(
|
|
218
|
+
), Pe = s.map(fe), He = (() => {
|
|
218
219
|
const e = [], t = /* @__PURE__ */ new Map();
|
|
219
220
|
return s.forEach((o) => {
|
|
220
221
|
const r = o.source ?? p.Manifest;
|
|
221
|
-
t.has(r) || (t.set(r, []), e.push(r)), t.get(r)?.push(
|
|
222
|
+
t.has(r) || (t.set(r, []), e.push(r)), t.get(r)?.push(fe(o));
|
|
222
223
|
}), e.map((o) => ({
|
|
223
224
|
source: o,
|
|
224
|
-
label:
|
|
225
|
+
label: rt(o),
|
|
225
226
|
options: t.get(o) ?? [],
|
|
226
227
|
// Not connected → the source button opens the connect flow instead of
|
|
227
228
|
// its tool list (see SelectableListSection / onConnectIntegration).
|
|
228
229
|
connected: L?.[o],
|
|
229
230
|
onConnect: () => K?.(o)
|
|
230
231
|
}));
|
|
231
|
-
})(),
|
|
232
|
+
})(), Le = n.subagents.map((e) => {
|
|
232
233
|
const t = A.get(e);
|
|
233
234
|
return t ? { id: e, label: t.name } : null;
|
|
234
|
-
}).filter((e) => e !== null),
|
|
235
|
+
}).filter((e) => e !== null), Ke = Z.map((e) => ({
|
|
235
236
|
label: e.name,
|
|
236
237
|
value: e.id
|
|
237
|
-
})),
|
|
238
|
-
...
|
|
239
|
-
...
|
|
240
|
-
],
|
|
238
|
+
})), ee = ue(X), Be = [
|
|
239
|
+
...de(s, [], ee),
|
|
240
|
+
...ct(n.configTools, n.restApiTools)
|
|
241
|
+
], Fe = de(
|
|
241
242
|
[],
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
),
|
|
243
|
+
Z,
|
|
244
|
+
ee
|
|
245
|
+
), Ge = E.map((e) => ({
|
|
245
246
|
label: e.label,
|
|
246
247
|
value: e.value,
|
|
247
248
|
selected: e.value === n.model
|
|
248
|
-
})),
|
|
249
|
-
|
|
249
|
+
})), j = E.find((e) => e.value === n.model), te = a?.kind === "config" && a.toolKey ? N?.[a.toolKey] : void 0, oe = /* @__PURE__ */ i(
|
|
250
|
+
gt,
|
|
250
251
|
{
|
|
251
252
|
"data-test": "agent-auth-toggle",
|
|
252
253
|
value: S || f,
|
|
@@ -255,20 +256,20 @@ const gt = (n) => ct(be(n)) ?? void 0, ge = (n) => ({
|
|
|
255
256
|
l({ authentication: { enabled: e, type: T } });
|
|
256
257
|
}
|
|
257
258
|
}
|
|
258
|
-
),
|
|
259
|
-
|
|
259
|
+
), Ue = f ? /* @__PURE__ */ i(
|
|
260
|
+
mt,
|
|
260
261
|
{
|
|
261
262
|
body: "Remove tools that requires customer verification to change this setting.",
|
|
262
263
|
placement: "bottom",
|
|
263
|
-
children: /* @__PURE__ */ i("span", { style: { display: "flex" }, children:
|
|
264
|
+
children: /* @__PURE__ */ i("span", { style: { display: "flex" }, children: oe })
|
|
264
265
|
}
|
|
265
|
-
) :
|
|
266
|
-
return /* @__PURE__ */ u(
|
|
267
|
-
/* @__PURE__ */ i(
|
|
268
|
-
/* @__PURE__ */ u(
|
|
269
|
-
/* @__PURE__ */ u(
|
|
266
|
+
) : oe;
|
|
267
|
+
return /* @__PURE__ */ u(Ve, { children: [
|
|
268
|
+
/* @__PURE__ */ i(et, { title: he.title, helper: he.helper }),
|
|
269
|
+
/* @__PURE__ */ u(je, { $grow: !0, children: [
|
|
270
|
+
/* @__PURE__ */ u(ae, { children: [
|
|
270
271
|
/* @__PURE__ */ i(
|
|
271
|
-
|
|
272
|
+
re,
|
|
272
273
|
{
|
|
273
274
|
fieldKey: "instructions",
|
|
274
275
|
"data-test": "agent-instructions",
|
|
@@ -279,7 +280,7 @@ const gt = (n) => ct(be(n)) ?? void 0, ge = (n) => ({
|
|
|
279
280
|
}
|
|
280
281
|
),
|
|
281
282
|
/* @__PURE__ */ i(
|
|
282
|
-
|
|
283
|
+
re,
|
|
283
284
|
{
|
|
284
285
|
fieldKey: "guardrail",
|
|
285
286
|
"data-test": "agent-guardrail",
|
|
@@ -290,72 +291,72 @@ const gt = (n) => ct(be(n)) ?? void 0, ge = (n) => ({
|
|
|
290
291
|
}
|
|
291
292
|
)
|
|
292
293
|
] }),
|
|
293
|
-
/* @__PURE__ */ i(
|
|
294
|
-
/* @__PURE__ */ u(
|
|
294
|
+
/* @__PURE__ */ i($e, {}),
|
|
295
|
+
/* @__PURE__ */ u(ae, { children: [
|
|
295
296
|
/* @__PURE__ */ i(
|
|
296
|
-
|
|
297
|
+
ce,
|
|
297
298
|
{
|
|
298
299
|
title: "Tools",
|
|
299
300
|
helper: "Actions this agent can take while responding.",
|
|
300
301
|
dataTestPrefix: "agent-tools",
|
|
301
|
-
items:
|
|
302
|
+
items: qe,
|
|
302
303
|
addableOptions: Pe,
|
|
303
|
-
sourceGroups:
|
|
304
|
-
mentionItems:
|
|
305
|
-
actionSources:
|
|
304
|
+
sourceGroups: He,
|
|
305
|
+
mentionItems: Be,
|
|
306
|
+
actionSources: De,
|
|
306
307
|
emptyText: "No tools added yet.",
|
|
307
|
-
onAdd:
|
|
308
|
-
onRemove: (e) =>
|
|
308
|
+
onAdd: xe,
|
|
309
|
+
onRemove: (e) => Q("tool", e),
|
|
309
310
|
confirmDelete: { noun: "tool" }
|
|
310
311
|
}
|
|
311
312
|
),
|
|
312
313
|
/* @__PURE__ */ i(
|
|
313
|
-
|
|
314
|
+
ce,
|
|
314
315
|
{
|
|
315
316
|
title: "Sub-agents",
|
|
316
317
|
helper: "Other agents this agent can hand off the conversation to.",
|
|
317
318
|
dataTestPrefix: "agent-subagents",
|
|
318
|
-
items:
|
|
319
|
-
addableOptions:
|
|
320
|
-
mentionItems:
|
|
319
|
+
items: Le,
|
|
320
|
+
addableOptions: Ke,
|
|
321
|
+
mentionItems: Fe,
|
|
321
322
|
emptyText: "No sub-agents added yet.",
|
|
322
323
|
onAdd: (e) => {
|
|
323
324
|
d("subagent", e), m("subagent", e);
|
|
324
325
|
},
|
|
325
|
-
onRemove: (e) =>
|
|
326
|
+
onRemove: (e) => Q("subagent", e),
|
|
326
327
|
confirmDelete: { noun: "sub-agent" },
|
|
327
|
-
onConfigure: _ ?
|
|
328
|
-
createOption: h ? { label: "Create new", onSelect:
|
|
328
|
+
onConfigure: _ ? Re : void 0,
|
|
329
|
+
createOption: h ? { label: "Create new", onSelect: W } : void 0
|
|
329
330
|
}
|
|
330
331
|
),
|
|
331
|
-
/* @__PURE__ */ u(
|
|
332
|
-
/* @__PURE__ */ u(
|
|
332
|
+
/* @__PURE__ */ u(se, { children: [
|
|
333
|
+
/* @__PURE__ */ u(Je, { children: [
|
|
333
334
|
/* @__PURE__ */ u("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
334
|
-
/* @__PURE__ */ i(
|
|
335
|
-
/* @__PURE__ */ i(
|
|
335
|
+
/* @__PURE__ */ i(pt, { size: 20 }),
|
|
336
|
+
/* @__PURE__ */ i(ie, { color: R.content.primary, children: "Require customer verification" })
|
|
336
337
|
] }),
|
|
337
|
-
|
|
338
|
+
Ue
|
|
338
339
|
] }),
|
|
339
|
-
/* @__PURE__ */ i(
|
|
340
|
-
(S || f) && /* @__PURE__ */ u(
|
|
341
|
-
/* @__PURE__ */ i(
|
|
340
|
+
/* @__PURE__ */ i(ze, { color: R.content.secondary, children: f ? "Required — this agent uses a tool that accesses customer order details." : "Customers must verify their identity before this agent responds." }),
|
|
341
|
+
(S || f) && /* @__PURE__ */ u(We, { children: [
|
|
342
|
+
/* @__PURE__ */ i(le, { color: R.content.primary, children: "Select verification method" }),
|
|
342
343
|
/* @__PURE__ */ i(
|
|
343
|
-
|
|
344
|
+
me,
|
|
344
345
|
{
|
|
345
346
|
"data-test": "agent-auth-method",
|
|
346
347
|
size: "small",
|
|
347
348
|
width: "100%",
|
|
348
349
|
dropdownWidth: "328px",
|
|
349
350
|
placeHolder: "Select verification method",
|
|
350
|
-
options:
|
|
351
|
+
options: J.map((e) => ({
|
|
351
352
|
...e,
|
|
352
353
|
selected: e.value === T
|
|
353
354
|
})),
|
|
354
355
|
defaultOptions: [
|
|
355
|
-
|
|
356
|
+
J.find((e) => e.value === T) ?? J[0]
|
|
356
357
|
],
|
|
357
358
|
onSelect: (e) => {
|
|
358
|
-
const t =
|
|
359
|
+
const t = ge(e);
|
|
359
360
|
t && l({
|
|
360
361
|
authentication: {
|
|
361
362
|
enabled: !0,
|
|
@@ -367,26 +368,26 @@ const gt = (n) => ct(be(n)) ?? void 0, ge = (n) => ({
|
|
|
367
368
|
)
|
|
368
369
|
] })
|
|
369
370
|
] }),
|
|
370
|
-
E.length > 0 && /* @__PURE__ */ u(
|
|
371
|
-
/* @__PURE__ */ i(
|
|
372
|
-
/* @__PURE__ */ i(
|
|
371
|
+
E.length > 0 && /* @__PURE__ */ u(se, { children: [
|
|
372
|
+
/* @__PURE__ */ i(ie, { color: R.content.primary, children: "Advanced settings" }),
|
|
373
|
+
/* @__PURE__ */ i(le, { color: R.content.primary, children: "Select AI model" }),
|
|
373
374
|
/* @__PURE__ */ i(
|
|
374
|
-
|
|
375
|
+
me,
|
|
375
376
|
{
|
|
376
377
|
"data-test": "agent-model",
|
|
377
378
|
size: "small",
|
|
378
379
|
width: "100%",
|
|
379
380
|
dropdownWidth: "328px",
|
|
380
381
|
placeHolder: "Select model",
|
|
381
|
-
options:
|
|
382
|
-
defaultOptions:
|
|
382
|
+
options: Ge,
|
|
383
|
+
defaultOptions: j ? [
|
|
383
384
|
{
|
|
384
|
-
label:
|
|
385
|
-
value:
|
|
385
|
+
label: j.label,
|
|
386
|
+
value: j.value
|
|
386
387
|
}
|
|
387
388
|
] : void 0,
|
|
388
389
|
onSelect: (e) => {
|
|
389
|
-
const t =
|
|
390
|
+
const t = ge(e);
|
|
390
391
|
t && y("model", t);
|
|
391
392
|
}
|
|
392
393
|
}
|
|
@@ -395,63 +396,66 @@ const gt = (n) => ct(be(n)) ?? void 0, ge = (n) => ({
|
|
|
395
396
|
] })
|
|
396
397
|
] }),
|
|
397
398
|
g && /* @__PURE__ */ i(
|
|
398
|
-
|
|
399
|
+
Xe,
|
|
399
400
|
{
|
|
400
401
|
title: g.title,
|
|
401
402
|
initial: g.initial,
|
|
402
403
|
existingNames: n.subagents.filter((e) => e !== g.editingId).map((e) => A.get(e)?.name).filter((e) => !!e),
|
|
403
404
|
availableTools: s,
|
|
404
405
|
configToolTemplates: N,
|
|
406
|
+
variablesData: B,
|
|
405
407
|
integrationStatus: L,
|
|
406
408
|
onConnectIntegration: K,
|
|
407
|
-
appLabel:
|
|
409
|
+
appLabel: ue(X),
|
|
408
410
|
charLimits: v,
|
|
409
|
-
onImprove:
|
|
410
|
-
onImproveToolInstructions:
|
|
411
|
+
onImprove: ye,
|
|
412
|
+
onImproveToolInstructions: D,
|
|
411
413
|
onClose: () => O(null),
|
|
412
|
-
onSave:
|
|
414
|
+
onSave: ke
|
|
413
415
|
},
|
|
414
416
|
g.key
|
|
415
417
|
),
|
|
416
418
|
a?.kind === "restapi" && /* @__PURE__ */ i(
|
|
417
|
-
|
|
419
|
+
Ze,
|
|
418
420
|
{
|
|
419
421
|
initial: a.initialRest,
|
|
420
422
|
charLimits: v,
|
|
423
|
+
variablesData: B,
|
|
421
424
|
existingNames: (n.restApiTools ?? []).filter((e) => e.id !== a.initialRest?.id).map((e) => e.name),
|
|
422
|
-
onImprove:
|
|
425
|
+
onImprove: D,
|
|
423
426
|
onClose: () => b(null),
|
|
424
|
-
onSave:
|
|
427
|
+
onSave: ve
|
|
425
428
|
},
|
|
426
429
|
a.key
|
|
427
430
|
),
|
|
428
|
-
a?.kind === "config" && a.toolKey &&
|
|
429
|
-
|
|
431
|
+
a?.kind === "config" && a.toolKey && te && /* @__PURE__ */ i(
|
|
432
|
+
Qe,
|
|
430
433
|
{
|
|
431
434
|
toolKey: a.toolKey,
|
|
432
|
-
template:
|
|
435
|
+
template: te,
|
|
433
436
|
initial: a.initialConfig,
|
|
434
437
|
charLimits: v,
|
|
435
|
-
|
|
438
|
+
variablesData: B,
|
|
439
|
+
onImprove: D,
|
|
436
440
|
onClose: () => b(null),
|
|
437
|
-
onSave:
|
|
441
|
+
onSave: Ae
|
|
438
442
|
},
|
|
439
443
|
a.key
|
|
440
444
|
),
|
|
441
445
|
/* @__PURE__ */ i(
|
|
442
|
-
|
|
446
|
+
Ye,
|
|
443
447
|
{
|
|
444
448
|
open: M !== null,
|
|
445
449
|
toolLabel: s.find((e) => e.tool_id === M)?.display_name ?? "This tool",
|
|
446
|
-
onCancel: () =>
|
|
450
|
+
onCancel: () => z(null),
|
|
447
451
|
onConfirm: () => {
|
|
448
|
-
l({ authentication: { enabled: !0, type: T } }), M &&
|
|
452
|
+
l({ authentication: { enabled: !0, type: T } }), M && V(M), z(null);
|
|
449
453
|
}
|
|
450
454
|
}
|
|
451
455
|
)
|
|
452
456
|
] });
|
|
453
457
|
};
|
|
454
458
|
export {
|
|
455
|
-
|
|
459
|
+
Kt as Step3HowItResponds
|
|
456
460
|
};
|
|
457
461
|
//# sourceMappingURL=Step3HowItResponds.js.map
|