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