@bikdotai/bik-component-library 0.0.870 → 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 (114) 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/components/bik-copilot/CopilotPanel.js +1 -1
  20. package/dist/cjs/components/bik-copilot/CopilotPanel.js.map +1 -1
  21. package/dist/cjs/components/bik-copilot/useCopilotStreamChat.js +1 -1
  22. package/dist/cjs/components/bik-copilot/useCopilotStreamChat.js.map +1 -1
  23. package/dist/cjs/icons/Social/Channels/Aftership.js +2 -0
  24. package/dist/cjs/icons/Social/Channels/Aftership.js.map +1 -0
  25. package/dist/cjs/icons/Social/Channels/Attentive.js +2 -0
  26. package/dist/cjs/icons/Social/Channels/Attentive.js.map +1 -0
  27. package/dist/cjs/icons/Social/Channels/Freshdesk.js +2 -0
  28. package/dist/cjs/icons/Social/Channels/Freshdesk.js.map +1 -0
  29. package/dist/cjs/icons/Social/Channels/GoogleSheets.js +2 -0
  30. package/dist/cjs/icons/Social/Channels/GoogleSheets.js.map +1 -0
  31. package/dist/cjs/icons/Social/Channels/Klavyio.js +2 -0
  32. package/dist/cjs/icons/Social/Channels/Klavyio.js.map +1 -0
  33. package/dist/cjs/icons/Social/Channels/Kustomer.js +2 -0
  34. package/dist/cjs/icons/Social/Channels/Kustomer.js.map +1 -0
  35. package/dist/cjs/icons/Social/Channels/Mailchimp.js +2 -0
  36. package/dist/cjs/icons/Social/Channels/Mailchimp.js.map +1 -0
  37. package/dist/cjs/icons/Social/Channels/OmniSend.js +2 -0
  38. package/dist/cjs/icons/Social/Channels/OmniSend.js.map +1 -0
  39. package/dist/cjs/icons/Social/Channels/Segment.js +2 -0
  40. package/dist/cjs/icons/Social/Channels/Segment.js.map +1 -0
  41. package/dist/cjs/icons/Social/Channels/ShipBob.js +2 -0
  42. package/dist/cjs/icons/Social/Channels/ShipBob.js.map +1 -0
  43. package/dist/cjs/icons/Social/Channels/Skio.js +1 -1
  44. package/dist/cjs/icons/Social/Channels/Skio.js.map +1 -1
  45. package/dist/cjs/icons/index.js +1 -1
  46. package/dist/esm/components/agent-builder/__fixtures__/integrationCatalog.d.ts +17 -0
  47. package/dist/esm/components/agent-builder/components/ConfigToolPanel.js +104 -96
  48. package/dist/esm/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
  49. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +256 -242
  50. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  51. package/dist/esm/components/agent-builder/components/MentionPicker.d.ts +0 -10
  52. package/dist/esm/components/agent-builder/components/MentionPicker.js +201 -199
  53. package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
  54. package/dist/esm/components/agent-builder/components/SelectableListSection.d.ts +9 -0
  55. package/dist/esm/components/agent-builder/components/SelectableListSection.js +213 -188
  56. package/dist/esm/components/agent-builder/components/SelectableListSection.js.map +1 -1
  57. package/dist/esm/components/agent-builder/constants/tools.d.ts +46 -22
  58. package/dist/esm/components/agent-builder/constants/tools.js +86 -35
  59. package/dist/esm/components/agent-builder/constants/tools.js.map +1 -1
  60. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +289 -279
  61. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
  62. package/dist/esm/components/agent-builder/utils/sourceGrouping.d.ts +39 -0
  63. package/dist/esm/components/agent-builder/utils/sourceGrouping.js +14 -0
  64. package/dist/esm/components/agent-builder/utils/sourceGrouping.js.map +1 -0
  65. package/dist/esm/components/agent-builder/utils/sourceIcons.d.ts +6 -4
  66. package/dist/esm/components/agent-builder/utils/sourceIcons.js +64 -33
  67. package/dist/esm/components/agent-builder/utils/sourceIcons.js.map +1 -1
  68. package/dist/esm/components/agent-builder/utils/toolActions.d.ts +11 -6
  69. package/dist/esm/components/agent-builder/utils/toolActions.js +23 -16
  70. package/dist/esm/components/agent-builder/utils/toolActions.js.map +1 -1
  71. package/dist/esm/components/bik-copilot/CopilotPanel.js +235 -244
  72. package/dist/esm/components/bik-copilot/CopilotPanel.js.map +1 -1
  73. package/dist/esm/components/bik-copilot/model.d.ts +4 -2
  74. package/dist/esm/components/bik-copilot/useCopilotStreamChat.d.ts +0 -18
  75. package/dist/esm/components/bik-copilot/useCopilotStreamChat.js +168 -163
  76. package/dist/esm/components/bik-copilot/useCopilotStreamChat.js.map +1 -1
  77. package/dist/esm/icons/Social/Channels/Aftership.d.ts +6 -0
  78. package/dist/esm/icons/Social/Channels/Aftership.js +47 -0
  79. package/dist/esm/icons/Social/Channels/Aftership.js.map +1 -0
  80. package/dist/esm/icons/Social/Channels/Attentive.d.ts +6 -0
  81. package/dist/esm/icons/Social/Channels/Attentive.js +54 -0
  82. package/dist/esm/icons/Social/Channels/Attentive.js.map +1 -0
  83. package/dist/esm/icons/Social/Channels/Freshdesk.d.ts +6 -0
  84. package/dist/esm/icons/Social/Channels/Freshdesk.js +47 -0
  85. package/dist/esm/icons/Social/Channels/Freshdesk.js.map +1 -0
  86. package/dist/esm/icons/Social/Channels/GoogleSheets.d.ts +6 -0
  87. package/dist/esm/icons/Social/Channels/GoogleSheets.js +53 -0
  88. package/dist/esm/icons/Social/Channels/GoogleSheets.js.map +1 -0
  89. package/dist/esm/icons/Social/Channels/Klavyio.d.ts +6 -0
  90. package/dist/esm/icons/Social/Channels/Klavyio.js +47 -0
  91. package/dist/esm/icons/Social/Channels/Klavyio.js.map +1 -0
  92. package/dist/esm/icons/Social/Channels/Kustomer.d.ts +6 -0
  93. package/dist/esm/icons/Social/Channels/Kustomer.js +68 -0
  94. package/dist/esm/icons/Social/Channels/Kustomer.js.map +1 -0
  95. package/dist/esm/icons/Social/Channels/Mailchimp.d.ts +6 -0
  96. package/dist/esm/icons/Social/Channels/Mailchimp.js +31 -0
  97. package/dist/esm/icons/Social/Channels/Mailchimp.js.map +1 -0
  98. package/dist/esm/icons/Social/Channels/OmniSend.d.ts +6 -0
  99. package/dist/esm/icons/Social/Channels/OmniSend.js +47 -0
  100. package/dist/esm/icons/Social/Channels/OmniSend.js.map +1 -0
  101. package/dist/esm/icons/Social/Channels/Segment.d.ts +6 -0
  102. package/dist/esm/icons/Social/Channels/Segment.js +53 -0
  103. package/dist/esm/icons/Social/Channels/Segment.js.map +1 -0
  104. package/dist/esm/icons/Social/Channels/ShipBob.d.ts +6 -0
  105. package/dist/esm/icons/Social/Channels/ShipBob.js +28 -0
  106. package/dist/esm/icons/Social/Channels/ShipBob.js.map +1 -0
  107. package/dist/esm/icons/Social/Channels/Skio.js +41 -19
  108. package/dist/esm/icons/Social/Channels/Skio.js.map +1 -1
  109. package/dist/esm/icons/Social/Channels/Zendesk.d.ts +6 -0
  110. package/dist/esm/icons/Social/Channels/index.d.ts +10 -0
  111. package/dist/esm/icons/index.d.ts +26 -25
  112. package/dist/esm/icons/index.js +658 -638
  113. package/dist/esm/icons/index.js.map +1 -1
  114. package/package.json +1 -1
@@ -1,29 +1,30 @@
1
- import { jsxs as de, Fragment as Pe, jsx as c } from "react/jsx-runtime";
2
- import { useState as i, useRef as T, useMemo as ze, useCallback as a } from "react";
1
+ import { jsxs as pe, Fragment as Ue, jsx as c } from "react/jsx-runtime";
2
+ import { useState as i, useRef as C, useMemo as ze, useCallback as a } from "react";
3
3
  import He from "styled-components";
4
- import { addUnique as me } from "../../../utils/arrayUtils.js";
5
- import { COLORS as Z } from "../../../constants/Theme.js";
6
- import { AGENT_CHAR_LIMITS as Ue } from "../constants/charLimits.js";
7
- import { CONFIG_TOOL_SOURCES as $e, ToolSource as u } from "../constants/tools.js";
8
- import { buildAgentMentionItems as Le, buildCustomToolMentionItems as Fe, restApiMentionItem as je, configToolMentionItem as We, restApiToolName as qe, configToolName as Ye, toolSourceLabel as Xe } from "../utils/mentionSerialization.js";
9
- import { sourceIcon as J, SOURCE_ICONS as pe, renderSourceIcon as fe } from "../utils/sourceIcons.js";
10
- import { buildToolActions as Ze } from "../utils/toolActions.js";
11
- import { ConfigToolPanel as Je } from "./ConfigToolPanel.js";
12
- import { DRAWER_BODY_STYLE as Qe, DRAWER_HEADER_STYLE as Ve, DrawerHeaderText as et } from "./DrawerHeaderText.js";
13
- import { MentionEditor as ge } from "./MentionEditor.js";
14
- import { RestApiToolPanel as tt } from "./RestApiToolPanel.js";
15
- import { SelectableListSection as ot } from "./SelectableListSection.js";
16
- import { SideModal as nt } from "../../side-modal/SideModal.js";
17
- import { Input as st } from "../../input/Input.js";
18
- import { Toaster as rt } from "../../toaster/Toaster.js";
19
- const it = 1e3, Q = 1002, he = (A, f) => {
20
- const s = A ?? [];
21
- return s.some((d) => d.id === f.id) ? s.map((d) => d.id === f.id ? f : d) : [...s, f];
22
- }, ye = He.button`
4
+ import { addUnique as fe } from "../../../utils/arrayUtils.js";
5
+ import { COLORS as Q } from "../../../constants/Theme.js";
6
+ import { AGENT_CHAR_LIMITS as $e } from "../constants/charLimits.js";
7
+ import { CONFIG_TOOL_SOURCES as Fe, ToolSource as g, CONFIG_TOOL_SOURCE_BY_KEY as Ye, INTEGRATIONS_LABEL as je, INTEGRATIONS_KEY as We } from "../constants/tools.js";
8
+ import { buildAgentMentionItems as qe, buildCustomToolMentionItems as Xe, restApiMentionItem as Ze, configToolMentionItem as Je, restApiToolName as Qe, configToolName as Ve, toolSourceLabel as et } from "../utils/mentionSerialization.js";
9
+ import { partitionSources as tt } from "../utils/sourceGrouping.js";
10
+ import { sourceIcon as V, SOURCE_ICONS as ge, renderSourceIcon as he } from "../utils/sourceIcons.js";
11
+ import { buildToolActions as ot } from "../utils/toolActions.js";
12
+ import { ConfigToolPanel as nt } from "./ConfigToolPanel.js";
13
+ import { DRAWER_BODY_STYLE as st, DRAWER_HEADER_STYLE as rt, DrawerHeaderText as it } from "./DrawerHeaderText.js";
14
+ import { MentionEditor as ye } from "./MentionEditor.js";
15
+ import { RestApiToolPanel as lt } from "./RestApiToolPanel.js";
16
+ import { SelectableListSection as at } from "./SelectableListSection.js";
17
+ import { SideModal as ct } from "../../side-modal/SideModal.js";
18
+ import { Input as ut } from "../../input/Input.js";
19
+ import { Toaster as dt } from "../../toaster/Toaster.js";
20
+ const mt = 1e3, ee = 1002, Te = (w, h) => {
21
+ const r = w ?? [];
22
+ return r.some((u) => u.id === h.id) ? r.map((u) => u.id === h.id ? h : u) : [...r, h];
23
+ }, Ie = He.button`
23
24
  align-self: flex-start;
24
- border: 1px solid ${Z.stroke.primary};
25
- color: ${Z.content.primary};
26
- background: ${Z.surface.standard};
25
+ border: 1px solid ${Q.stroke.primary};
26
+ color: ${Q.content.primary};
27
+ background: ${Q.surface.standard};
27
28
  border-radius: 8px;
28
29
  padding: 6px 12px;
29
30
  font-size: 13px;
@@ -35,367 +36,380 @@ const it = 1e3, Q = 1002, he = (A, f) => {
35
36
  cursor: default;
36
37
  opacity: 0.6;
37
38
  }
38
- `, At = ({
39
- onClose: A,
40
- onSave: f,
41
- availableTools: s,
42
- onImprove: d,
43
- onImproveToolInstructions: V,
44
- configToolTemplates: ee,
45
- integrationStatus: R,
46
- onConnectIntegration: _,
47
- title: te = "Create sub-agent",
48
- initial: g,
49
- existingNames: Te = [],
50
- appLabel: h = "Manifest",
51
- charLimits: b = Ue,
52
- variablesData: w
39
+ `, Nt = ({
40
+ onClose: w,
41
+ onSave: h,
42
+ availableTools: r,
43
+ onImprove: u,
44
+ onImproveToolInstructions: te,
45
+ configToolTemplates: oe,
46
+ integrationStatus: y,
47
+ onConnectIntegration: S,
48
+ title: ne = "Create sub-agent",
49
+ initial: T,
50
+ existingNames: be = [],
51
+ appLabel: I = "Manifest",
52
+ charLimits: A = $e,
53
+ variablesData: E
53
54
  }) => {
54
- const [N, be] = i(g?.name ?? ""), [C, k] = i(g?.instructions ?? ""), [I, E] = i(g?.guardrail ?? ""), [D, M] = i(g?.tools ?? []), [p, B] = i(
55
- g?.configTools ?? []
56
- ), [m, G] = i(
57
- g?.restApiTools ?? []
58
- ), [l, y] = i(null), O = T(0), [oe, ne] = i(!1), [Ce, P] = i(0), [Ie, z] = i(0), [S, se] = i(null), H = ze(
55
+ const [D, Ce] = i(T?.name ?? ""), [v, O] = i(T?.instructions ?? ""), [x, k] = i(T?.guardrail ?? ""), [L, N] = i(T?.tools ?? []), [p, P] = i(
56
+ T?.configTools ?? []
57
+ ), [d, U] = i(
58
+ T?.restApiTools ?? []
59
+ ), [l, b] = i(null), M = C(0), [se, re] = i(!1), [Se, z] = i(0), [Ae, H] = i(0), [R, ie] = i(null), $ = ze(
59
60
  () => [
60
- ...Le(s, [], h),
61
- ...Fe(p, m)
61
+ ...qe(r, [], I),
62
+ ...Xe(p, d)
62
63
  ],
63
- [s, h, p, m]
64
- ), K = T({}), U = T("instructions"), Se = a((e) => {
64
+ [r, I, p, d]
65
+ ), K = C({}), F = C("instructions"), ve = a((e) => {
65
66
  K.current.instructions = e ?? void 0;
66
- }, []), ve = a((e) => {
67
+ }, []), xe = a((e) => {
67
68
  K.current.guardrail = e ?? void 0;
68
- }, []), xe = a(() => {
69
- U.current = "instructions";
70
- }, []), Ae = a(() => {
71
- U.current = "guardrail";
72
- }, []), re = T(/* @__PURE__ */ new Set());
73
- re.current = new Set(
74
- [...p, ...m].map((e) => e.id)
69
+ }, []), Re = a(() => {
70
+ F.current = "instructions";
71
+ }, []), _e = a(() => {
72
+ F.current = "guardrail";
73
+ }, []), le = C(/* @__PURE__ */ new Set());
74
+ le.current = new Set(
75
+ [...p, ...d].map((e) => e.id)
75
76
  );
76
- const ie = a(
77
+ const ae = a(
77
78
  (e, t) => {
78
- e === "tool" && !re.current.has(t) && M((o) => me(o, t));
79
+ e === "tool" && !le.current.has(t) && N((o) => fe(o, t));
79
80
  },
80
81
  []
81
- ), v = a(
82
+ ), _ = a(
82
83
  (e, t, o) => {
83
- (K.current[U.current] ?? K.current.instructions)?.("tool", e, t, o);
84
+ (K.current[F.current] ?? K.current.instructions)?.("tool", e, t, o);
84
85
  },
85
86
  []
86
- ), $ = a((e) => {
87
- O.current += 1, y({
88
- key: O.current,
87
+ ), Y = a((e) => {
88
+ M.current += 1, b({
89
+ key: M.current,
89
90
  kind: "restapi",
90
91
  initialRest: e
91
92
  });
92
- }, []), L = a(
93
+ }, []), j = a(
93
94
  (e, t) => {
94
- O.current += 1, y({
95
- key: O.current,
95
+ M.current += 1, b({
96
+ key: M.current,
96
97
  kind: "config",
97
98
  toolKey: e,
98
99
  initialConfig: t
99
100
  });
100
101
  },
101
102
  []
102
- ), Re = a(
103
- (e) => {
104
- const t = $e[e];
105
- t ? L(t) : $();
103
+ ), we = a(
104
+ (e, t) => {
105
+ const o = t ?? Fe[e]?.[0];
106
+ o ? j(o) : Y();
106
107
  },
107
- [L, $]
108
- ), _e = a(
108
+ [j, Y]
109
+ ), Ee = a(
109
110
  (e) => {
110
- const t = !m.some((o) => o.id === e.id);
111
- G((o) => he(o, e)), t && v(
111
+ const t = !d.some((o) => o.id === e.id);
112
+ U((o) => Te(o, e)), t && _(
112
113
  e.id,
113
- je(e).label,
114
- u.RestApi
115
- ), y(null);
114
+ Ze(e).label,
115
+ g.RestApi
116
+ ), b(null);
116
117
  },
117
- [m, v]
118
- ), we = a(
118
+ [d, _]
119
+ ), Oe = a(
119
120
  (e) => {
120
121
  const t = !p.some((o) => o.id === e.id);
121
- if (B((o) => he(o, e)), t) {
122
- const o = e.tool_key === "send_slack_message" ? u.Slack : u.EmailHandover;
123
- v(e.id, We(e).label, o);
124
- }
125
- y(null);
122
+ P((o) => Te(o, e)), t && _(
123
+ e.id,
124
+ Je(e).label,
125
+ Ye[e.tool_key]
126
+ ), b(null);
126
127
  },
127
- [p, v]
128
- ), [F, j] = i(
128
+ [p, _]
129
+ ), [W, q] = i(
129
130
  null
130
- ), W = T(null), le = T(0), ke = (e) => {
131
- const t = s.find((n) => n.tool_id === e)?.display_name ?? m.find((n) => n.id === e)?.name ?? "Tool", o = `{{tool:${e}}}`, r = (n) => n.split(o).join("");
132
- W.current = {
133
- instructions: C,
134
- guardrail: I,
135
- tools: D,
131
+ ), X = C(null), ce = C(0), ke = (e) => {
132
+ const t = r.find((n) => n.tool_id === e)?.display_name ?? d.find((n) => n.id === e)?.name ?? "Tool", o = `{{tool:${e}}}`, m = (n) => n.split(o).join("");
133
+ X.current = {
134
+ instructions: v,
135
+ guardrail: x,
136
+ tools: L,
136
137
  configTools: p,
137
- restApiTools: m
138
- }, k((n) => r(n)), E((n) => r(n)), M((n) => n.filter((x) => x !== e)), B((n) => n.filter((x) => x.id !== e)), G((n) => n.filter((x) => x.id !== e)), P((n) => n + 1), z((n) => n + 1), le.current += 1, j({ id: le.current, message: `Tool "${t}" removed` });
139
- }, Ee = () => {
140
- const e = W.current;
141
- e && (k(e.instructions), E(e.guardrail), M(e.tools), B(e.configTools), G(e.restApiTools), P((t) => t + 1), z((t) => t + 1), W.current = null), j(null);
142
- }, q = N.trim(), Y = q.length > 0 && Te.some(
143
- (e) => e.trim().toLowerCase() === q.toLowerCase()
144
- ), ae = q.length > 0 && !Y && (C.trim().length > 0 || I.trim().length > 0), Me = D.map((e) => {
145
- const t = s.find((o) => o.tool_id === e);
138
+ restApiTools: d
139
+ }, O((n) => m(n)), k((n) => m(n)), N((n) => n.filter((f) => f !== e)), P((n) => n.filter((f) => f.id !== e)), U((n) => n.filter((f) => f.id !== e)), z((n) => n + 1), H((n) => n + 1), ce.current += 1, q({ id: ce.current, message: `Tool "${t}" removed` });
140
+ }, Ne = () => {
141
+ const e = X.current;
142
+ e && (O(e.instructions), k(e.guardrail), N(e.tools), P(e.configTools), U(e.restApiTools), z((t) => t + 1), H((t) => t + 1), X.current = null), q(null);
143
+ }, Z = D.trim(), J = Z.length > 0 && be.some(
144
+ (e) => e.trim().toLowerCase() === Z.toLowerCase()
145
+ ), ue = Z.length > 0 && !J && (v.trim().length > 0 || x.trim().length > 0), Me = L.map((e) => {
146
+ const t = r.find((o) => o.tool_id === e);
146
147
  return t ? {
147
148
  id: e,
148
149
  label: t.display_name,
149
- icon: J(t.source ?? u.Manifest),
150
+ icon: V(t.source ?? g.Manifest),
150
151
  // Shield flags a tool that needs customer verification, same as
151
152
  // the main builder's Step 3 tool rows.
152
153
  authRequired: t.auth_required
153
154
  } : null;
154
- }).filter((e) => e !== null), Oe = m.map((e) => ({
155
+ }).filter((e) => e !== null), Ke = d.map((e) => ({
155
156
  id: e.id,
156
- label: qe(e),
157
- icon: pe[u.RestApi],
158
- onConfigure: () => $(e)
159
- })), Ke = p.map((e) => ({
157
+ label: Qe(e),
158
+ icon: ge[g.RestApi],
159
+ onConfigure: () => Y(e)
160
+ })), Be = p.map((e) => ({
160
161
  id: e.id,
161
- label: Ye(e),
162
- icon: pe[e.tool_key === "send_slack_message" ? u.Slack : u.EmailHandover],
163
- onConfigure: () => L(e.tool_key, e)
164
- })), Ne = [
162
+ label: Ve(e),
163
+ icon: ge[e.tool_key === "send_slack_message" ? g.Slack : g.EmailHandover],
164
+ onConfigure: () => j(e.tool_key, e)
165
+ })), Ge = [
165
166
  ...Me,
166
- ...Oe,
167
- ...Ke
168
- ], X = Ze(
169
- ee,
170
- Re,
171
- R,
172
- _
173
- ), ce = l?.kind === "config" && l.toolKey ? ee?.[l.toolKey] : void 0, De = s.map((e) => ({
167
+ ...Ke,
168
+ ...Be
169
+ ], B = ot(
170
+ oe,
171
+ we,
172
+ y,
173
+ S
174
+ ), de = l?.kind === "config" && l.toolKey ? oe?.[l.toolKey] : void 0, De = r.map((e) => ({
174
175
  label: e.display_name,
175
176
  value: e.tool_id,
176
- leadingIcon: fe(J(e.source ?? u.Manifest)) ?? void 0
177
- })), Be = (() => {
177
+ leadingIcon: he(V(e.source ?? g.Manifest)) ?? void 0
178
+ })), Le = (() => {
178
179
  const e = [], t = /* @__PURE__ */ new Map();
179
- return s.forEach((o) => {
180
- const r = o.source ?? u.Manifest;
181
- t.has(r) || (t.set(r, []), e.push(r)), t.get(r)?.push({
182
- label: o.display_name,
183
- value: o.tool_id,
184
- leadingIcon: fe(J(o.source ?? u.Manifest)) ?? void 0
180
+ r.forEach((s) => {
181
+ const G = s.source ?? g.Manifest;
182
+ t.has(G) || (t.set(G, []), e.push(G)), t.get(G)?.push({
183
+ label: s.display_name,
184
+ value: s.tool_id,
185
+ leadingIcon: he(V(s.source ?? g.Manifest)) ?? void 0
185
186
  });
186
- }), e.map((o) => ({
187
- source: o,
188
- label: Xe(o, h),
189
- options: t.get(o) ?? [],
190
- // Not connected → the source button opens the connect flow instead of
191
- // its tool list (mirrors Step 3's tool section).
192
- connected: R?.[o],
193
- onConnect: () => _?.(o)
187
+ });
188
+ const { outside: o, inside: m } = tt(
189
+ [...e, ...B.map((s) => s.source)],
190
+ y
191
+ ), n = new Set(o), f = e.filter((s) => n.has(s)).map((s) => ({
192
+ source: s,
193
+ label: et(s, I),
194
+ options: t.get(s) ?? [],
195
+ // Reachable only when connected or ungated, so no connect flow needed —
196
+ // kept for the picker's own gating, which reads these groups.
197
+ connected: y?.[s],
198
+ onConnect: () => S?.(s)
194
199
  }));
195
- })(), Ge = async () => {
196
- if (!ae || oe)
200
+ return m.length > 0 && f.push({
201
+ source: We,
202
+ label: je,
203
+ // No options of its own: clicking opens the picker at the umbrella,
204
+ // where each unconnected source offers "Connect".
205
+ options: []
206
+ }), f;
207
+ })(), Pe = async () => {
208
+ if (!ue || se)
197
209
  return;
198
- const e = f({
199
- name: N.trim(),
200
- instructions: C,
201
- guardrail: I,
202
- tools: D,
210
+ const e = h({
211
+ name: D.trim(),
212
+ instructions: v,
213
+ guardrail: x,
214
+ tools: L,
203
215
  configTools: p,
204
- restApiTools: m
216
+ restApiTools: d
205
217
  });
206
218
  if (e && typeof e.then == "function") {
207
- ne(!0);
219
+ re(!0);
208
220
  try {
209
221
  await e;
210
222
  } finally {
211
- ne(!1);
223
+ re(!1);
212
224
  }
213
225
  }
214
- }, ue = async (e) => {
215
- if (!(!d || S)) {
216
- se(e);
226
+ }, me = async (e) => {
227
+ if (!(!u || R)) {
228
+ ie(e);
217
229
  try {
218
- const o = await d(e, e === "instructions" ? C : I);
219
- e === "instructions" ? (k(o), P((r) => r + 1)) : (E(o), z((r) => r + 1));
230
+ const o = await u(e, e === "instructions" ? v : x);
231
+ e === "instructions" ? (O(o), z((m) => m + 1)) : (k(o), H((m) => m + 1));
220
232
  } finally {
221
- se(null);
233
+ ie(null);
222
234
  }
223
235
  }
224
236
  };
225
- return /* @__PURE__ */ de(Pe, { children: [
226
- /* @__PURE__ */ de(
227
- nt,
237
+ return /* @__PURE__ */ pe(Ue, { children: [
238
+ /* @__PURE__ */ pe(
239
+ ct,
228
240
  {
229
- header: te,
241
+ header: ne,
230
242
  closeOnEscapeKey: !1,
231
- zIndex: it,
243
+ zIndex: mt,
232
244
  headerCustomComponent: /* @__PURE__ */ c(
233
- et,
245
+ it,
234
246
  {
235
- title: te,
247
+ title: ne,
236
248
  subtitle: "Each sub-agent handles one piece of the job. Use @ in the main instructions to call them."
237
249
  }
238
250
  ),
239
251
  width: "421px",
240
- headerStyle: Ve,
241
- bodyStyle: Qe,
242
- onClose: A,
252
+ headerStyle: rt,
253
+ bodyStyle: st,
254
+ onClose: w,
243
255
  saveButtonProps: {
244
256
  "data-test": "subagent-save",
245
257
  buttonText: "Save",
246
258
  buttonType: "primary",
247
259
  size: "small",
248
- disabled: !ae,
249
- isLoading: oe,
250
- onClick: Ge
260
+ disabled: !ue,
261
+ isLoading: se,
262
+ onClick: Pe
251
263
  },
252
264
  cancelButtonProps: {
253
265
  "data-test": "subagent-cancel",
254
266
  buttonText: "Cancel",
255
267
  buttonType: "tertiaryGray",
256
268
  size: "small",
257
- onClick: A
269
+ onClick: w
258
270
  },
259
271
  children: [
260
272
  /* @__PURE__ */ c(
261
- st,
273
+ ut,
262
274
  {
263
275
  "data-test": "subagent-name",
264
276
  labelText: "Agent name",
265
277
  labelTextBold: !0,
266
278
  placeholder: "Enter agent name",
267
- value: N,
268
- maxCharLimit: b.name,
279
+ value: D,
280
+ maxCharLimit: A.name,
269
281
  maxCharLimitPosition: "TOP",
270
282
  maxCharStyle: { fontSize: 12, lineHeight: "16px" },
271
- state: Y ? "invalid" : void 0,
272
- errorMessage: Y ? "A sub-agent with this name already exists" : void 0,
273
- onChangeText: be
283
+ state: J ? "invalid" : void 0,
284
+ errorMessage: J ? "A sub-agent with this name already exists" : void 0,
285
+ onChangeText: Ce
274
286
  }
275
287
  ),
276
288
  /* @__PURE__ */ c(
277
- ge,
289
+ ye,
278
290
  {
279
291
  "data-test": "subagent-instructions",
280
292
  label: "Instructions",
281
- value: C,
282
- onChange: k,
283
- maxLength: b.instructions,
293
+ value: v,
294
+ onChange: O,
295
+ maxLength: A.instructions,
284
296
  placeholder: "Write the steps in plain English. The agent will follow them exactly. The more specific you are, the better it performs.",
285
297
  minHeight: "160px",
286
- resetKey: `instr-${Ce}`,
287
- mentionItems: H,
288
- tools: s,
289
- toolActions: X,
290
- variablesData: w,
298
+ resetKey: `instr-${Se}`,
299
+ mentionItems: $,
300
+ tools: r,
301
+ toolActions: B,
302
+ variablesData: E,
291
303
  addDataButton: !0,
292
- integrationStatus: R,
293
- appLabel: h,
294
- onConnectIntegration: _,
295
- onMentionSelect: ie,
296
- onFocus: xe,
297
- registerInsert: Se,
298
- action: d ? /* @__PURE__ */ c(
299
- ye,
304
+ integrationStatus: y,
305
+ appLabel: I,
306
+ onConnectIntegration: S,
307
+ onMentionSelect: ae,
308
+ onFocus: Re,
309
+ registerInsert: ve,
310
+ action: u ? /* @__PURE__ */ c(
311
+ Ie,
300
312
  {
301
313
  type: "button",
302
314
  "data-test": "subagent-improve-instructions",
303
- disabled: S !== null,
304
- onClick: () => ue("instructions"),
305
- children: S === "instructions" ? "Improving…" : "Improve with AI"
315
+ disabled: R !== null,
316
+ onClick: () => me("instructions"),
317
+ children: R === "instructions" ? "Improving…" : "Improve with AI"
306
318
  }
307
319
  ) : void 0
308
320
  }
309
321
  ),
310
322
  /* @__PURE__ */ c(
311
- ge,
323
+ ye,
312
324
  {
313
325
  "data-test": "subagent-guardrail",
314
326
  label: "Guardrails",
315
- value: I,
316
- onChange: E,
317
- maxLength: b.guardrail,
327
+ value: x,
328
+ onChange: k,
329
+ maxLength: A.guardrail,
318
330
  placeholder: "e.g. Never discuss competitor pricing. Always stay within the cancellation policy. Do not process refunds above ₹10,000 without human approval.",
319
331
  minHeight: "160px",
320
- resetKey: `guard-${Ie}`,
321
- mentionItems: H,
322
- tools: s,
323
- toolActions: X,
324
- variablesData: w,
332
+ resetKey: `guard-${Ae}`,
333
+ mentionItems: $,
334
+ tools: r,
335
+ toolActions: B,
336
+ variablesData: E,
325
337
  addDataButton: !0,
326
- integrationStatus: R,
327
- appLabel: h,
328
- onConnectIntegration: _,
329
- onMentionSelect: ie,
330
- onFocus: Ae,
331
- registerInsert: ve,
332
- action: d ? /* @__PURE__ */ c(
333
- ye,
338
+ integrationStatus: y,
339
+ appLabel: I,
340
+ onConnectIntegration: S,
341
+ onMentionSelect: ae,
342
+ onFocus: _e,
343
+ registerInsert: xe,
344
+ action: u ? /* @__PURE__ */ c(
345
+ Ie,
334
346
  {
335
347
  type: "button",
336
348
  "data-test": "subagent-improve-guardrail",
337
- disabled: S !== null,
338
- onClick: () => ue("guardrail"),
339
- children: S === "guardrail" ? "Improving…" : "Improve with AI"
349
+ disabled: R !== null,
350
+ onClick: () => me("guardrail"),
351
+ children: R === "guardrail" ? "Improving…" : "Improve with AI"
340
352
  }
341
353
  ) : void 0
342
354
  }
343
355
  ),
344
356
  /* @__PURE__ */ c(
345
- ot,
357
+ at,
346
358
  {
347
359
  title: "Tools this agent can use",
348
360
  dataTestPrefix: "subagent-tools",
349
- items: Ne,
361
+ items: Ge,
350
362
  addableOptions: De,
351
- sourceGroups: Be,
352
- mentionItems: H,
353
- actionSources: X,
363
+ sourceGroups: Le,
364
+ integrationStatus: y,
365
+ onConnectIntegration: (e) => S?.(e),
366
+ mentionItems: $,
367
+ actionSources: B,
354
368
  emptyText: "No tools added yet.",
355
- appLabel: h,
369
+ appLabel: I,
356
370
  pickerOpensUp: !0,
357
371
  onAdd: (e) => {
358
- v(e), M((t) => me(t, e));
372
+ _(e), N((t) => fe(t, e));
359
373
  },
360
374
  onRemove: ke,
361
- confirmDelete: { noun: "tool", zIndex: Q + 1 }
375
+ confirmDelete: { noun: "tool", zIndex: ee + 1 }
362
376
  }
363
377
  )
364
378
  ]
365
379
  }
366
380
  ),
367
381
  l?.kind === "restapi" && /* @__PURE__ */ c(
368
- tt,
382
+ lt,
369
383
  {
370
384
  initial: l.initialRest,
371
- charLimits: b,
372
- variablesData: w,
373
- onImprove: V,
374
- onClose: () => y(null),
375
- onSave: _e,
376
- zIndex: Q
385
+ charLimits: A,
386
+ variablesData: E,
387
+ onImprove: te,
388
+ onClose: () => b(null),
389
+ onSave: Ee,
390
+ zIndex: ee
377
391
  },
378
392
  l.key
379
393
  ),
380
- l?.kind === "config" && l.toolKey && ce && /* @__PURE__ */ c(
381
- Je,
394
+ l?.kind === "config" && l.toolKey && de && /* @__PURE__ */ c(
395
+ nt,
382
396
  {
383
397
  toolKey: l.toolKey,
384
- template: ce,
398
+ template: de,
385
399
  initial: l.initialConfig,
386
- charLimits: b,
387
- variablesData: w,
388
- onImprove: V,
389
- onClose: () => y(null),
390
- onSave: we,
391
- zIndex: Q
400
+ charLimits: A,
401
+ variablesData: E,
402
+ onImprove: te,
403
+ onClose: () => b(null),
404
+ onSave: Oe,
405
+ zIndex: ee
392
406
  },
393
407
  l.key
394
408
  ),
395
- F && /* @__PURE__ */ c(
396
- rt,
409
+ W && /* @__PURE__ */ c(
410
+ dt,
397
411
  {
398
- text: F.message,
412
+ text: W.message,
399
413
  type: "info",
400
414
  position: "top-right",
401
415
  autoClose: 5e3,
@@ -403,15 +417,15 @@ const it = 1e3, Q = 1002, he = (A, f) => {
403
417
  buttonProps: {
404
418
  buttonText: "Undo",
405
419
  showButton: !0,
406
- onButtonClick: () => (Ee(), {})
420
+ onButtonClick: () => (Ne(), {})
407
421
  },
408
- onCloseToast: () => j(null)
422
+ onCloseToast: () => q(null)
409
423
  },
410
- F.id
424
+ W.id
411
425
  )
412
426
  ] });
413
427
  };
414
428
  export {
415
- At as CreateSubAgentPanel
429
+ Nt as CreateSubAgentPanel
416
430
  };
417
431
  //# sourceMappingURL=CreateSubAgentPanel.js.map