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