@bikdotai/bik-component-library 0.0.850-tools-beta.0 → 0.0.850

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