@bikdotai/bik-component-library 0.0.874 → 0.0.875-beta.0

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.
@@ -7,10 +7,10 @@ import h from "styled-components";
7
7
  import { TitleSmall as pe, BodySecondary as fe, BodyCaption as ge } from "../../TypographyStyle.js";
8
8
  import { COLORS as o } from "../../../constants/Theme.js";
9
9
  import { PickerType as be } from "../../variable-picker-v3/model.js";
10
- import { CATEGORIES as me, INTEGRATIONS_KEY as k, toolSourceRank as xe, INTEGRATIONS_LABEL as Z, isIntegrationSource as ke, CONFIG_TOOL_SOURCES as ve, INTEGRATIONS_RANK as ye } from "../constants/tools.js";
10
+ import { CATEGORIES as me, INTEGRATIONS_KEY as k, toolSourceRank as xe, INTEGRATIONS_LABEL as Z, INTEGRATIONS_RANK as ke, isIntegrationSource as ve, CONFIG_TOOL_SOURCES as ye } from "../constants/tools.js";
11
11
  import { toolSourceLabel as j } from "../utils/mentionSerialization.js";
12
12
  import { partitionSources as we, isUnconnectedSource as Ie } from "../utils/sourceGrouping.js";
13
- import { INTEGRATIONS_ICON as ee, renderSourceIcon as te, sourceIcon as M } from "../utils/sourceIcons.js";
13
+ import { sourceIcon as M, INTEGRATIONS_ICON as ee, renderSourceIcon as te } from "../utils/sourceIcons.js";
14
14
  import { VariablePicker as Re } from "../../variable-picker-v3/VariablePicker.js";
15
15
  import re from "../../../icons/Informational/Common UI/Shield.js";
16
16
  const g = (c) => c.meta, A = (c) => g(c)?.plainLabel ?? c.label, Se = "__bik_create_subagent__", Ae = 5, nt = ({
@@ -133,7 +133,7 @@ const g = (c) => c.meta, A = (c) => g(c)?.plainLabel ?? c.label, Se = "__bik_cre
133
133
  const X = m.filter(
134
134
  (q) => (g(q)?.source ?? "other") === r
135
135
  ), ae = (_.get(r) ?? []).length;
136
- if (X.length + ae === 1 && !(d === void 0 && ke(r))) {
136
+ if (X.length + ae === 1 && !(d === void 0 && ve(r))) {
137
137
  const q = M(r) ?? d?.icon;
138
138
  if (d)
139
139
  return {
@@ -169,7 +169,7 @@ const g = (c) => c.meta, A = (c) => g(c)?.plainLabel ?? c.label, Se = "__bik_cre
169
169
  (r) => ({ row: u(r), rank: xe(r) })
170
170
  );
171
171
  return J.length > 0 && Q.push({
172
- rank: ye,
172
+ rank: ke,
173
173
  row: {
174
174
  id: k,
175
175
  label: Z,
@@ -187,7 +187,7 @@ const g = (c) => c.meta, A = (c) => g(c)?.plainLabel ?? c.label, Se = "__bik_cre
187
187
  onActivate: () => E(t)
188
188
  }));
189
189
  return (_.get(i) ?? []).forEach((t) => {
190
- const f = i in ve;
190
+ const f = i in ye;
191
191
  n.push({
192
192
  // A source with several config tools gets one row each, so the key
193
193
  // carries the tool it opens.
@@ -2,6 +2,18 @@ export { AgentBuilder } from './AgentBuilder';
2
2
  export { Channels } from '@bikdotai/bik-models/campaigns/models/Channel';
3
3
  export { AgentStateModal } from './components/AgentStateModal';
4
4
  export type { AgentModalState } from './components/AgentStateModal';
5
+ export { ConfigToolPanel } from './components/ConfigToolPanel';
6
+ export { CreateSubAgentPanel } from './components/CreateSubAgentPanel';
7
+ export { RestApiToolPanel } from './components/RestApiToolPanel';
8
+ export { SelectableListSection } from './components/SelectableListSection';
9
+ export type { SelectableItem, SourceGroup, } from './components/SelectableListSection';
10
+ export { MentionEditor } from './components/MentionEditor';
11
+ export { MentionPicker } from './components/MentionPicker';
12
+ export { AiTextArea } from './components/AiTextArea';
13
+ export { ToolInstructionsField } from './components/ToolInstructionsField';
14
+ export { DrawerHeaderText } from './components/DrawerHeaderText';
15
+ export { HandoverMethodSection } from './components/HandoverMethodSection';
16
+ export type { HandoverMethodSectionProps } from './components/HandoverMethodSection';
5
17
  export { useAgentDraft } from './hooks/useAgentDraft';
6
18
  export type { AgentDraft } from './hooks/useAgentDraft';
7
19
  export { AGENT_CHAR_LIMITS } from './constants/charLimits';
@@ -9,6 +21,12 @@ export type { AgentCharLimits } from './constants/charLimits';
9
21
  export { APP_TOKEN, resolveAppToken, STEP_DEFINITIONS, } from './constants/steps';
10
22
  export { AGENT_CHANNEL_TYPES, channelPresentation, CHANNEL_PRESENTATION, } from './constants/channels';
11
23
  export type { ChannelPresentation } from './constants/channels';
12
- export { ToolSource } from './constants/tools';
13
- export { buildAgentMentionItems, editorDocToInstructions, instructionsToEditorHtml, } from './utils/mentionSerialization';
24
+ export { ToolSource, TOOL_SOURCE_LABELS, TOOL_ACTION_SOURCES, TOOL_ACTION_LABELS, CONFIG_TOOL_SOURCES, CONFIG_TOOL_ACTION_LABELS, INTEGRATION_SOURCES, TOOL_SOURCE_RANK, } from './constants/tools';
25
+ export type { ToolAction, SourceIcon, IconComp } from './constants/tools';
26
+ export { AGENT_EDITOR_STYLE } from './constants/editorStyle';
27
+ export { buildAgentMentionItems, editorDocToInstructions, instructionsToEditorHtml, toolSourceLabel, appTypeLabel, } from './utils/mentionSerialization';
28
+ export { SOURCE_ICONS, sourceIcon, renderSourceIcon, GENERIC_SOURCE_ICON, } from './utils/sourceIcons';
29
+ export { buildToolActions } from './utils/toolActions';
30
+ export { partitionSources, isUnconnectedSource } from './utils/sourceGrouping';
31
+ export { FieldBlock, FieldLabelRow, SectionHeaderWrap, SectionBodyWrap, } from './AgentBuilder.styled';
14
32
  export type { AgentBuilderProps, AgentBuilderConfig, AgentValue, AgentStatus as AgentBuilderStatus, StepKey, StepValidation, TriggerMode, AgentTriggerValue, AgentHandoverConfig, HandoverMethod, AgentTool, SubAgentRef, SubAgentDraft, IntentOption, ModelOption, RestApiToolConfig, RestApiMethod, RestApiHeader, ConfigToolConfig, ConfigToolKey, ParamField, ParamsBlob, ToolRef, CatalogTool, CustomTool, AgentChannel, AgentChannelAccount, AgentChannelSelection, AgentChannelStatus, AgentChannelType, } from './AgentBuilder.model';
@@ -5,8 +5,9 @@ import { default as React } from 'react';
5
5
  * **Manifest** (and any other host) keeps the original single free-text field:
6
6
  * the method is implicit and the consumer always sends the seeded `'default'`.
7
7
  *
8
- * **BIK** picks a handover *method* first. "Use default settings" is selected by
9
- * default and links out to where those defaults live; "Custom instructions" is
8
+ * **BIK** picks a handover *method* first, via the shared
9
+ * {@link HandoverMethodSection}: "Use default settings" is selected by default
10
+ * and links out to where those defaults live; "Custom instructions" is
10
11
  * deliberately disabled until that flow is built, so the free-text field only
11
12
  * appears for an agent already saved with a non-default method.
12
13
  */
@@ -1,132 +1,46 @@
1
- import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
- import x from "../../../assets/icons/RedirectToNew.svg.js";
3
- import { RadioButton as m } from "../../radioButton/RadioButton.js";
4
- import { TitleSmall as c, BodyCaption as p } from "../../TypographyStyle.js";
5
- import { COLORS as a, BASE_COLORS as v } from "../../../constants/Theme.js";
6
- import { SectionBodyWrap as u, FieldBlock as T, CardRow as w, RadioCard as f, RadioCardText as g, ChannelsLink as H } from "../AgentBuilder.styled.js";
7
- import { AiTextArea as A } from "../components/AiTextArea.js";
8
- import { StepSectionHeader as C } from "../components/StepSectionHeader.js";
9
- import { STEP_DEFINITIONS as B } from "../constants/steps.js";
10
- import { useAgentBuilderContext as S } from "../context/AgentBuilderContext.js";
11
- import { appTypeLabel as O } from "../utils/mentionSerialization.js";
12
- import { Tooltip as R } from "../../tooltips/Tooltip.js";
13
- const d = B[3], h = "default", K = () => {
14
- const { value: l, patch: i, applicationType: s, onSmartAgentHandover: o } = S(), { handover: n } = l, b = O(s) === "BIK", r = n.method !== h;
15
- return b ? /* @__PURE__ */ t("div", { className: "bik-agent-step bik-agent-step--handover", children: [
16
- /* @__PURE__ */ e(C, { title: d.title, helper: d.helper }),
17
- /* @__PURE__ */ t(u, { children: [
18
- /* @__PURE__ */ t(T, { children: [
19
- /* @__PURE__ */ e(c, { color: a.content.primary, children: "Handover method" }),
20
- /* @__PURE__ */ t(w, { children: [
21
- /* @__PURE__ */ t(
22
- f,
23
- {
24
- "data-test": "handover-method-default",
25
- type: "button",
26
- selected: !r,
27
- onClick: () => i({ handover: { ...n, method: h } }),
28
- children: [
29
- /* @__PURE__ */ e(
30
- m,
31
- {
32
- isActive: !r,
33
- onValueChange: () => i({ handover: { ...n, method: h } }),
34
- skipSelectingOff: !0,
35
- activeColor: v.brand[800]
36
- }
37
- ),
38
- /* @__PURE__ */ t(g, { children: [
39
- /* @__PURE__ */ e(c, { color: a.content.primary, children: "Use default settings" }),
40
- /* @__PURE__ */ t(p, { color: a.content.secondary, children: [
41
- "As defined in",
42
- " ",
43
- o ? /* @__PURE__ */ t(
44
- H,
45
- {
46
- "data-test": "handover-smart-agent-link",
47
- type: "button",
48
- onClick: (k) => {
49
- k.stopPropagation(), o();
50
- },
51
- style: { display: "inline-flex" },
52
- children: [
53
- "Smart agent handover",
54
- /* @__PURE__ */ e(x, { width: 12, height: 12 })
55
- ]
56
- }
57
- ) : "Smart agent handover"
58
- ] })
59
- ] })
60
- ]
61
- }
62
- ),
63
- /* @__PURE__ */ e(
64
- R,
65
- {
66
- body: "Custom handover rules are coming soon. For now this agent follows your smart agent handover settings.",
67
- placement: "top",
68
- children: /* @__PURE__ */ e(
69
- "span",
70
- {
71
- style: {
72
- flex: 1,
73
- display: "flex",
74
- cursor: "not-allowed"
75
- },
76
- children: /* @__PURE__ */ t(
77
- f,
78
- {
79
- "data-test": "handover-method-custom",
80
- type: "button",
81
- disabled: !0,
82
- selected: r,
83
- children: [
84
- /* @__PURE__ */ e(
85
- m,
86
- {
87
- isActive: r,
88
- isDisabled: !0,
89
- onValueChange: () => {
90
- },
91
- skipSelectingOff: !0,
92
- activeColor: v.brand[800]
93
- }
94
- ),
95
- /* @__PURE__ */ t(g, { children: [
96
- /* @__PURE__ */ e(c, { color: a.content.inactive, children: "Custom instructions" }),
97
- /* @__PURE__ */ e(p, { color: a.content.inactive, children: "Write custom handover rules for this agent." })
98
- ] })
99
- ]
100
- }
101
- )
102
- }
103
- )
104
- }
105
- )
106
- ] })
107
- ] }),
108
- r && /* @__PURE__ */ e(y, {})
1
+ import { jsxs as h, jsx as e } from "react/jsx-runtime";
2
+ import { SectionBodyWrap as d } from "../AgentBuilder.styled.js";
3
+ import { AiTextArea as u } from "../components/AiTextArea.js";
4
+ import { HandoverMethodSection as f } from "../components/HandoverMethodSection.js";
5
+ import { StepSectionHeader as s } from "../components/StepSectionHeader.js";
6
+ import { STEP_DEFINITIONS as g } from "../constants/steps.js";
7
+ import { useAgentBuilderContext as m } from "../context/AgentBuilderContext.js";
8
+ import { appTypeLabel as H } from "../utils/mentionSerialization.js";
9
+ const r = g[3], S = "default", B = () => {
10
+ const { value: n, patch: a, applicationType: i, onSmartAgentHandover: o } = m(), { handover: t } = n, l = H(i) === "BIK", c = t.method !== S;
11
+ return l ? /* @__PURE__ */ h("div", { className: "bik-agent-step bik-agent-step--handover", children: [
12
+ /* @__PURE__ */ e(s, { title: r.title, helper: r.helper }),
13
+ /* @__PURE__ */ h(d, { children: [
14
+ /* @__PURE__ */ e(
15
+ f,
16
+ {
17
+ method: t.method,
18
+ onMethodChange: (v) => a({ handover: { ...t, method: v } }),
19
+ onSmartAgentHandover: o
20
+ }
21
+ ),
22
+ c && /* @__PURE__ */ e(p, {})
109
23
  ] })
110
- ] }) : /* @__PURE__ */ t("div", { className: "bik-agent-step bik-agent-step--handover", children: [
111
- /* @__PURE__ */ e(C, { title: d.title, helper: d.helper }),
112
- /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e(y, {}) })
24
+ ] }) : /* @__PURE__ */ h("div", { className: "bik-agent-step bik-agent-step--handover", children: [
25
+ /* @__PURE__ */ e(s, { title: r.title, helper: r.helper }),
26
+ /* @__PURE__ */ e(d, { children: /* @__PURE__ */ e(p, {}) })
113
27
  ] });
114
- }, y = () => {
115
- const { value: l, patch: i, charLimits: s } = S(), { handover: o } = l;
28
+ }, p = () => {
29
+ const { value: n, patch: a, charLimits: i } = m(), { handover: o } = n;
116
30
  return /* @__PURE__ */ e(
117
- A,
31
+ u,
118
32
  {
119
33
  "data-test": "handover-when",
120
34
  label: "Handover when",
121
35
  value: o.when,
122
- onChange: (n) => i({ handover: { ...o, when: n } }),
123
- maxLength: s.handoverWhen,
36
+ onChange: (t) => a({ handover: { ...o, when: t } }),
37
+ maxLength: i.handoverWhen,
124
38
  placeholder: "e.g. Hand over if the customer is angry or asks for a human three times. Hand over if the order value exceeds ₹5,000.",
125
39
  minHeight: "120px"
126
40
  }
127
41
  );
128
42
  };
129
43
  export {
130
- K as Step4HandoverRules
44
+ B as Step4HandoverRules
131
45
  };
132
46
  //# sourceMappingURL=Step4HandoverRules.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Step4HandoverRules.js","sources":["../../../../../src/components/agent-builder/steps/Step4HandoverRules.tsx"],"sourcesContent":["import RedirectIcon from '@src/assets/icons/RedirectToNew.svg';\nimport React from 'react';\nimport { RadioButton } from '@src/components/radioButton/RadioButton';\nimport { Tooltip } from '@src/components/tooltips';\nimport { BodyCaption, TitleSmall } from '@src/components/TypographyStyle';\nimport { BASE_COLORS, COLORS } from '@src/constants/Theme';\nimport type { HandoverMethod } from '../AgentBuilder.model';\nimport {\n\tCardRow,\n\tChannelsLink,\n\tFieldBlock,\n\tRadioCard,\n\tRadioCardText,\n\tSectionBodyWrap,\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';\nimport { appTypeLabel } from '../utils/mentionSerialization';\n\nconst STEP = STEP_DEFINITIONS[3];\n\n/**\n * The stored `handover.method` that means \"inherit the store's smart-agent\n * handover settings\" — the BIK default, and the only method selectable today.\n */\nconst DEFAULT_METHOD: HandoverMethod = 'default';\n\n/**\n * Step 4.\n *\n * **Manifest** (and any other host) keeps the original single free-text field:\n * the method is implicit and the consumer always sends the seeded `'default'`.\n *\n * **BIK** picks a handover *method* first. \"Use default settings\" is selected by\n * default and links out to where those defaults live; \"Custom instructions\" is\n * deliberately disabled until that flow is built, so the free-text field only\n * appears for an agent already saved with a non-default method.\n */\nexport const Step4HandoverRules: React.FC = () => {\n\tconst { value, patch, applicationType, onSmartAgentHandover } =\n\t\tuseAgentBuilderContext();\n\tconst { handover } = value;\n\n\tconst isBik = appTypeLabel(applicationType) === 'BIK';\n\t// Anything other than the default method means the merchant is on custom\n\t// instructions, so the free-text field is what they need to see.\n\tconst usesCustom = handover.method !== DEFAULT_METHOD;\n\n\tif (!isBik) {\n\t\treturn (\n\t\t\t<div className=\"bik-agent-step bik-agent-step--handover\">\n\t\t\t\t<StepSectionHeader title={STEP.title} helper={STEP.helper} />\n\t\t\t\t<SectionBodyWrap>\n\t\t\t\t\t<HandoverWhenField />\n\t\t\t\t</SectionBodyWrap>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className=\"bik-agent-step bik-agent-step--handover\">\n\t\t\t<StepSectionHeader title={STEP.title} helper={STEP.helper} />\n\n\t\t\t<SectionBodyWrap>\n\t\t\t\t<FieldBlock>\n\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\tHandover method\n\t\t\t\t\t</TitleSmall>\n\n\t\t\t\t\t<CardRow>\n\t\t\t\t\t\t<RadioCard\n\t\t\t\t\t\t\tdata-test=\"handover-method-default\"\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tselected={!usesCustom}\n\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\tpatch({ handover: { ...handover, method: DEFAULT_METHOD } })\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RadioButton\n\t\t\t\t\t\t\t\tisActive={!usesCustom}\n\t\t\t\t\t\t\t\tonValueChange={() =>\n\t\t\t\t\t\t\t\t\tpatch({ handover: { ...handover, method: DEFAULT_METHOD } })\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tskipSelectingOff\n\t\t\t\t\t\t\t\tactiveColor={BASE_COLORS.brand['800']}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<RadioCardText>\n\t\t\t\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\t\t\t\tUse default settings\n\t\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t\t\tAs defined in{' '}\n\t\t\t\t\t\t\t\t\t{onSmartAgentHandover ? (\n\t\t\t\t\t\t\t\t\t\t<ChannelsLink\n\t\t\t\t\t\t\t\t\t\t\tdata-test=\"handover-smart-agent-link\"\n\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t// The link sits inside the card's own click target, so\n\t\t\t\t\t\t\t\t\t\t\t// stop the click bubbling up and re-selecting the card.\n\t\t\t\t\t\t\t\t\t\t\tonClick={(event) => {\n\t\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\t\tonSmartAgentHandover();\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\tstyle={{ display: 'inline-flex' }}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\tSmart agent handover\n\t\t\t\t\t\t\t\t\t\t\t<RedirectIcon width={12} height={12} />\n\t\t\t\t\t\t\t\t\t\t</ChannelsLink>\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t'Smart agent handover'\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t</RadioCardText>\n\t\t\t\t\t\t</RadioCard>\n\n\t\t\t\t\t\t{/* Custom handover rules aren't built yet — the card is shown so the\n\t\t\t\t\t\t merchant knows it's coming, but it can't be selected. */}\n\t\t\t\t\t\t<Tooltip\n\t\t\t\t\t\t\tbody=\"Custom handover rules are coming soon. For now this agent follows your smart agent handover settings.\"\n\t\t\t\t\t\t\tplacement=\"top\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{/* A disabled <button> fires no mouse events, so the tooltip would\n\t\t\t\t\t\t\t never open on the card itself — the span is the hover target\n\t\t\t\t\t\t\t (same wrapper IconButton uses for its disabled tooltip). It also\n\t\t\t\t\t\t\t has to carry the card's `flex: 1`, since it is now the flex item. */}\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tflex: 1,\n\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\tcursor: 'not-allowed',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<RadioCard\n\t\t\t\t\t\t\t\t\tdata-test=\"handover-method-custom\"\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tdisabled\n\t\t\t\t\t\t\t\t\tselected={usesCustom}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<RadioButton\n\t\t\t\t\t\t\t\t\t\tisActive={usesCustom}\n\t\t\t\t\t\t\t\t\t\tisDisabled\n\t\t\t\t\t\t\t\t\t\tonValueChange={() => undefined}\n\t\t\t\t\t\t\t\t\t\tskipSelectingOff\n\t\t\t\t\t\t\t\t\t\tactiveColor={BASE_COLORS.brand['800']}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<RadioCardText>\n\t\t\t\t\t\t\t\t\t\t<TitleSmall color={COLORS.content.inactive}>\n\t\t\t\t\t\t\t\t\t\t\tCustom instructions\n\t\t\t\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.inactive}>\n\t\t\t\t\t\t\t\t\t\t\tWrite custom handover rules for this agent.\n\t\t\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t\t\t</RadioCardText>\n\t\t\t\t\t\t\t\t</RadioCard>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t</CardRow>\n\t\t\t\t</FieldBlock>\n\n\t\t\t\t{usesCustom && <HandoverWhenField />}\n\t\t\t</SectionBodyWrap>\n\t\t</div>\n\t);\n};\n\n/** The free-text \"Handover when\" field, shared by both layouts. */\nconst HandoverWhenField: React.FC = () => {\n\tconst { value, patch, charLimits } = useAgentBuilderContext();\n\tconst { handover } = value;\n\n\treturn (\n\t\t<AiTextArea\n\t\t\tdata-test=\"handover-when\"\n\t\t\tlabel=\"Handover when\"\n\t\t\tvalue={handover.when}\n\t\t\tonChange={(text) => patch({ handover: { ...handover, when: text } })}\n\t\t\tmaxLength={charLimits.handoverWhen}\n\t\t\tplaceholder=\"e.g. Hand over if the customer is angry or asks for a human three times. Hand over if the order value exceeds ₹5,000.\"\n\t\t\tminHeight=\"120px\"\n\t\t/>\n\t);\n};\n"],"names":["STEP","STEP_DEFINITIONS","DEFAULT_METHOD","Step4HandoverRules","value","patch","applicationType","onSmartAgentHandover","useAgentBuilderContext","handover","isBik","appTypeLabel","usesCustom","jsxs","jsx","StepSectionHeader","SectionBodyWrap","FieldBlock","TitleSmall","COLORS","CardRow","RadioCard","RadioButton","BASE_COLORS","RadioCardText","BodyCaption","ChannelsLink","event","RedirectIcon","Tooltip","HandoverWhenField","charLimits","AiTextArea","text"],"mappings":";;;;;;;;;;;;AAqBA,MAAMA,IAAOC,EAAiB,CAAC,GAMzBC,IAAiC,WAa1BC,IAA+B,MAAM;AACjD,QAAM,EAAE,OAAAC,GAAO,OAAAC,GAAO,iBAAAC,GAAiB,sBAAAC,EAAA,IACtCC,EAAA,GACK,EAAE,UAAAC,MAAaL,GAEfM,IAAQC,EAAaL,CAAe,MAAM,OAG1CM,IAAaH,EAAS,WAAWP;AAEvC,SAAKQ,IAYJ,gBAAAG,EAAC,OAAA,EAAI,WAAU,2CACd,UAAA;AAAA,IAAA,gBAAAC,EAACC,KAAkB,OAAOf,EAAK,OAAO,QAAQA,EAAK,QAAQ;AAAA,sBA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AkB,EAAA,CACpB;AAAA,EAAA,GACD;AA2GH,GAGMA,IAA8B,MAAM;AACzC,QAAM,EAAE,OAAA1B,GAAO,OAAAC,GAAO,YAAA0B,EAAA,IAAevB,EAAA,GAC/B,EAAE,UAAAC,MAAaL;AAErB,SACC,gBAAAU;AAAA,IAACkB;AAAA,IAAA;AAAA,MACA,aAAU;AAAA,MACV,OAAM;AAAA,MACN,OAAOvB,EAAS;AAAA,MAChB,UAAU,CAACwB,MAAS5B,EAAM,EAAE,UAAU,EAAE,GAAGI,GAAU,MAAMwB,EAAA,GAAQ;AAAA,MACnE,WAAWF,EAAW;AAAA,MACtB,aAAY;AAAA,MACZ,WAAU;AAAA,IAAA;AAAA,EAAA;AAGb;"}
1
+ {"version":3,"file":"Step4HandoverRules.js","sources":["../../../../../src/components/agent-builder/steps/Step4HandoverRules.tsx"],"sourcesContent":["import React from 'react';\nimport type { HandoverMethod } from '../AgentBuilder.model';\nimport { SectionBodyWrap } from '../AgentBuilder.styled';\nimport { AiTextArea } from '../components/AiTextArea';\nimport { HandoverMethodSection } from '../components/HandoverMethodSection';\nimport { StepSectionHeader } from '../components/StepSectionHeader';\nimport { STEP_DEFINITIONS } from '../constants/steps';\nimport { useAgentBuilderContext } from '../context/AgentBuilderContext';\nimport { appTypeLabel } from '../utils/mentionSerialization';\n\nconst STEP = STEP_DEFINITIONS[3];\n\n/**\n * The stored `handover.method` that means \"inherit the store's smart-agent\n * handover settings\" — the BIK default, and the only method selectable today.\n */\nconst DEFAULT_METHOD: HandoverMethod = 'default';\n\n/**\n * Step 4.\n *\n * **Manifest** (and any other host) keeps the original single free-text field:\n * the method is implicit and the consumer always sends the seeded `'default'`.\n *\n * **BIK** picks a handover *method* first, via the shared\n * {@link HandoverMethodSection}: \"Use default settings\" is selected by default\n * and links out to where those defaults live; \"Custom instructions\" is\n * deliberately disabled until that flow is built, so the free-text field only\n * appears for an agent already saved with a non-default method.\n */\nexport const Step4HandoverRules: React.FC = () => {\n\tconst { value, patch, applicationType, onSmartAgentHandover } =\n\t\tuseAgentBuilderContext();\n\tconst { handover } = value;\n\n\tconst isBik = appTypeLabel(applicationType) === 'BIK';\n\t// Anything other than the default method means the merchant is on custom\n\t// instructions, so the free-text field is what they need to see.\n\tconst usesCustom = handover.method !== DEFAULT_METHOD;\n\n\tif (!isBik) {\n\t\treturn (\n\t\t\t<div className=\"bik-agent-step bik-agent-step--handover\">\n\t\t\t\t<StepSectionHeader title={STEP.title} helper={STEP.helper} />\n\t\t\t\t<SectionBodyWrap>\n\t\t\t\t\t<HandoverWhenField />\n\t\t\t\t</SectionBodyWrap>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className=\"bik-agent-step bik-agent-step--handover\">\n\t\t\t<StepSectionHeader title={STEP.title} helper={STEP.helper} />\n\n\t\t\t<SectionBodyWrap>\n\t\t\t\t<HandoverMethodSection\n\t\t\t\t\tmethod={handover.method}\n\t\t\t\t\tonMethodChange={(method) =>\n\t\t\t\t\t\tpatch({ handover: { ...handover, method } })\n\t\t\t\t\t}\n\t\t\t\t\tonSmartAgentHandover={onSmartAgentHandover}\n\t\t\t\t/>\n\n\t\t\t\t{usesCustom && <HandoverWhenField />}\n\t\t\t</SectionBodyWrap>\n\t\t</div>\n\t);\n};\n\n/** The free-text \"Handover when\" field, shared by both layouts. */\nconst HandoverWhenField: React.FC = () => {\n\tconst { value, patch, charLimits } = useAgentBuilderContext();\n\tconst { handover } = value;\n\n\treturn (\n\t\t<AiTextArea\n\t\t\tdata-test=\"handover-when\"\n\t\t\tlabel=\"Handover when\"\n\t\t\tvalue={handover.when}\n\t\t\tonChange={(text) => patch({ handover: { ...handover, when: text } })}\n\t\t\tmaxLength={charLimits.handoverWhen}\n\t\t\tplaceholder=\"e.g. Hand over if the customer is angry or asks for a human three times. Hand over if the order value exceeds ₹5,000.\"\n\t\t\tminHeight=\"120px\"\n\t\t/>\n\t);\n};\n"],"names":["STEP","STEP_DEFINITIONS","DEFAULT_METHOD","Step4HandoverRules","value","patch","applicationType","onSmartAgentHandover","useAgentBuilderContext","handover","isBik","appTypeLabel","usesCustom","jsxs","jsx","StepSectionHeader","SectionBodyWrap","HandoverMethodSection","method","HandoverWhenField","charLimits","AiTextArea","text"],"mappings":";;;;;;;;AAUA,MAAMA,IAAOC,EAAiB,CAAC,GAMzBC,IAAiC,WAc1BC,IAA+B,MAAM;AACjD,QAAM,EAAE,OAAAC,GAAO,OAAAC,GAAO,iBAAAC,GAAiB,sBAAAC,EAAA,IACtCC,EAAA,GACK,EAAE,UAAAC,MAAaL,GAEfM,IAAQC,EAAaL,CAAe,MAAM,OAG1CM,IAAaH,EAAS,WAAWP;AAEvC,SAAKQ,IAYJ,gBAAAG,EAAC,OAAA,EAAI,WAAU,2CACd,UAAA;AAAA,IAAA,gBAAAC,EAACC,KAAkB,OAAOf,EAAK,OAAO,QAAQA,EAAK,QAAQ;AAAA,sBAE1DgB,GAAA,EACA,UAAA;AAAA,MAAA,gBAAAF;AAAA,QAACG;AAAA,QAAA;AAAA,UACA,QAAQR,EAAS;AAAA,UACjB,gBAAgB,CAACS,MAChBb,EAAM,EAAE,UAAU,EAAE,GAAGI,GAAU,QAAAS,EAAA,GAAU;AAAA,UAE5C,sBAAAX;AAAA,QAAA;AAAA,MAAA;AAAA,MAGAK,uBAAeO,GAAA,CAAA,CAAkB;AAAA,IAAA,EAAA,CACnC;AAAA,EAAA,GACD,IAxBC,gBAAAN,EAAC,OAAA,EAAI,WAAU,2CACd,UAAA;AAAA,IAAA,gBAAAC,EAACC,KAAkB,OAAOf,EAAK,OAAO,QAAQA,EAAK,QAAQ;AAAA,IAC3D,gBAAAc,EAACE,GAAA,EACA,UAAA,gBAAAF,EAACK,GAAA,CAAA,CAAkB,EAAA,CACpB;AAAA,EAAA,GACD;AAqBH,GAGMA,IAA8B,MAAM;AACzC,QAAM,EAAE,OAAAf,GAAO,OAAAC,GAAO,YAAAe,EAAA,IAAeZ,EAAA,GAC/B,EAAE,UAAAC,MAAaL;AAErB,SACC,gBAAAU;AAAA,IAACO;AAAA,IAAA;AAAA,MACA,aAAU;AAAA,MACV,OAAM;AAAA,MACN,OAAOZ,EAAS;AAAA,MAChB,UAAU,CAACa,MAASjB,EAAM,EAAE,UAAU,EAAE,GAAGI,GAAU,MAAMa,EAAA,GAAQ;AAAA,MACnE,WAAWF,EAAW;AAAA,MACtB,aAAY;AAAA,MACZ,WAAU;AAAA,IAAA;AAAA,EAAA;AAGb;"}
@@ -1,56 +1,56 @@
1
1
  import i from "react";
2
- import { INTEGRATIONS_KEY as n, ToolSource as o } from "../constants/tools.js";
3
- import e from "../../../icons/Social/Channels/GoogleSheets.js";
4
- import S from "../../../icons/Social/Channels/ShipBob.js";
5
- import h from "../../../icons/Social/Channels/Kustomer.js";
6
- import c from "../../../icons/Social/Channels/Freshdesk.js";
7
- import p from "../../../icons/Social/Social/Zendesk.js";
8
- import I from "../../../icons/Social/Channels/Segment.js";
9
- import f from "../../../icons/Social/Channels/Mailchimp.js";
10
- import g from "../../../icons/Social/Channels/Attentive.js";
11
- import v from "../../../icons/Social/Channels/OmniSend.js";
12
- import w from "../../../icons/Social/Channels/Klavyio.js";
13
- import s from "../../../icons/Social/Channels/Aftership.js";
14
- import a from "../../../icons/Social/Social/SlackIcon.js";
15
- import l from "../../../icons/Informational/Communication/Email.js";
16
- import d from "../../../icons/BIK AI specific/Webhook.js";
2
+ import { ToolSource as o, INTEGRATIONS_KEY as n } from "../constants/tools.js";
3
+ import e from "../../../icons/Actions/Common actions/LinkSimpleHorizontal.js";
4
+ import S from "../../../icons/Social/Channels/GoogleSheets.js";
5
+ import h from "../../../icons/Social/Channels/ShipBob.js";
6
+ import c from "../../../icons/Social/Channels/Kustomer.js";
7
+ import p from "../../../icons/Social/Channels/Freshdesk.js";
8
+ import I from "../../../icons/Social/Social/Zendesk.js";
9
+ import f from "../../../icons/Social/Channels/Segment.js";
10
+ import g from "../../../icons/Social/Channels/Mailchimp.js";
11
+ import v from "../../../icons/Social/Channels/Attentive.js";
12
+ import w from "../../../icons/Social/Channels/OmniSend.js";
13
+ import s from "../../../icons/Social/Channels/Klavyio.js";
14
+ import a from "../../../icons/Social/Channels/Aftership.js";
15
+ import l from "../../../icons/Social/Social/SlackIcon.js";
16
+ import d from "../../../icons/Informational/Communication/Email.js";
17
+ import k from "../../../icons/BIK AI specific/Webhook.js";
17
18
  import t from "../../../icons/Informational/Identity/PuzzlePiece.js";
18
- import k from "../../../icons/Social/Social/Gorgias.js";
19
- import E from "../../../icons/Social/Channels/Skio.js";
20
- import u from "../../../icons/Social/Channels/ShipStation.js";
21
- import O from "../../../icons/Social/Social/BigCommerce.js";
22
- import G from "../../../icons/Social/Channels/ShopifyBrand.js";
23
- import N from "../../../icons/Social/Channels/ManifestGlass.js";
24
- import A from "../../../icons/Actions/Common actions/LinkSimpleHorizontal.js";
19
+ import E from "../../../icons/Social/Social/Gorgias.js";
20
+ import u from "../../../icons/Social/Channels/Skio.js";
21
+ import O from "../../../icons/Social/Channels/ShipStation.js";
22
+ import G from "../../../icons/Social/Social/BigCommerce.js";
23
+ import N from "../../../icons/Social/Channels/ShopifyBrand.js";
24
+ import A from "../../../icons/Social/Channels/ManifestGlass.js";
25
25
  const C = {
26
- [o.Manifest]: { Icon: N, w: 24, h: 24 },
27
- [o.Shopify]: { Icon: G, w: 24, h: 24 },
28
- [o.Bigcommerce]: { Icon: O, w: 20, h: 20 },
29
- [o.Shipstation]: { Icon: u, w: 22, h: 22 },
30
- [o.Skio]: { Icon: E, w: 20, h: 20 },
31
- [o.Gorgias]: { Icon: k, w: 20, h: 20 },
26
+ [o.Manifest]: { Icon: A, w: 24, h: 24 },
27
+ [o.Shopify]: { Icon: N, w: 24, h: 24 },
28
+ [o.Bigcommerce]: { Icon: G, w: 20, h: 20 },
29
+ [o.Shipstation]: { Icon: O, w: 22, h: 22 },
30
+ [o.Skio]: { Icon: u, w: 20, h: 20 },
31
+ [o.Gorgias]: { Icon: E, w: 20, h: 20 },
32
32
  [o.Integration]: { Icon: t, w: 20, h: 20 },
33
- [o.RestApi]: { Icon: d, w: 20, h: 20 },
34
- [o.EmailHandover]: { Icon: l, w: 20, h: 20 },
35
- [o.Slack]: { Icon: a, w: 20, h: 20 },
33
+ [o.RestApi]: { Icon: k, w: 20, h: 20 },
34
+ [o.EmailHandover]: { Icon: d, w: 20, h: 20 },
35
+ [o.Slack]: { Icon: l, w: 20, h: 20 },
36
36
  // Standard-contract vendors — brand glyphs from the shared icon set.
37
- [o.Aftership]: { Icon: s, w: 20, h: 20 },
38
- [o.Klaviyo]: { Icon: w, w: 20, h: 20 },
39
- [o.Omnisend]: { Icon: v, w: 20, h: 20 },
40
- [o.Attentive]: { Icon: g, w: 20, h: 20 },
41
- [o.Mailchimp]: { Icon: f, w: 20, h: 20 },
42
- [o.Segment]: { Icon: I, w: 20, h: 20 },
43
- [o.Zendesk]: { Icon: p, w: 20, h: 20 },
44
- [o.Freshdesk]: { Icon: c, w: 20, h: 20 },
45
- [o.Kustomer]: { Icon: h, w: 20, h: 20 },
46
- [o.Shipbob]: { Icon: S, w: 20, h: 20 },
47
- [o.GoogleSheets]: { Icon: e, w: 20, h: 20 }
37
+ [o.Aftership]: { Icon: a, w: 20, h: 20 },
38
+ [o.Klaviyo]: { Icon: s, w: 20, h: 20 },
39
+ [o.Omnisend]: { Icon: w, w: 20, h: 20 },
40
+ [o.Attentive]: { Icon: v, w: 20, h: 20 },
41
+ [o.Mailchimp]: { Icon: g, w: 20, h: 20 },
42
+ [o.Segment]: { Icon: f, w: 20, h: 20 },
43
+ [o.Zendesk]: { Icon: I, w: 20, h: 20 },
44
+ [o.Freshdesk]: { Icon: p, w: 20, h: 20 },
45
+ [o.Kustomer]: { Icon: c, w: 20, h: 20 },
46
+ [o.Shipbob]: { Icon: h, w: 20, h: 20 },
47
+ [o.GoogleSheets]: { Icon: S, w: 20, h: 20 }
48
48
  }, R = {
49
49
  Icon: t,
50
50
  w: 20,
51
51
  h: 20
52
52
  }, _ = {
53
- Icon: A,
53
+ Icon: e,
54
54
  w: 20,
55
55
  h: 20
56
56
  }, oo = (r) => {
@@ -1,7 +1,7 @@
1
- import { TOOL_ACTION_SOURCES as T, TOOL_ACTION_LABELS as o, TOOL_SOURCE_LABELS as a, CONFIG_TOOL_SOURCES as i, CONFIG_TOOL_ACTION_LABELS as A } from "../constants/tools.js";
1
+ import { TOOL_ACTION_SOURCES as T, CONFIG_TOOL_SOURCES as o, TOOL_ACTION_LABELS as a, TOOL_SOURCE_LABELS as i, CONFIG_TOOL_ACTION_LABELS as A } from "../constants/tools.js";
2
2
  import { SOURCE_ICONS as E } from "./sourceIcons.js";
3
3
  const f = (L, t, S, l) => T.flatMap((O) => {
4
- const _ = i[O], C = {
4
+ const _ = o[O], C = {
5
5
  source: O,
6
6
  icon: E[O],
7
7
  connected: S?.[O],
@@ -15,7 +15,7 @@ const f = (L, t, S, l) => T.flatMap((O) => {
15
15
  })) : [
16
16
  {
17
17
  ...C,
18
- label: o[O] ?? a[O],
18
+ label: a[O] ?? i[O],
19
19
  onSelect: () => t(O)
20
20
  }
21
21
  ];