@bikdotai/bik-component-library 0.0.821-beta.8 → 0.0.821

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.
Files changed (89) hide show
  1. package/dist/cjs/assets/icons/Shopify.svg.js +2 -0
  2. package/dist/cjs/assets/icons/Shopify.svg.js.map +1 -0
  3. package/dist/cjs/components/agent-builder/AgentBuilder.js +1 -1
  4. package/dist/cjs/components/agent-builder/AgentBuilder.js.map +1 -1
  5. package/dist/cjs/components/agent-builder/AgentBuilder.styled.js +57 -23
  6. package/dist/cjs/components/agent-builder/AgentBuilder.styled.js.map +1 -1
  7. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js +1 -1
  8. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  9. package/dist/cjs/components/agent-builder/components/GoLiveModal.js.map +1 -1
  10. package/dist/cjs/components/agent-builder/components/MentionEditor.js +1 -1
  11. package/dist/cjs/components/agent-builder/components/MentionEditor.js.map +1 -1
  12. package/dist/cjs/components/agent-builder/components/MentionField.js +1 -1
  13. package/dist/cjs/components/agent-builder/components/MentionField.js.map +1 -1
  14. package/dist/cjs/components/agent-builder/components/MentionPicker.js +37 -6
  15. package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
  16. package/dist/cjs/components/agent-builder/components/SelectableListSection.js +1 -1
  17. package/dist/cjs/components/agent-builder/components/SelectableListSection.js.map +1 -1
  18. package/dist/cjs/components/agent-builder/constants/charLimits.js +1 -1
  19. package/dist/cjs/components/agent-builder/constants/charLimits.js.map +1 -1
  20. package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js +1 -1
  21. package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
  22. package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.js +1 -1
  23. package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
  24. package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js +1 -1
  25. package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
  26. package/dist/cjs/components/agent-builder/utils/mentionSerialization.js +1 -1
  27. package/dist/cjs/components/agent-builder/utils/mentionSerialization.js.map +1 -1
  28. package/dist/cjs/components/agent-builder/utils/sourceIcons.js +2 -0
  29. package/dist/cjs/components/agent-builder/utils/sourceIcons.js.map +1 -0
  30. package/dist/cjs/components/agent-listing/AgentListing.js +1 -1
  31. package/dist/cjs/components/agent-listing/AgentListing.js.map +1 -1
  32. package/dist/cjs/components/agent-listing/AgentListingFilters.js +1 -1
  33. package/dist/cjs/components/agent-listing/AgentListingFilters.js.map +1 -1
  34. package/dist/cjs/editor/BikEditor.types.js.map +1 -1
  35. package/dist/cjs/editor/extensions/mention/MentionDropdown.js +1 -1
  36. package/dist/cjs/editor/extensions/mention/MentionDropdown.js.map +1 -1
  37. package/dist/cjs/editor/extensions/mention/MentionExtension.js +1 -1
  38. package/dist/cjs/editor/extensions/mention/MentionExtension.js.map +1 -1
  39. package/dist/esm/assets/icons/Shopify.svg.js +6 -0
  40. package/dist/esm/assets/icons/Shopify.svg.js.map +1 -0
  41. package/dist/esm/components/agent-builder/AgentBuilder.js +47 -47
  42. package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
  43. package/dist/esm/components/agent-builder/AgentBuilder.model.d.ts +1 -1
  44. package/dist/esm/components/agent-builder/AgentBuilder.styled.d.ts +6 -0
  45. package/dist/esm/components/agent-builder/AgentBuilder.styled.js +82 -42
  46. package/dist/esm/components/agent-builder/AgentBuilder.styled.js.map +1 -1
  47. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +84 -76
  48. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  49. package/dist/esm/components/agent-builder/components/GoLiveModal.js.map +1 -1
  50. package/dist/esm/components/agent-builder/components/MentionEditor.d.ts +6 -0
  51. package/dist/esm/components/agent-builder/components/MentionEditor.js +31 -30
  52. package/dist/esm/components/agent-builder/components/MentionEditor.js.map +1 -1
  53. package/dist/esm/components/agent-builder/components/MentionField.js +40 -37
  54. package/dist/esm/components/agent-builder/components/MentionField.js.map +1 -1
  55. package/dist/esm/components/agent-builder/components/MentionPicker.d.ts +6 -1
  56. package/dist/esm/components/agent-builder/components/MentionPicker.js +202 -101
  57. package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
  58. package/dist/esm/components/agent-builder/components/SelectableListSection.d.ts +18 -2
  59. package/dist/esm/components/agent-builder/components/SelectableListSection.js +159 -91
  60. package/dist/esm/components/agent-builder/components/SelectableListSection.js.map +1 -1
  61. package/dist/esm/components/agent-builder/constants/charLimits.d.ts +1 -1
  62. package/dist/esm/components/agent-builder/constants/charLimits.js +1 -1
  63. package/dist/esm/components/agent-builder/constants/charLimits.js.map +1 -1
  64. package/dist/esm/components/agent-builder/context/AgentBuilderContext.d.ts +7 -0
  65. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +107 -99
  66. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
  67. package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js +7 -7
  68. package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
  69. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +131 -106
  70. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
  71. package/dist/esm/components/agent-builder/utils/mentionSerialization.js +2 -2
  72. package/dist/esm/components/agent-builder/utils/mentionSerialization.js.map +1 -1
  73. package/dist/esm/components/agent-builder/utils/sourceIcons.d.ts +10 -0
  74. package/dist/esm/components/agent-builder/utils/sourceIcons.js +10 -0
  75. package/dist/esm/components/agent-builder/utils/sourceIcons.js.map +1 -0
  76. package/dist/esm/components/agent-listing/AgentListing.js +108 -101
  77. package/dist/esm/components/agent-listing/AgentListing.js.map +1 -1
  78. package/dist/esm/components/agent-listing/AgentListing.model.d.ts +8 -0
  79. package/dist/esm/components/agent-listing/AgentListingFilters.d.ts +2 -0
  80. package/dist/esm/components/agent-listing/AgentListingFilters.js +37 -33
  81. package/dist/esm/components/agent-listing/AgentListingFilters.js.map +1 -1
  82. package/dist/esm/editor/BikEditor.types.d.ts +7 -0
  83. package/dist/esm/editor/BikEditor.types.js.map +1 -1
  84. package/dist/esm/editor/extensions/mention/MentionDropdown.d.ts +2 -0
  85. package/dist/esm/editor/extensions/mention/MentionDropdown.js +21 -20
  86. package/dist/esm/editor/extensions/mention/MentionDropdown.js.map +1 -1
  87. package/dist/esm/editor/extensions/mention/MentionExtension.js +66 -55
  88. package/dist/esm/editor/extensions/mention/MentionExtension.js.map +1 -1
  89. package/package.json +2 -2
@@ -1,29 +1,91 @@
1
- import { jsx as o, jsxs as r } from "react/jsx-runtime";
2
- import A from "../../../assets/icons/delete.svg.js";
3
- import v from "../../../assets/icons/edit.svg.js";
4
- import _ from "../../../assets/icons/plus.svg.js";
5
- import { useState as R } from "react";
6
- import { TitleSmall as C, BodyCaption as b, BodySecondary as B } from "../../TypographyStyle.js";
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 E, SideSectionHeader as L, AddIconButton as k, SelectableRow as D, RowText as I, RowActions as j, RowMenuButton as g, RowActionDivider as z } from "../AgentBuilder.styled.js";
9
- import { Dropdown as H } from "../../dropdown/Dropdown.js";
10
- const y = "__bik_create_new__", J = ({
11
- title: d,
12
- helper: s,
13
- items: h,
14
- addableOptions: c,
15
- onAdd: p,
16
- onRemove: u,
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: i
22
+ onConfigure: w,
23
+ sourceGroups: h
21
24
  }) => {
22
- const [S, m] = R(!1), f = c.length > 0 || !!n, w = n ? [
23
- ...c,
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: y,
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
- ] : c;
44
- return /* @__PURE__ */ r(E, { children: [
45
- /* @__PURE__ */ r(L, { children: [
46
- /* @__PURE__ */ o(C, { color: l.content.primary, children: d }),
47
- f && /* @__PURE__ */ o(
48
- k,
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: () => m((e) => !e),
52
- "aria-label": `Add ${d}`,
53
- children: /* @__PURE__ */ o(_, { width: 20, height: 20, color: l.content.brand })
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
- s && /* @__PURE__ */ o(b, { color: l.content.secondary, children: s }),
58
- S && w.length > 0 && /* @__PURE__ */ o(
59
- H,
60
- {
61
- "data-test": `${t}-dropdown`,
62
- size: "small",
63
- width: "100%",
64
- isSearchable: !0,
65
- placeHolder: `Select ${d.toLowerCase()}`,
66
- options: w,
67
- onSelect: (e) => {
68
- const a = (Array.isArray(e) ? e[0] : e)?.value;
69
- m(!1), a && (a === y ? n?.onSelect() : p(a));
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
- h.length === 0 && !S ? /* @__PURE__ */ o(b, { color: l.content.placeholder, children: $ }) : h.map((e) => /* @__PURE__ */ r(
74
- D,
75
- {
76
- "data-test": `${t}-row-${e.id}`,
77
- children: [
78
- /* @__PURE__ */ o(I, { children: /* @__PURE__ */ o(B, { numberOfLines: 1, color: l.content.primary, children: e.label }) }),
79
- /* @__PURE__ */ r(j, { children: [
80
- i && // Configurable rows (sub-agents) get an always-visible edit icon.
81
- /* @__PURE__ */ o(
82
- g,
83
- {
84
- "data-test": `${t}-edit-${e.id}`,
85
- "aria-label": `Edit ${e.label}`,
86
- onClick: () => i(e.id),
87
- children: /* @__PURE__ */ o(
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
- J as SelectableListSection
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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,oBACA,OAAO;AAAA,oBACP,QAAQ;AAAA,oBACR,OAAOnB,EAAO,QAAQ;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACvB;AAAA,YAAA;AAAA,UACD,EAAA,CACD;AAAA,QAAA;AAAA,MAAA;AAAA,MAnCKW,EAAK;AAAA,IAAA,CAqCX;AAAA,EAAA,GAEH;AAEF;"}
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 { 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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AgB;AAAA,YAChB,aAAaqC;AAAAA,YACb,YAAYnC,EAAa;AAAA,YACzB,SAASA,EAAa;AAAA,UAAA;AAAA,QAAA;AAAA,MACvB,EAAA,CAEF,IAEAgB,EAAA;AAAA,IAAe,EAAA,CAEjB;AAAA,EAAA,GAEF;AAEF;"}
@@ -11,7 +11,7 @@ export declare const AGENT_CHAR_LIMITS: {
11
11
  /** Step 1 — "What it does". */
12
12
  readonly description: 1000;
13
13
  /** Step 2 — custom intent free text. */
14
- readonly customIntent: 1000;
14
+ readonly custom_intent: 1000;
15
15
  /** Step 3 — Instructions (BikEditor `maxCharacters`). */
16
16
  readonly instructions: 1000;
17
17
  /** Step 3 — Guardrails. */
@@ -4,7 +4,7 @@ const e = {
4
4
  /** Step 1 — "What it does". */
5
5
  description: 1e3,
6
6
  /** Step 2 — custom intent free text. */
7
- customIntent: 1e3,
7
+ custom_intent: 1e3,
8
8
  /** Step 3 — Instructions (BikEditor `maxCharacters`). */
9
9
  instructions: 1e3,
10
10
  /** Step 3 — Guardrails. */
@@ -1 +1 @@
1
- {"version":3,"file":"charLimits.js","sources":["../../../../../src/components/agent-builder/constants/charLimits.ts"],"sourcesContent":["/**\n * Character limits for AgentBuilder fields.\n *\n * `name` and `description` are taken directly from the Figma spec. The rest are\n * sized to match the 0/1000 counters shown on the response/handover steps; adjust\n * here if product changes them.\n */\nexport const AGENT_CHAR_LIMITS = {\n\t/** Step 1 — Agent name. */\n\tname: 60,\n\t/** Step 1 — \"What it does\". */\n\tdescription: 1000,\n\t/** Step 2 — custom intent free text. */\n\tcustomIntent: 1000,\n\t/** Step 3 — Instructions (BikEditor `maxCharacters`). */\n\tinstructions: 1000,\n\t/** Step 3 — Guardrails. */\n\tguardrail: 1000,\n\t/** Step 4 — \"Handover when\". */\n\thandoverWhen: 1000,\n} as const;\n"],"names":["AGENT_CHAR_LIMITS"],"mappings":"AAOO,MAAMA,IAAoB;AAAA;AAAA,EAEhC,MAAM;AAAA;AAAA,EAEN,aAAa;AAAA;AAAA,EAEb,cAAc;AAAA;AAAA,EAEd,cAAc;AAAA;AAAA,EAEd,WAAW;AAAA;AAAA,EAEX,cAAc;AACf;"}
1
+ {"version":3,"file":"charLimits.js","sources":["../../../../../src/components/agent-builder/constants/charLimits.ts"],"sourcesContent":["/**\n * Character limits for AgentBuilder fields.\n *\n * `name` and `description` are taken directly from the Figma spec. The rest are\n * sized to match the 0/1000 counters shown on the response/handover steps; adjust\n * here if product changes them.\n */\nexport const AGENT_CHAR_LIMITS = {\n\t/** Step 1 — Agent name. */\n\tname: 60,\n\t/** Step 1 — \"What it does\". */\n\tdescription: 1000,\n\t/** Step 2 — custom intent free text. */\n\tcustom_intent: 1000,\n\t/** Step 3 — Instructions (BikEditor `maxCharacters`). */\n\tinstructions: 1000,\n\t/** Step 3 — Guardrails. */\n\tguardrail: 1000,\n\t/** Step 4 — \"Handover when\". */\n\thandoverWhen: 1000,\n} as const;\n"],"names":["AGENT_CHAR_LIMITS"],"mappings":"AAOO,MAAMA,IAAoB;AAAA;AAAA,EAEhC,MAAM;AAAA;AAAA,EAEN,aAAa;AAAA;AAAA,EAEb,eAAe;AAAA;AAAA,EAEf,cAAc;AAAA;AAAA,EAEd,WAAW;AAAA;AAAA,EAEX,cAAc;AACf;"}
@@ -61,6 +61,13 @@ export interface AgentBuilderContextShape {
61
61
  disableStepNavigation: boolean;
62
62
  /** Persist a 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. */