@bikdotai/bik-component-library 0.0.830 → 0.0.831-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/cjs/components/agent-builder/AgentBuilder.js +1 -1
  2. package/dist/cjs/components/agent-builder/AgentBuilder.js.map +1 -1
  3. package/dist/cjs/components/agent-builder/AgentBuilder.styled.js +17 -65
  4. package/dist/cjs/components/agent-builder/AgentBuilder.styled.js.map +1 -1
  5. package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js +41 -0
  6. package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js.map +1 -0
  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/DrawerHeaderText.js +15 -0
  10. package/dist/cjs/components/agent-builder/components/DrawerHeaderText.js.map +1 -0
  11. package/dist/cjs/components/agent-builder/components/MentionEditor.js +1 -1
  12. package/dist/cjs/components/agent-builder/components/MentionEditor.js.map +1 -1
  13. package/dist/cjs/components/agent-builder/components/MentionField.js +1 -1
  14. package/dist/cjs/components/agent-builder/components/MentionField.js.map +1 -1
  15. package/dist/cjs/components/agent-builder/components/MentionPicker.js +20 -20
  16. package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
  17. package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js +23 -0
  18. package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js.map +1 -0
  19. package/dist/cjs/components/agent-builder/components/SelectableListSection.js +5 -5
  20. package/dist/cjs/components/agent-builder/components/SelectableListSection.js.map +1 -1
  21. package/dist/cjs/components/agent-builder/components/ToolInstructionsField.js +5 -0
  22. package/dist/cjs/components/agent-builder/components/ToolInstructionsField.js.map +1 -0
  23. package/dist/cjs/components/agent-builder/constants/tools.js +2 -0
  24. package/dist/cjs/components/agent-builder/constants/tools.js.map +1 -0
  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 +3 -3
  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/side-modal/SideModal.style.js +11 -10
  34. package/dist/cjs/components/side-modal/SideModal.style.js.map +1 -1
  35. package/dist/cjs/editor/extensions/mention/MentionExtension.js +1 -1
  36. package/dist/cjs/editor/extensions/mention/MentionExtension.js.map +1 -1
  37. package/dist/cjs/index.js +1 -1
  38. package/dist/esm/components/agent-builder/AgentBuilder.js +100 -96
  39. package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
  40. package/dist/esm/components/agent-builder/AgentBuilder.model.d.ts +144 -1
  41. package/dist/esm/components/agent-builder/AgentBuilder.styled.d.ts +0 -21
  42. package/dist/esm/components/agent-builder/AgentBuilder.styled.js +42 -111
  43. package/dist/esm/components/agent-builder/AgentBuilder.styled.js.map +1 -1
  44. package/dist/esm/components/agent-builder/components/ConfigToolPanel.d.ts +33 -0
  45. package/dist/esm/components/agent-builder/components/ConfigToolPanel.js +251 -0
  46. package/dist/esm/components/agent-builder/components/ConfigToolPanel.js.map +1 -0
  47. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.d.ts +9 -1
  48. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +318 -219
  49. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  50. package/dist/esm/components/agent-builder/components/DrawerHeaderText.d.ts +33 -0
  51. package/dist/esm/components/agent-builder/components/DrawerHeaderText.js +42 -0
  52. package/dist/esm/components/agent-builder/components/DrawerHeaderText.js.map +1 -0
  53. package/dist/esm/components/agent-builder/components/MentionEditor.d.ts +6 -0
  54. package/dist/esm/components/agent-builder/components/MentionEditor.js +38 -30
  55. package/dist/esm/components/agent-builder/components/MentionEditor.js.map +1 -1
  56. package/dist/esm/components/agent-builder/components/MentionField.js +77 -52
  57. package/dist/esm/components/agent-builder/components/MentionField.js.map +1 -1
  58. package/dist/esm/components/agent-builder/components/MentionPicker.d.ts +7 -0
  59. package/dist/esm/components/agent-builder/components/MentionPicker.js +162 -145
  60. package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
  61. package/dist/esm/components/agent-builder/components/RestApiToolPanel.d.ts +27 -0
  62. package/dist/esm/components/agent-builder/components/RestApiToolPanel.js +270 -0
  63. package/dist/esm/components/agent-builder/components/RestApiToolPanel.js.map +1 -0
  64. package/dist/esm/components/agent-builder/components/SelectableListSection.d.ts +14 -0
  65. package/dist/esm/components/agent-builder/components/SelectableListSection.js +166 -140
  66. package/dist/esm/components/agent-builder/components/SelectableListSection.js.map +1 -1
  67. package/dist/esm/components/agent-builder/components/ToolInstructionsField.d.ts +19 -0
  68. package/dist/esm/components/agent-builder/components/ToolInstructionsField.js +66 -0
  69. package/dist/esm/components/agent-builder/components/ToolInstructionsField.js.map +1 -0
  70. package/dist/esm/components/agent-builder/constants/tools.d.ts +67 -0
  71. package/dist/esm/components/agent-builder/constants/tools.js +29 -0
  72. package/dist/esm/components/agent-builder/constants/tools.js.map +1 -0
  73. package/dist/esm/components/agent-builder/context/AgentBuilderContext.d.ts +19 -1
  74. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +169 -140
  75. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
  76. package/dist/esm/components/agent-builder/index.d.ts +2 -1
  77. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +241 -141
  78. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
  79. package/dist/esm/components/agent-builder/utils/mentionSerialization.d.ts +18 -3
  80. package/dist/esm/components/agent-builder/utils/mentionSerialization.js +81 -62
  81. package/dist/esm/components/agent-builder/utils/mentionSerialization.js.map +1 -1
  82. package/dist/esm/components/agent-builder/utils/sourceIcons.d.ts +15 -9
  83. package/dist/esm/components/agent-builder/utils/sourceIcons.js +16 -8
  84. package/dist/esm/components/agent-builder/utils/sourceIcons.js.map +1 -1
  85. package/dist/esm/components/side-modal/SideModal.style.js +1 -0
  86. package/dist/esm/components/side-modal/SideModal.style.js.map +1 -1
  87. package/dist/esm/editor/extensions/mention/MentionExtension.js +60 -57
  88. package/dist/esm/editor/extensions/mention/MentionExtension.js.map +1 -1
  89. package/dist/esm/index.js +97 -95
  90. package/dist/esm/index.js.map +1 -1
  91. package/package.json +1 -1
@@ -1,24 +1,28 @@
1
- import { jsxs as l, Fragment as ct, jsx as o } from "react/jsx-runtime";
2
- import ut from "../../../assets/icons/cross.svg.js";
3
- import { useState as i, useMemo as dt, useRef as x, useCallback as c } from "react";
4
- import mt from "styled-components";
5
- import { TitleRegular as gt, BodySecondary as pt } from "../../TypographyStyle.js";
6
- import { addUnique as N } from "../../../utils/arrayUtils.js";
7
- import { COLORS as u } from "../../../constants/Theme.js";
8
- import { SubAgentScrim as ft, SubAgentPanel as ht, SubAgentPanelHeader as bt, SubAgentPanelHeaderText as yt, SubAgentCloseButton as St, SubAgentPanelBody as xt, SubAgentPanelFooter as Ct } from "../AgentBuilder.styled.js";
9
- import { AGENT_CHAR_LIMITS as vt } from "../constants/charLimits.js";
10
- import { buildAgentMentionItems as It, toolSourceLabel as Tt } from "../utils/mentionSerialization.js";
11
- import { SOURCE_ICONS as k, renderSourceIcon as U } from "../utils/sourceIcons.js";
12
- import { MentionEditor as j } from "./MentionEditor.js";
13
- import { SelectableListSection as At } from "./SelectableListSection.js";
14
- import { Input as Rt } from "../../input/Input.js";
15
- import { Button as z } from "../../button/Button.js";
16
- import { Toaster as _t } from "../../toaster/Toaster.js";
17
- const q = mt.button`
1
+ import { jsxs as rt, Fragment as Kt, jsx as c } from "react/jsx-runtime";
2
+ import { useState as r, useRef as v, useMemo as wt, useCallback as a } from "react";
3
+ import Nt from "styled-components";
4
+ import { addUnique as it } from "../../../utils/arrayUtils.js";
5
+ import { COLORS as F } from "../../../constants/Theme.js";
6
+ import { AGENT_CHAR_LIMITS as Bt } from "../constants/charLimits.js";
7
+ import { CONFIG_TOOL_SOURCES as lt, ToolSource as p, TOOL_ACTION_SOURCES as Lt, TOOL_SOURCE_LABELS as Dt } from "../constants/tools.js";
8
+ import { buildAgentMentionItems as Gt, buildCustomToolMentionItems as Pt, restApiMentionItem as Ut, configToolMentionItem as zt, restApiToolName as Ht, configToolName as $t, toolSourceLabel as Ft } from "../utils/mentionSerialization.js";
9
+ import { sourceIcon as j, SOURCE_ICONS as W, renderSourceIcon as at } from "../utils/sourceIcons.js";
10
+ import { ConfigToolPanel as jt } from "./ConfigToolPanel.js";
11
+ import { DRAWER_BODY_STYLE as Wt, DRAWER_HEADER_STYLE as Yt, DrawerHeaderText as Xt } from "./DrawerHeaderText.js";
12
+ import { MentionEditor as ct } from "./MentionEditor.js";
13
+ import { RestApiToolPanel as Zt } from "./RestApiToolPanel.js";
14
+ import { SelectableListSection as qt } from "./SelectableListSection.js";
15
+ import { SideModal as Jt } from "../../side-modal/SideModal.js";
16
+ import { Input as Qt } from "../../input/Input.js";
17
+ import { Toaster as Vt } from "../../toaster/Toaster.js";
18
+ const te = 1e3, ut = 1002, dt = (A, f) => {
19
+ const s = A ?? [];
20
+ return s.some((u) => u.id === f.id) ? s.map((u) => u.id === f.id ? f : u) : [...s, f];
21
+ }, mt = Nt.button`
18
22
  align-self: flex-start;
19
- border: 1px solid ${u.stroke.primary};
20
- color: ${u.content.primary};
21
- background: ${u.surface.standard};
23
+ border: 1px solid ${F.stroke.primary};
24
+ color: ${F.content.primary};
25
+ background: ${F.surface.standard};
22
26
  border-radius: 8px;
23
27
  padding: 6px 12px;
24
28
  font-size: 13px;
@@ -30,232 +34,327 @@ const q = mt.button`
30
34
  cursor: default;
31
35
  opacity: 0.6;
32
36
  }
33
- `, zt = ({
34
- onClose: C,
35
- onSave: W,
36
- availableTools: a,
37
- onImprove: p,
38
- title: D = "Create sub-agent",
39
- initial: f,
40
- appLabel: w = "Manifest",
41
- charLimits: v = vt
37
+ `, Te = ({
38
+ onClose: A,
39
+ onSave: f,
40
+ availableTools: s,
41
+ onImprove: u,
42
+ onImproveToolInstructions: Y,
43
+ configToolTemplates: X,
44
+ title: Z = "Create sub-agent",
45
+ initial: g,
46
+ appLabel: q = "Manifest",
47
+ charLimits: h = Bt
42
48
  }) => {
43
- const [I, J] = i(f?.name ?? ""), [d, h] = i(f?.instructions ?? ""), [m, b] = i(f?.guardrail ?? ""), [T, y] = i(f?.tools ?? []), [E, O] = i(!1), [Q, A] = i(0), [V, R] = i(0), [g, $] = i(null), _ = dt(
44
- () => It(a, [], w),
45
- [a, w]
46
- ), S = x({}), P = x("instructions"), X = c((t) => {
47
- S.current.instructions = t ?? void 0;
48
- }, []), Y = c((t) => {
49
- S.current.guardrail = t ?? void 0;
50
- }, []), Z = c(() => {
51
- P.current = "instructions";
52
- }, []), tt = c(() => {
53
- P.current = "guardrail";
54
- }, []), H = c(
49
+ const [k, pt] = r(g?.name ?? ""), [T, x] = r(g?.instructions ?? ""), [b, R] = r(g?.guardrail ?? ""), [M, _] = r(g?.tools ?? []), [m, K] = r(
50
+ g?.configTools ?? []
51
+ ), [d, w] = r(
52
+ g?.restApiTools ?? []
53
+ ), [i, y] = r(null), E = v(0), [J, Q] = r(!1), [ft, N] = r(0), [gt, B] = r(0), [S, V] = r(null), L = wt(
54
+ () => [
55
+ ...Gt(s, [], q),
56
+ ...Pt(m, d)
57
+ ],
58
+ [s, q, m, d]
59
+ ), O = v({}), D = v("instructions"), yt = a((t) => {
60
+ O.current.instructions = t ?? void 0;
61
+ }, []), ht = a((t) => {
62
+ O.current.guardrail = t ?? void 0;
63
+ }, []), Tt = a(() => {
64
+ D.current = "instructions";
65
+ }, []), bt = a(() => {
66
+ D.current = "guardrail";
67
+ }, []), tt = a(
55
68
  (t, e) => {
56
- t === "tool" && y((n) => N(n, e));
69
+ t === "tool" && _((o) => it(o, e));
57
70
  },
58
71
  []
59
- ), et = c((t) => {
60
- (S.current[P.current] ?? S.current.instructions)?.("tool", t);
61
- }, []), [B, G] = i(
62
- null
63
- ), M = x(null), K = x(0), nt = (t) => {
64
- const e = a.find((r) => r.tool_id === t), n = `{{tool:${t}}}`, s = (r) => r.split(n).join("");
65
- M.current = { instructions: d, guardrail: m, tools: T }, h((r) => s(r)), b((r) => s(r)), y((r) => r.filter((lt) => lt !== t)), A((r) => r + 1), R((r) => r + 1), K.current += 1, G({
66
- id: K.current,
67
- message: `Tool "${e?.display_name ?? "Tool"}" removed`
72
+ ), C = a((t, e) => {
73
+ (O.current[D.current] ?? O.current.instructions)?.("tool", t, e);
74
+ }, []), G = a((t) => {
75
+ E.current += 1, y({
76
+ key: E.current,
77
+ kind: "restapi",
78
+ initialRest: t
68
79
  });
69
- }, ot = () => {
70
- const t = M.current;
71
- t && (h(t.instructions), b(t.guardrail), y(t.tools), A((e) => e + 1), R((e) => e + 1), M.current = null), G(null);
72
- }, L = I.trim().length > 0 && (d.trim().length > 0 || m.trim().length > 0), rt = T.map((t) => {
73
- const e = a.find((n) => n.tool_id === t);
80
+ }, []), P = a(
81
+ (t, e) => {
82
+ E.current += 1, y({
83
+ key: E.current,
84
+ kind: "config",
85
+ toolKey: t,
86
+ initialConfig: e
87
+ });
88
+ },
89
+ []
90
+ ), St = a(
91
+ (t) => {
92
+ const e = lt[t];
93
+ e ? P(e) : G();
94
+ },
95
+ [P, G]
96
+ ), Ct = a(
97
+ (t) => {
98
+ const e = !d.some((o) => o.id === t.id);
99
+ w((o) => dt(o, t)), e && C(t.id, Ut(t).label), y(null);
100
+ },
101
+ [d, C]
102
+ ), It = a(
103
+ (t) => {
104
+ const e = !m.some((o) => o.id === t.id);
105
+ K((o) => dt(o, t)), e && C(t.id, zt(t).label), y(null);
106
+ },
107
+ [m, C]
108
+ ), [U, z] = r(
109
+ null
110
+ ), H = v(null), et = v(0), vt = (t) => {
111
+ const e = s.find((n) => n.tool_id === t)?.display_name ?? d.find((n) => n.id === t)?.name ?? "Tool", o = `{{tool:${t}}}`, l = (n) => n.split(o).join("");
112
+ H.current = {
113
+ instructions: T,
114
+ guardrail: b,
115
+ tools: M,
116
+ configTools: m,
117
+ restApiTools: d
118
+ }, x((n) => l(n)), R((n) => l(n)), _((n) => n.filter((I) => I !== t)), K((n) => n.filter((I) => I.id !== t)), w((n) => n.filter((I) => I.id !== t)), N((n) => n + 1), B((n) => n + 1), et.current += 1, z({ id: et.current, message: `Tool "${e}" removed` });
119
+ }, At = () => {
120
+ const t = H.current;
121
+ t && (x(t.instructions), R(t.guardrail), _(t.tools), K(t.configTools), w(t.restApiTools), N((e) => e + 1), B((e) => e + 1), H.current = null), z(null);
122
+ }, ot = k.trim().length > 0 && (T.trim().length > 0 || b.trim().length > 0), xt = M.map((t) => {
123
+ const e = s.find((o) => o.tool_id === t);
74
124
  return e ? {
75
125
  id: t,
76
126
  label: e.display_name,
77
- icon: k[e.source ?? "manifest"]
127
+ icon: j(e.source ?? p.Manifest)
78
128
  } : null;
79
- }).filter((t) => t !== null), st = a.map((t) => ({
129
+ }).filter((t) => t !== null), Rt = d.map((t) => ({
130
+ id: t.id,
131
+ label: Ht(t),
132
+ icon: W[p.RestApi],
133
+ onConfigure: () => G(t)
134
+ })), _t = m.map((t) => ({
135
+ id: t.id,
136
+ label: $t(t),
137
+ icon: W[t.tool_key === "send_slack_message" ? p.Slack : p.EmailHandover],
138
+ onConfigure: () => P(t.tool_key, t)
139
+ })), Et = [
140
+ ...xt,
141
+ ...Rt,
142
+ ..._t
143
+ ], $ = Lt.filter(
144
+ (t) => {
145
+ const e = lt[t];
146
+ return !e || !!X?.[e];
147
+ }
148
+ ).map((t) => ({
149
+ source: t,
150
+ label: Dt[t],
151
+ icon: W[t],
152
+ onSelect: () => St(t)
153
+ })), nt = i?.kind === "config" && i.toolKey ? X?.[i.toolKey] : void 0, Ot = s.map((t) => ({
80
154
  label: t.display_name,
81
155
  value: t.tool_id,
82
- leadingIcon: U(k[t.source ?? "manifest"]) ?? void 0
83
- })), it = (() => {
156
+ leadingIcon: at(j(t.source ?? p.Manifest)) ?? void 0
157
+ })), kt = (() => {
84
158
  const t = [], e = /* @__PURE__ */ new Map();
85
- return a.forEach((n) => {
86
- const s = n.source ?? "manifest";
87
- e.has(s) || (e.set(s, []), t.push(s)), e.get(s)?.push({
88
- label: n.display_name,
89
- value: n.tool_id,
90
- leadingIcon: U(k[n.source ?? "manifest"]) ?? void 0
159
+ return s.forEach((o) => {
160
+ const l = o.source ?? p.Manifest;
161
+ e.has(l) || (e.set(l, []), t.push(l)), e.get(l)?.push({
162
+ label: o.display_name,
163
+ value: o.tool_id,
164
+ leadingIcon: at(j(o.source ?? p.Manifest)) ?? void 0
91
165
  });
92
- }), t.map((n) => ({
93
- source: n,
94
- label: Tt(n),
95
- options: e.get(n) ?? []
166
+ }), t.map((o) => ({
167
+ source: o,
168
+ label: Ft(o),
169
+ options: e.get(o) ?? []
96
170
  }));
97
- })(), at = async () => {
98
- if (!L || E)
171
+ })(), Mt = async () => {
172
+ if (!ot || J)
99
173
  return;
100
- const t = W({
101
- name: I.trim(),
102
- instructions: d,
103
- guardrail: m,
104
- tools: T
174
+ const t = f({
175
+ name: k.trim(),
176
+ instructions: T,
177
+ guardrail: b,
178
+ tools: M,
179
+ configTools: m,
180
+ restApiTools: d
105
181
  });
106
182
  if (t && typeof t.then == "function") {
107
- O(!0);
183
+ Q(!0);
108
184
  try {
109
185
  await t;
110
186
  } finally {
111
- O(!1);
187
+ Q(!1);
112
188
  }
113
189
  }
114
- }, F = async (t) => {
115
- if (!(!p || g)) {
116
- $(t);
190
+ }, st = async (t) => {
191
+ if (!(!u || S)) {
192
+ V(t);
117
193
  try {
118
- const n = await p(t, t === "instructions" ? d : m);
119
- t === "instructions" ? (h(n), A((s) => s + 1)) : (b(n), R((s) => s + 1));
194
+ const o = await u(t, t === "instructions" ? T : b);
195
+ t === "instructions" ? (x(o), N((l) => l + 1)) : (R(o), B((l) => l + 1));
120
196
  } finally {
121
- $(null);
197
+ V(null);
122
198
  }
123
199
  }
124
200
  };
125
- return /* @__PURE__ */ l(ct, { children: [
126
- /* @__PURE__ */ o(ft, { onClick: C, "data-test": "subagent-scrim" }),
127
- /* @__PURE__ */ l(ht, { "data-test": "create-subagent-panel", children: [
128
- /* @__PURE__ */ l(bt, { children: [
129
- /* @__PURE__ */ l(yt, { children: [
130
- /* @__PURE__ */ o(gt, { color: u.content.primary, children: D }),
131
- /* @__PURE__ */ o(pt, { color: u.content.secondary, children: "Each sub-agent handles one piece of the job. Use @ in the main instructions to call them." })
132
- ] }),
133
- /* @__PURE__ */ o(St, { onClick: C, "aria-label": "Close", children: /* @__PURE__ */ o(
134
- ut,
135
- {
136
- width: 20,
137
- height: 20,
138
- color: u.content.secondary
139
- }
140
- ) })
141
- ] }),
142
- /* @__PURE__ */ l(xt, { children: [
143
- /* @__PURE__ */ o(
144
- Rt,
145
- {
146
- "data-test": "subagent-name",
147
- labelText: "Agent name",
148
- labelTextBold: !0,
149
- placeholder: "Enter agent name",
150
- value: I,
151
- maxCharLimit: v.name,
152
- maxCharLimitPosition: "TOP",
153
- maxCharStyle: { fontSize: 12, lineHeight: "16px" },
154
- onChangeText: J
155
- }
156
- ),
157
- /* @__PURE__ */ o(
158
- j,
159
- {
160
- "data-test": "subagent-instructions",
161
- label: "Instructions",
162
- value: d,
163
- onChange: h,
164
- maxLength: v.instructions,
165
- placeholder: "Write the steps in plain English. Type @ to reference a tool.",
166
- minHeight: "160px",
167
- resetKey: `instr-${Q}`,
168
- mentionItems: _,
169
- tools: a,
170
- onMentionSelect: H,
171
- onFocus: Z,
172
- registerInsert: X,
173
- action: p ? /* @__PURE__ */ o(
174
- q,
175
- {
176
- type: "button",
177
- "data-test": "subagent-improve-instructions",
178
- disabled: g !== null,
179
- onClick: () => F("instructions"),
180
- children: g === "instructions" ? "Improving…" : "Improve with AI"
181
- }
182
- ) : void 0
183
- }
184
- ),
185
- /* @__PURE__ */ o(
186
- j,
187
- {
188
- "data-test": "subagent-guardrail",
189
- label: "Guardrails",
190
- value: m,
191
- onChange: b,
192
- maxLength: v.guardrail,
193
- placeholder: "e.g. Never discuss competitor pricing. Type @ to reference a tool.",
194
- minHeight: "160px",
195
- resetKey: `guard-${V}`,
196
- mentionItems: _,
197
- tools: a,
198
- onMentionSelect: H,
199
- onFocus: tt,
200
- registerInsert: Y,
201
- action: p ? /* @__PURE__ */ o(
202
- q,
203
- {
204
- type: "button",
205
- "data-test": "subagent-improve-guardrail",
206
- disabled: g !== null,
207
- onClick: () => F("guardrail"),
208
- children: g === "guardrail" ? "Improving…" : "Improve with AI"
209
- }
210
- ) : void 0
211
- }
212
- ),
213
- /* @__PURE__ */ o(
214
- At,
215
- {
216
- title: "Tools this agent can use",
217
- dataTestPrefix: "subagent-tools",
218
- items: rt,
219
- addableOptions: st,
220
- sourceGroups: it,
221
- mentionItems: _,
222
- emptyText: "No tools added yet.",
223
- onAdd: (t) => {
224
- et(t), y((e) => N(e, t));
225
- },
226
- onRemove: nt
227
- }
228
- )
229
- ] }),
230
- /* @__PURE__ */ l(Ct, { children: [
231
- /* @__PURE__ */ o(
232
- z,
201
+ return /* @__PURE__ */ rt(Kt, { children: [
202
+ /* @__PURE__ */ rt(
203
+ Jt,
204
+ {
205
+ header: Z,
206
+ closeOnEscapeKey: !1,
207
+ zIndex: te,
208
+ headerCustomComponent: /* @__PURE__ */ c(
209
+ Xt,
233
210
  {
234
- "data-test": "subagent-save",
235
- buttonType: "primary",
236
- size: "small",
237
- buttonText: "Save",
238
- disabled: !L,
239
- isLoading: E,
240
- onClick: at
211
+ title: Z,
212
+ subtitle: "Each sub-agent handles one piece of the job. Use @ in the main instructions to call them."
241
213
  }
242
214
  ),
243
- /* @__PURE__ */ o(
244
- z,
245
- {
246
- "data-test": "subagent-cancel",
247
- buttonType: "tertiaryGray",
248
- size: "small",
249
- buttonText: "Cancel",
250
- onClick: C
251
- }
252
- )
253
- ] })
254
- ] }),
255
- B && /* @__PURE__ */ o(
256
- _t,
215
+ width: "421px",
216
+ headerStyle: Yt,
217
+ bodyStyle: Wt,
218
+ onClose: A,
219
+ saveButtonProps: {
220
+ "data-test": "subagent-save",
221
+ buttonText: "Save",
222
+ buttonType: "primary",
223
+ size: "small",
224
+ disabled: !ot,
225
+ isLoading: J,
226
+ onClick: Mt
227
+ },
228
+ cancelButtonProps: {
229
+ "data-test": "subagent-cancel",
230
+ buttonText: "Cancel",
231
+ buttonType: "tertiaryGray",
232
+ size: "small",
233
+ onClick: A
234
+ },
235
+ children: [
236
+ /* @__PURE__ */ c(
237
+ Qt,
238
+ {
239
+ "data-test": "subagent-name",
240
+ labelText: "Agent name",
241
+ labelTextBold: !0,
242
+ placeholder: "Enter agent name",
243
+ value: k,
244
+ maxCharLimit: h.name,
245
+ maxCharLimitPosition: "TOP",
246
+ maxCharStyle: { fontSize: 12, lineHeight: "16px" },
247
+ onChangeText: pt
248
+ }
249
+ ),
250
+ /* @__PURE__ */ c(
251
+ ct,
252
+ {
253
+ "data-test": "subagent-instructions",
254
+ label: "Instructions",
255
+ value: T,
256
+ onChange: x,
257
+ maxLength: h.instructions,
258
+ placeholder: "Write the steps in plain English. Type @ to reference a tool.",
259
+ minHeight: "160px",
260
+ resetKey: `instr-${ft}`,
261
+ mentionItems: L,
262
+ tools: s,
263
+ toolActions: $,
264
+ onMentionSelect: tt,
265
+ onFocus: Tt,
266
+ registerInsert: yt,
267
+ action: u ? /* @__PURE__ */ c(
268
+ mt,
269
+ {
270
+ type: "button",
271
+ "data-test": "subagent-improve-instructions",
272
+ disabled: S !== null,
273
+ onClick: () => st("instructions"),
274
+ children: S === "instructions" ? "Improving…" : "Improve with AI"
275
+ }
276
+ ) : void 0
277
+ }
278
+ ),
279
+ /* @__PURE__ */ c(
280
+ ct,
281
+ {
282
+ "data-test": "subagent-guardrail",
283
+ label: "Guardrails",
284
+ value: b,
285
+ onChange: R,
286
+ maxLength: h.guardrail,
287
+ placeholder: "e.g. Never discuss competitor pricing. Type @ to reference a tool.",
288
+ minHeight: "160px",
289
+ resetKey: `guard-${gt}`,
290
+ mentionItems: L,
291
+ tools: s,
292
+ toolActions: $,
293
+ onMentionSelect: tt,
294
+ onFocus: bt,
295
+ registerInsert: ht,
296
+ action: u ? /* @__PURE__ */ c(
297
+ mt,
298
+ {
299
+ type: "button",
300
+ "data-test": "subagent-improve-guardrail",
301
+ disabled: S !== null,
302
+ onClick: () => st("guardrail"),
303
+ children: S === "guardrail" ? "Improving…" : "Improve with AI"
304
+ }
305
+ ) : void 0
306
+ }
307
+ ),
308
+ /* @__PURE__ */ c(
309
+ qt,
310
+ {
311
+ title: "Tools this agent can use",
312
+ dataTestPrefix: "subagent-tools",
313
+ items: Et,
314
+ addableOptions: Ot,
315
+ sourceGroups: kt,
316
+ mentionItems: L,
317
+ actionSources: $,
318
+ emptyText: "No tools added yet.",
319
+ onAdd: (t) => {
320
+ C(t), _((e) => it(e, t));
321
+ },
322
+ onRemove: vt
323
+ }
324
+ )
325
+ ]
326
+ }
327
+ ),
328
+ i?.kind === "restapi" && /* @__PURE__ */ c(
329
+ Zt,
330
+ {
331
+ initial: i.initialRest,
332
+ charLimits: h,
333
+ onImprove: Y,
334
+ onClose: () => y(null),
335
+ onSave: Ct,
336
+ zIndex: ut
337
+ },
338
+ i.key
339
+ ),
340
+ i?.kind === "config" && i.toolKey && nt && /* @__PURE__ */ c(
341
+ jt,
342
+ {
343
+ toolKey: i.toolKey,
344
+ template: nt,
345
+ initial: i.initialConfig,
346
+ charLimits: h,
347
+ onImprove: Y,
348
+ onClose: () => y(null),
349
+ onSave: It,
350
+ zIndex: ut
351
+ },
352
+ i.key
353
+ ),
354
+ U && /* @__PURE__ */ c(
355
+ Vt,
257
356
  {
258
- text: B.message,
357
+ text: U.message,
259
358
  type: "info",
260
359
  position: "top-right",
261
360
  autoClose: 5e3,
@@ -263,15 +362,15 @@ const q = mt.button`
263
362
  buttonProps: {
264
363
  buttonText: "Undo",
265
364
  showButton: !0,
266
- onButtonClick: () => (ot(), {})
365
+ onButtonClick: () => (At(), {})
267
366
  },
268
- onCloseToast: () => G(null)
367
+ onCloseToast: () => z(null)
269
368
  },
270
- B.id
369
+ U.id
271
370
  )
272
371
  ] });
273
372
  };
274
373
  export {
275
- zt as CreateSubAgentPanel
374
+ Te as CreateSubAgentPanel
276
375
  };
277
376
  //# sourceMappingURL=CreateSubAgentPanel.js.map