@bikdotai/bik-component-library 0.0.853 → 0.0.855

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