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