@bikdotai/bik-component-library 0.0.821 → 0.0.822-beta.1
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/AgentBuilder.js +1 -1
- package/dist/cjs/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/cjs/components/agent-builder/AgentBuilder.styled.js +66 -90
- package/dist/cjs/components/agent-builder/AgentBuilder.styled.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js +1 -1
- package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionPicker.js +19 -19
- package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/SelectableListSection.js +14 -1
- package/dist/cjs/components/agent-builder/components/SelectableListSection.js.map +1 -1
- package/dist/cjs/components/agent-builder/constants/charLimits.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/Step1About.js +1 -1
- package/dist/cjs/components/agent-builder/steps/Step1About.js.map +1 -1
- package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.js +1 -1
- package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.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/steps/Step4HandoverRules.js +1 -1
- package/dist/cjs/components/agent-builder/steps/Step4HandoverRules.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/AgentListingFilters.js +1 -1
- package/dist/cjs/components/agent-listing/AgentListingFilters.js.map +1 -1
- package/dist/cjs/components/dropdown/utils.js +2 -0
- package/dist/cjs/components/dropdown/utils.js.map +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/utils/arrayUtils.js +2 -0
- package/dist/cjs/utils/arrayUtils.js.map +1 -0
- package/dist/esm/components/agent-builder/AgentBuilder.js +67 -65
- package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.model.d.ts +7 -0
- package/dist/esm/components/agent-builder/AgentBuilder.styled.js +117 -141
- package/dist/esm/components/agent-builder/AgentBuilder.styled.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 +95 -96
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionPicker.d.ts +4 -0
- package/dist/esm/components/agent-builder/components/MentionPicker.js +64 -69
- package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/esm/components/agent-builder/components/SelectableListSection.d.ts +10 -0
- package/dist/esm/components/agent-builder/components/SelectableListSection.js +161 -106
- package/dist/esm/components/agent-builder/components/SelectableListSection.js.map +1 -1
- package/dist/esm/components/agent-builder/constants/charLimits.d.ts +6 -0
- package/dist/esm/components/agent-builder/constants/charLimits.js.map +1 -1
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.d.ts +4 -0
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +126 -120
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
- package/dist/esm/components/agent-builder/index.d.ts +1 -0
- package/dist/esm/components/agent-builder/steps/Step1About.js +6 -7
- package/dist/esm/components/agent-builder/steps/Step1About.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js +59 -59
- package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +114 -109
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js +26 -27
- package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js.map +1 -1
- package/dist/esm/components/agent-builder/utils/sourceIcons.d.ts +6 -0
- package/dist/esm/components/agent-builder/utils/sourceIcons.js +12 -7
- package/dist/esm/components/agent-builder/utils/sourceIcons.js.map +1 -1
- package/dist/esm/components/agent-listing/AgentListing.js +91 -90
- package/dist/esm/components/agent-listing/AgentListing.js.map +1 -1
- package/dist/esm/components/agent-listing/AgentListingFilters.js +31 -30
- package/dist/esm/components/agent-listing/AgentListingFilters.js.map +1 -1
- package/dist/esm/components/dropdown/index.d.ts +1 -0
- package/dist/esm/components/dropdown/utils.d.ts +9 -0
- package/dist/esm/components/dropdown/utils.js +5 -0
- package/dist/esm/components/dropdown/utils.js.map +1 -0
- package/dist/esm/index.js +10 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/arrayUtils.d.ts +7 -0
- package/dist/esm/utils/arrayUtils.js +5 -0
- package/dist/esm/utils/arrayUtils.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
import { jsxs as i, jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { RadioButton as
|
|
6
|
-
import { TitleSmall as l, BodyCaption as d, BodySecondary as
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import I from "../../../assets/icons/cross.svg.js";
|
|
3
|
+
import k from "../../../assets/icons/plus.svg.js";
|
|
4
|
+
import x from "react";
|
|
5
|
+
import { RadioButton as u } from "../../radioButton/RadioButton.js";
|
|
6
|
+
import { TitleSmall as l, BodyCaption as d, BodySecondary as g } from "../../TypographyStyle.js";
|
|
7
7
|
import { COLORS as o } from "../../../constants/Theme.js";
|
|
8
|
-
import { CardRow as
|
|
8
|
+
import { CardRow as T, RadioCard as f, RadioCardText as C, FieldBlock as A, ChipWrap as B, IntentChip as R, ChipCloseButton as O, AddChipButton as D } from "../AgentBuilder.styled.js";
|
|
9
9
|
import { AiTextArea as E } from "../components/AiTextArea.js";
|
|
10
|
-
import { StepSectionHeader as
|
|
11
|
-
import {
|
|
12
|
-
import { STEP_DEFINITIONS as F } from "../constants/steps.js";
|
|
10
|
+
import { StepSectionHeader as F } from "../components/StepSectionHeader.js";
|
|
11
|
+
import { STEP_DEFINITIONS as H } from "../constants/steps.js";
|
|
13
12
|
import { useAgentBuilderContext as L } from "../context/AgentBuilderContext.js";
|
|
14
|
-
import { Dropdown as
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
import { Dropdown as M } from "../../dropdown/Dropdown.js";
|
|
14
|
+
import { unwrapDropdownValue as P } from "../../dropdown/utils.js";
|
|
15
|
+
const v = H[1], Z = () => {
|
|
16
|
+
const { value: y, patch: a, availableIntents: m, charLimits: S } = L(), { trigger: n } = y, [_, h] = x.useState(!1), c = (t) => a({ trigger: { ...n, mode: t } }), b = (t) => {
|
|
17
|
+
n.intents.includes(t) || a({
|
|
18
|
+
trigger: { ...n, intents: [...n.intents, t] }
|
|
19
19
|
}), h(!1);
|
|
20
|
-
},
|
|
20
|
+
}, w = (t) => a({
|
|
21
21
|
trigger: {
|
|
22
22
|
...n,
|
|
23
|
-
intents: n.intents.filter((
|
|
23
|
+
intents: n.intents.filter((r) => r !== t)
|
|
24
24
|
}
|
|
25
|
-
}),
|
|
25
|
+
}), p = (t) => m.find((r) => r.value === t)?.label ?? t, s = m.filter((t) => !n.intents.includes(t.value)).map((t) => ({ label: t.label, value: t.value }));
|
|
26
26
|
return /* @__PURE__ */ i("div", { children: [
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */ i(
|
|
27
|
+
/* @__PURE__ */ e(F, { title: v.title, helper: v.helper }),
|
|
28
|
+
/* @__PURE__ */ i(T, { children: [
|
|
29
29
|
/* @__PURE__ */ i(
|
|
30
|
-
|
|
30
|
+
f,
|
|
31
31
|
{
|
|
32
32
|
"data-test": "trigger-mode-manifest",
|
|
33
33
|
selected: n.mode === "manifest_intent",
|
|
34
|
-
onClick: () =>
|
|
34
|
+
onClick: () => c("manifest_intent"),
|
|
35
35
|
children: [
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
|
|
36
|
+
/* @__PURE__ */ e(
|
|
37
|
+
u,
|
|
38
38
|
{
|
|
39
39
|
isActive: n.mode === "manifest_intent",
|
|
40
|
-
onValueChange: () =>
|
|
40
|
+
onValueChange: () => c("manifest_intent"),
|
|
41
41
|
skipSelectingOff: !0,
|
|
42
42
|
activeColor: o.content.brand
|
|
43
43
|
}
|
|
44
44
|
),
|
|
45
|
-
/* @__PURE__ */ i(
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ i(C, { children: [
|
|
46
|
+
/* @__PURE__ */ e(l, { color: o.content.primary, children: "Manifest intent" }),
|
|
47
|
+
/* @__PURE__ */ e(d, { color: o.content.secondary, children: "Manifest's AI classifier routes conversations automatically — no keywords needed." })
|
|
48
48
|
] })
|
|
49
49
|
]
|
|
50
50
|
}
|
|
51
51
|
),
|
|
52
52
|
/* @__PURE__ */ i(
|
|
53
|
-
|
|
53
|
+
f,
|
|
54
54
|
{
|
|
55
55
|
"data-test": "trigger-mode-custom",
|
|
56
56
|
selected: n.mode === "custom_intent",
|
|
57
|
-
onClick: () =>
|
|
57
|
+
onClick: () => c("custom_intent"),
|
|
58
58
|
children: [
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
|
|
59
|
+
/* @__PURE__ */ e(
|
|
60
|
+
u,
|
|
61
61
|
{
|
|
62
62
|
isActive: n.mode === "custom_intent",
|
|
63
|
-
onValueChange: () =>
|
|
63
|
+
onValueChange: () => c("custom_intent"),
|
|
64
64
|
skipSelectingOff: !0,
|
|
65
65
|
activeColor: o.content.brand
|
|
66
66
|
}
|
|
67
67
|
),
|
|
68
|
-
/* @__PURE__ */ i(
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ i(C, { children: [
|
|
69
|
+
/* @__PURE__ */ e(l, { color: o.content.primary, children: "Custom intent" }),
|
|
70
|
+
/* @__PURE__ */ e(d, { color: o.content.secondary, children: "Define your own trigger — use exact phrases or describe the customer's intent." })
|
|
71
71
|
] })
|
|
72
72
|
]
|
|
73
73
|
}
|
|
74
74
|
)
|
|
75
75
|
] }),
|
|
76
|
-
n.mode === "manifest_intent" ? /* @__PURE__ */ i(
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
/* @__PURE__ */ i(
|
|
79
|
-
n.intents.map((
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */
|
|
76
|
+
n.mode === "manifest_intent" ? /* @__PURE__ */ i(A, { children: [
|
|
77
|
+
/* @__PURE__ */ e(l, { color: o.content.primary, children: "If customer talks about" }),
|
|
78
|
+
/* @__PURE__ */ i(B, { children: [
|
|
79
|
+
n.intents.map((t) => /* @__PURE__ */ i(R, { "data-test": `intent-chip-${t}`, children: [
|
|
80
|
+
/* @__PURE__ */ e(g, { color: o.content.primary, children: p(t) }),
|
|
81
|
+
/* @__PURE__ */ e(
|
|
82
82
|
O,
|
|
83
83
|
{
|
|
84
|
-
onClick: () =>
|
|
85
|
-
"aria-label": `Remove ${
|
|
86
|
-
children: /* @__PURE__ */
|
|
87
|
-
|
|
84
|
+
onClick: () => w(t),
|
|
85
|
+
"aria-label": `Remove ${p(t)}`,
|
|
86
|
+
children: /* @__PURE__ */ e(
|
|
87
|
+
I,
|
|
88
88
|
{
|
|
89
89
|
width: 14,
|
|
90
90
|
height: 14,
|
|
@@ -93,9 +93,9 @@ const y = F[1], Z = () => {
|
|
|
93
93
|
)
|
|
94
94
|
}
|
|
95
95
|
)
|
|
96
|
-
] },
|
|
97
|
-
_ && s.length > 0 ? /* @__PURE__ */
|
|
98
|
-
|
|
96
|
+
] }, t)),
|
|
97
|
+
_ && s.length > 0 ? /* @__PURE__ */ e(
|
|
98
|
+
M,
|
|
99
99
|
{
|
|
100
100
|
"data-test": "intent-add-dropdown",
|
|
101
101
|
size: "small",
|
|
@@ -103,9 +103,9 @@ const y = F[1], Z = () => {
|
|
|
103
103
|
placeHolder: "Select intent",
|
|
104
104
|
isSearchable: !0,
|
|
105
105
|
options: s,
|
|
106
|
-
onSelect: (
|
|
107
|
-
const
|
|
108
|
-
|
|
106
|
+
onSelect: (t) => {
|
|
107
|
+
const r = P(t);
|
|
108
|
+
r && b(r);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
) : s.length > 0 && /* @__PURE__ */ i(
|
|
@@ -114,28 +114,28 @@ const y = F[1], Z = () => {
|
|
|
114
114
|
"data-test": "intent-add-button",
|
|
115
115
|
onClick: () => h(!0),
|
|
116
116
|
children: [
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
|
|
117
|
+
/* @__PURE__ */ e(
|
|
118
|
+
k,
|
|
119
119
|
{
|
|
120
120
|
width: 16,
|
|
121
121
|
height: 16,
|
|
122
122
|
color: o.content.secondary
|
|
123
123
|
}
|
|
124
124
|
),
|
|
125
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ e(g, { color: o.content.secondary, children: "Intent" })
|
|
126
126
|
]
|
|
127
127
|
}
|
|
128
128
|
)
|
|
129
129
|
] }),
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
] }) : /* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ e(d, { color: o.content.secondary, children: "This agent takes over from your main assistant when this intent is detected. The changeover is automatic when you go live." })
|
|
131
|
+
] }) : /* @__PURE__ */ e(
|
|
132
132
|
E,
|
|
133
133
|
{
|
|
134
134
|
"data-test": "custom-intent",
|
|
135
135
|
label: "Describe the trigger",
|
|
136
136
|
value: n.custom_intent ?? "",
|
|
137
|
-
onChange: (
|
|
138
|
-
maxLength:
|
|
137
|
+
onChange: (t) => a({ trigger: { ...n, custom_intent: t } }),
|
|
138
|
+
maxLength: S.custom_intent,
|
|
139
139
|
placeholder: "e.g. The customer wants to cancel an order they placed.",
|
|
140
140
|
minHeight: "120px"
|
|
141
141
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Step2WhenItStepsIn.js","sources":["../../../../../src/components/agent-builder/steps/Step2WhenItStepsIn.tsx"],"sourcesContent":["import CrossIcon from '@src/assets/icons/cross.svg';\nimport PlusIcon from '@src/assets/icons/plus.svg';\nimport React from 'react';\nimport { Dropdown } from '@src/components/dropdown';\nimport { SingleOption } from '@src/components/dropdown/type';\nimport { RadioButton } from '@src/components/radioButton/RadioButton';\nimport {\n\tBodyCaption,\n\tBodySecondary,\n\tTitleSmall,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport { TriggerMode } from '../AgentBuilder.model';\nimport {\n\tAddChipButton,\n\tCardRow,\n\tChipCloseButton,\n\tChipWrap,\n\tFieldBlock,\n\tIntentChip,\n\tRadioCard,\n\tRadioCardText,\n} from '../AgentBuilder.styled';\nimport { AiTextArea } from '../components/AiTextArea';\nimport { StepSectionHeader } from '../components/StepSectionHeader';\nimport { AGENT_CHAR_LIMITS } from '../constants/charLimits';\nimport { STEP_DEFINITIONS } from '../constants/steps';\nimport { useAgentBuilderContext } from '../context/AgentBuilderContext';\n\nconst STEP = STEP_DEFINITIONS[1];\n\nexport const Step2WhenItStepsIn: React.FC = () => {\n\tconst { value, patch, availableIntents } = useAgentBuilderContext();\n\tconst { trigger } = value;\n\tconst [adding, setAdding] = React.useState(false);\n\n\tconst setMode = (mode: TriggerMode) =>\n\t\tpatch({ trigger: { ...trigger, mode } });\n\n\tconst addIntent = (intentValue: string) => {\n\t\tif (!trigger.intents.includes(intentValue)) {\n\t\t\tpatch({\n\t\t\t\ttrigger: { ...trigger, intents: [...trigger.intents, intentValue] },\n\t\t\t});\n\t\t}\n\t\tsetAdding(false);\n\t};\n\n\tconst removeIntent = (intentValue: string) =>\n\t\tpatch({\n\t\t\ttrigger: {\n\t\t\t\t...trigger,\n\t\t\t\tintents: trigger.intents.filter((i) => i !== intentValue),\n\t\t\t},\n\t\t});\n\n\tconst labelFor = (v: string) =>\n\t\tavailableIntents.find((o) => o.value === v)?.label ?? v;\n\n\tconst remainingOptions: SingleOption[] = availableIntents\n\t\t.filter((o) => !trigger.intents.includes(o.value))\n\t\t.map((o) => ({ label: o.label, value: o.value }));\n\n\treturn (\n\t\t<div>\n\t\t\t<StepSectionHeader title={STEP.title} helper={STEP.helper} />\n\n\t\t\t<CardRow>\n\t\t\t\t<RadioCard\n\t\t\t\t\tdata-test=\"trigger-mode-manifest\"\n\t\t\t\t\tselected={trigger.mode === 'manifest_intent'}\n\t\t\t\t\tonClick={() => setMode('manifest_intent')}\n\t\t\t\t>\n\t\t\t\t\t<RadioButton\n\t\t\t\t\t\tisActive={trigger.mode === 'manifest_intent'}\n\t\t\t\t\t\tonValueChange={() => setMode('manifest_intent')}\n\t\t\t\t\t\tskipSelectingOff\n\t\t\t\t\t\tactiveColor={COLORS.content.brand}\n\t\t\t\t\t/>\n\t\t\t\t\t<RadioCardText>\n\t\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\t\tManifest intent\n\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\tManifest's AI classifier routes conversations automatically —\n\t\t\t\t\t\t\tno keywords needed.\n\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t</RadioCardText>\n\t\t\t\t</RadioCard>\n\n\t\t\t\t<RadioCard\n\t\t\t\t\tdata-test=\"trigger-mode-custom\"\n\t\t\t\t\tselected={trigger.mode === 'custom_intent'}\n\t\t\t\t\tonClick={() => setMode('custom_intent')}\n\t\t\t\t>\n\t\t\t\t\t<RadioButton\n\t\t\t\t\t\tisActive={trigger.mode === 'custom_intent'}\n\t\t\t\t\t\tonValueChange={() => setMode('custom_intent')}\n\t\t\t\t\t\tskipSelectingOff\n\t\t\t\t\t\tactiveColor={COLORS.content.brand}\n\t\t\t\t\t/>\n\t\t\t\t\t<RadioCardText>\n\t\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\t\tCustom intent\n\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\tDefine your own trigger — use exact phrases or describe the\n\t\t\t\t\t\t\tcustomer's intent.\n\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t</RadioCardText>\n\t\t\t\t</RadioCard>\n\t\t\t</CardRow>\n\n\t\t\t{trigger.mode === 'manifest_intent' ? (\n\t\t\t\t<FieldBlock>\n\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\tIf customer talks about\n\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t<ChipWrap>\n\t\t\t\t\t\t{trigger.intents.map((intent) => (\n\t\t\t\t\t\t\t<IntentChip key={intent} data-test={`intent-chip-${intent}`}>\n\t\t\t\t\t\t\t\t<BodySecondary color={COLORS.content.primary}>\n\t\t\t\t\t\t\t\t\t{labelFor(intent)}\n\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t\t<ChipCloseButton\n\t\t\t\t\t\t\t\t\tonClick={() => removeIntent(intent)}\n\t\t\t\t\t\t\t\t\taria-label={`Remove ${labelFor(intent)}`}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<CrossIcon\n\t\t\t\t\t\t\t\t\t\twidth={14}\n\t\t\t\t\t\t\t\t\t\theight={14}\n\t\t\t\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</ChipCloseButton>\n\t\t\t\t\t\t\t</IntentChip>\n\t\t\t\t\t\t))}\n\n\t\t\t\t\t\t{adding && remainingOptions.length > 0 ? (\n\t\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\t\tdata-test=\"intent-add-dropdown\"\n\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\twidth=\"200px\"\n\t\t\t\t\t\t\t\tplaceHolder=\"Select intent\"\n\t\t\t\t\t\t\t\tisSearchable\n\t\t\t\t\t\t\t\toptions={remainingOptions}\n\t\t\t\t\t\t\t\tonSelect={(opt) => {\n\t\t\t\t\t\t\t\t\tconst single = Array.isArray(opt) ? opt[0] : opt;\n\t\t\t\t\t\t\t\t\tconst v = (single as SingleOption)?.value;\n\t\t\t\t\t\t\t\t\tif (v) {\n\t\t\t\t\t\t\t\t\t\taddIntent(v);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tremainingOptions.length > 0 && (\n\t\t\t\t\t\t\t\t<AddChipButton\n\t\t\t\t\t\t\t\t\tdata-test=\"intent-add-button\"\n\t\t\t\t\t\t\t\t\tonClick={() => setAdding(true)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<PlusIcon\n\t\t\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<BodySecondary color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t\t\t\tIntent\n\t\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t\t</AddChipButton>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ChipWrap>\n\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\tThis agent takes over from your main assistant when this intent is\n\t\t\t\t\t\tdetected. The changeover is automatic when you go live.\n\t\t\t\t\t</BodyCaption>\n\t\t\t\t</FieldBlock>\n\t\t\t) : (\n\t\t\t\t<AiTextArea\n\t\t\t\t\tdata-test=\"custom-intent\"\n\t\t\t\t\tlabel=\"Describe the trigger\"\n\t\t\t\t\tvalue={trigger.custom_intent ?? ''}\n\t\t\t\t\tonChange={(text) =>\n\t\t\t\t\t\tpatch({ trigger: { ...trigger, custom_intent: text } })\n\t\t\t\t\t}\n\t\t\t\t\tmaxLength={AGENT_CHAR_LIMITS.custom_intent}\n\t\t\t\t\tplaceholder=\"e.g. The customer wants to cancel an order they placed.\"\n\t\t\t\t\tminHeight=\"120px\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n"],"names":["STEP","STEP_DEFINITIONS","Step2WhenItStepsIn","value","patch","availableIntents","useAgentBuilderContext","trigger","adding","setAdding","React","setMode","mode","addIntent","intentValue","removeIntent","i","labelFor","v","o","remainingOptions","jsx","StepSectionHeader","CardRow","jsxs","RadioCard","RadioButton","COLORS","RadioCardText","TitleSmall","BodyCaption","FieldBlock","ChipWrap","intent","IntentChip","BodySecondary","ChipCloseButton","CrossIcon","Dropdown","opt","AddChipButton","PlusIcon","AiTextArea","text","AGENT_CHAR_LIMITS"],"mappings":";;;;;;;;;;;;;;AA6BA,MAAMA,IAAOC,EAAiB,CAAC,GAElBC,IAA+B,MAAM;AACjD,QAAM,EAAE,OAAAC,GAAO,OAAAC,GAAO,kBAAAC,EAAA,IAAqBC,EAAA,GACrC,EAAE,SAAAC,MAAYJ,GACd,CAACK,GAAQC,CAAS,IAAIC,EAAM,SAAS,EAAK,GAE1CC,IAAU,CAACC,MAChBR,EAAM,EAAE,SAAS,EAAE,GAAGG,GAAS,MAAAK,EAAA,GAAQ,GAElCC,IAAY,CAACC,MAAwB;AAC1C,IAAKP,EAAQ,QAAQ,SAASO,CAAW,KACxCV,EAAM;AAAA,MACL,SAAS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A,MAAA;AAAA,IAAA;AAAA,EACX,GAEF;AAEF;"}
|
|
1
|
+
{"version":3,"file":"Step2WhenItStepsIn.js","sources":["../../../../../src/components/agent-builder/steps/Step2WhenItStepsIn.tsx"],"sourcesContent":["import CrossIcon from '@src/assets/icons/cross.svg';\nimport PlusIcon from '@src/assets/icons/plus.svg';\nimport React from 'react';\nimport { Dropdown, unwrapDropdownValue } from '@src/components/dropdown';\nimport { SingleOption } from '@src/components/dropdown/type';\nimport { RadioButton } from '@src/components/radioButton/RadioButton';\nimport {\n\tBodyCaption,\n\tBodySecondary,\n\tTitleSmall,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport { TriggerMode } from '../AgentBuilder.model';\nimport {\n\tAddChipButton,\n\tCardRow,\n\tChipCloseButton,\n\tChipWrap,\n\tFieldBlock,\n\tIntentChip,\n\tRadioCard,\n\tRadioCardText,\n} from '../AgentBuilder.styled';\nimport { AiTextArea } from '../components/AiTextArea';\nimport { StepSectionHeader } from '../components/StepSectionHeader';\nimport { STEP_DEFINITIONS } from '../constants/steps';\nimport { useAgentBuilderContext } from '../context/AgentBuilderContext';\n\nconst STEP = STEP_DEFINITIONS[1];\n\nexport const Step2WhenItStepsIn: React.FC = () => {\n\tconst { value, patch, availableIntents, charLimits } =\n\t\tuseAgentBuilderContext();\n\tconst { trigger } = value;\n\tconst [adding, setAdding] = React.useState(false);\n\n\tconst setMode = (mode: TriggerMode) =>\n\t\tpatch({ trigger: { ...trigger, mode } });\n\n\tconst addIntent = (intentValue: string) => {\n\t\tif (!trigger.intents.includes(intentValue)) {\n\t\t\tpatch({\n\t\t\t\ttrigger: { ...trigger, intents: [...trigger.intents, intentValue] },\n\t\t\t});\n\t\t}\n\t\tsetAdding(false);\n\t};\n\n\tconst removeIntent = (intentValue: string) =>\n\t\tpatch({\n\t\t\ttrigger: {\n\t\t\t\t...trigger,\n\t\t\t\tintents: trigger.intents.filter((i) => i !== intentValue),\n\t\t\t},\n\t\t});\n\n\tconst labelFor = (v: string) =>\n\t\tavailableIntents.find((o) => o.value === v)?.label ?? v;\n\n\tconst remainingOptions: SingleOption[] = availableIntents\n\t\t.filter((o) => !trigger.intents.includes(o.value))\n\t\t.map((o) => ({ label: o.label, value: o.value }));\n\n\treturn (\n\t\t<div>\n\t\t\t<StepSectionHeader title={STEP.title} helper={STEP.helper} />\n\n\t\t\t<CardRow>\n\t\t\t\t<RadioCard\n\t\t\t\t\tdata-test=\"trigger-mode-manifest\"\n\t\t\t\t\tselected={trigger.mode === 'manifest_intent'}\n\t\t\t\t\tonClick={() => setMode('manifest_intent')}\n\t\t\t\t>\n\t\t\t\t\t<RadioButton\n\t\t\t\t\t\tisActive={trigger.mode === 'manifest_intent'}\n\t\t\t\t\t\tonValueChange={() => setMode('manifest_intent')}\n\t\t\t\t\t\tskipSelectingOff\n\t\t\t\t\t\tactiveColor={COLORS.content.brand}\n\t\t\t\t\t/>\n\t\t\t\t\t<RadioCardText>\n\t\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\t\tManifest intent\n\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\tManifest's AI classifier routes conversations automatically —\n\t\t\t\t\t\t\tno keywords needed.\n\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t</RadioCardText>\n\t\t\t\t</RadioCard>\n\n\t\t\t\t<RadioCard\n\t\t\t\t\tdata-test=\"trigger-mode-custom\"\n\t\t\t\t\tselected={trigger.mode === 'custom_intent'}\n\t\t\t\t\tonClick={() => setMode('custom_intent')}\n\t\t\t\t>\n\t\t\t\t\t<RadioButton\n\t\t\t\t\t\tisActive={trigger.mode === 'custom_intent'}\n\t\t\t\t\t\tonValueChange={() => setMode('custom_intent')}\n\t\t\t\t\t\tskipSelectingOff\n\t\t\t\t\t\tactiveColor={COLORS.content.brand}\n\t\t\t\t\t/>\n\t\t\t\t\t<RadioCardText>\n\t\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\t\tCustom intent\n\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\tDefine your own trigger — use exact phrases or describe the\n\t\t\t\t\t\t\tcustomer's intent.\n\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t</RadioCardText>\n\t\t\t\t</RadioCard>\n\t\t\t</CardRow>\n\n\t\t\t{trigger.mode === 'manifest_intent' ? (\n\t\t\t\t<FieldBlock>\n\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\tIf customer talks about\n\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t<ChipWrap>\n\t\t\t\t\t\t{trigger.intents.map((intent) => (\n\t\t\t\t\t\t\t<IntentChip key={intent} data-test={`intent-chip-${intent}`}>\n\t\t\t\t\t\t\t\t<BodySecondary color={COLORS.content.primary}>\n\t\t\t\t\t\t\t\t\t{labelFor(intent)}\n\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t\t<ChipCloseButton\n\t\t\t\t\t\t\t\t\tonClick={() => removeIntent(intent)}\n\t\t\t\t\t\t\t\t\taria-label={`Remove ${labelFor(intent)}`}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<CrossIcon\n\t\t\t\t\t\t\t\t\t\twidth={14}\n\t\t\t\t\t\t\t\t\t\theight={14}\n\t\t\t\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</ChipCloseButton>\n\t\t\t\t\t\t\t</IntentChip>\n\t\t\t\t\t\t))}\n\n\t\t\t\t\t\t{adding && remainingOptions.length > 0 ? (\n\t\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\t\tdata-test=\"intent-add-dropdown\"\n\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\twidth=\"200px\"\n\t\t\t\t\t\t\t\tplaceHolder=\"Select intent\"\n\t\t\t\t\t\t\t\tisSearchable\n\t\t\t\t\t\t\t\toptions={remainingOptions}\n\t\t\t\t\t\t\t\tonSelect={(opt) => {\n\t\t\t\t\t\t\t\t\tconst v = unwrapDropdownValue(opt);\n\t\t\t\t\t\t\t\t\tif (v) {\n\t\t\t\t\t\t\t\t\t\taddIntent(v);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tremainingOptions.length > 0 && (\n\t\t\t\t\t\t\t\t<AddChipButton\n\t\t\t\t\t\t\t\t\tdata-test=\"intent-add-button\"\n\t\t\t\t\t\t\t\t\tonClick={() => setAdding(true)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<PlusIcon\n\t\t\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<BodySecondary color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t\t\t\tIntent\n\t\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t\t</AddChipButton>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ChipWrap>\n\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\tThis agent takes over from your main assistant when this intent is\n\t\t\t\t\t\tdetected. The changeover is automatic when you go live.\n\t\t\t\t\t</BodyCaption>\n\t\t\t\t</FieldBlock>\n\t\t\t) : (\n\t\t\t\t<AiTextArea\n\t\t\t\t\tdata-test=\"custom-intent\"\n\t\t\t\t\tlabel=\"Describe the trigger\"\n\t\t\t\t\tvalue={trigger.custom_intent ?? ''}\n\t\t\t\t\tonChange={(text) =>\n\t\t\t\t\t\tpatch({ trigger: { ...trigger, custom_intent: text } })\n\t\t\t\t\t}\n\t\t\t\t\tmaxLength={charLimits.custom_intent}\n\t\t\t\t\tplaceholder=\"e.g. The customer wants to cancel an order they placed.\"\n\t\t\t\t\tminHeight=\"120px\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n"],"names":["STEP","STEP_DEFINITIONS","Step2WhenItStepsIn","value","patch","availableIntents","charLimits","useAgentBuilderContext","trigger","adding","setAdding","React","setMode","mode","addIntent","intentValue","removeIntent","i","labelFor","v","o","remainingOptions","jsx","StepSectionHeader","CardRow","jsxs","RadioCard","RadioButton","COLORS","RadioCardText","TitleSmall","BodyCaption","FieldBlock","ChipWrap","intent","IntentChip","BodySecondary","ChipCloseButton","CrossIcon","Dropdown","opt","unwrapDropdownValue","AddChipButton","PlusIcon","AiTextArea","text"],"mappings":";;;;;;;;;;;;;;AA4BA,MAAMA,IAAOC,EAAiB,CAAC,GAElBC,IAA+B,MAAM;AACjD,QAAM,EAAE,OAAAC,GAAO,OAAAC,GAAO,kBAAAC,GAAkB,YAAAC,EAAA,IACvCC,EAAA,GACK,EAAE,SAAAC,MAAYL,GACd,CAACM,GAAQC,CAAS,IAAIC,EAAM,SAAS,EAAK,GAE1CC,IAAU,CAACC,MAChBT,EAAM,EAAE,SAAS,EAAE,GAAGI,GAAS,MAAAK,EAAA,GAAQ,GAElCC,IAAY,CAACC,MAAwB;AAC1C,IAAKP,EAAQ,QAAQ,SAASO,CAAW,KACxCX,EAAM;AAAA,MACL,SAAS,EAAE,GAAGI,GAAS,SAAS,CAAC,GAAGA,EAAQ,SAASO,CAAW,EAAA;AAAA,IAAE,CAClE,GAEFL,EAAU,EAAK;AAAA,EAChB,GAEMM,IAAe,CAACD,MACrBX,EAAM;AAAA,IACL,SAAS;AAAA,MACR,GAAGI;AAAA,MACH,SAASA,EAAQ,QAAQ,OAAO,CAACS,MAAMA,MAAMF,CAAW;AAAA,IAAA;AAAA,EACzD,CACA,GAEIG,IAAW,CAACC,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A,YACT,UAAU,CAACmB,MAAQ;AAClB,oBAAMrB,IAAIsB,EAAoBD,CAAG;AACjC,cAAIrB,KACHL,EAAUK,CAAC;AAAA,YAEb;AAAA,UAAA;AAAA,QAAA,IAGDE,EAAiB,SAAS,KACzB,gBAAAI;AAAA,UAACiB;AAAA,UAAA;AAAA,YACA,aAAU;AAAA,YACV,SAAS,MAAMhC,EAAU,EAAI;AAAA,YAE7B,UAAA;AAAA,cAAA,gBAAAY;AAAA,gBAACqB;AAAAA,gBAAA;AAAA,kBACA,OAAO;AAAA,kBACP,QAAQ;AAAA,kBACR,OAAOf,EAAO,QAAQ;AAAA,gBAAA;AAAA,cAAA;AAAA,gCAEtBQ,GAAA,EAAc,OAAOR,EAAO,QAAQ,WAAW,UAAA,SAAA,CAEhD;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACD,GAGH;AAAA,wBACCG,GAAA,EAAY,OAAOH,EAAO,QAAQ,WAAW,UAAA,6HAAA,CAG9C;AAAA,IAAA,EAAA,CACD,IAEA,gBAAAN;AAAA,MAACsB;AAAA,MAAA;AAAA,QACA,aAAU;AAAA,QACV,OAAM;AAAA,QACN,OAAOpC,EAAQ,iBAAiB;AAAA,QAChC,UAAU,CAACqC,MACVzC,EAAM,EAAE,SAAS,EAAE,GAAGI,GAAS,eAAeqC,EAAA,GAAQ;AAAA,QAEvD,WAAWvC,EAAW;AAAA,QACtB,aAAY;AAAA,QACZ,WAAU;AAAA,MAAA;AAAA,IAAA;AAAA,EACX,GAEF;AAEF;"}
|
|
@@ -1,51 +1,49 @@
|
|
|
1
|
-
import { jsxs as c, jsx as
|
|
2
|
-
import
|
|
3
|
-
import { TitleSmall as
|
|
4
|
-
import { COLORS as
|
|
5
|
-
import { Step3Grid as
|
|
6
|
-
import { CreateSubAgentPanel as
|
|
7
|
-
import { MentionField as
|
|
8
|
-
import { SelectableListSection as
|
|
9
|
-
import { StepSectionHeader as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
const
|
|
17
|
-
const a = L[n];
|
|
18
|
-
return a ? q.createElement(a.Icon, { width: a.w, height: a.h }) : void 0;
|
|
19
|
-
}, _ = (n) => ({
|
|
1
|
+
import { jsxs as c, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as E, useRef as Y, useCallback as A, useEffect as Z } from "react";
|
|
3
|
+
import { TitleSmall as M } from "../../TypographyStyle.js";
|
|
4
|
+
import { COLORS as L } from "../../../constants/Theme.js";
|
|
5
|
+
import { Step3Grid as ee, Step3Main as te, Step3Side as ne, SideSection as oe } from "../AgentBuilder.styled.js";
|
|
6
|
+
import { CreateSubAgentPanel as ae } from "../components/CreateSubAgentPanel.js";
|
|
7
|
+
import { MentionField as k } from "../components/MentionField.js";
|
|
8
|
+
import { SelectableListSection as R } from "../components/SelectableListSection.js";
|
|
9
|
+
import { StepSectionHeader as le } from "../components/StepSectionHeader.js";
|
|
10
|
+
import { STEP_DEFINITIONS as se } from "../constants/steps.js";
|
|
11
|
+
import { useAgentBuilderContext as ie } from "../context/AgentBuilderContext.js";
|
|
12
|
+
import { toolSourceLabel as re, buildAgentMentionItems as P, appTypeLabel as N } from "../utils/mentionSerialization.js";
|
|
13
|
+
import { SOURCE_ICONS as F, renderSourceIcon as ce } from "../utils/sourceIcons.js";
|
|
14
|
+
import { Dropdown as ue } from "../../dropdown/Dropdown.js";
|
|
15
|
+
import { unwrapDropdownValue as de } from "../../dropdown/utils.js";
|
|
16
|
+
const pe = (n) => ce(F[n]) ?? void 0, _ = (n) => ({
|
|
20
17
|
label: n.display_name,
|
|
21
18
|
value: n.tool_id,
|
|
22
|
-
leadingIcon:
|
|
23
|
-
}),
|
|
19
|
+
leadingIcon: pe(n.source ?? "manifest")
|
|
20
|
+
}), H = se[2], Ee = () => {
|
|
24
21
|
const {
|
|
25
22
|
value: n,
|
|
26
|
-
patch:
|
|
27
|
-
updateField:
|
|
28
|
-
removeReference:
|
|
29
|
-
availableTools:
|
|
30
|
-
availableSubAgents:
|
|
23
|
+
patch: u,
|
|
24
|
+
updateField: G,
|
|
25
|
+
removeReference: C,
|
|
26
|
+
availableTools: r,
|
|
27
|
+
availableSubAgents: D,
|
|
31
28
|
availableModels: f,
|
|
32
|
-
applicationType:
|
|
29
|
+
applicationType: T,
|
|
30
|
+
charLimits: h,
|
|
33
31
|
insertMention: d,
|
|
34
|
-
onCreateSubAgent:
|
|
32
|
+
onCreateSubAgent: s,
|
|
35
33
|
onFetchSubAgent: p,
|
|
36
|
-
onUpdateSubAgent:
|
|
37
|
-
onImproveSubAgent:
|
|
38
|
-
registerSubAgentCreator:
|
|
39
|
-
} =
|
|
40
|
-
|
|
41
|
-
const
|
|
34
|
+
onUpdateSubAgent: S,
|
|
35
|
+
onImproveSubAgent: K,
|
|
36
|
+
registerSubAgentCreator: v
|
|
37
|
+
} = ie(), [l, m] = E(null), g = Y(0), [j, w] = E([]), b = /* @__PURE__ */ new Map();
|
|
38
|
+
D.forEach((e) => b.set(e.id, e)), j.forEach((e) => b.set(e.id, e));
|
|
39
|
+
const O = Array.from(b.values()), y = A(() => {
|
|
42
40
|
g.current += 1, m({ key: g.current, title: "Create sub-agent" });
|
|
43
41
|
}, []);
|
|
44
|
-
|
|
45
|
-
if (
|
|
46
|
-
return
|
|
47
|
-
}, [
|
|
48
|
-
const
|
|
42
|
+
Z(() => {
|
|
43
|
+
if (s)
|
|
44
|
+
return v(y), () => v(null);
|
|
45
|
+
}, [v, y, s]);
|
|
46
|
+
const B = A(
|
|
49
47
|
async (e) => {
|
|
50
48
|
if (!p)
|
|
51
49
|
return;
|
|
@@ -58,161 +56,168 @@ const ie = (n) => {
|
|
|
58
56
|
});
|
|
59
57
|
},
|
|
60
58
|
[p]
|
|
61
|
-
),
|
|
59
|
+
), U = A(
|
|
62
60
|
async (e) => {
|
|
63
|
-
if (
|
|
64
|
-
if (
|
|
65
|
-
const t = await
|
|
66
|
-
|
|
67
|
-
...o.filter((
|
|
61
|
+
if (l?.editingId) {
|
|
62
|
+
if (S) {
|
|
63
|
+
const t = await S(l.editingId, e);
|
|
64
|
+
w((o) => [
|
|
65
|
+
...o.filter((i) => i.id !== t.id),
|
|
68
66
|
t
|
|
69
67
|
]);
|
|
70
68
|
}
|
|
71
|
-
} else if (
|
|
72
|
-
const t = await
|
|
73
|
-
|
|
69
|
+
} else if (s) {
|
|
70
|
+
const t = await s(e);
|
|
71
|
+
w((o) => [...o, t]), u({ subagents: [...n.subagents, t.id] }), d("subagent", t.id, `sub-agent: ${t.name}`);
|
|
74
72
|
}
|
|
75
73
|
m(null);
|
|
76
74
|
},
|
|
77
75
|
[
|
|
76
|
+
l,
|
|
77
|
+
S,
|
|
78
78
|
s,
|
|
79
|
-
|
|
80
|
-
i,
|
|
81
|
-
a,
|
|
79
|
+
u,
|
|
82
80
|
n.subagents,
|
|
83
81
|
d
|
|
84
82
|
]
|
|
85
|
-
),
|
|
86
|
-
const t =
|
|
83
|
+
), z = n.tools.map((e) => {
|
|
84
|
+
const t = r.find((o) => o.tool_id === e);
|
|
87
85
|
return t ? {
|
|
88
86
|
id: e,
|
|
89
87
|
label: t.display_name,
|
|
90
|
-
icon:
|
|
88
|
+
icon: F[t.source ?? "manifest"]
|
|
91
89
|
} : null;
|
|
92
|
-
}).filter((e) => e !== null),
|
|
90
|
+
}).filter((e) => e !== null), V = r.map(_), W = (() => {
|
|
93
91
|
const e = [], t = /* @__PURE__ */ new Map();
|
|
94
|
-
return
|
|
95
|
-
const
|
|
96
|
-
t.has(
|
|
92
|
+
return r.forEach((o) => {
|
|
93
|
+
const i = o.source ?? "manifest";
|
|
94
|
+
t.has(i) || (t.set(i, []), e.push(i)), t.get(i)?.push(_(o));
|
|
97
95
|
}), e.map((o) => ({
|
|
98
96
|
source: o,
|
|
99
|
-
label:
|
|
97
|
+
label: re(o),
|
|
100
98
|
options: t.get(o) ?? []
|
|
101
99
|
}));
|
|
102
|
-
})(),
|
|
100
|
+
})(), $ = n.subagents.map((e) => {
|
|
103
101
|
const t = b.get(e);
|
|
104
102
|
return t ? { id: e, label: t.name } : null;
|
|
105
|
-
}).filter((e) => e !== null),
|
|
103
|
+
}).filter((e) => e !== null), q = O.map((e) => ({
|
|
106
104
|
label: e.name,
|
|
107
105
|
value: e.id
|
|
108
|
-
})),
|
|
106
|
+
})), x = N(T), J = P(r, [], x), Q = P(
|
|
107
|
+
[],
|
|
108
|
+
O,
|
|
109
|
+
x
|
|
110
|
+
), X = f.map((e) => ({
|
|
109
111
|
label: e.label,
|
|
110
112
|
value: e.value,
|
|
111
113
|
selected: e.value === n.model
|
|
112
|
-
})),
|
|
114
|
+
})), I = f.find((e) => e.value === n.model);
|
|
113
115
|
return /* @__PURE__ */ c("div", { className: "bik-agent-step bik-agent-step--response", children: [
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
/* @__PURE__ */ c(
|
|
116
|
-
/* @__PURE__ */ c(
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
|
|
116
|
+
/* @__PURE__ */ a(le, { title: H.title, helper: H.helper }),
|
|
117
|
+
/* @__PURE__ */ c(ee, { children: [
|
|
118
|
+
/* @__PURE__ */ c(te, { children: [
|
|
119
|
+
/* @__PURE__ */ a(
|
|
120
|
+
k,
|
|
119
121
|
{
|
|
120
122
|
fieldKey: "instructions",
|
|
121
123
|
"data-test": "agent-instructions",
|
|
122
124
|
label: "Instructions",
|
|
123
|
-
maxLength:
|
|
125
|
+
maxLength: h.instructions,
|
|
124
126
|
placeholder: "Write what this agent should do. Type @ to reference a tool or sub-agent.",
|
|
125
127
|
minHeight: "200px"
|
|
126
128
|
}
|
|
127
129
|
),
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
|
|
130
|
+
/* @__PURE__ */ a(
|
|
131
|
+
k,
|
|
130
132
|
{
|
|
131
133
|
fieldKey: "guardrail",
|
|
132
134
|
"data-test": "agent-guardrail",
|
|
133
135
|
label: "Guardrails",
|
|
134
|
-
maxLength:
|
|
136
|
+
maxLength: h.guardrail,
|
|
135
137
|
placeholder: "Things this agent must never do. Type @ to reference a tool or sub-agent.",
|
|
136
138
|
minHeight: "140px"
|
|
137
139
|
}
|
|
138
140
|
)
|
|
139
141
|
] }),
|
|
140
|
-
/* @__PURE__ */ c(
|
|
141
|
-
/* @__PURE__ */
|
|
142
|
-
|
|
142
|
+
/* @__PURE__ */ c(ne, { children: [
|
|
143
|
+
/* @__PURE__ */ a(
|
|
144
|
+
R,
|
|
143
145
|
{
|
|
144
146
|
title: "Tools",
|
|
145
147
|
helper: "Actions this agent can take while responding.",
|
|
146
148
|
dataTestPrefix: "agent-tools",
|
|
147
|
-
items:
|
|
148
|
-
addableOptions:
|
|
149
|
-
sourceGroups:
|
|
149
|
+
items: z,
|
|
150
|
+
addableOptions: V,
|
|
151
|
+
sourceGroups: W,
|
|
152
|
+
mentionItems: J,
|
|
150
153
|
emptyText: "No tools added yet.",
|
|
151
154
|
onAdd: (e) => {
|
|
152
|
-
d("tool", e), n.tools.includes(e) ||
|
|
155
|
+
d("tool", e), n.tools.includes(e) || u({ tools: [...n.tools, e] });
|
|
153
156
|
},
|
|
154
|
-
onRemove: (e) =>
|
|
157
|
+
onRemove: (e) => C("tool", e)
|
|
155
158
|
}
|
|
156
159
|
),
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
|
|
160
|
+
/* @__PURE__ */ a(
|
|
161
|
+
R,
|
|
159
162
|
{
|
|
160
163
|
title: "Sub-agents",
|
|
161
164
|
helper: "Other agents this agent can hand off the conversation to.",
|
|
162
165
|
dataTestPrefix: "agent-subagents",
|
|
163
|
-
items:
|
|
164
|
-
addableOptions:
|
|
166
|
+
items: $,
|
|
167
|
+
addableOptions: q,
|
|
168
|
+
mentionItems: Q,
|
|
165
169
|
emptyText: "No sub-agents added yet.",
|
|
166
170
|
onAdd: (e) => {
|
|
167
|
-
d("subagent", e), n.subagents.includes(e) ||
|
|
171
|
+
d("subagent", e), n.subagents.includes(e) || u({ subagents: [...n.subagents, e] });
|
|
168
172
|
},
|
|
169
|
-
onRemove: (e) =>
|
|
170
|
-
onConfigure: p ?
|
|
171
|
-
createOption:
|
|
173
|
+
onRemove: (e) => C("subagent", e),
|
|
174
|
+
onConfigure: p ? B : void 0,
|
|
175
|
+
createOption: s ? { label: "Create new", onSelect: y } : void 0
|
|
172
176
|
}
|
|
173
177
|
),
|
|
174
|
-
f.length > 0 && /* @__PURE__ */ c(
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
|
|
178
|
+
f.length > 0 && /* @__PURE__ */ c(oe, { children: [
|
|
179
|
+
/* @__PURE__ */ a(M, { color: L.content.primary, children: "Advanced settings" }),
|
|
180
|
+
/* @__PURE__ */ a(M, { color: L.content.secondary, children: "Select AI model" }),
|
|
181
|
+
/* @__PURE__ */ a(
|
|
182
|
+
ue,
|
|
179
183
|
{
|
|
180
184
|
"data-test": "agent-model",
|
|
181
185
|
size: "small",
|
|
182
186
|
width: "100%",
|
|
183
187
|
placeHolder: "Select model",
|
|
184
|
-
options:
|
|
185
|
-
defaultOptions:
|
|
188
|
+
options: X,
|
|
189
|
+
defaultOptions: I ? [
|
|
186
190
|
{
|
|
187
|
-
label:
|
|
188
|
-
value:
|
|
191
|
+
label: I.label,
|
|
192
|
+
value: I.value
|
|
189
193
|
}
|
|
190
194
|
] : void 0,
|
|
191
195
|
onSelect: (e) => {
|
|
192
|
-
const
|
|
193
|
-
|
|
196
|
+
const t = de(e);
|
|
197
|
+
t && G("model", t);
|
|
194
198
|
}
|
|
195
199
|
}
|
|
196
200
|
)
|
|
197
201
|
] })
|
|
198
202
|
] })
|
|
199
203
|
] }),
|
|
200
|
-
|
|
201
|
-
|
|
204
|
+
l && /* @__PURE__ */ a(
|
|
205
|
+
ae,
|
|
202
206
|
{
|
|
203
|
-
title:
|
|
204
|
-
initial:
|
|
205
|
-
availableTools:
|
|
206
|
-
appLabel:
|
|
207
|
-
|
|
207
|
+
title: l.title,
|
|
208
|
+
initial: l.initial,
|
|
209
|
+
availableTools: r,
|
|
210
|
+
appLabel: N(T),
|
|
211
|
+
charLimits: h,
|
|
212
|
+
onImprove: K,
|
|
208
213
|
onClose: () => m(null),
|
|
209
|
-
onSave:
|
|
214
|
+
onSave: U
|
|
210
215
|
},
|
|
211
|
-
|
|
216
|
+
l.key
|
|
212
217
|
)
|
|
213
218
|
] });
|
|
214
219
|
};
|
|
215
220
|
export {
|
|
216
|
-
|
|
221
|
+
Ee as Step3HowItResponds
|
|
217
222
|
};
|
|
218
223
|
//# sourceMappingURL=Step3HowItResponds.js.map
|