@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.
- package/dist/cjs/components/add-variableV2/AddDataPill.js +10 -0
- package/dist/cjs/components/add-variableV2/AddDataPill.js.map +1 -0
- 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/components/ConfigToolPanel.js +11 -11
- package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
- 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/MentionEditor.js +7 -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 +41 -14
- package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js +6 -5
- package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/ToolInstructionsField.js +2 -2
- package/dist/cjs/components/agent-builder/components/ToolInstructionsField.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/VariableInlineField.js +65 -0
- package/dist/cjs/components/agent-builder/components/VariableInlineField.js.map +1 -0
- package/dist/cjs/components/agent-builder/components/VariableTriggerArea.js +10 -0
- package/dist/cjs/components/agent-builder/components/VariableTriggerArea.js.map +1 -0
- package/dist/cjs/components/agent-builder/constants/tools.js +1 -1
- package/dist/cjs/components/agent-builder/constants/tools.js.map +1 -1
- 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 +4 -4
- package/dist/cjs/components/agent-builder/utils/mentionSerialization.js.map +1 -1
- package/dist/cjs/components/toaster/Toaster.js +1 -1
- package/dist/cjs/components/toaster/Toaster.js.map +1 -1
- package/dist/cjs/components/toaster/Toaster.styled.js +7 -7
- package/dist/cjs/components/toaster/Toaster.styled.js.map +1 -1
- package/dist/cjs/components/variable-picker-v3/Content.js +1 -1
- package/dist/cjs/components/variable-picker-v3/Content.js.map +1 -1
- package/dist/cjs/editor/BikEditor.js +1 -1
- package/dist/cjs/editor/BikEditor.js.map +1 -1
- package/dist/cjs/editor/BikEditor.styles.js +8 -0
- package/dist/cjs/editor/BikEditor.styles.js.map +1 -1
- package/dist/cjs/editor/BikEditor.types.js.map +1 -1
- package/dist/cjs/editor/extensions/mention/MentionDropdown.js +1 -1
- package/dist/cjs/editor/extensions/mention/MentionDropdown.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/add-variableV2/AddDataPill.d.ts +24 -0
- package/dist/esm/components/add-variableV2/AddDataPill.js +33 -0
- package/dist/esm/components/add-variableV2/AddDataPill.js.map +1 -0
- package/dist/esm/components/add-variableV2/index.d.ts +1 -0
- package/dist/esm/components/agent-builder/AgentBuilder.js +76 -74
- package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.model.d.ts +8 -0
- package/dist/esm/components/agent-builder/components/ConfigToolPanel.d.ts +8 -0
- package/dist/esm/components/agent-builder/components/ConfigToolPanel.js +182 -136
- package/dist/esm/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.d.ts +3 -0
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +195 -188
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionEditor.d.ts +12 -0
- package/dist/esm/components/agent-builder/components/MentionEditor.js +144 -103
- package/dist/esm/components/agent-builder/components/MentionEditor.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionField.js +48 -45
- package/dist/esm/components/agent-builder/components/MentionField.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionPicker.d.ts +14 -1
- package/dist/esm/components/agent-builder/components/MentionPicker.js +286 -218
- package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.d.ts +8 -0
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.js +192 -176
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/ToolInstructionsField.d.ts +9 -0
- package/dist/esm/components/agent-builder/components/ToolInstructionsField.js +67 -48
- package/dist/esm/components/agent-builder/components/ToolInstructionsField.js.map +1 -1
- package/dist/esm/components/agent-builder/components/VariableInlineField.d.ts +26 -0
- package/dist/esm/components/agent-builder/components/VariableInlineField.js +149 -0
- package/dist/esm/components/agent-builder/components/VariableInlineField.js.map +1 -0
- package/dist/esm/components/agent-builder/components/VariableTriggerArea.d.ts +46 -0
- package/dist/esm/components/agent-builder/components/VariableTriggerArea.js +118 -0
- package/dist/esm/components/agent-builder/components/VariableTriggerArea.js.map +1 -0
- package/dist/esm/components/agent-builder/constants/tools.d.ts +1 -1
- package/dist/esm/components/agent-builder/constants/tools.js +14 -13
- package/dist/esm/components/agent-builder/constants/tools.js.map +1 -1
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.d.ts +7 -0
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +99 -96
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +164 -160
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
- package/dist/esm/components/agent-builder/utils/mentionSerialization.d.ts +14 -4
- package/dist/esm/components/agent-builder/utils/mentionSerialization.js +54 -36
- package/dist/esm/components/agent-builder/utils/mentionSerialization.js.map +1 -1
- package/dist/esm/components/toaster/Toaster.js +30 -25
- package/dist/esm/components/toaster/Toaster.js.map +1 -1
- package/dist/esm/components/toaster/Toaster.styled.js +5 -5
- package/dist/esm/components/toaster/Toaster.styled.js.map +1 -1
- package/dist/esm/components/variable-picker-v3/Content.js +16 -15
- package/dist/esm/components/variable-picker-v3/Content.js.map +1 -1
- package/dist/esm/editor/BikEditor.js +40 -34
- package/dist/esm/editor/BikEditor.js.map +1 -1
- package/dist/esm/editor/BikEditor.styles.js +20 -12
- package/dist/esm/editor/BikEditor.styles.js.map +1 -1
- package/dist/esm/editor/BikEditor.types.d.ts +9 -0
- package/dist/esm/editor/BikEditor.types.js.map +1 -1
- package/dist/esm/editor/extensions/mention/MentionDropdown.js +28 -28
- package/dist/esm/editor/extensions/mention/MentionDropdown.js.map +1 -1
- package/dist/esm/editor/extensions/mention/MentionExtension.js +23 -19
- package/dist/esm/editor/extensions/mention/MentionExtension.js.map +1 -1
- package/dist/esm/icons/index.d.ts +25 -25
- package/dist/esm/index.js +543 -541
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as i, useRef as y, useMemo as
|
|
3
|
-
import
|
|
4
|
-
import { addUnique as
|
|
5
|
-
import { COLORS as
|
|
6
|
-
import { AGENT_CHAR_LIMITS as
|
|
7
|
-
import { CONFIG_TOOL_SOURCES as
|
|
8
|
-
import { buildAgentMentionItems as
|
|
9
|
-
import { sourceIcon as
|
|
10
|
-
import { buildToolActions as
|
|
11
|
-
import { ConfigToolPanel as
|
|
12
|
-
import { DRAWER_BODY_STYLE as
|
|
13
|
-
import { MentionEditor as
|
|
14
|
-
import { RestApiToolPanel as
|
|
15
|
-
import { SelectableListSection as
|
|
16
|
-
import { SideModal as
|
|
17
|
-
import { Input as
|
|
18
|
-
import { Toaster as
|
|
19
|
-
const
|
|
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
|
-
},
|
|
22
|
+
}, ye = ze.button`
|
|
23
23
|
align-self: flex-start;
|
|
24
|
-
border: 1px solid ${
|
|
25
|
-
color: ${
|
|
26
|
-
background: ${
|
|
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
|
-
`,
|
|
38
|
+
`, At = ({
|
|
39
39
|
onClose: x,
|
|
40
40
|
onSave: f,
|
|
41
41
|
availableTools: s,
|
|
42
42
|
onImprove: d,
|
|
43
|
-
onImproveToolInstructions:
|
|
44
|
-
configToolTemplates:
|
|
43
|
+
onImproveToolInstructions: Q,
|
|
44
|
+
configToolTemplates: V,
|
|
45
45
|
integrationStatus: A,
|
|
46
46
|
onConnectIntegration: R,
|
|
47
|
-
title:
|
|
47
|
+
title: ee = "Create sub-agent",
|
|
48
48
|
initial: g,
|
|
49
|
-
existingNames:
|
|
50
|
-
appLabel:
|
|
51
|
-
charLimits:
|
|
49
|
+
existingNames: Te = [],
|
|
50
|
+
appLabel: te = "Manifest",
|
|
51
|
+
charLimits: T = He,
|
|
52
|
+
variablesData: _
|
|
52
53
|
}) => {
|
|
53
|
-
const [
|
|
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,
|
|
56
|
+
), [m, B] = i(
|
|
56
57
|
g?.restApiTools ?? []
|
|
57
|
-
), [
|
|
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
|
-
|
|
60
|
-
|
|
60
|
+
...$e(s, [], te),
|
|
61
|
+
...Fe(p, m)
|
|
61
62
|
],
|
|
62
|
-
[s,
|
|
63
|
-
),
|
|
64
|
-
|
|
65
|
-
}, []),
|
|
66
|
-
|
|
67
|
-
}, []),
|
|
68
|
-
|
|
69
|
-
}, []),
|
|
70
|
-
|
|
71
|
-
}, []),
|
|
72
|
-
|
|
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
|
|
76
|
+
const ie = a(
|
|
76
77
|
(e, t) => {
|
|
77
|
-
e === "tool" && !
|
|
78
|
+
e === "tool" && !re.current.has(t) && E((o) => me(o, t));
|
|
78
79
|
},
|
|
79
80
|
[]
|
|
80
|
-
),
|
|
81
|
+
), S = a(
|
|
81
82
|
(e, t, o) => {
|
|
82
|
-
(
|
|
83
|
+
(O.current[z.current] ?? O.current.instructions)?.("tool", e, t, o);
|
|
83
84
|
},
|
|
84
85
|
[]
|
|
85
|
-
),
|
|
86
|
-
|
|
87
|
-
key:
|
|
86
|
+
), H = a((e) => {
|
|
87
|
+
M.current += 1, h({
|
|
88
|
+
key: M.current,
|
|
88
89
|
kind: "restapi",
|
|
89
90
|
initialRest: e
|
|
90
91
|
});
|
|
91
|
-
}, []),
|
|
92
|
+
}, []), U = a(
|
|
92
93
|
(e, t) => {
|
|
93
|
-
|
|
94
|
-
key:
|
|
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
|
-
),
|
|
102
|
+
), Re = a(
|
|
102
103
|
(e) => {
|
|
103
|
-
const t =
|
|
104
|
-
t ?
|
|
104
|
+
const t = Ue[e];
|
|
105
|
+
t ? U(t) : H();
|
|
105
106
|
},
|
|
106
|
-
[
|
|
107
|
-
),
|
|
107
|
+
[U, H]
|
|
108
|
+
), _e = a(
|
|
108
109
|
(e) => {
|
|
109
110
|
const t = !m.some((o) => o.id === e.id);
|
|
110
|
-
|
|
111
|
+
B((o) => he(o, e)), t && S(
|
|
111
112
|
e.id,
|
|
112
|
-
|
|
113
|
+
je(e).label,
|
|
113
114
|
u.RestApi
|
|
114
115
|
), h(null);
|
|
115
116
|
},
|
|
116
|
-
[m,
|
|
117
|
-
),
|
|
117
|
+
[m, S]
|
|
118
|
+
), we = a(
|
|
118
119
|
(e) => {
|
|
119
120
|
const t = !p.some((o) => o.id === e.id);
|
|
120
|
-
if (
|
|
121
|
+
if (D((o) => he(o, e)), t) {
|
|
121
122
|
const o = e.tool_key === "send_slack_message" ? u.Slack : u.EmailHandover;
|
|
122
|
-
|
|
123
|
+
S(e.id, We(e).label, o);
|
|
123
124
|
}
|
|
124
125
|
h(null);
|
|
125
126
|
},
|
|
126
|
-
[p,
|
|
127
|
-
), [
|
|
127
|
+
[p, S]
|
|
128
|
+
), [$, F] = i(
|
|
128
129
|
null
|
|
129
|
-
),
|
|
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
|
-
|
|
132
|
-
instructions:
|
|
132
|
+
j.current = {
|
|
133
|
+
instructions: b,
|
|
133
134
|
guardrail: C,
|
|
134
|
-
tools:
|
|
135
|
+
tools: N,
|
|
135
136
|
configTools: p,
|
|
136
137
|
restApiTools: m
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
const e =
|
|
140
|
-
e && (
|
|
141
|
-
},
|
|
142
|
-
(e) => e.trim().toLowerCase() ===
|
|
143
|
-
), ae =
|
|
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:
|
|
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),
|
|
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:
|
|
162
|
-
onConfigure: () => H(e
|
|
163
|
-
})),
|
|
164
|
-
|
|
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
|
-
|
|
168
|
-
|
|
169
|
-
|
|
166
|
+
...Oe,
|
|
167
|
+
...Ke
|
|
168
|
+
], Y = Ze(
|
|
169
|
+
V,
|
|
170
|
+
Re,
|
|
170
171
|
A,
|
|
171
172
|
R
|
|
172
|
-
),
|
|
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:
|
|
176
|
-
})),
|
|
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:
|
|
184
|
+
leadingIcon: fe(Z(o.source ?? u.Manifest)) ?? void 0
|
|
184
185
|
});
|
|
185
186
|
}), e.map((o) => ({
|
|
186
187
|
source: o,
|
|
187
|
-
label:
|
|
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 ||
|
|
196
|
+
if (!ae || oe)
|
|
196
197
|
return;
|
|
197
198
|
const e = f({
|
|
198
|
-
name:
|
|
199
|
-
instructions:
|
|
199
|
+
name: K.trim(),
|
|
200
|
+
instructions: b,
|
|
200
201
|
guardrail: C,
|
|
201
|
-
tools:
|
|
202
|
+
tools: N,
|
|
202
203
|
configTools: p,
|
|
203
204
|
restApiTools: m
|
|
204
205
|
});
|
|
205
206
|
if (e && typeof e.then == "function") {
|
|
206
|
-
|
|
207
|
+
ne(!0);
|
|
207
208
|
try {
|
|
208
209
|
await e;
|
|
209
210
|
} finally {
|
|
210
|
-
|
|
211
|
+
ne(!1);
|
|
211
212
|
}
|
|
212
213
|
}
|
|
213
|
-
},
|
|
214
|
-
if (!(!d ||
|
|
215
|
-
|
|
214
|
+
}, ue = async (e) => {
|
|
215
|
+
if (!(!d || I)) {
|
|
216
|
+
se(e);
|
|
216
217
|
try {
|
|
217
|
-
const o = await d(e, e === "instructions" ?
|
|
218
|
-
e === "instructions" ? (
|
|
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
|
-
|
|
221
|
+
se(null);
|
|
221
222
|
}
|
|
222
223
|
}
|
|
223
224
|
};
|
|
224
|
-
return /* @__PURE__ */
|
|
225
|
-
/* @__PURE__ */
|
|
226
|
-
|
|
225
|
+
return /* @__PURE__ */ de(Le, { children: [
|
|
226
|
+
/* @__PURE__ */ de(
|
|
227
|
+
nt,
|
|
227
228
|
{
|
|
228
|
-
header:
|
|
229
|
+
header: ee,
|
|
229
230
|
closeOnEscapeKey: !1,
|
|
230
|
-
zIndex:
|
|
231
|
+
zIndex: it,
|
|
231
232
|
headerCustomComponent: /* @__PURE__ */ c(
|
|
232
|
-
|
|
233
|
+
et,
|
|
233
234
|
{
|
|
234
|
-
title:
|
|
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:
|
|
240
|
-
bodyStyle:
|
|
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:
|
|
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
|
-
|
|
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:
|
|
267
|
-
maxCharLimit:
|
|
267
|
+
value: K,
|
|
268
|
+
maxCharLimit: T.name,
|
|
268
269
|
maxCharLimitPosition: "TOP",
|
|
269
270
|
maxCharStyle: { fontSize: 12, lineHeight: "16px" },
|
|
270
|
-
state:
|
|
271
|
-
errorMessage:
|
|
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
|
-
|
|
277
|
+
ge,
|
|
277
278
|
{
|
|
278
279
|
"data-test": "subagent-instructions",
|
|
279
280
|
label: "Instructions",
|
|
280
|
-
value:
|
|
281
|
-
onChange:
|
|
282
|
-
maxLength:
|
|
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-${
|
|
286
|
-
mentionItems:
|
|
286
|
+
resetKey: `instr-${Ce}`,
|
|
287
|
+
mentionItems: P,
|
|
287
288
|
tools: s,
|
|
288
|
-
toolActions:
|
|
289
|
+
toolActions: Y,
|
|
290
|
+
variablesData: _,
|
|
291
|
+
addDataButton: !0,
|
|
289
292
|
integrationStatus: A,
|
|
290
293
|
onConnectIntegration: R,
|
|
291
|
-
onMentionSelect:
|
|
292
|
-
onFocus:
|
|
293
|
-
registerInsert:
|
|
294
|
+
onMentionSelect: ie,
|
|
295
|
+
onFocus: xe,
|
|
296
|
+
registerInsert: Se,
|
|
294
297
|
action: d ? /* @__PURE__ */ c(
|
|
295
|
-
|
|
298
|
+
ye,
|
|
296
299
|
{
|
|
297
300
|
type: "button",
|
|
298
301
|
"data-test": "subagent-improve-instructions",
|
|
299
|
-
disabled:
|
|
300
|
-
onClick: () =>
|
|
301
|
-
children:
|
|
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
|
-
|
|
310
|
+
ge,
|
|
308
311
|
{
|
|
309
312
|
"data-test": "subagent-guardrail",
|
|
310
313
|
label: "Guardrails",
|
|
311
314
|
value: C,
|
|
312
|
-
onChange:
|
|
313
|
-
maxLength:
|
|
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-${
|
|
317
|
-
mentionItems:
|
|
319
|
+
resetKey: `guard-${Ie}`,
|
|
320
|
+
mentionItems: P,
|
|
318
321
|
tools: s,
|
|
319
|
-
toolActions:
|
|
322
|
+
toolActions: Y,
|
|
323
|
+
variablesData: _,
|
|
324
|
+
addDataButton: !0,
|
|
320
325
|
integrationStatus: A,
|
|
321
326
|
onConnectIntegration: R,
|
|
322
|
-
onMentionSelect:
|
|
323
|
-
onFocus:
|
|
324
|
-
registerInsert:
|
|
327
|
+
onMentionSelect: ie,
|
|
328
|
+
onFocus: Ae,
|
|
329
|
+
registerInsert: ve,
|
|
325
330
|
action: d ? /* @__PURE__ */ c(
|
|
326
|
-
|
|
331
|
+
ye,
|
|
327
332
|
{
|
|
328
333
|
type: "button",
|
|
329
334
|
"data-test": "subagent-improve-guardrail",
|
|
330
|
-
disabled:
|
|
331
|
-
onClick: () =>
|
|
332
|
-
children:
|
|
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
|
-
|
|
343
|
+
ot,
|
|
339
344
|
{
|
|
340
345
|
title: "Tools this agent can use",
|
|
341
346
|
dataTestPrefix: "subagent-tools",
|
|
342
|
-
items:
|
|
343
|
-
addableOptions:
|
|
344
|
-
sourceGroups:
|
|
345
|
-
mentionItems:
|
|
346
|
-
actionSources:
|
|
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
|
-
|
|
355
|
+
S(e), E((t) => me(t, e));
|
|
351
356
|
},
|
|
352
|
-
onRemove:
|
|
353
|
-
confirmDelete: { noun: "tool", zIndex:
|
|
357
|
+
onRemove: ke,
|
|
358
|
+
confirmDelete: { noun: "tool", zIndex: J + 1 }
|
|
354
359
|
}
|
|
355
360
|
)
|
|
356
361
|
]
|
|
357
362
|
}
|
|
358
363
|
),
|
|
359
|
-
|
|
360
|
-
|
|
364
|
+
l?.kind === "restapi" && /* @__PURE__ */ c(
|
|
365
|
+
tt,
|
|
361
366
|
{
|
|
362
|
-
initial:
|
|
363
|
-
charLimits:
|
|
364
|
-
|
|
367
|
+
initial: l.initialRest,
|
|
368
|
+
charLimits: T,
|
|
369
|
+
variablesData: _,
|
|
370
|
+
onImprove: Q,
|
|
365
371
|
onClose: () => h(null),
|
|
366
|
-
onSave:
|
|
367
|
-
zIndex:
|
|
372
|
+
onSave: _e,
|
|
373
|
+
zIndex: J
|
|
368
374
|
},
|
|
369
|
-
|
|
375
|
+
l.key
|
|
370
376
|
),
|
|
371
|
-
|
|
372
|
-
|
|
377
|
+
l?.kind === "config" && l.toolKey && ce && /* @__PURE__ */ c(
|
|
378
|
+
Je,
|
|
373
379
|
{
|
|
374
|
-
toolKey:
|
|
375
|
-
template:
|
|
376
|
-
initial:
|
|
377
|
-
charLimits:
|
|
378
|
-
|
|
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:
|
|
381
|
-
zIndex:
|
|
387
|
+
onSave: we,
|
|
388
|
+
zIndex: J
|
|
382
389
|
},
|
|
383
|
-
|
|
390
|
+
l.key
|
|
384
391
|
),
|
|
385
|
-
|
|
386
|
-
|
|
392
|
+
$ && /* @__PURE__ */ c(
|
|
393
|
+
rt,
|
|
387
394
|
{
|
|
388
|
-
text:
|
|
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: () => (
|
|
403
|
+
onButtonClick: () => (Ee(), {})
|
|
397
404
|
},
|
|
398
|
-
onCloseToast: () =>
|
|
405
|
+
onCloseToast: () => F(null)
|
|
399
406
|
},
|
|
400
|
-
|
|
407
|
+
$.id
|
|
401
408
|
)
|
|
402
409
|
] });
|
|
403
410
|
};
|
|
404
411
|
export {
|
|
405
|
-
|
|
412
|
+
At as CreateSubAgentPanel
|
|
406
413
|
};
|
|
407
414
|
//# sourceMappingURL=CreateSubAgentPanel.js.map
|