@bikdotai/bik-component-library 0.0.871 → 0.0.872

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