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