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