@bikdotai/bik-component-library 0.0.830 → 0.0.831-beta.1
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.
- package/dist/cjs/components/agent-builder/AgentBuilder.js +1 -1
- package/dist/cjs/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/cjs/components/agent-builder/AgentBuilder.styled.js +17 -65
- package/dist/cjs/components/agent-builder/AgentBuilder.styled.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js +41 -0
- package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js.map +1 -0
- package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js +5 -5
- package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/DrawerHeaderText.js +15 -0
- package/dist/cjs/components/agent-builder/components/DrawerHeaderText.js.map +1 -0
- package/dist/cjs/components/agent-builder/components/MentionEditor.js +1 -1
- package/dist/cjs/components/agent-builder/components/MentionEditor.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionField.js +1 -1
- package/dist/cjs/components/agent-builder/components/MentionField.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionPicker.js +20 -20
- package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js +23 -0
- package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js.map +1 -0
- package/dist/cjs/components/agent-builder/components/SelectableListSection.js +5 -5
- package/dist/cjs/components/agent-builder/components/SelectableListSection.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/ToolInstructionsField.js +5 -0
- package/dist/cjs/components/agent-builder/components/ToolInstructionsField.js.map +1 -0
- package/dist/cjs/components/agent-builder/constants/tools.js +2 -0
- package/dist/cjs/components/agent-builder/constants/tools.js.map +1 -0
- package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js +1 -1
- package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
- package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js +1 -1
- package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
- package/dist/cjs/components/agent-builder/utils/mentionSerialization.js +3 -3
- package/dist/cjs/components/agent-builder/utils/mentionSerialization.js.map +1 -1
- package/dist/cjs/components/agent-builder/utils/sourceIcons.js +1 -1
- package/dist/cjs/components/agent-builder/utils/sourceIcons.js.map +1 -1
- package/dist/cjs/components/side-modal/SideModal.style.js +11 -10
- package/dist/cjs/components/side-modal/SideModal.style.js.map +1 -1
- package/dist/cjs/editor/extensions/mention/MentionExtension.js +1 -1
- package/dist/cjs/editor/extensions/mention/MentionExtension.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.js +100 -96
- package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.model.d.ts +144 -1
- package/dist/esm/components/agent-builder/AgentBuilder.styled.d.ts +0 -21
- package/dist/esm/components/agent-builder/AgentBuilder.styled.js +42 -111
- package/dist/esm/components/agent-builder/AgentBuilder.styled.js.map +1 -1
- package/dist/esm/components/agent-builder/components/ConfigToolPanel.d.ts +33 -0
- package/dist/esm/components/agent-builder/components/ConfigToolPanel.js +251 -0
- package/dist/esm/components/agent-builder/components/ConfigToolPanel.js.map +1 -0
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.d.ts +9 -1
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +318 -219
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/DrawerHeaderText.d.ts +33 -0
- package/dist/esm/components/agent-builder/components/DrawerHeaderText.js +42 -0
- package/dist/esm/components/agent-builder/components/DrawerHeaderText.js.map +1 -0
- package/dist/esm/components/agent-builder/components/MentionEditor.d.ts +6 -0
- package/dist/esm/components/agent-builder/components/MentionEditor.js +38 -30
- package/dist/esm/components/agent-builder/components/MentionEditor.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionField.js +76 -51
- package/dist/esm/components/agent-builder/components/MentionField.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionPicker.d.ts +7 -0
- package/dist/esm/components/agent-builder/components/MentionPicker.js +162 -145
- package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.d.ts +27 -0
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.js +270 -0
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.js.map +1 -0
- package/dist/esm/components/agent-builder/components/SelectableListSection.d.ts +14 -0
- package/dist/esm/components/agent-builder/components/SelectableListSection.js +166 -140
- package/dist/esm/components/agent-builder/components/SelectableListSection.js.map +1 -1
- package/dist/esm/components/agent-builder/components/ToolInstructionsField.d.ts +19 -0
- package/dist/esm/components/agent-builder/components/ToolInstructionsField.js +66 -0
- package/dist/esm/components/agent-builder/components/ToolInstructionsField.js.map +1 -0
- package/dist/esm/components/agent-builder/constants/tools.d.ts +77 -0
- package/dist/esm/components/agent-builder/constants/tools.js +34 -0
- package/dist/esm/components/agent-builder/constants/tools.js.map +1 -0
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.d.ts +19 -1
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +169 -140
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
- package/dist/esm/components/agent-builder/index.d.ts +2 -1
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +241 -141
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
- package/dist/esm/components/agent-builder/utils/mentionSerialization.d.ts +18 -3
- package/dist/esm/components/agent-builder/utils/mentionSerialization.js +81 -62
- package/dist/esm/components/agent-builder/utils/mentionSerialization.js.map +1 -1
- package/dist/esm/components/agent-builder/utils/sourceIcons.d.ts +15 -9
- package/dist/esm/components/agent-builder/utils/sourceIcons.js +16 -8
- package/dist/esm/components/agent-builder/utils/sourceIcons.js.map +1 -1
- package/dist/esm/components/side-modal/SideModal.style.js +1 -0
- package/dist/esm/components/side-modal/SideModal.style.js.map +1 -1
- package/dist/esm/editor/extensions/mention/MentionExtension.js +60 -57
- package/dist/esm/editor/extensions/mention/MentionExtension.js.map +1 -1
- package/dist/esm/index.js +97 -95
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { MentionEditor as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
1
|
+
import { jsxs as rt, Fragment as Kt, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useState as r, useRef as A, useMemo as Lt, 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 wt } from "../constants/charLimits.js";
|
|
7
|
+
import { CONFIG_TOOL_SOURCES as lt, ToolSource as p, TOOL_ACTION_SOURCES as Bt, TOOL_ACTION_LABELS as Dt, TOOL_SOURCE_LABELS as Gt } from "../constants/tools.js";
|
|
8
|
+
import { buildAgentMentionItems as Pt, buildCustomToolMentionItems as Ut, restApiMentionItem as zt, configToolMentionItem as Ht, restApiToolName as $t, configToolName as Ft, toolSourceLabel as jt } from "../utils/mentionSerialization.js";
|
|
9
|
+
import { sourceIcon as j, SOURCE_ICONS as W, renderSourceIcon as at } from "../utils/sourceIcons.js";
|
|
10
|
+
import { ConfigToolPanel as Wt } from "./ConfigToolPanel.js";
|
|
11
|
+
import { DRAWER_BODY_STYLE as Yt, DRAWER_HEADER_STYLE as Xt, DrawerHeaderText as Zt } from "./DrawerHeaderText.js";
|
|
12
|
+
import { MentionEditor as ct } from "./MentionEditor.js";
|
|
13
|
+
import { RestApiToolPanel as qt } from "./RestApiToolPanel.js";
|
|
14
|
+
import { SelectableListSection as Jt } from "./SelectableListSection.js";
|
|
15
|
+
import { SideModal as Qt } from "../../side-modal/SideModal.js";
|
|
16
|
+
import { Input as Vt } from "../../input/Input.js";
|
|
17
|
+
import { Toaster as te } from "../../toaster/Toaster.js";
|
|
18
|
+
const ee = 1e3, ut = 1002, dt = (v, f) => {
|
|
19
|
+
const s = v ?? [];
|
|
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 ${
|
|
20
|
-
color: ${
|
|
21
|
-
background: ${
|
|
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
|
-
`,
|
|
34
|
-
onClose:
|
|
35
|
-
onSave:
|
|
36
|
-
availableTools:
|
|
37
|
-
onImprove:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
`, be = ({
|
|
38
|
+
onClose: v,
|
|
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 = wt
|
|
42
48
|
}) => {
|
|
43
|
-
const [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
const [k, pt] = r(g?.name ?? ""), [T, x] = r(g?.instructions ?? ""), [b, _] = r(g?.guardrail ?? ""), [M, R] = r(g?.tools ?? []), [m, K] = r(
|
|
50
|
+
g?.configTools ?? []
|
|
51
|
+
), [d, L] = r(
|
|
52
|
+
g?.restApiTools ?? []
|
|
53
|
+
), [i, y] = r(null), O = A(0), [J, Q] = r(!1), [ft, N] = r(0), [gt, w] = r(0), [S, V] = r(null), B = Lt(
|
|
54
|
+
() => [
|
|
55
|
+
...Pt(s, [], q),
|
|
56
|
+
...Ut(m, d)
|
|
57
|
+
],
|
|
58
|
+
[s, q, m, d]
|
|
59
|
+
), E = A({}), D = A("instructions"), yt = a((t) => {
|
|
60
|
+
E.current.instructions = t ?? void 0;
|
|
61
|
+
}, []), ht = a((t) => {
|
|
62
|
+
E.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" &&
|
|
69
|
+
t === "tool" && R((o) => it(o, e));
|
|
57
70
|
},
|
|
58
71
|
[]
|
|
59
|
-
),
|
|
60
|
-
(
|
|
61
|
-
}, []),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
id: K.current,
|
|
67
|
-
message: `Tool "${e?.display_name ?? "Tool"}" removed`
|
|
72
|
+
), C = a((t, e) => {
|
|
73
|
+
(E.current[D.current] ?? E.current.instructions)?.("tool", t, e);
|
|
74
|
+
}, []), G = a((t) => {
|
|
75
|
+
O.current += 1, y({
|
|
76
|
+
key: O.current,
|
|
77
|
+
kind: "restapi",
|
|
78
|
+
initialRest: t
|
|
68
79
|
});
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
80
|
+
}, []), P = a(
|
|
81
|
+
(t, e) => {
|
|
82
|
+
O.current += 1, y({
|
|
83
|
+
key: O.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
|
+
L((o) => dt(o, t)), e && C(t.id, zt(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, Ht(t).label), y(null);
|
|
106
|
+
},
|
|
107
|
+
[m, C]
|
|
108
|
+
), [U, z] = r(
|
|
109
|
+
null
|
|
110
|
+
), H = A(null), et = A(0), At = (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)), _((n) => l(n)), R((n) => n.filter((I) => I !== t)), K((n) => n.filter((I) => I.id !== t)), L((n) => n.filter((I) => I.id !== t)), N((n) => n + 1), w((n) => n + 1), et.current += 1, z({ id: et.current, message: `Tool "${e}" removed` });
|
|
119
|
+
}, vt = () => {
|
|
120
|
+
const t = H.current;
|
|
121
|
+
t && (x(t.instructions), _(t.guardrail), R(t.tools), K(t.configTools), L(t.restApiTools), N((e) => e + 1), w((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:
|
|
127
|
+
icon: j(e.source ?? p.Manifest)
|
|
78
128
|
} : null;
|
|
79
|
-
}).filter((t) => t !== null),
|
|
129
|
+
}).filter((t) => t !== null), _t = d.map((t) => ({
|
|
130
|
+
id: t.id,
|
|
131
|
+
label: $t(t),
|
|
132
|
+
icon: W[p.RestApi],
|
|
133
|
+
onConfigure: () => G(t)
|
|
134
|
+
})), Rt = m.map((t) => ({
|
|
135
|
+
id: t.id,
|
|
136
|
+
label: Ft(t),
|
|
137
|
+
icon: W[t.tool_key === "send_slack_message" ? p.Slack : p.EmailHandover],
|
|
138
|
+
onConfigure: () => P(t.tool_key, t)
|
|
139
|
+
})), Ot = [
|
|
140
|
+
...xt,
|
|
141
|
+
..._t,
|
|
142
|
+
...Rt
|
|
143
|
+
], $ = Bt.filter(
|
|
144
|
+
(t) => {
|
|
145
|
+
const e = lt[t];
|
|
146
|
+
return !e || !!X?.[e];
|
|
147
|
+
}
|
|
148
|
+
).map((t) => ({
|
|
149
|
+
source: t,
|
|
150
|
+
label: Dt[t] ?? Gt[t],
|
|
151
|
+
icon: W[t],
|
|
152
|
+
onSelect: () => St(t)
|
|
153
|
+
})), nt = i?.kind === "config" && i.toolKey ? X?.[i.toolKey] : void 0, Et = s.map((t) => ({
|
|
80
154
|
label: t.display_name,
|
|
81
155
|
value: t.tool_id,
|
|
82
|
-
leadingIcon:
|
|
83
|
-
})),
|
|
156
|
+
leadingIcon: at(j(t.source ?? p.Manifest)) ?? void 0
|
|
157
|
+
})), kt = (() => {
|
|
84
158
|
const t = [], e = /* @__PURE__ */ new Map();
|
|
85
|
-
return
|
|
86
|
-
const
|
|
87
|
-
e.has(
|
|
88
|
-
label:
|
|
89
|
-
value:
|
|
90
|
-
leadingIcon:
|
|
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((
|
|
93
|
-
source:
|
|
94
|
-
label:
|
|
95
|
-
options: e.get(
|
|
166
|
+
}), t.map((o) => ({
|
|
167
|
+
source: o,
|
|
168
|
+
label: jt(o),
|
|
169
|
+
options: e.get(o) ?? []
|
|
96
170
|
}));
|
|
97
|
-
})(),
|
|
98
|
-
if (!
|
|
171
|
+
})(), Mt = async () => {
|
|
172
|
+
if (!ot || J)
|
|
99
173
|
return;
|
|
100
|
-
const t =
|
|
101
|
-
name:
|
|
102
|
-
instructions:
|
|
103
|
-
guardrail:
|
|
104
|
-
tools:
|
|
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
|
-
|
|
183
|
+
Q(!0);
|
|
108
184
|
try {
|
|
109
185
|
await t;
|
|
110
186
|
} finally {
|
|
111
|
-
|
|
187
|
+
Q(!1);
|
|
112
188
|
}
|
|
113
189
|
}
|
|
114
|
-
},
|
|
115
|
-
if (!(!
|
|
116
|
-
|
|
190
|
+
}, st = async (t) => {
|
|
191
|
+
if (!(!u || S)) {
|
|
192
|
+
V(t);
|
|
117
193
|
try {
|
|
118
|
-
const
|
|
119
|
-
t === "instructions" ? (
|
|
194
|
+
const o = await u(t, t === "instructions" ? T : b);
|
|
195
|
+
t === "instructions" ? (x(o), N((l) => l + 1)) : (_(o), w((l) => l + 1));
|
|
120
196
|
} finally {
|
|
121
|
-
|
|
197
|
+
V(null);
|
|
122
198
|
}
|
|
123
199
|
}
|
|
124
200
|
};
|
|
125
|
-
return /* @__PURE__ */
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
+
Qt,
|
|
204
|
+
{
|
|
205
|
+
header: Z,
|
|
206
|
+
closeOnEscapeKey: !1,
|
|
207
|
+
zIndex: ee,
|
|
208
|
+
headerCustomComponent: /* @__PURE__ */ c(
|
|
209
|
+
Zt,
|
|
233
210
|
{
|
|
234
|
-
|
|
235
|
-
|
|
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
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
215
|
+
width: "421px",
|
|
216
|
+
headerStyle: Xt,
|
|
217
|
+
bodyStyle: Yt,
|
|
218
|
+
onClose: v,
|
|
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: v
|
|
234
|
+
},
|
|
235
|
+
children: [
|
|
236
|
+
/* @__PURE__ */ c(
|
|
237
|
+
Vt,
|
|
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: B,
|
|
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: _,
|
|
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: B,
|
|
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
|
+
Jt,
|
|
310
|
+
{
|
|
311
|
+
title: "Tools this agent can use",
|
|
312
|
+
dataTestPrefix: "subagent-tools",
|
|
313
|
+
items: Ot,
|
|
314
|
+
addableOptions: Et,
|
|
315
|
+
sourceGroups: kt,
|
|
316
|
+
mentionItems: B,
|
|
317
|
+
actionSources: $,
|
|
318
|
+
emptyText: "No tools added yet.",
|
|
319
|
+
onAdd: (t) => {
|
|
320
|
+
C(t), R((e) => it(e, t));
|
|
321
|
+
},
|
|
322
|
+
onRemove: At
|
|
323
|
+
}
|
|
324
|
+
)
|
|
325
|
+
]
|
|
326
|
+
}
|
|
327
|
+
),
|
|
328
|
+
i?.kind === "restapi" && /* @__PURE__ */ c(
|
|
329
|
+
qt,
|
|
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
|
+
Wt,
|
|
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
|
+
te,
|
|
257
356
|
{
|
|
258
|
-
text:
|
|
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: () => (
|
|
365
|
+
onButtonClick: () => (vt(), {})
|
|
267
366
|
},
|
|
268
|
-
onCloseToast: () =>
|
|
367
|
+
onCloseToast: () => z(null)
|
|
269
368
|
},
|
|
270
|
-
|
|
369
|
+
U.id
|
|
271
370
|
)
|
|
272
371
|
] });
|
|
273
372
|
};
|
|
274
373
|
export {
|
|
275
|
-
|
|
374
|
+
be as CreateSubAgentPanel
|
|
276
375
|
};
|
|
277
376
|
//# sourceMappingURL=CreateSubAgentPanel.js.map
|