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