@bikdotai/bik-component-library 0.0.821-beta.12 → 0.0.821-beta.13
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/assets/icons/Shopify.svg.js +2 -0
- package/dist/cjs/assets/icons/Shopify.svg.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/AgentBuilder.styled.js +57 -23
- package/dist/cjs/components/agent-builder/AgentBuilder.styled.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js +1 -1
- package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/GoLiveModal.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionEditor.js +1 -1
- package/dist/cjs/components/agent-builder/components/MentionEditor.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionField.js +1 -1
- package/dist/cjs/components/agent-builder/components/MentionField.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionPicker.js +37 -6
- package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/SelectableListSection.js +1 -1
- package/dist/cjs/components/agent-builder/components/SelectableListSection.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/sourceIcons.js +2 -0
- package/dist/cjs/components/agent-builder/utils/sourceIcons.js.map +1 -0
- 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/esm/assets/icons/Shopify.svg.js +6 -0
- package/dist/esm/assets/icons/Shopify.svg.js.map +1 -0
- package/dist/esm/components/agent-builder/AgentBuilder.js +47 -47
- package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.styled.d.ts +6 -0
- package/dist/esm/components/agent-builder/AgentBuilder.styled.js +82 -42
- package/dist/esm/components/agent-builder/AgentBuilder.styled.js.map +1 -1
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +83 -75
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/GoLiveModal.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionEditor.d.ts +6 -0
- package/dist/esm/components/agent-builder/components/MentionEditor.js +31 -30
- package/dist/esm/components/agent-builder/components/MentionEditor.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionField.js +40 -37
- package/dist/esm/components/agent-builder/components/MentionField.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionPicker.d.ts +6 -1
- package/dist/esm/components/agent-builder/components/MentionPicker.js +202 -101
- package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/esm/components/agent-builder/components/SelectableListSection.d.ts +18 -2
- package/dist/esm/components/agent-builder/components/SelectableListSection.js +159 -91
- package/dist/esm/components/agent-builder/components/SelectableListSection.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 +108 -100
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +132 -107
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
- package/dist/esm/components/agent-builder/utils/sourceIcons.d.ts +10 -0
- package/dist/esm/components/agent-builder/utils/sourceIcons.js +10 -0
- package/dist/esm/components/agent-builder/utils/sourceIcons.js.map +1 -0
- package/dist/esm/editor/BikEditor.types.d.ts +7 -0
- package/dist/esm/editor/BikEditor.types.js.map +1 -1
- package/dist/esm/editor/extensions/mention/MentionDropdown.d.ts +2 -0
- package/dist/esm/editor/extensions/mention/MentionDropdown.js +21 -20
- package/dist/esm/editor/extensions/mention/MentionDropdown.js.map +1 -1
- package/dist/esm/editor/extensions/mention/MentionExtension.js +66 -55
- package/dist/esm/editor/extensions/mention/MentionExtension.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,29 +1,91 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { useState as
|
|
6
|
-
import { TitleSmall as
|
|
1
|
+
import { jsx as o, jsxs as c, Fragment as g } from "react/jsx-runtime";
|
|
2
|
+
import U from "../../../assets/icons/delete.svg.js";
|
|
3
|
+
import W from "../../../assets/icons/edit.svg.js";
|
|
4
|
+
import A from "../../../assets/icons/plus.svg.js";
|
|
5
|
+
import v, { useState as C } from "react";
|
|
6
|
+
import { TitleSmall as K, BodyCaption as R, BodySecondary as _ } from "../../TypographyStyle.js";
|
|
7
7
|
import { COLORS as l } from "../../../constants/Theme.js";
|
|
8
|
-
import { SideSection as
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
import { SideSection as M, SideSectionHeader as V, AddIconButton as q, SourceButtonRow as J, SourceButton as Q, SelectableRow as X, RowText as Y, RowActions as Z, RowMenuButton as B, RowActionDivider as G } from "../AgentBuilder.styled.js";
|
|
9
|
+
import { SOURCE_ICONS as x } from "../utils/sourceIcons.js";
|
|
10
|
+
import { Dropdown as E } from "../../dropdown/Dropdown.js";
|
|
11
|
+
import { Button as T } from "../../button/Button.js";
|
|
12
|
+
const k = "__bik_create_new__", ae = ({
|
|
13
|
+
title: S,
|
|
14
|
+
helper: y,
|
|
15
|
+
items: r,
|
|
16
|
+
addableOptions: a,
|
|
17
|
+
onAdd: $,
|
|
18
|
+
onRemove: I,
|
|
17
19
|
dataTestPrefix: t,
|
|
18
|
-
emptyText:
|
|
20
|
+
emptyText: L,
|
|
19
21
|
createOption: n,
|
|
20
|
-
onConfigure:
|
|
22
|
+
onConfigure: w,
|
|
23
|
+
sourceGroups: h
|
|
21
24
|
}) => {
|
|
22
|
-
const [
|
|
23
|
-
|
|
25
|
+
const [f, s] = C(!1), [z, m] = C(null), u = !!h && h.length > 0, b = h?.find((e) => e.source === z), D = u ? r.length > 0 : a.length > 0 || !!n && r.length > 0, H = r.length === 0 && !!n && !u, j = u && r.length === 0, F = () => {
|
|
26
|
+
if (u) {
|
|
27
|
+
m(null), s((e) => !e);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (a.length === 0 && n) {
|
|
31
|
+
n.onSelect();
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
s((e) => !e);
|
|
35
|
+
}, N = () => r.map((e) => /* @__PURE__ */ c(
|
|
36
|
+
X,
|
|
37
|
+
{
|
|
38
|
+
"data-test": `${t}-row-${e.id}`,
|
|
39
|
+
children: [
|
|
40
|
+
e.icon && v.createElement(e.icon.Icon, {
|
|
41
|
+
width: e.icon.w,
|
|
42
|
+
height: e.icon.h
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ o(Y, { children: /* @__PURE__ */ o(_, { numberOfLines: 1, color: l.content.primary, children: e.label }) }),
|
|
45
|
+
/* @__PURE__ */ c(Z, { children: [
|
|
46
|
+
w && // Configurable rows (sub-agents) get an always-visible edit icon.
|
|
47
|
+
/* @__PURE__ */ o(
|
|
48
|
+
B,
|
|
49
|
+
{
|
|
50
|
+
"data-test": `${t}-edit-${e.id}`,
|
|
51
|
+
"aria-label": `Edit ${e.label}`,
|
|
52
|
+
onClick: () => w(e.id),
|
|
53
|
+
children: /* @__PURE__ */ o(
|
|
54
|
+
W,
|
|
55
|
+
{
|
|
56
|
+
width: 16,
|
|
57
|
+
height: 16,
|
|
58
|
+
color: l.content.secondary
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
w && /* @__PURE__ */ o(G, { "aria-hidden": !0 }),
|
|
64
|
+
/* @__PURE__ */ o(
|
|
65
|
+
B,
|
|
66
|
+
{
|
|
67
|
+
"data-test": `${t}-delete-${e.id}`,
|
|
68
|
+
"aria-label": `Delete ${e.label}`,
|
|
69
|
+
onClick: () => I(e.id),
|
|
70
|
+
children: /* @__PURE__ */ o(
|
|
71
|
+
U,
|
|
72
|
+
{
|
|
73
|
+
width: 16,
|
|
74
|
+
height: 16,
|
|
75
|
+
color: l.content.secondary
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
] })
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
e.id
|
|
84
|
+
)), p = n ? [
|
|
85
|
+
...a,
|
|
24
86
|
{
|
|
25
87
|
label: n.label,
|
|
26
|
-
value:
|
|
88
|
+
value: k,
|
|
27
89
|
searchKey: n.label,
|
|
28
90
|
customComponent: /* @__PURE__ */ o(
|
|
29
91
|
"div",
|
|
@@ -40,85 +102,91 @@ const y = "__bik_create_new__", J = ({
|
|
|
40
102
|
}
|
|
41
103
|
)
|
|
42
104
|
}
|
|
43
|
-
] :
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */ o(
|
|
47
|
-
|
|
48
|
-
|
|
105
|
+
] : a;
|
|
106
|
+
return /* @__PURE__ */ c(M, { children: [
|
|
107
|
+
/* @__PURE__ */ c(V, { children: [
|
|
108
|
+
/* @__PURE__ */ o(K, { color: l.content.primary, children: S }),
|
|
109
|
+
D && /* @__PURE__ */ o(
|
|
110
|
+
q,
|
|
49
111
|
{
|
|
50
112
|
"data-test": `${t}-add`,
|
|
51
|
-
onClick:
|
|
52
|
-
"aria-label": `Add ${
|
|
53
|
-
children: /* @__PURE__ */ o(
|
|
113
|
+
onClick: F,
|
|
114
|
+
"aria-label": `Add ${S}`,
|
|
115
|
+
children: /* @__PURE__ */ o(A, { width: 20, height: 20, color: l.content.brand })
|
|
54
116
|
}
|
|
55
117
|
)
|
|
56
118
|
] }),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
119
|
+
y && /* @__PURE__ */ o(R, { color: l.content.secondary, children: y }),
|
|
120
|
+
j ? /* @__PURE__ */ c(g, { children: [
|
|
121
|
+
/* @__PURE__ */ o(J, { "data-test": `${t}-sources`, children: h?.map((e) => {
|
|
122
|
+
const d = x[e.source];
|
|
123
|
+
return /* @__PURE__ */ c(
|
|
124
|
+
Q,
|
|
125
|
+
{
|
|
126
|
+
type: "button",
|
|
127
|
+
"data-test": `${t}-source-${e.source}`,
|
|
128
|
+
onClick: () => m(e.source),
|
|
129
|
+
children: [
|
|
130
|
+
d && v.createElement(d.Icon, {
|
|
131
|
+
width: d.w - 4,
|
|
132
|
+
height: d.h - 4
|
|
133
|
+
}),
|
|
134
|
+
/* @__PURE__ */ o(_, { color: l.content.primary, children: e.label })
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
e.source
|
|
138
|
+
);
|
|
139
|
+
}) }),
|
|
140
|
+
b && /* @__PURE__ */ o(
|
|
141
|
+
E,
|
|
142
|
+
{
|
|
143
|
+
"data-test": `${t}-dropdown`,
|
|
144
|
+
size: "small",
|
|
145
|
+
width: "100%",
|
|
146
|
+
isSearchable: !0,
|
|
147
|
+
placeHolder: `Search ${b.label} tools`,
|
|
148
|
+
options: b.options,
|
|
149
|
+
onSelect: (e) => {
|
|
150
|
+
const i = (Array.isArray(e) ? e[0] : e)?.value;
|
|
151
|
+
m(null), s(!1), i && $(i);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
] }) : /* @__PURE__ */ c(g, { children: [
|
|
156
|
+
f && p.length > 0 && /* @__PURE__ */ o(
|
|
157
|
+
E,
|
|
158
|
+
{
|
|
159
|
+
"data-test": `${t}-dropdown`,
|
|
160
|
+
size: "small",
|
|
161
|
+
width: "100%",
|
|
162
|
+
isSearchable: !0,
|
|
163
|
+
placeHolder: `Select ${S.toLowerCase()}`,
|
|
164
|
+
options: p,
|
|
165
|
+
onSelect: (e) => {
|
|
166
|
+
const i = (Array.isArray(e) ? e[0] : e)?.value;
|
|
167
|
+
s(!1), i && (i === k ? n?.onSelect() : $(i));
|
|
168
|
+
}
|
|
70
169
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
v,
|
|
89
|
-
{
|
|
90
|
-
width: 16,
|
|
91
|
-
height: 16,
|
|
92
|
-
color: l.content.secondary
|
|
93
|
-
}
|
|
94
|
-
)
|
|
95
|
-
}
|
|
96
|
-
),
|
|
97
|
-
i && /* @__PURE__ */ o(z, { "aria-hidden": !0 }),
|
|
98
|
-
/* @__PURE__ */ o(
|
|
99
|
-
g,
|
|
100
|
-
{
|
|
101
|
-
"data-test": `${t}-delete-${e.id}`,
|
|
102
|
-
"aria-label": `Delete ${e.label}`,
|
|
103
|
-
onClick: () => u(e.id),
|
|
104
|
-
children: /* @__PURE__ */ o(
|
|
105
|
-
A,
|
|
106
|
-
{
|
|
107
|
-
width: 16,
|
|
108
|
-
height: 16,
|
|
109
|
-
color: l.content.secondary
|
|
110
|
-
}
|
|
111
|
-
)
|
|
112
|
-
}
|
|
113
|
-
)
|
|
114
|
-
] })
|
|
115
|
-
]
|
|
116
|
-
},
|
|
117
|
-
e.id
|
|
118
|
-
))
|
|
170
|
+
),
|
|
171
|
+
r.length === 0 && !f ? /* @__PURE__ */ c(g, { children: [
|
|
172
|
+
/* @__PURE__ */ o(R, { color: l.content.placeholder, children: L }),
|
|
173
|
+
H && n && /* @__PURE__ */ o(
|
|
174
|
+
T,
|
|
175
|
+
{
|
|
176
|
+
"data-test": `${t}-create`,
|
|
177
|
+
buttonType: "secondary",
|
|
178
|
+
size: "small",
|
|
179
|
+
matchParentWidth: !0,
|
|
180
|
+
LeadingIcon: A,
|
|
181
|
+
buttonText: n.label,
|
|
182
|
+
onClick: n.onSelect
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
] }) : N()
|
|
186
|
+
] })
|
|
119
187
|
] });
|
|
120
188
|
};
|
|
121
189
|
export {
|
|
122
|
-
|
|
190
|
+
ae as SelectableListSection
|
|
123
191
|
};
|
|
124
192
|
//# sourceMappingURL=SelectableListSection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectableListSection.js","sources":["../../../../../src/components/agent-builder/components/SelectableListSection.tsx"],"sourcesContent":["import DeleteIcon from '@src/assets/icons/delete.svg';\nimport EditIcon from '@src/assets/icons/edit.svg';\nimport PlusIcon from '@src/assets/icons/plus.svg';\nimport React, { useState } from 'react';\nimport { Dropdown } from '@src/components/dropdown';\nimport { SingleOption } from '@src/components/dropdown/type';\nimport {\n\tBodyCaption,\n\tBodySecondary,\n\tTitleSmall,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport {\n\tAddIconButton,\n\tRowActionDivider,\n\tRowActions,\n\tRowMenuButton,\n\tRowText,\n\tSelectableRow,\n\tSideSection,\n\tSideSectionHeader,\n} from '../AgentBuilder.styled';\n\nexport interface SelectableItem {\n\tid: string;\n\tlabel: string;\n}\n\n/** Sentinel value for the \"create new\" entry in the add dropdown. */\nconst CREATE_OPTION_VALUE = '__bik_create_new__';\n\ninterface SelectableListSectionProps {\n\ttitle: string;\n\thelper?: string;\n\titems: SelectableItem[];\n\t/**\n\t * Options shown in the add dropdown. Pass ALL items (not just unselected\n\t * ones) when re-picking an already-added item is allowed (e.g. to insert its\n\t * mention again) — the chip list still shows each item only once.\n\t */\n\taddableOptions: SingleOption[];\n\tonAdd: (id: string) => void;\n\tonRemove: (id: string) => void;\n\tdataTestPrefix: string;\n\temptyText: string;\n\t/**\n\t * Adds a \"create new\" entry at the top of the add dropdown (e.g. \"Create\n\t * sub-agent\"). Selecting it calls `onSelect` instead of `onAdd`.\n\t */\n\tcreateOption?: { label: string; onSelect: () => void };\n\t/**\n\t * When provided, each row's kebab menu gains a \"Configure\" action (above\n\t * \"Delete\"). Omit for tools (Delete only).\n\t */\n\tonConfigure?: (id: string) => void;\n}\n\nexport const SelectableListSection: React.FC<SelectableListSectionProps> = ({\n\ttitle,\n\thelper,\n\titems,\n\taddableOptions,\n\tonAdd,\n\tonRemove,\n\tdataTestPrefix,\n\temptyText,\n\tcreateOption,\n\tonConfigure,\n}) => {\n\tconst [adding, setAdding] = useState(false);\n\tconst showAddButton = addableOptions.length > 0 || !!createOption;\n\t// \"Create new\" is a brand-coloured footer row at the BOTTOM of the dropdown,\n\t// separated from the selectable items by a divider.\n\tconst dropdownOptions: SingleOption[] = createOption\n\t\t? [\n\t\t\t\t...addableOptions,\n\t\t\t\t{\n\t\t\t\t\tlabel: createOption.label,\n\t\t\t\t\tvalue: CREATE_OPTION_VALUE,\n\t\t\t\t\tsearchKey: createOption.label,\n\t\t\t\t\tcustomComponent: (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\t\ttextAlign: 'center',\n\t\t\t\t\t\t\t\tcolor: COLORS.content.brand,\n\t\t\t\t\t\t\t\tfontFamily: 'Inter',\n\t\t\t\t\t\t\t\tfontSize: 14,\n\t\t\t\t\t\t\t\tfontWeight: 600,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{createOption.label}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t ]\n\t\t: addableOptions;\n\n\treturn (\n\t\t<SideSection>\n\t\t\t<SideSectionHeader>\n\t\t\t\t<TitleSmall color={COLORS.content.primary}>{title}</TitleSmall>\n\t\t\t\t{showAddButton && (\n\t\t\t\t\t<AddIconButton\n\t\t\t\t\t\tdata-test={`${dataTestPrefix}-add`}\n\t\t\t\t\t\tonClick={() => setAdding((v) => !v)}\n\t\t\t\t\t\taria-label={`Add ${title}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t<PlusIcon width={20} height={20} color={COLORS.content.brand} />\n\t\t\t\t\t</AddIconButton>\n\t\t\t\t)}\n\t\t\t</SideSectionHeader>\n\n\t\t\t{helper && (\n\t\t\t\t<BodyCaption color={COLORS.content.secondary}>{helper}</BodyCaption>\n\t\t\t)}\n\n\t\t\t{adding && dropdownOptions.length > 0 && (\n\t\t\t\t<Dropdown\n\t\t\t\t\tdata-test={`${dataTestPrefix}-dropdown`}\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\twidth=\"100%\"\n\t\t\t\t\tisSearchable\n\t\t\t\t\tplaceHolder={`Select ${title.toLowerCase()}`}\n\t\t\t\t\toptions={dropdownOptions}\n\t\t\t\t\tonSelect={(opt) => {\n\t\t\t\t\t\tconst single = Array.isArray(opt) ? opt[0] : opt;\n\t\t\t\t\t\tconst v = (single as SingleOption)?.value;\n\t\t\t\t\t\tsetAdding(false);\n\t\t\t\t\t\tif (!v) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (v === CREATE_OPTION_VALUE) {\n\t\t\t\t\t\t\tcreateOption?.onSelect();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tonAdd(v);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{items.length === 0 && !adding ? (\n\t\t\t\t<BodyCaption color={COLORS.content.placeholder}>\n\t\t\t\t\t{emptyText}\n\t\t\t\t</BodyCaption>\n\t\t\t) : (\n\t\t\t\titems.map((item) => (\n\t\t\t\t\t<SelectableRow\n\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\tdata-test={`${dataTestPrefix}-row-${item.id}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t<RowText>\n\t\t\t\t\t\t\t<BodySecondary numberOfLines={1} color={COLORS.content.primary}>\n\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t</RowText>\n\t\t\t\t\t\t<RowActions>\n\t\t\t\t\t\t\t{onConfigure && (\n\t\t\t\t\t\t\t\t// Configurable rows (sub-agents) get an always-visible edit icon.\n\t\t\t\t\t\t\t\t<RowMenuButton\n\t\t\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-edit-${item.id}`}\n\t\t\t\t\t\t\t\t\taria-label={`Edit ${item.label}`}\n\t\t\t\t\t\t\t\t\tonClick={() => onConfigure(item.id)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EditIcon\n\t\t\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</RowMenuButton>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{onConfigure && <RowActionDivider aria-hidden />}\n\t\t\t\t\t\t\t<RowMenuButton\n\t\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-delete-${item.id}`}\n\t\t\t\t\t\t\t\taria-label={`Delete ${item.label}`}\n\t\t\t\t\t\t\t\tonClick={() => onRemove(item.id)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<DeleteIcon\n\t\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</RowMenuButton>\n\t\t\t\t\t\t</RowActions>\n\t\t\t\t\t</SelectableRow>\n\t\t\t\t))\n\t\t\t)}\n\t\t</SideSection>\n\t);\n};\n"],"names":["CREATE_OPTION_VALUE","SelectableListSection","title","helper","items","addableOptions","onAdd","onRemove","dataTestPrefix","emptyText","createOption","onConfigure","adding","setAdding","useState","showAddButton","dropdownOptions","jsx","COLORS","SideSection","jsxs","SideSectionHeader","TitleSmall","AddIconButton","v","PlusIcon","BodyCaption","Dropdown","opt","item","SelectableRow","RowText","BodySecondary","RowActions","RowMenuButton","EditIcon","RowActionDivider","DeleteIcon"],"mappings":";;;;;;;;;AA6BA,MAAMA,IAAsB,sBA4BfC,IAA8D,CAAC;AAAA,EAC3E,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC;AACD,MAAM;AACL,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK,GACpCC,IAAgBV,EAAe,SAAS,KAAK,CAAC,CAACK,GAG/CM,IAAkCN,IACrC;AAAA,IACA,GAAGL;AAAA,IACH;AAAA,MACC,OAAOK,EAAa;AAAA,MACpB,OAAOV;AAAA,MACP,WAAWU,EAAa;AAAA,MACxB,iBACC,gBAAAO;AAAA,QAAC;AAAA,QAAA;AAAA,UACA,OAAO;AAAA,YACN,OAAO;AAAA,YACP,WAAW;AAAA,YACX,OAAOC,EAAO,QAAQ;AAAA,YACtB,YAAY;AAAA,YACZ,UAAU;AAAA,YACV,YAAY;AAAA,UAAA;AAAA,UA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electableListSection.tsx"],"sourcesContent":["import DeleteIcon from '@src/assets/icons/delete.svg';\nimport EditIcon from '@src/assets/icons/edit.svg';\nimport PlusIcon from '@src/assets/icons/plus.svg';\nimport React, { useState } from 'react';\nimport { Button } from '@src/components/button';\nimport { Dropdown } from '@src/components/dropdown';\nimport { SingleOption } from '@src/components/dropdown/type';\nimport {\n\tBodyCaption,\n\tBodySecondary,\n\tTitleSmall,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport {\n\tAddIconButton,\n\tRowActionDivider,\n\tRowActions,\n\tRowMenuButton,\n\tRowText,\n\tSelectableRow,\n\tSideSection,\n\tSideSectionHeader,\n\tSourceButton,\n\tSourceButtonRow,\n} from '../AgentBuilder.styled';\nimport { SOURCE_ICONS, SourceIcon } from '../utils/sourceIcons';\n\nexport interface SelectableItem {\n\tid: string;\n\tlabel: string;\n\t/** Leading brand glyph (e.g. a tool's source icon). */\n\ticon?: SourceIcon;\n}\n\n/** A tool source for the empty-state picker (Tools): a button → its searchable list. */\nexport interface SourceGroup {\n\tsource: string;\n\tlabel: string;\n\toptions: SingleOption[];\n}\n\n/** Sentinel value for the \"create new\" entry in the add dropdown. */\nconst CREATE_OPTION_VALUE = '__bik_create_new__';\n\ninterface SelectableListSectionProps {\n\ttitle: string;\n\thelper?: string;\n\titems: SelectableItem[];\n\t/**\n\t * Options shown in the add dropdown. Pass ALL items (not just unselected\n\t * ones) when re-picking an already-added item is allowed (e.g. to insert its\n\t * mention again) — the chip list still shows each item only once.\n\t */\n\taddableOptions: SingleOption[];\n\tonAdd: (id: string) => void;\n\tonRemove: (id: string) => void;\n\tdataTestPrefix: string;\n\temptyText: string;\n\t/**\n\t * Adds a \"create new\" entry at the top of the add dropdown (e.g. \"Create\n\t * sub-agent\"). Selecting it calls `onSelect` instead of `onAdd`.\n\t */\n\tcreateOption?: { label: string; onSelect: () => void };\n\t/**\n\t * When provided, each row shows an edit (Configure) icon next to Delete.\n\t * Omit for tools (Delete only).\n\t */\n\tonConfigure?: (id: string) => void;\n\t/**\n\t * Tool sources (e.g. Manifest / Shopify). When set, the empty state shows a\n\t * button per source; clicking one reveals a searchable dropdown of just that\n\t * source's options. Selecting calls `onAdd`. Takes precedence over the plain\n\t * `addableOptions` dropdown.\n\t */\n\tsourceGroups?: SourceGroup[];\n}\n\nexport const SelectableListSection: React.FC<SelectableListSectionProps> = ({\n\ttitle,\n\thelper,\n\titems,\n\taddableOptions,\n\tonAdd,\n\tonRemove,\n\tdataTestPrefix,\n\temptyText,\n\tcreateOption,\n\tonConfigure,\n\tsourceGroups,\n}) => {\n\tconst [adding, setAdding] = useState(false);\n\t// Tools: which source's searchable list is open (null = just show the buttons).\n\tconst [activeSource, setActiveSource] = useState<string | null>(null);\n\tconst hasSourceGroups = !!sourceGroups && sourceGroups.length > 0;\n\tconst activeGroup = sourceGroups?.find((g) => g.source === activeSource);\n\n\t// Header \"+\" picks an EXISTING item (and, once some exist, re-creates via the\n\t// dropdown's footer row). With an empty list + a createOption the body shows a\n\t// dedicated \"Create new\" button instead, so the header \"+\" would be redundant.\n\t// With sourceGroups the empty state IS the source buttons, so \"+\" only adds more.\n\tconst showAddButton = hasSourceGroups\n\t\t? items.length > 0\n\t\t: addableOptions.length > 0 || (!!createOption && items.length > 0);\n\t// Empty state offers a one-click \"Create new\" (sub-agents) rather than burying\n\t// it behind a single-item dropdown.\n\tconst showEmptyCreate =\n\t\titems.length === 0 && !!createOption && !hasSourceGroups;\n\t// Source buttons ONLY while no tool is added. Once one exists, adding more uses\n\t// the header \"+\" → all-tools dropdown (the buttons never come back).\n\tconst showSourceButtons = hasSourceGroups && items.length === 0;\n\t// Nothing existing to pick → skip the 1-item dropdown and create directly.\n\tconst handleAddClick = () => {\n\t\tif (hasSourceGroups) {\n\t\t\tsetActiveSource(null);\n\t\t\tsetAdding((v) => !v);\n\t\t\treturn;\n\t\t}\n\t\tif (addableOptions.length === 0 && createOption) {\n\t\t\tcreateOption.onSelect();\n\t\t\treturn;\n\t\t}\n\t\tsetAdding((v) => !v);\n\t};\n\n\tconst renderChipRows = () =>\n\t\titems.map((item) => (\n\t\t\t<SelectableRow\n\t\t\t\tkey={item.id}\n\t\t\t\tdata-test={`${dataTestPrefix}-row-${item.id}`}\n\t\t\t>\n\t\t\t\t{item.icon &&\n\t\t\t\t\tReact.createElement(item.icon.Icon, {\n\t\t\t\t\t\twidth: item.icon.w,\n\t\t\t\t\t\theight: item.icon.h,\n\t\t\t\t\t})}\n\t\t\t\t<RowText>\n\t\t\t\t\t<BodySecondary numberOfLines={1} color={COLORS.content.primary}>\n\t\t\t\t\t\t{item.label}\n\t\t\t\t\t</BodySecondary>\n\t\t\t\t</RowText>\n\t\t\t\t<RowActions>\n\t\t\t\t\t{onConfigure && (\n\t\t\t\t\t\t// Configurable rows (sub-agents) get an always-visible edit icon.\n\t\t\t\t\t\t<RowMenuButton\n\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-edit-${item.id}`}\n\t\t\t\t\t\t\taria-label={`Edit ${item.label}`}\n\t\t\t\t\t\t\tonClick={() => onConfigure(item.id)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EditIcon\n\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</RowMenuButton>\n\t\t\t\t\t)}\n\t\t\t\t\t{onConfigure && <RowActionDivider aria-hidden />}\n\t\t\t\t\t<RowMenuButton\n\t\t\t\t\t\tdata-test={`${dataTestPrefix}-delete-${item.id}`}\n\t\t\t\t\t\taria-label={`Delete ${item.label}`}\n\t\t\t\t\t\tonClick={() => onRemove(item.id)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<DeleteIcon\n\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</RowMenuButton>\n\t\t\t\t</RowActions>\n\t\t\t</SelectableRow>\n\t\t));\n\t// \"Create new\" is a brand-coloured footer row at the BOTTOM of the dropdown,\n\t// separated from the selectable items by a divider.\n\tconst dropdownOptions: SingleOption[] = createOption\n\t\t? [\n\t\t\t\t...addableOptions,\n\t\t\t\t{\n\t\t\t\t\tlabel: createOption.label,\n\t\t\t\t\tvalue: CREATE_OPTION_VALUE,\n\t\t\t\t\tsearchKey: createOption.label,\n\t\t\t\t\tcustomComponent: (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\t\ttextAlign: 'center',\n\t\t\t\t\t\t\t\tcolor: COLORS.content.brand,\n\t\t\t\t\t\t\t\tfontFamily: 'Inter',\n\t\t\t\t\t\t\t\tfontSize: 14,\n\t\t\t\t\t\t\t\tfontWeight: 600,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{createOption.label}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t ]\n\t\t: addableOptions;\n\n\treturn (\n\t\t<SideSection>\n\t\t\t<SideSectionHeader>\n\t\t\t\t<TitleSmall color={COLORS.content.primary}>{title}</TitleSmall>\n\t\t\t\t{showAddButton && (\n\t\t\t\t\t<AddIconButton\n\t\t\t\t\t\tdata-test={`${dataTestPrefix}-add`}\n\t\t\t\t\t\tonClick={handleAddClick}\n\t\t\t\t\t\taria-label={`Add ${title}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t<PlusIcon width={20} height={20} color={COLORS.content.brand} />\n\t\t\t\t\t</AddIconButton>\n\t\t\t\t)}\n\t\t\t</SideSectionHeader>\n\n\t\t\t{helper && (\n\t\t\t\t<BodyCaption color={COLORS.content.secondary}>{helper}</BodyCaption>\n\t\t\t)}\n\n\t\t\t{showSourceButtons ? (\n\t\t\t\t<>\n\t\t\t\t\t{/* No tools yet: one button per source (never shown once a tool exists). */}\n\t\t\t\t\t<SourceButtonRow data-test={`${dataTestPrefix}-sources`}>\n\t\t\t\t\t\t{sourceGroups?.map((g) => {\n\t\t\t\t\t\t\tconst icon = SOURCE_ICONS[g.source];\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<SourceButton\n\t\t\t\t\t\t\t\t\tkey={g.source}\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-source-${g.source}`}\n\t\t\t\t\t\t\t\t\tonClick={() => setActiveSource(g.source)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{icon &&\n\t\t\t\t\t\t\t\t\t\tReact.createElement(icon.Icon, {\n\t\t\t\t\t\t\t\t\t\t\twidth: icon.w - 4,\n\t\t\t\t\t\t\t\t\t\t\theight: icon.h - 4,\n\t\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t\t<BodySecondary color={COLORS.content.primary}>\n\t\t\t\t\t\t\t\t\t\t{g.label}\n\t\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t\t</SourceButton>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</SourceButtonRow>\n\n\t\t\t\t\t{/* Chosen source → its searchable tool list. */}\n\t\t\t\t\t{activeGroup && (\n\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-dropdown`}\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\twidth=\"100%\"\n\t\t\t\t\t\t\tisSearchable\n\t\t\t\t\t\t\tplaceHolder={`Search ${activeGroup.label} tools`}\n\t\t\t\t\t\t\toptions={activeGroup.options}\n\t\t\t\t\t\t\tonSelect={(opt) => {\n\t\t\t\t\t\t\t\tconst single = Array.isArray(opt) ? opt[0] : opt;\n\t\t\t\t\t\t\t\tconst v = (single as SingleOption)?.value;\n\t\t\t\t\t\t\t\tsetActiveSource(null);\n\t\t\t\t\t\t\t\tsetAdding(false);\n\t\t\t\t\t\t\t\tif (v) {\n\t\t\t\t\t\t\t\t\tonAdd(v);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t{adding && dropdownOptions.length > 0 && (\n\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-dropdown`}\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\twidth=\"100%\"\n\t\t\t\t\t\t\tisSearchable\n\t\t\t\t\t\t\tplaceHolder={`Select ${title.toLowerCase()}`}\n\t\t\t\t\t\t\toptions={dropdownOptions}\n\t\t\t\t\t\t\tonSelect={(opt) => {\n\t\t\t\t\t\t\t\tconst single = Array.isArray(opt) ? opt[0] : opt;\n\t\t\t\t\t\t\t\tconst v = (single as SingleOption)?.value;\n\t\t\t\t\t\t\t\tsetAdding(false);\n\t\t\t\t\t\t\t\tif (!v) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (v === CREATE_OPTION_VALUE) {\n\t\t\t\t\t\t\t\t\tcreateOption?.onSelect();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tonAdd(v);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{items.length === 0 && !adding ? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.placeholder}>\n\t\t\t\t\t\t\t\t{emptyText}\n\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t{showEmptyCreate && createOption && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tdata-test={`${dataTestPrefix}-create`}\n\t\t\t\t\t\t\t\t\tbuttonType=\"secondary\"\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tmatchParentWidth\n\t\t\t\t\t\t\t\t\tLeadingIcon={PlusIcon}\n\t\t\t\t\t\t\t\t\tbuttonText={createOption.label}\n\t\t\t\t\t\t\t\t\tonClick={createOption.onSelect}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</>\n\t\t\t\t\t) : (\n\t\t\t\t\t\trenderChipRows()\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</SideSection>\n\t);\n};\n"],"names":["CREATE_OPTION_VALUE","SelectableListSection","title","helper","items","addableOptions","onAdd","onRemove","dataTestPrefix","emptyText","createOption","onConfigure","sourceGroups","adding","setAdding","useState","activeSource","setActiveSource","hasSourceGroups","activeGroup","g","showAddButton","showEmptyCreate","showSourceButtons","handleAddClick","v","renderChipRows","item","jsxs","SelectableRow","React","jsx","RowText","BodySecondary","COLORS","RowActions","RowMenuButton","EditIcon","RowActionDivider","DeleteIcon","dropdownOptions","SideSection","SideSectionHeader","TitleSmall","AddIconButton","PlusIcon","BodyCaption","Fragment","SourceButtonRow","icon","SOURCE_ICONS","SourceButton","Dropdown","opt","Button"],"mappings":";;;;;;;;;;;AA0CA,MAAMA,IAAsB,sBAmCfC,KAA8D,CAAC;AAAA,EAC3E,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AACD,MAAM;AACL,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK,GAEpC,CAACC,GAAcC,CAAe,IAAIF,EAAwB,IAAI,GAC9DG,IAAkB,CAAC,CAACN,KAAgBA,EAAa,SAAS,GAC1DO,IAAcP,GAA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new sub-agent and resolve with its ref. Omit to hide the create flow. */
|
|
63
63
|
onCreateSubAgent?: (draft: SubAgentDraft) => Promise<SubAgentRef>;
|
|
64
|
+
/**
|
|
65
|
+
* Step 3 registers its "open create-sub-agent drawer" action here so the `@`
|
|
66
|
+
* picker's "Create new" row can trigger it. Pass `null` to unregister.
|
|
67
|
+
*/
|
|
68
|
+
registerSubAgentCreator: (fn: (() => void) | null) => void;
|
|
69
|
+
/** Open the create-sub-agent drawer (no-op until Step 3 registers it). */
|
|
70
|
+
requestCreateSubAgent: () => void;
|
|
64
71
|
/** Fetch a sub-agent's editable data (Configure). Omit to hide Configure. */
|
|
65
72
|
onFetchSubAgent?: (id: string) => Promise<SubAgentDraft>;
|
|
66
73
|
/** Persist edits to an existing sub-agent. */
|
|
@@ -1,113 +1,117 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { AGENT_CHAR_LIMITS as
|
|
4
|
-
import { getStepIndex as
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
if (!
|
|
1
|
+
import { jsx as st } from "react/jsx-runtime";
|
|
2
|
+
import it, { useState as S, useRef as g, useCallback as o, useMemo as Z, useContext as ct } from "react";
|
|
3
|
+
import { AGENT_CHAR_LIMITS as O } from "../constants/charLimits.js";
|
|
4
|
+
import { getStepIndex as ut, STEP_KEYS as x } from "../constants/steps.js";
|
|
5
|
+
const b = it.createContext(null), pt = () => {
|
|
6
|
+
const n = ct(b);
|
|
7
|
+
if (!n)
|
|
8
8
|
throw new Error(
|
|
9
9
|
"useAgentBuilderContext must be used within an AgentBuilderProvider"
|
|
10
10
|
);
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
const s =
|
|
11
|
+
return n;
|
|
12
|
+
}, dt = (n) => {
|
|
13
|
+
const s = n.trigger.mode === "custom_intent" ? (n.trigger.custom_intent ?? "").trim().length > 0 : n.trigger.intents.length > 0;
|
|
14
14
|
return {
|
|
15
|
-
about:
|
|
15
|
+
about: n.name.trim().length > 0 && n.name.length <= O.name && n.description.length <= O.description,
|
|
16
16
|
trigger: s,
|
|
17
17
|
// At least one of Instructions / Guardrails must be filled.
|
|
18
|
-
response:
|
|
18
|
+
response: n.instructions.trim().length > 0 || (n.guardrail ?? "").trim().length > 0,
|
|
19
19
|
// Optional until specced further — never blocks go-live.
|
|
20
20
|
handover: !0
|
|
21
21
|
};
|
|
22
|
-
},
|
|
23
|
-
value:
|
|
22
|
+
}, xt = ({
|
|
23
|
+
value: n,
|
|
24
24
|
onChange: s,
|
|
25
25
|
activeStep: R,
|
|
26
|
-
onStepChange:
|
|
26
|
+
onStepChange: B,
|
|
27
27
|
availableTools: u,
|
|
28
28
|
availableSubAgents: m,
|
|
29
|
-
availableIntents:
|
|
30
|
-
availableModels:
|
|
31
|
-
validation:
|
|
32
|
-
applicationType:
|
|
33
|
-
disableStepNavigation:
|
|
34
|
-
onCreateSubAgent:
|
|
35
|
-
onFetchSubAgent:
|
|
36
|
-
onUpdateSubAgent:
|
|
37
|
-
onImproveSubAgent:
|
|
38
|
-
children:
|
|
29
|
+
availableIntents: F,
|
|
30
|
+
availableModels: I,
|
|
31
|
+
validation: P,
|
|
32
|
+
applicationType: A,
|
|
33
|
+
disableStepNavigation: E = !0,
|
|
34
|
+
onCreateSubAgent: $,
|
|
35
|
+
onFetchSubAgent: w,
|
|
36
|
+
onUpdateSubAgent: y,
|
|
37
|
+
onImproveSubAgent: T,
|
|
38
|
+
children: v
|
|
39
39
|
}) => {
|
|
40
|
-
const [
|
|
41
|
-
(
|
|
42
|
-
e ? _.current[
|
|
40
|
+
const [tt, nt] = S("about"), l = R ?? tt, i = ut(l), [V, a] = S(0), _ = g({}), j = g("instructions"), K = o(
|
|
41
|
+
(t, e) => {
|
|
42
|
+
e ? _.current[t] = e : delete _.current[t];
|
|
43
43
|
},
|
|
44
44
|
[]
|
|
45
|
-
),
|
|
46
|
-
|
|
47
|
-
}, []),
|
|
45
|
+
), L = o((t) => {
|
|
46
|
+
j.current = t;
|
|
47
|
+
}, []), q = g(null), C = o((t) => {
|
|
48
|
+
q.current = t;
|
|
49
|
+
}, []), G = o(() => {
|
|
50
|
+
q.current?.();
|
|
51
|
+
}, []), H = o((t, e, p) => {
|
|
48
52
|
const d = _.current;
|
|
49
|
-
(d[
|
|
50
|
-
}, []), [N, h] =
|
|
51
|
-
(
|
|
52
|
-
R === void 0 &&
|
|
53
|
+
(d[j.current] ?? d.instructions)?.(t, e, p);
|
|
54
|
+
}, []), [N, h] = S(null), f = g(null), U = g(0), c = o(
|
|
55
|
+
(t) => {
|
|
56
|
+
R === void 0 && nt(t), B?.(t);
|
|
53
57
|
},
|
|
54
|
-
[R,
|
|
58
|
+
[R, B]
|
|
55
59
|
), Y = o(() => {
|
|
56
|
-
const
|
|
57
|
-
c(
|
|
60
|
+
const t = x[Math.min(i + 1, x.length - 1)];
|
|
61
|
+
c(t);
|
|
58
62
|
}, [i, c]), k = o(() => {
|
|
59
|
-
const
|
|
60
|
-
c(
|
|
61
|
-
}, [i, c]),
|
|
62
|
-
(
|
|
63
|
-
[s]
|
|
64
|
-
), z = o(
|
|
65
|
-
(n, e) => s({ [n]: e }),
|
|
63
|
+
const t = x[Math.max(i - 1, 0)];
|
|
64
|
+
c(t);
|
|
65
|
+
}, [i, c]), z = o(
|
|
66
|
+
(t) => s(t),
|
|
66
67
|
[s]
|
|
67
68
|
), D = o(
|
|
68
|
-
(
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
(t, e) => s({ [t]: e }),
|
|
70
|
+
[s]
|
|
71
|
+
), J = o(
|
|
72
|
+
(t, e) => {
|
|
73
|
+
const p = t === "tool" ? (() => {
|
|
74
|
+
const r = u.find((ot) => ot.tool_id === e);
|
|
71
75
|
return r ? `{{tool:${r.function_key}}}` : null;
|
|
72
|
-
})() : `{{subagent:${e}}}`, d = (r) =>
|
|
73
|
-
|
|
74
|
-
tools:
|
|
75
|
-
subagents:
|
|
76
|
-
instructions:
|
|
77
|
-
guardrail:
|
|
76
|
+
})() : `{{subagent:${e}}}`, d = (r) => p ? r.split(p).join("") : r;
|
|
77
|
+
f.current = {
|
|
78
|
+
tools: n.tools,
|
|
79
|
+
subagents: n.subagents,
|
|
80
|
+
instructions: n.instructions,
|
|
81
|
+
guardrail: n.guardrail
|
|
78
82
|
};
|
|
79
|
-
const
|
|
80
|
-
instructions: d(
|
|
81
|
-
guardrail: d(
|
|
82
|
-
...
|
|
83
|
+
const X = {
|
|
84
|
+
instructions: d(n.instructions),
|
|
85
|
+
guardrail: d(n.guardrail ?? ""),
|
|
86
|
+
...t === "tool" ? { tools: n.tools.filter((r) => r !== e) } : { subagents: n.subagents.filter((r) => r !== e) }
|
|
83
87
|
};
|
|
84
|
-
s(
|
|
85
|
-
const
|
|
88
|
+
s(X), a((r) => r + 1);
|
|
89
|
+
const et = t === "tool" ? u.find((r) => r.tool_id === e)?.display_name ?? "Tool" : m.find((r) => r.id === e)?.name ?? "Sub-agent";
|
|
86
90
|
U.current += 1, h({
|
|
87
91
|
id: U.current,
|
|
88
|
-
message: `${
|
|
92
|
+
message: `${t === "tool" ? "Tool" : "Sub-agent"} "${et}" removed`
|
|
89
93
|
});
|
|
90
94
|
},
|
|
91
|
-
[u, m,
|
|
92
|
-
),
|
|
93
|
-
|
|
94
|
-
}, [s]),
|
|
95
|
-
() => ({ ...
|
|
96
|
-
[
|
|
97
|
-
),
|
|
95
|
+
[u, m, n, s]
|
|
96
|
+
), Q = o(() => {
|
|
97
|
+
f.current && (s(f.current), f.current = null, a((t) => t + 1)), h(null);
|
|
98
|
+
}, [s]), W = o(() => h(null), []), M = Z(
|
|
99
|
+
() => ({ ...dt(n), ...P }),
|
|
100
|
+
[n, P]
|
|
101
|
+
), rt = Z(
|
|
98
102
|
() => ({
|
|
99
|
-
value:
|
|
100
|
-
patch:
|
|
101
|
-
updateField:
|
|
102
|
-
removeReference:
|
|
103
|
-
mentionResetKey:
|
|
103
|
+
value: n,
|
|
104
|
+
patch: z,
|
|
105
|
+
updateField: D,
|
|
106
|
+
removeReference: J,
|
|
107
|
+
mentionResetKey: V,
|
|
104
108
|
insertMention: H,
|
|
105
|
-
registerMentionField:
|
|
106
|
-
notifyMentionFocus:
|
|
109
|
+
registerMentionField: K,
|
|
110
|
+
notifyMentionFocus: L,
|
|
107
111
|
undoToast: N,
|
|
108
|
-
undoRemoval:
|
|
109
|
-
dismissUndo:
|
|
110
|
-
activeStep:
|
|
112
|
+
undoRemoval: Q,
|
|
113
|
+
dismissUndo: W,
|
|
114
|
+
activeStep: l,
|
|
111
115
|
activeIndex: i,
|
|
112
116
|
goToStep: c,
|
|
113
117
|
goNext: Y,
|
|
@@ -115,31 +119,33 @@ const a = et.createContext(null), gt = () => {
|
|
|
115
119
|
isFirstStep: i === 0,
|
|
116
120
|
isLastStep: i === x.length - 1,
|
|
117
121
|
validation: M,
|
|
118
|
-
isActiveStepValid: M[
|
|
122
|
+
isActiveStepValid: M[l],
|
|
119
123
|
availableTools: u,
|
|
120
124
|
availableSubAgents: m,
|
|
121
|
-
availableIntents:
|
|
122
|
-
availableModels:
|
|
123
|
-
applicationType:
|
|
124
|
-
disableStepNavigation:
|
|
125
|
-
onCreateSubAgent:
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
availableIntents: F,
|
|
126
|
+
availableModels: I,
|
|
127
|
+
applicationType: A,
|
|
128
|
+
disableStepNavigation: E,
|
|
129
|
+
onCreateSubAgent: $,
|
|
130
|
+
registerSubAgentCreator: C,
|
|
131
|
+
requestCreateSubAgent: G,
|
|
132
|
+
onFetchSubAgent: w,
|
|
133
|
+
onUpdateSubAgent: y,
|
|
134
|
+
onImproveSubAgent: T
|
|
129
135
|
}),
|
|
130
136
|
[
|
|
131
|
-
|
|
132
|
-
q,
|
|
137
|
+
n,
|
|
133
138
|
z,
|
|
134
139
|
D,
|
|
135
|
-
|
|
140
|
+
J,
|
|
141
|
+
V,
|
|
136
142
|
H,
|
|
137
|
-
|
|
138
|
-
|
|
143
|
+
K,
|
|
144
|
+
L,
|
|
139
145
|
N,
|
|
140
|
-
J,
|
|
141
146
|
Q,
|
|
142
|
-
|
|
147
|
+
W,
|
|
148
|
+
l,
|
|
143
149
|
i,
|
|
144
150
|
c,
|
|
145
151
|
Y,
|
|
@@ -147,20 +153,22 @@ const a = et.createContext(null), gt = () => {
|
|
|
147
153
|
M,
|
|
148
154
|
u,
|
|
149
155
|
m,
|
|
156
|
+
F,
|
|
150
157
|
I,
|
|
151
|
-
|
|
158
|
+
A,
|
|
152
159
|
E,
|
|
153
160
|
$,
|
|
161
|
+
C,
|
|
162
|
+
G,
|
|
154
163
|
w,
|
|
155
164
|
y,
|
|
156
|
-
T
|
|
157
|
-
V
|
|
165
|
+
T
|
|
158
166
|
]
|
|
159
167
|
);
|
|
160
|
-
return /* @__PURE__ */
|
|
168
|
+
return /* @__PURE__ */ st(b.Provider, { value: rt, children: v });
|
|
161
169
|
};
|
|
162
170
|
export {
|
|
163
|
-
|
|
164
|
-
|
|
171
|
+
xt as AgentBuilderProvider,
|
|
172
|
+
pt as useAgentBuilderContext
|
|
165
173
|
};
|
|
166
174
|
//# sourceMappingURL=AgentBuilderContext.js.map
|