@bikdotai/bik-component-library 0.0.875-beta.1 → 0.0.875-beta.3

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 (59) hide show
  1. package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js +11 -11
  2. package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
  3. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js +2 -2
  4. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  5. package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js +4 -4
  6. package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
  7. package/dist/cjs/components/agent-builder/utils/sourceIcons.js +1 -1
  8. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
  9. package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js.map +1 -1
  10. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +27 -10
  11. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
  12. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
  13. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js.map +1 -1
  14. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js +1 -1
  15. package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js.map +1 -1
  16. package/dist/cjs/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.js +1 -1
  17. package/dist/cjs/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.js.map +1 -1
  18. package/dist/cjs/components/dropdown/OpenedDropdown/utils/iterationOnOptions.js +1 -1
  19. package/dist/cjs/components/dropdown/OpenedDropdown/utils/iterationOnOptions.js.map +1 -1
  20. package/dist/cjs/components/dropdown/hooks/useDropdown.js +1 -1
  21. package/dist/cjs/components/dropdown/hooks/useDropdown.js.map +1 -1
  22. package/dist/cjs/index.js +1 -1
  23. package/dist/esm/components/agent-builder/components/ConfigToolPanel.d.ts +0 -6
  24. package/dist/esm/components/agent-builder/components/ConfigToolPanel.js +141 -143
  25. package/dist/esm/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
  26. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.d.ts +0 -6
  27. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +81 -83
  28. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  29. package/dist/esm/components/agent-builder/components/MentionPicker.js +5 -5
  30. package/dist/esm/components/agent-builder/components/RestApiToolPanel.d.ts +0 -6
  31. package/dist/esm/components/agent-builder/components/RestApiToolPanel.js +48 -50
  32. package/dist/esm/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
  33. package/dist/esm/components/agent-builder/index.d.ts +2 -18
  34. package/dist/esm/components/agent-builder/utils/sourceIcons.js +43 -43
  35. package/dist/esm/components/agent-builder/utils/toolActions.js +3 -3
  36. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +300 -278
  37. package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js.map +1 -1
  38. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.d.ts +8 -0
  39. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +170 -126
  40. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
  41. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.d.ts +4 -0
  42. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.js +144 -112
  43. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.js.map +1 -1
  44. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.d.ts +1 -0
  45. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js +32 -31
  46. package/dist/esm/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js.map +1 -1
  47. package/dist/esm/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.d.ts +2 -0
  48. package/dist/esm/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.js +54 -39
  49. package/dist/esm/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.js.map +1 -1
  50. package/dist/esm/components/dropdown/OpenedDropdown/utils/iterationOnOptions.d.ts +18 -16
  51. package/dist/esm/components/dropdown/OpenedDropdown/utils/iterationOnOptions.js +73 -27
  52. package/dist/esm/components/dropdown/OpenedDropdown/utils/iterationOnOptions.js.map +1 -1
  53. package/dist/esm/components/dropdown/hooks/useDropdown.d.ts +4 -17
  54. package/dist/esm/components/dropdown/hooks/useDropdown.js +176 -163
  55. package/dist/esm/components/dropdown/hooks/useDropdown.js.map +1 -1
  56. package/dist/esm/components/dropdown/type.d.ts +22 -0
  57. package/dist/esm/index.js +772 -816
  58. package/dist/esm/index.js.map +1 -1
  59. package/package.json +1 -1
@@ -13,12 +13,6 @@ interface RestApiToolPanelProps {
13
13
  charLimits?: AgentCharLimits;
14
14
  /** SideModal stacking order — raise it when opened over another drawer. */
15
15
  zIndex?: number;
16
- /**
17
- * Portal target for the drawer, passed straight to {@link SideModal}
18
- * (default `document.body`). Lets a host render it into its own positioned
19
- * slot rather than as a viewport overlay.
20
- */
21
- element?: Element | DocumentFragment;
22
16
  /** Names of the OTHER tools — a new tool can't reuse one of these. */
23
17
  existingNames?: string[];
24
18
  /**
@@ -1,25 +1,25 @@
1
1
  import { jsxs as i, jsx as r } from "react/jsx-runtime";
2
- import Z from "../../../assets/icons/delete.svg.js";
3
- import ee from "../../../assets/icons/plus.svg.js";
2
+ import X from "../../../assets/icons/delete.svg.js";
3
+ import Z from "../../../assets/icons/plus.svg.js";
4
4
  import { useState as l, useRef as B } from "react";
5
5
  import C from "styled-components";
6
- import { BodyCaption as te, TitleSmall as u } from "../../TypographyStyle.js";
6
+ import { BodyCaption as ee, TitleSmall as u } from "../../TypographyStyle.js";
7
7
  import { COLORS as a } from "../../../constants/Theme.js";
8
8
  import { FieldBlock as m } from "../AgentBuilder.styled.js";
9
- import { AGENT_CHAR_LIMITS as re } from "../constants/charLimits.js";
10
- import { DRAWER_BODY_STYLE as ne, DRAWER_HEADER_STYLE as oe, DrawerHeaderText as ae } from "./DrawerHeaderText.js";
11
- import { ToolInstructionsField as se } from "./ToolInstructionsField.js";
9
+ import { AGENT_CHAR_LIMITS as te } from "../constants/charLimits.js";
10
+ import { DRAWER_BODY_STYLE as re, DRAWER_HEADER_STYLE as ne, DrawerHeaderText as oe } from "./DrawerHeaderText.js";
11
+ import { ToolInstructionsField as ae } from "./ToolInstructionsField.js";
12
12
  import { VariableInlineField as D } from "./VariableInlineField.js";
13
- import { SideModal as le } from "../../side-modal/SideModal.js";
13
+ import { SideModal as se } from "../../side-modal/SideModal.js";
14
14
  import { Input as _ } from "../../input/Input.js";
15
- import { Dropdown as ie } from "../../dropdown/Dropdown.js";
16
- import { unwrapDropdownValue as de } from "../../dropdown/utils.js";
17
- import { Button as ce } from "../../button/Button.js";
15
+ import { Dropdown as le } from "../../dropdown/Dropdown.js";
16
+ import { unwrapDropdownValue as ie } from "../../dropdown/utils.js";
17
+ import { Button as de } from "../../button/Button.js";
18
18
  import { BikEditor as M } from "../../../editor/BikEditor.js";
19
- const pe = ["GET", "POST", "PUT", "PATCH", "DELETE"], me = pe.map((s) => ({
19
+ const ce = ["GET", "POST", "PUT", "PATCH", "DELETE"], pe = ce.map((s) => ({
20
20
  label: s,
21
21
  value: s
22
- })), he = (s) => {
22
+ })), me = (s) => {
23
23
  if (!/^https?:\/\//i.test(s))
24
24
  return !1;
25
25
  let d;
@@ -29,55 +29,53 @@ const pe = ["GET", "POST", "PUT", "PATCH", "DELETE"], me = pe.map((s) => ({
29
29
  return !1;
30
30
  }
31
31
  return d.includes(".") && !d.startsWith(".") && !d.endsWith(".");
32
- }, Me = ({
32
+ }, _e = ({
33
33
  onClose: s,
34
34
  onSave: d,
35
35
  initial: o,
36
36
  onImprove: N,
37
- charLimits: f = re,
37
+ charLimits: f = te,
38
38
  zIndex: q,
39
39
  existingNames: $ = [],
40
- variablesData: y,
41
- element: j
40
+ variablesData: y
42
41
  }) => {
43
- const [g, V] = l(o?.name ?? ""), [v, W] = l(o?.instructions ?? ""), [x, z] = l(o?.url ?? "https://"), [T, F] = l(
42
+ const [g, j] = l(o?.name ?? ""), [v, V] = l(o?.instructions ?? ""), [x, W] = l(o?.url ?? "https://"), [T, z] = l(
44
43
  o?.method ?? "POST"
45
44
  ), [H, S] = l(
46
45
  o?.headers ?? [{ key: "", value: "" }]
47
- ), [w, G] = l(o?.requestBody ?? ""), [E, J] = l(
46
+ ), [w, F] = l(o?.requestBody ?? ""), [E, G] = l(
48
47
  o?.responseSample ?? ""
49
48
  ), [I, k] = l(!1), c = B(
50
49
  (o?.headers ?? [{ key: "", value: "" }]).map(
51
50
  (e, t) => t
52
51
  )
53
52
  ), A = B(c.current.length), L = (e, t) => S(
54
- (n) => n.map((h, X) => X === e ? { ...h, ...t } : h)
55
- ), Y = () => {
53
+ (n) => n.map((h, Q) => Q === e ? { ...h, ...t } : h)
54
+ ), J = () => {
56
55
  c.current = [...c.current, A.current], A.current += 1, S((e) => [...e, { key: "", value: "" }]);
57
- }, K = (e) => {
56
+ }, Y = (e) => {
58
57
  c.current = c.current.filter((t, n) => n !== e), S((t) => t.filter((n, h) => h !== e));
59
58
  }, b = g.trim(), R = b.length > 0 && $.some(
60
59
  (e) => e.trim().toLowerCase() === b.toLowerCase()
61
- ), p = x.trim(), O = p.includes("{{variable:") ? /^https?:\/\/./.test(p) : he(p), Q = p.length > 0 && p !== "https://" && !O, P = b.length > 0 && O && !R && // The editor's characterLimit is soft (a paste may exceed it, rendered
60
+ ), p = x.trim(), O = p.includes("{{variable:") ? /^https?:\/\/./.test(p) : me(p), K = p.length > 0 && p !== "https://" && !O, P = b.length > 0 && O && !R && // The editor's characterLimit is soft (a paste may exceed it, rendered
62
61
  // grey) — gate the save so over-limit instructions can't be persisted.
63
62
  v.length <= f.instructions;
64
63
  return /* @__PURE__ */ i(
65
- le,
64
+ se,
66
65
  {
67
66
  header: "Rest API",
68
67
  closeOnEscapeKey: !1,
69
68
  zIndex: q,
70
- element: j,
71
69
  headerCustomComponent: /* @__PURE__ */ r(
72
- ae,
70
+ oe,
73
71
  {
74
72
  title: "Rest API",
75
73
  subtitle: "Connect to any API endpoint. Define the request and a sample response for the agent to reference."
76
74
  }
77
75
  ),
78
76
  width: "431px",
79
- headerStyle: oe,
80
- bodyStyle: ne,
77
+ headerStyle: ne,
78
+ bodyStyle: re,
81
79
  onClose: s,
82
80
  saveButtonProps: {
83
81
  "data-test": "restapi-save",
@@ -130,16 +128,16 @@ const pe = ["GET", "POST", "PUT", "PATCH", "DELETE"], me = pe.map((s) => ({
130
128
  maxCharLimit: f.name,
131
129
  state: R ? "invalid" : void 0,
132
130
  errorMessage: R ? "A tool with this name already exists" : void 0,
133
- onChangeText: V
131
+ onChangeText: j
134
132
  }
135
133
  ),
136
134
  /* @__PURE__ */ r(
137
- se,
135
+ ae,
138
136
  {
139
137
  "data-test": "restapi-instructions",
140
138
  label: "Instructions",
141
139
  value: v,
142
- onChange: W,
140
+ onChange: V,
143
141
  maxLength: f.instructions,
144
142
  placeholder: "Describe how should the LLM generate the rest API",
145
143
  onImprove: N,
@@ -154,26 +152,26 @@ const pe = ["GET", "POST", "PUT", "PATCH", "DELETE"], me = pe.map((s) => ({
154
152
  label: "Request URL",
155
153
  placeholder: "https://",
156
154
  value: x,
157
- onChange: z,
155
+ onChange: W,
158
156
  variablesData: y
159
157
  }
160
158
  ),
161
- Q && /* @__PURE__ */ r(te, { color: a.content.negative, children: "Enter a valid URL (including https://)" })
159
+ K && /* @__PURE__ */ r(ee, { color: a.content.negative, children: "Enter a valid URL (including https://)" })
162
160
  ] }),
163
161
  /* @__PURE__ */ i(m, { children: [
164
162
  /* @__PURE__ */ r(u, { color: a.content.primary, children: "HTTP method" }),
165
163
  /* @__PURE__ */ r(
166
- ie,
164
+ le,
167
165
  {
168
166
  "data-test": "restapi-method",
169
167
  size: "small",
170
168
  width: "100%",
171
169
  dropdownWidth: "399px",
172
- options: me,
170
+ options: pe,
173
171
  defaultOptions: [{ label: T, value: T }],
174
172
  onSelect: (e) => {
175
- const t = de(e);
176
- t && F(t);
173
+ const t = ie(e);
174
+ t && z(t);
177
175
  }
178
176
  }
179
177
  )
@@ -181,7 +179,7 @@ const pe = ["GET", "POST", "PUT", "PATCH", "DELETE"], me = pe.map((s) => ({
181
179
  /* @__PURE__ */ i(m, { children: [
182
180
  /* @__PURE__ */ r(u, { color: a.content.primary, children: "Headers" }),
183
181
  H.map((e, t) => /* @__PURE__ */ i(
184
- ue,
182
+ he,
185
183
  {
186
184
  "data-test": `restapi-header-${t}`,
187
185
  children: [
@@ -205,14 +203,14 @@ const pe = ["GET", "POST", "PUT", "PATCH", "DELETE"], me = pe.map((s) => ({
205
203
  }
206
204
  ),
207
205
  /* @__PURE__ */ r(
208
- ye,
206
+ fe,
209
207
  {
210
208
  type: "button",
211
209
  "aria-label": "Remove header",
212
210
  "data-test": `restapi-header-remove-${t}`,
213
- onClick: () => K(t),
211
+ onClick: () => Y(t),
214
212
  children: /* @__PURE__ */ r(
215
- Z,
213
+ X,
216
214
  {
217
215
  width: 16,
218
216
  height: 16,
@@ -225,15 +223,15 @@ const pe = ["GET", "POST", "PUT", "PATCH", "DELETE"], me = pe.map((s) => ({
225
223
  },
226
224
  c.current[t]
227
225
  )),
228
- /* @__PURE__ */ r(fe, { children: /* @__PURE__ */ r(
229
- ce,
226
+ /* @__PURE__ */ r(ue, { children: /* @__PURE__ */ r(
227
+ de,
230
228
  {
231
229
  "data-test": "restapi-add-header",
232
230
  buttonType: "dashRegular",
233
231
  size: "small",
234
- LeadingIcon: ee,
232
+ LeadingIcon: Z,
235
233
  buttonText: "Add header",
236
- onClick: Y
234
+ onClick: J
237
235
  }
238
236
  ) })
239
237
  ] }),
@@ -246,7 +244,7 @@ const pe = ["GET", "POST", "PUT", "PATCH", "DELETE"], me = pe.map((s) => ({
246
244
  initialContent: w,
247
245
  style: U,
248
246
  placeholder: "Type or paste JSON here",
249
- onChange: (e) => G(e.text),
247
+ onChange: (e) => F(e.text),
250
248
  minHeight: "120px",
251
249
  maxHeight: "240px"
252
250
  }
@@ -261,7 +259,7 @@ const pe = ["GET", "POST", "PUT", "PATCH", "DELETE"], me = pe.map((s) => ({
261
259
  style: U,
262
260
  initialContent: E,
263
261
  placeholder: "Type or paste JSON here",
264
- onChange: (e) => J(e.text),
262
+ onChange: (e) => G(e.text),
265
263
  minHeight: "120px",
266
264
  maxHeight: "240px"
267
265
  }
@@ -270,14 +268,14 @@ const pe = ["GET", "POST", "PUT", "PATCH", "DELETE"], me = pe.map((s) => ({
270
268
  ]
271
269
  }
272
270
  );
273
- }, ue = C.div`
271
+ }, he = C.div`
274
272
  display: grid;
275
273
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 32px;
276
274
  align-items: center;
277
275
  gap: 8px;
278
- `, fe = C.div`
276
+ `, ue = C.div`
279
277
  display: flex;
280
- `, ye = C.button`
278
+ `, fe = C.button`
281
279
  display: inline-flex;
282
280
  align-items: center;
283
281
  justify-content: center;
@@ -298,6 +296,6 @@ const pe = ["GET", "POST", "PUT", "PATCH", "DELETE"], me = pe.map((s) => ({
298
296
  };
299
297
  export {
300
298
  U as JsonFieldBox,
301
- Me as RestApiToolPanel
299
+ _e as RestApiToolPanel
302
300
  };
303
301
  //# sourceMappingURL=RestApiToolPanel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RestApiToolPanel.js","sources":["../../../../../src/components/agent-builder/components/RestApiToolPanel.tsx"],"sourcesContent":["import DeleteIcon from '@src/assets/icons/delete.svg';\nimport PlusIcon from '@src/assets/icons/plus.svg';\nimport { BikEditor } from '@src/editor';\nimport React, { useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { Button } from '@src/components/button';\nimport { Dropdown, unwrapDropdownValue } from '@src/components/dropdown';\nimport { SingleOption } from '@src/components/dropdown/type';\nimport { Input } from '@src/components/input';\nimport { SideModal } from '@src/components/side-modal';\nimport { BodyCaption, TitleSmall } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport type { VariableListInterfaceV3 } from '../../variable-picker-v3/model';\nimport {\n\tRestApiHeader,\n\tRestApiMethod,\n\tRestApiToolConfig,\n} from '../AgentBuilder.model';\nimport { FieldBlock } from '../AgentBuilder.styled';\nimport type { AgentCharLimits } from '../constants/charLimits';\nimport { AGENT_CHAR_LIMITS } from '../constants/charLimits';\nimport {\n\tDRAWER_BODY_STYLE,\n\tDRAWER_HEADER_STYLE,\n\tDrawerHeaderText,\n} from './DrawerHeaderText';\nimport { ToolInstructionsField } from './ToolInstructionsField';\nimport { VariableInlineField } from './VariableInlineField';\n\ninterface RestApiToolPanelProps {\n\tonClose: () => void;\n\t/** Persist the config. A pending promise shows the Save loader. */\n\tonSave: (config: RestApiToolConfig) => void | Promise<void>;\n\t/** Seed values when editing an existing tool. */\n\tinitial?: RestApiToolConfig;\n\t/** Optional \"Improve with AI\" for the instructions field. Omit to hide it. */\n\tonImprove?: (text: string) => Promise<string>;\n\tcharLimits?: AgentCharLimits;\n\t/** SideModal stacking order — raise it when opened over another drawer. */\n\tzIndex?: number;\n\t/**\n\t * Portal target for the drawer, passed straight to {@link SideModal}\n\t * (default `document.body`). Lets a host render it into its own positioned\n\t * slot rather than as a viewport overlay.\n\t */\n\telement?: Element | DocumentFragment;\n\t/** Names of the OTHER tools — a new tool can't reuse one of these. */\n\texistingNames?: string[];\n\t/**\n\t * Variable catalog for the `@` trigger. When non-empty, `@` opens the\n\t * variable picker directly in Instructions / Request URL / header values.\n\t * (Request / Response JSON editors are deliberately not wired for now.)\n\t * Absent → the drawer behaves exactly as before.\n\t */\n\tvariablesData?: VariableListInterfaceV3[];\n}\n\nconst METHODS: RestApiMethod[] = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'];\nconst METHOD_OPTIONS: SingleOption[] = METHODS.map((m) => ({\n\tlabel: m,\n\tvalue: m,\n}));\n\n// A callable endpoint needs an explicit http(s):// scheme AND a real, dotted\n// host. `new URL` alone is too lenient — it accepts single-label hosts\n// (\"https://abc\"), a one-slash scheme (\"https:/abc.com\"), and dangling-dot\n// hosts (\"https://.com\" / \"https://abc.\"). Require the `://` prefix on the raw\n// value plus a hostname that is either dotted (example.com) or an IPv4.\nconst isValidHttpUrl = (value: string): boolean => {\n\tif (!/^https?:\\/\\//i.test(value)) {\n\t\treturn false;\n\t}\n\tlet host: string;\n\ttry {\n\t\thost = new URL(value).hostname;\n\t} catch {\n\t\treturn false;\n\t}\n\treturn host.includes('.') && !host.startsWith('.') && !host.endsWith('.');\n};\n\n/**\n * Right-side drawer to configure a \"Rest API\" tool: the endpoint the agent can\n * call, plus a JSON request-body template and a sample response. Mount it fresh\n * per open (key it) so `initial` seeds the state. Built on the shared `SideModal`\n * shell and the BikEditor JSON body mode for the Request / Response editors.\n */\nexport const RestApiToolPanel: React.FC<RestApiToolPanelProps> = ({\n\tonClose,\n\tonSave,\n\tinitial,\n\tonImprove,\n\tcharLimits = AGENT_CHAR_LIMITS,\n\tzIndex,\n\texistingNames = [],\n\tvariablesData,\n\telement,\n}) => {\n\tconst [name, setName] = useState(initial?.name ?? '');\n\tconst [instructions, setInstructions] = useState(initial?.instructions ?? '');\n\t// New tools start with the scheme pre-filled so the user only types the host.\n\tconst [url, setUrl] = useState(initial?.url ?? 'https://');\n\tconst [method, setMethod] = useState<RestApiMethod>(\n\t\tinitial?.method ?? 'POST',\n\t);\n\tconst [headers, setHeaders] = useState<RestApiHeader[]>(\n\t\tinitial?.headers ?? [{ key: '', value: '' }],\n\t);\n\tconst [requestBody, setRequestBody] = useState(initial?.requestBody ?? '');\n\tconst [responseSample, setResponseSample] = useState(\n\t\tinitial?.responseSample ?? '',\n\t);\n\tconst [saving, setSaving] = useState(false);\n\n\t// Stable per-row identity for React keys, parallel to `headers`. The value\n\t// field is an uncontrolled editor, so a row must keep its mount across\n\t// sibling add/remove — index-based keys would remount every row (dropping\n\t// focus mid-edit) or let a deleted row's text linger in a reused neighbour.\n\tconst headerIdsRef = useRef<number[]>(\n\t\t(initial?.headers ?? [{ key: '', value: '' }]).map(\n\t\t\t(_h: RestApiHeader, i: number) => i,\n\t\t),\n\t);\n\tconst nextHeaderIdRef = useRef(headerIdsRef.current.length);\n\n\tconst patchHeader = (i: number, patch: Partial<RestApiHeader>) =>\n\t\tsetHeaders((prev) =>\n\t\t\tprev.map((h, idx) => (idx === i ? { ...h, ...patch } : h)),\n\t\t);\n\tconst addHeader = () => {\n\t\theaderIdsRef.current = [...headerIdsRef.current, nextHeaderIdRef.current];\n\t\tnextHeaderIdRef.current += 1;\n\t\tsetHeaders((prev) => [...prev, { key: '', value: '' }]);\n\t};\n\tconst removeHeader = (i: number) => {\n\t\theaderIdsRef.current = headerIdsRef.current.filter((_, idx) => idx !== i);\n\t\tsetHeaders((prev) => prev.filter((_, idx) => idx !== i));\n\t};\n\n\tconst nameTrimmed = name.trim();\n\t// Case-insensitive: two tools can't share a name (the LLM references them by it).\n\tconst isDuplicateName =\n\t\tnameTrimmed.length > 0 &&\n\t\texistingNames.some(\n\t\t\t(n) => n.trim().toLowerCase() === nameTrimmed.toLowerCase(),\n\t\t);\n\tconst urlTrimmed = url.trim();\n\t// Save needs a real endpoint, but don't flash the error while the field still\n\t// holds its pristine \"https://\" seed — only once the user has typed past it.\n\t// A URL that interpolates variables can't be parsed literally (braces are\n\t// invalid URL characters) — accept it once a scheme + something follows;\n\t// it only becomes a concrete URL after runtime substitution.\n\tconst urlUsesVariables = urlTrimmed.includes('{{variable:');\n\tconst urlOk = urlUsesVariables\n\t\t? /^https?:\\/\\/./.test(urlTrimmed)\n\t\t: isValidHttpUrl(urlTrimmed);\n\tconst isUrlInvalid =\n\t\turlTrimmed.length > 0 && urlTrimmed !== 'https://' && !urlOk;\n\tconst canSave =\n\t\tnameTrimmed.length > 0 &&\n\t\turlOk &&\n\t\t!isDuplicateName &&\n\t\t// The editor's characterLimit is soft (a paste may exceed it, rendered\n\t\t// grey) — gate the save so over-limit instructions can't be persisted.\n\t\tinstructions.length <= charLimits.instructions;\n\n\tconst handleSave = async () => {\n\t\tif (!canSave || saving) {\n\t\t\treturn;\n\t\t}\n\t\tconst config: RestApiToolConfig = {\n\t\t\tid: initial?.id ?? `restapi_${Date.now().toString(36)}`,\n\t\t\tname: name.trim(),\n\t\t\tinstructions,\n\t\t\turl: url.trim(),\n\t\t\tmethod,\n\t\t\t// Drop fully-empty header rows.\n\t\t\theaders: headers.filter((h) => h.key.trim() || h.value.trim()),\n\t\t\trequestBody,\n\t\t\tresponseSample,\n\t\t};\n\t\tconst result = onSave(config);\n\t\tif (result && typeof (result as Promise<void>).then === 'function') {\n\t\t\tsetSaving(true);\n\t\t\ttry {\n\t\t\t\tawait result;\n\t\t\t} finally {\n\t\t\t\tsetSaving(false);\n\t\t\t}\n\t\t}\n\t};\n\n\treturn (\n\t\t<SideModal\n\t\t\theader=\"Rest API\"\n\t\t\tcloseOnEscapeKey={false}\n\t\t\tzIndex={zIndex}\n\t\t\telement={element}\n\t\t\theaderCustomComponent={\n\t\t\t\t<DrawerHeaderText\n\t\t\t\t\ttitle=\"Rest API\"\n\t\t\t\t\tsubtitle=\"Connect to any API endpoint. Define the request and a sample response for the agent to reference.\"\n\t\t\t\t/>\n\t\t\t}\n\t\t\twidth=\"431px\"\n\t\t\theaderStyle={DRAWER_HEADER_STYLE}\n\t\t\tbodyStyle={DRAWER_BODY_STYLE}\n\t\t\tonClose={onClose}\n\t\t\tsaveButtonProps={{\n\t\t\t\t'data-test': 'restapi-save',\n\t\t\t\tbuttonText: 'Save',\n\t\t\t\tbuttonType: 'primary',\n\t\t\t\tsize: 'small',\n\t\t\t\tdisabled: !canSave,\n\t\t\t\tisLoading: saving,\n\t\t\t\tonClick: handleSave,\n\t\t\t}}\n\t\t\tcancelButtonProps={{\n\t\t\t\t'data-test': 'restapi-cancel',\n\t\t\t\tbuttonText: 'Cancel',\n\t\t\t\tbuttonType: 'tertiaryGray',\n\t\t\t\tsize: 'small',\n\t\t\t\tonClick: onClose,\n\t\t\t}}\n\t\t>\n\t\t\t<Input\n\t\t\t\tdata-test=\"restapi-name\"\n\t\t\t\tvariant=\"small\"\n\t\t\t\tlabelText=\"Name\"\n\t\t\t\tlabelTextBold\n\t\t\t\tplaceholder=\"Enter action name\"\n\t\t\t\tvalue={name}\n\t\t\t\tmaxCharLimit={charLimits.name}\n\t\t\t\tstate={isDuplicateName ? 'invalid' : undefined}\n\t\t\t\terrorMessage={\n\t\t\t\t\tisDuplicateName ? 'A tool with this name already exists' : undefined\n\t\t\t\t}\n\t\t\t\tonChangeText={setName}\n\t\t\t/>\n\n\t\t\t<ToolInstructionsField\n\t\t\t\tdata-test=\"restapi-instructions\"\n\t\t\t\tlabel=\"Instructions\"\n\t\t\t\tvalue={instructions}\n\t\t\t\tonChange={setInstructions}\n\t\t\t\tmaxLength={charLimits.instructions}\n\t\t\t\tplaceholder=\"Describe how should the LLM generate the rest API\"\n\t\t\t\tonImprove={onImprove}\n\t\t\t\tvariablesData={variablesData}\n\t\t\t/>\n\n\t\t\t<FieldBlock>\n\t\t\t\t<VariableInlineField\n\t\t\t\t\tdata-test=\"restapi-url\"\n\t\t\t\t\tlabel=\"Request URL\"\n\t\t\t\t\tplaceholder=\"https://\"\n\t\t\t\t\tvalue={url}\n\t\t\t\t\tonChange={setUrl}\n\t\t\t\t\tvariablesData={variablesData}\n\t\t\t\t/>\n\t\t\t\t{/* VariableInlineField has no invalid state of its own — surface the\n\t\t\t\t URL validation (from main) as a caption below the field. */}\n\t\t\t\t{isUrlInvalid && (\n\t\t\t\t\t<BodyCaption color={COLORS.content.negative}>\n\t\t\t\t\t\tEnter a valid URL (including https://)\n\t\t\t\t\t</BodyCaption>\n\t\t\t\t)}\n\t\t\t</FieldBlock>\n\n\t\t\t<FieldBlock>\n\t\t\t\t<TitleSmall color={COLORS.content.primary}>HTTP method</TitleSmall>\n\t\t\t\t<Dropdown\n\t\t\t\t\tdata-test=\"restapi-method\"\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\twidth=\"100%\"\n\t\t\t\t\tdropdownWidth=\"399px\"\n\t\t\t\t\toptions={METHOD_OPTIONS}\n\t\t\t\t\tdefaultOptions={[{ label: method, value: method }]}\n\t\t\t\t\tonSelect={(opt) => {\n\t\t\t\t\t\tconst v = unwrapDropdownValue(opt);\n\t\t\t\t\t\tif (v) {\n\t\t\t\t\t\t\tsetMethod(v as RestApiMethod);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</FieldBlock>\n\n\t\t\t<FieldBlock>\n\t\t\t\t<TitleSmall color={COLORS.content.primary}>Headers</TitleSmall>\n\t\t\t\t{headers.map((h, i) => (\n\t\t\t\t\t<HeaderRow\n\t\t\t\t\t\tkey={headerIdsRef.current[i]}\n\t\t\t\t\t\tdata-test={`restapi-header-${i}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\tvariant=\"small\"\n\t\t\t\t\t\t\thideInputHeader\n\t\t\t\t\t\t\tplaceholder=\"Enter name\"\n\t\t\t\t\t\t\tvalue={h.key}\n\t\t\t\t\t\t\tonChangeText={(v) => patchHeader(i, { key: v })}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<VariableInlineField\n\t\t\t\t\t\t\tplaceholder=\"Enter value\"\n\t\t\t\t\t\t\tvalue={h.value}\n\t\t\t\t\t\t\tonChange={(v) => patchHeader(i, { value: v })}\n\t\t\t\t\t\t\tvariablesData={variablesData}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<IconBtn\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\taria-label=\"Remove header\"\n\t\t\t\t\t\t\tdata-test={`restapi-header-remove-${i}`}\n\t\t\t\t\t\t\tonClick={() => removeHeader(i)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<DeleteIcon\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</IconBtn>\n\t\t\t\t\t</HeaderRow>\n\t\t\t\t))}\n\t\t\t\t<AddHeaderRow>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tdata-test=\"restapi-add-header\"\n\t\t\t\t\t\tbuttonType=\"dashRegular\"\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tLeadingIcon={PlusIcon}\n\t\t\t\t\t\tbuttonText=\"Add header\"\n\t\t\t\t\t\tonClick={addHeader}\n\t\t\t\t\t/>\n\t\t\t\t</AddHeaderRow>\n\t\t\t</FieldBlock>\n\n\t\t\t{/* Variables intentionally NOT wired here (yet) — the JSON editors are\n\t\t\t plain code fields; @ types a literal @. */}\n\t\t\t<FieldBlock>\n\t\t\t\t<TitleSmall color={COLORS.content.primary}>Request </TitleSmall>\n\t\t\t\t<BikEditor\n\t\t\t\t\tfeatures={{ jsonMode: true }}\n\t\t\t\t\tinitialContent={requestBody}\n\t\t\t\t\tstyle={JsonFieldBox}\n\t\t\t\t\tplaceholder=\"Type or paste JSON here\"\n\t\t\t\t\tonChange={(c) => setRequestBody(c.text)}\n\t\t\t\t\tminHeight=\"120px\"\n\t\t\t\t\tmaxHeight=\"240px\"\n\t\t\t\t/>\n\t\t\t</FieldBlock>\n\n\t\t\t<FieldBlock>\n\t\t\t\t<TitleSmall color={COLORS.content.primary}>Response </TitleSmall>\n\t\t\t\t<BikEditor\n\t\t\t\t\tfeatures={{ jsonMode: true }}\n\t\t\t\t\tstyle={JsonFieldBox}\n\t\t\t\t\tinitialContent={responseSample}\n\t\t\t\t\tplaceholder=\"Type or paste JSON here\"\n\t\t\t\t\tonChange={(c) => setResponseSample(c.text)}\n\t\t\t\t\tminHeight=\"120px\"\n\t\t\t\t\tmaxHeight=\"240px\"\n\t\t\t\t/>\n\t\t\t</FieldBlock>\n\t\t</SideModal>\n\t);\n};\n\n// Fixed tracks (name / value / delete): minmax(0, …) lets the fields shrink\n// below their content width, so a long value scrolls inside its field and the\n// delete button can never be pushed off the row.\nconst HeaderRow = styled.div`\n\tdisplay: grid;\n\tgrid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 32px;\n\talign-items: center;\n\tgap: 8px;\n`;\n\nconst AddHeaderRow = styled.div`\n\tdisplay: flex;\n`;\n\nconst IconBtn = styled.button`\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tflex-shrink: 0;\n\twidth: 32px;\n\theight: 32px;\n\tborder: 1px solid ${COLORS.stroke.primary};\n\tborder-radius: 4px;\n\tbackground: ${COLORS.surface.standard};\n\tcursor: pointer;\n\n\t&:hover {\n\t\tborder-color: ${COLORS.content.secondary};\n\t}\n`;\n\nexport const JsonFieldBox = {\n\tborderRadius: '4px',\n\toverflow: 'hidden',\n};\n"],"names":["METHODS","METHOD_OPTIONS","m","isValidHttpUrl","value","host","RestApiToolPanel","onClose","onSave","initial","onImprove","charLimits","AGENT_CHAR_LIMITS","zIndex","existingNames","variablesData","element","name","setName","useState","instructions","setInstructions","url","setUrl","method","setMethod","headers","setHeaders","requestBody","setRequestBody","responseSample","setResponseSample","saving","setSaving","headerIdsRef","useRef","_h","i","nextHeaderIdRef","patchHeader","patch","prev","idx","addHeader","removeHeader","_","nameTrimmed","isDuplicateName","n","urlTrimmed","urlOk","isUrlInvalid","canSave","jsxs","SideModal","jsx","DrawerHeaderText","DRAWER_HEADER_STYLE","DRAWER_BODY_STYLE","config","h","result","Input","ToolInstructionsField","FieldBlock","VariableInlineField","BodyCaption","COLORS","TitleSmall","Dropdown","opt","v","unwrapDropdownValue","HeaderRow","IconBtn","DeleteIcon","AddHeaderRow","Button","PlusIcon","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/components/agent-builder/components/RestApiToolPanel.tsx"],"sourcesContent":["import DeleteIcon from '@src/assets/icons/delete.svg';\nimport PlusIcon from '@src/assets/icons/plus.svg';\nimport { BikEditor } from '@src/editor';\nimport React, { useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { Button } from '@src/components/button';\nimport { Dropdown, unwrapDropdownValue } from '@src/components/dropdown';\nimport { SingleOption } from '@src/components/dropdown/type';\nimport { Input } from '@src/components/input';\nimport { SideModal } from '@src/components/side-modal';\nimport { BodyCaption, TitleSmall } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport type { VariableListInterfaceV3 } from '../../variable-picker-v3/model';\nimport {\n\tRestApiHeader,\n\tRestApiMethod,\n\tRestApiToolConfig,\n} from '../AgentBuilder.model';\nimport { FieldBlock } from '../AgentBuilder.styled';\nimport type { AgentCharLimits } from '../constants/charLimits';\nimport { AGENT_CHAR_LIMITS } from '../constants/charLimits';\nimport {\n\tDRAWER_BODY_STYLE,\n\tDRAWER_HEADER_STYLE,\n\tDrawerHeaderText,\n} from './DrawerHeaderText';\nimport { ToolInstructionsField } from './ToolInstructionsField';\nimport { VariableInlineField } from './VariableInlineField';\n\ninterface RestApiToolPanelProps {\n\tonClose: () => void;\n\t/** Persist the config. A pending promise shows the Save loader. */\n\tonSave: (config: RestApiToolConfig) => void | Promise<void>;\n\t/** Seed values when editing an existing tool. */\n\tinitial?: RestApiToolConfig;\n\t/** Optional \"Improve with AI\" for the instructions field. Omit to hide it. */\n\tonImprove?: (text: string) => Promise<string>;\n\tcharLimits?: AgentCharLimits;\n\t/** SideModal stacking order — raise it when opened over another drawer. */\n\tzIndex?: number;\n\t/** Names of the OTHER tools — a new tool can't reuse one of these. */\n\texistingNames?: string[];\n\t/**\n\t * Variable catalog for the `@` trigger. When non-empty, `@` opens the\n\t * variable picker directly in Instructions / Request URL / header values.\n\t * (Request / Response JSON editors are deliberately not wired for now.)\n\t * Absent → the drawer behaves exactly as before.\n\t */\n\tvariablesData?: VariableListInterfaceV3[];\n}\n\nconst METHODS: RestApiMethod[] = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'];\nconst METHOD_OPTIONS: SingleOption[] = METHODS.map((m) => ({\n\tlabel: m,\n\tvalue: m,\n}));\n\n// A callable endpoint needs an explicit http(s):// scheme AND a real, dotted\n// host. `new URL` alone is too lenient — it accepts single-label hosts\n// (\"https://abc\"), a one-slash scheme (\"https:/abc.com\"), and dangling-dot\n// hosts (\"https://.com\" / \"https://abc.\"). Require the `://` prefix on the raw\n// value plus a hostname that is either dotted (example.com) or an IPv4.\nconst isValidHttpUrl = (value: string): boolean => {\n\tif (!/^https?:\\/\\//i.test(value)) {\n\t\treturn false;\n\t}\n\tlet host: string;\n\ttry {\n\t\thost = new URL(value).hostname;\n\t} catch {\n\t\treturn false;\n\t}\n\treturn host.includes('.') && !host.startsWith('.') && !host.endsWith('.');\n};\n\n/**\n * Right-side drawer to configure a \"Rest API\" tool: the endpoint the agent can\n * call, plus a JSON request-body template and a sample response. Mount it fresh\n * per open (key it) so `initial` seeds the state. Built on the shared `SideModal`\n * shell and the BikEditor JSON body mode for the Request / Response editors.\n */\nexport const RestApiToolPanel: React.FC<RestApiToolPanelProps> = ({\n\tonClose,\n\tonSave,\n\tinitial,\n\tonImprove,\n\tcharLimits = AGENT_CHAR_LIMITS,\n\tzIndex,\n\texistingNames = [],\n\tvariablesData,\n}) => {\n\tconst [name, setName] = useState(initial?.name ?? '');\n\tconst [instructions, setInstructions] = useState(initial?.instructions ?? '');\n\t// New tools start with the scheme pre-filled so the user only types the host.\n\tconst [url, setUrl] = useState(initial?.url ?? 'https://');\n\tconst [method, setMethod] = useState<RestApiMethod>(\n\t\tinitial?.method ?? 'POST',\n\t);\n\tconst [headers, setHeaders] = useState<RestApiHeader[]>(\n\t\tinitial?.headers ?? [{ key: '', value: '' }],\n\t);\n\tconst [requestBody, setRequestBody] = useState(initial?.requestBody ?? '');\n\tconst [responseSample, setResponseSample] = useState(\n\t\tinitial?.responseSample ?? '',\n\t);\n\tconst [saving, setSaving] = useState(false);\n\n\t// Stable per-row identity for React keys, parallel to `headers`. The value\n\t// field is an uncontrolled editor, so a row must keep its mount across\n\t// sibling add/remove — index-based keys would remount every row (dropping\n\t// focus mid-edit) or let a deleted row's text linger in a reused neighbour.\n\tconst headerIdsRef = useRef<number[]>(\n\t\t(initial?.headers ?? [{ key: '', value: '' }]).map(\n\t\t\t(_h: RestApiHeader, i: number) => i,\n\t\t),\n\t);\n\tconst nextHeaderIdRef = useRef(headerIdsRef.current.length);\n\n\tconst patchHeader = (i: number, patch: Partial<RestApiHeader>) =>\n\t\tsetHeaders((prev) =>\n\t\t\tprev.map((h, idx) => (idx === i ? { ...h, ...patch } : h)),\n\t\t);\n\tconst addHeader = () => {\n\t\theaderIdsRef.current = [...headerIdsRef.current, nextHeaderIdRef.current];\n\t\tnextHeaderIdRef.current += 1;\n\t\tsetHeaders((prev) => [...prev, { key: '', value: '' }]);\n\t};\n\tconst removeHeader = (i: number) => {\n\t\theaderIdsRef.current = headerIdsRef.current.filter((_, idx) => idx !== i);\n\t\tsetHeaders((prev) => prev.filter((_, idx) => idx !== i));\n\t};\n\n\tconst nameTrimmed = name.trim();\n\t// Case-insensitive: two tools can't share a name (the LLM references them by it).\n\tconst isDuplicateName =\n\t\tnameTrimmed.length > 0 &&\n\t\texistingNames.some(\n\t\t\t(n) => n.trim().toLowerCase() === nameTrimmed.toLowerCase(),\n\t\t);\n\tconst urlTrimmed = url.trim();\n\t// Save needs a real endpoint, but don't flash the error while the field still\n\t// holds its pristine \"https://\" seed — only once the user has typed past it.\n\t// A URL that interpolates variables can't be parsed literally (braces are\n\t// invalid URL characters) — accept it once a scheme + something follows;\n\t// it only becomes a concrete URL after runtime substitution.\n\tconst urlUsesVariables = urlTrimmed.includes('{{variable:');\n\tconst urlOk = urlUsesVariables\n\t\t? /^https?:\\/\\/./.test(urlTrimmed)\n\t\t: isValidHttpUrl(urlTrimmed);\n\tconst isUrlInvalid =\n\t\turlTrimmed.length > 0 && urlTrimmed !== 'https://' && !urlOk;\n\tconst canSave =\n\t\tnameTrimmed.length > 0 &&\n\t\turlOk &&\n\t\t!isDuplicateName &&\n\t\t// The editor's characterLimit is soft (a paste may exceed it, rendered\n\t\t// grey) — gate the save so over-limit instructions can't be persisted.\n\t\tinstructions.length <= charLimits.instructions;\n\n\tconst handleSave = async () => {\n\t\tif (!canSave || saving) {\n\t\t\treturn;\n\t\t}\n\t\tconst config: RestApiToolConfig = {\n\t\t\tid: initial?.id ?? `restapi_${Date.now().toString(36)}`,\n\t\t\tname: name.trim(),\n\t\t\tinstructions,\n\t\t\turl: url.trim(),\n\t\t\tmethod,\n\t\t\t// Drop fully-empty header rows.\n\t\t\theaders: headers.filter((h) => h.key.trim() || h.value.trim()),\n\t\t\trequestBody,\n\t\t\tresponseSample,\n\t\t};\n\t\tconst result = onSave(config);\n\t\tif (result && typeof (result as Promise<void>).then === 'function') {\n\t\t\tsetSaving(true);\n\t\t\ttry {\n\t\t\t\tawait result;\n\t\t\t} finally {\n\t\t\t\tsetSaving(false);\n\t\t\t}\n\t\t}\n\t};\n\n\treturn (\n\t\t<SideModal\n\t\t\theader=\"Rest API\"\n\t\t\tcloseOnEscapeKey={false}\n\t\t\tzIndex={zIndex}\n\t\t\theaderCustomComponent={\n\t\t\t\t<DrawerHeaderText\n\t\t\t\t\ttitle=\"Rest API\"\n\t\t\t\t\tsubtitle=\"Connect to any API endpoint. Define the request and a sample response for the agent to reference.\"\n\t\t\t\t/>\n\t\t\t}\n\t\t\twidth=\"431px\"\n\t\t\theaderStyle={DRAWER_HEADER_STYLE}\n\t\t\tbodyStyle={DRAWER_BODY_STYLE}\n\t\t\tonClose={onClose}\n\t\t\tsaveButtonProps={{\n\t\t\t\t'data-test': 'restapi-save',\n\t\t\t\tbuttonText: 'Save',\n\t\t\t\tbuttonType: 'primary',\n\t\t\t\tsize: 'small',\n\t\t\t\tdisabled: !canSave,\n\t\t\t\tisLoading: saving,\n\t\t\t\tonClick: handleSave,\n\t\t\t}}\n\t\t\tcancelButtonProps={{\n\t\t\t\t'data-test': 'restapi-cancel',\n\t\t\t\tbuttonText: 'Cancel',\n\t\t\t\tbuttonType: 'tertiaryGray',\n\t\t\t\tsize: 'small',\n\t\t\t\tonClick: onClose,\n\t\t\t}}\n\t\t>\n\t\t\t<Input\n\t\t\t\tdata-test=\"restapi-name\"\n\t\t\t\tvariant=\"small\"\n\t\t\t\tlabelText=\"Name\"\n\t\t\t\tlabelTextBold\n\t\t\t\tplaceholder=\"Enter action name\"\n\t\t\t\tvalue={name}\n\t\t\t\tmaxCharLimit={charLimits.name}\n\t\t\t\tstate={isDuplicateName ? 'invalid' : undefined}\n\t\t\t\terrorMessage={\n\t\t\t\t\tisDuplicateName ? 'A tool with this name already exists' : undefined\n\t\t\t\t}\n\t\t\t\tonChangeText={setName}\n\t\t\t/>\n\n\t\t\t<ToolInstructionsField\n\t\t\t\tdata-test=\"restapi-instructions\"\n\t\t\t\tlabel=\"Instructions\"\n\t\t\t\tvalue={instructions}\n\t\t\t\tonChange={setInstructions}\n\t\t\t\tmaxLength={charLimits.instructions}\n\t\t\t\tplaceholder=\"Describe how should the LLM generate the rest API\"\n\t\t\t\tonImprove={onImprove}\n\t\t\t\tvariablesData={variablesData}\n\t\t\t/>\n\n\t\t\t<FieldBlock>\n\t\t\t\t<VariableInlineField\n\t\t\t\t\tdata-test=\"restapi-url\"\n\t\t\t\t\tlabel=\"Request URL\"\n\t\t\t\t\tplaceholder=\"https://\"\n\t\t\t\t\tvalue={url}\n\t\t\t\t\tonChange={setUrl}\n\t\t\t\t\tvariablesData={variablesData}\n\t\t\t\t/>\n\t\t\t\t{/* VariableInlineField has no invalid state of its own — surface the\n\t\t\t\t URL validation (from main) as a caption below the field. */}\n\t\t\t\t{isUrlInvalid && (\n\t\t\t\t\t<BodyCaption color={COLORS.content.negative}>\n\t\t\t\t\t\tEnter a valid URL (including https://)\n\t\t\t\t\t</BodyCaption>\n\t\t\t\t)}\n\t\t\t</FieldBlock>\n\n\t\t\t<FieldBlock>\n\t\t\t\t<TitleSmall color={COLORS.content.primary}>HTTP method</TitleSmall>\n\t\t\t\t<Dropdown\n\t\t\t\t\tdata-test=\"restapi-method\"\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\twidth=\"100%\"\n\t\t\t\t\tdropdownWidth=\"399px\"\n\t\t\t\t\toptions={METHOD_OPTIONS}\n\t\t\t\t\tdefaultOptions={[{ label: method, value: method }]}\n\t\t\t\t\tonSelect={(opt) => {\n\t\t\t\t\t\tconst v = unwrapDropdownValue(opt);\n\t\t\t\t\t\tif (v) {\n\t\t\t\t\t\t\tsetMethod(v as RestApiMethod);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</FieldBlock>\n\n\t\t\t<FieldBlock>\n\t\t\t\t<TitleSmall color={COLORS.content.primary}>Headers</TitleSmall>\n\t\t\t\t{headers.map((h, i) => (\n\t\t\t\t\t<HeaderRow\n\t\t\t\t\t\tkey={headerIdsRef.current[i]}\n\t\t\t\t\t\tdata-test={`restapi-header-${i}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\tvariant=\"small\"\n\t\t\t\t\t\t\thideInputHeader\n\t\t\t\t\t\t\tplaceholder=\"Enter name\"\n\t\t\t\t\t\t\tvalue={h.key}\n\t\t\t\t\t\t\tonChangeText={(v) => patchHeader(i, { key: v })}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<VariableInlineField\n\t\t\t\t\t\t\tplaceholder=\"Enter value\"\n\t\t\t\t\t\t\tvalue={h.value}\n\t\t\t\t\t\t\tonChange={(v) => patchHeader(i, { value: v })}\n\t\t\t\t\t\t\tvariablesData={variablesData}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<IconBtn\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\taria-label=\"Remove header\"\n\t\t\t\t\t\t\tdata-test={`restapi-header-remove-${i}`}\n\t\t\t\t\t\t\tonClick={() => removeHeader(i)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<DeleteIcon\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</IconBtn>\n\t\t\t\t\t</HeaderRow>\n\t\t\t\t))}\n\t\t\t\t<AddHeaderRow>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tdata-test=\"restapi-add-header\"\n\t\t\t\t\t\tbuttonType=\"dashRegular\"\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tLeadingIcon={PlusIcon}\n\t\t\t\t\t\tbuttonText=\"Add header\"\n\t\t\t\t\t\tonClick={addHeader}\n\t\t\t\t\t/>\n\t\t\t\t</AddHeaderRow>\n\t\t\t</FieldBlock>\n\n\t\t\t{/* Variables intentionally NOT wired here (yet) — the JSON editors are\n\t\t\t plain code fields; @ types a literal @. */}\n\t\t\t<FieldBlock>\n\t\t\t\t<TitleSmall color={COLORS.content.primary}>Request </TitleSmall>\n\t\t\t\t<BikEditor\n\t\t\t\t\tfeatures={{ jsonMode: true }}\n\t\t\t\t\tinitialContent={requestBody}\n\t\t\t\t\tstyle={JsonFieldBox}\n\t\t\t\t\tplaceholder=\"Type or paste JSON here\"\n\t\t\t\t\tonChange={(c) => setRequestBody(c.text)}\n\t\t\t\t\tminHeight=\"120px\"\n\t\t\t\t\tmaxHeight=\"240px\"\n\t\t\t\t/>\n\t\t\t</FieldBlock>\n\n\t\t\t<FieldBlock>\n\t\t\t\t<TitleSmall color={COLORS.content.primary}>Response </TitleSmall>\n\t\t\t\t<BikEditor\n\t\t\t\t\tfeatures={{ jsonMode: true }}\n\t\t\t\t\tstyle={JsonFieldBox}\n\t\t\t\t\tinitialContent={responseSample}\n\t\t\t\t\tplaceholder=\"Type or paste JSON here\"\n\t\t\t\t\tonChange={(c) => setResponseSample(c.text)}\n\t\t\t\t\tminHeight=\"120px\"\n\t\t\t\t\tmaxHeight=\"240px\"\n\t\t\t\t/>\n\t\t\t</FieldBlock>\n\t\t</SideModal>\n\t);\n};\n\n// Fixed tracks (name / value / delete): minmax(0, …) lets the fields shrink\n// below their content width, so a long value scrolls inside its field and the\n// delete button can never be pushed off the row.\nconst HeaderRow = styled.div`\n\tdisplay: grid;\n\tgrid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 32px;\n\talign-items: center;\n\tgap: 8px;\n`;\n\nconst AddHeaderRow = styled.div`\n\tdisplay: flex;\n`;\n\nconst IconBtn = styled.button`\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tflex-shrink: 0;\n\twidth: 32px;\n\theight: 32px;\n\tborder: 1px solid ${COLORS.stroke.primary};\n\tborder-radius: 4px;\n\tbackground: ${COLORS.surface.standard};\n\tcursor: pointer;\n\n\t&:hover {\n\t\tborder-color: ${COLORS.content.secondary};\n\t}\n`;\n\nexport const JsonFieldBox = {\n\tborderRadius: '4px',\n\toverflow: 'hidden',\n};\n"],"names":["METHODS","METHOD_OPTIONS","m","isValidHttpUrl","value","host","RestApiToolPanel","onClose","onSave","initial","onImprove","charLimits","AGENT_CHAR_LIMITS","zIndex","existingNames","variablesData","name","setName","useState","instructions","setInstructions","url","setUrl","method","setMethod","headers","setHeaders","requestBody","setRequestBody","responseSample","setResponseSample","saving","setSaving","headerIdsRef","useRef","_h","i","nextHeaderIdRef","patchHeader","patch","prev","idx","addHeader","removeHeader","_","nameTrimmed","isDuplicateName","n","urlTrimmed","urlOk","isUrlInvalid","canSave","jsxs","SideModal","jsx","DrawerHeaderText","DRAWER_HEADER_STYLE","DRAWER_BODY_STYLE","config","h","result","Input","ToolInstructionsField","FieldBlock","VariableInlineField","BodyCaption","COLORS","TitleSmall","Dropdown","opt","v","unwrapDropdownValue","HeaderRow","IconBtn","DeleteIcon","AddHeaderRow","Button","PlusIcon","BikEditor","JsonFieldBox","c","styled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,EACA,UAAA;AAAA,UAAA,gBAAAT,EAACa,GAAA,EAAW,OAAOD,EAAO,QAAQ,SAAS,UAAA,YAAQ;AAAA,UACnD,gBAAAZ;AAAA,YAACwB;AAAA,YAAA;AAAA,cACA,UAAU,EAAE,UAAU,GAAA;AAAA,cACtB,gBAAgBnD;AAAA,cAChB,OAAOoD;AAAA,cACP,aAAY;AAAA,cACZ,UAAU,CAACC,MAAMpD,EAAeoD,EAAE,IAAI;AAAA,cACtC,WAAU;AAAA,cACV,WAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QACX,GACD;AAAA,0BAECjB,GAAA,EACA,UAAA;AAAA,UAAA,gBAAAT,EAACa,GAAA,EAAW,OAAOD,EAAO,QAAQ,SAAS,UAAA,aAAS;AAAA,UACpD,gBAAAZ;AAAA,YAACwB;AAAA,YAAA;AAAA,cACA,UAAU,EAAE,UAAU,GAAA;AAAA,cACtB,OAAOC;AAAA,cACP,gBAAgBlD;AAAA,cAChB,aAAY;AAAA,cACZ,UAAU,CAACmD,MAAMlD,EAAkBkD,EAAE,IAAI;AAAA,cACzC,WAAU;AAAA,cACV,WAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QACX,EAAA,CACD;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGH,GAKMR,KAAYS,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOnBN,KAAeM,EAAO;AAAA;AAAA,GAItBR,KAAUQ,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAOFf,EAAO,OAAO,OAAO;AAAA;AAAA,eAE3BA,EAAO,QAAQ,QAAQ;AAAA;AAAA;AAAA;AAAA,kBAIpBA,EAAO,QAAQ,SAAS;AAAA;AAAA,GAI7Ba,IAAe;AAAA,EAC3B,cAAc;AAAA,EACd,UAAU;AACX;"}
@@ -2,16 +2,6 @@ export { AgentBuilder } from './AgentBuilder';
2
2
  export { Channels } from '@bikdotai/bik-models/campaigns/models/Channel';
3
3
  export { AgentStateModal } from './components/AgentStateModal';
4
4
  export type { AgentModalState } from './components/AgentStateModal';
5
- export { ConfigToolPanel } from './components/ConfigToolPanel';
6
- export { CreateSubAgentPanel } from './components/CreateSubAgentPanel';
7
- export { RestApiToolPanel } from './components/RestApiToolPanel';
8
- export { SelectableListSection } from './components/SelectableListSection';
9
- export type { SelectableItem, SourceGroup, } from './components/SelectableListSection';
10
- export { MentionEditor } from './components/MentionEditor';
11
- export { MentionPicker } from './components/MentionPicker';
12
- export { AiTextArea } from './components/AiTextArea';
13
- export { ToolInstructionsField } from './components/ToolInstructionsField';
14
- export { DrawerHeaderText } from './components/DrawerHeaderText';
15
5
  export { useAgentDraft } from './hooks/useAgentDraft';
16
6
  export type { AgentDraft } from './hooks/useAgentDraft';
17
7
  export { AGENT_CHAR_LIMITS } from './constants/charLimits';
@@ -19,12 +9,6 @@ export type { AgentCharLimits } from './constants/charLimits';
19
9
  export { APP_TOKEN, resolveAppToken, STEP_DEFINITIONS, } from './constants/steps';
20
10
  export { AGENT_CHANNEL_TYPES, channelPresentation, CHANNEL_PRESENTATION, } from './constants/channels';
21
11
  export type { ChannelPresentation } from './constants/channels';
22
- export { ToolSource, TOOL_SOURCE_LABELS, TOOL_ACTION_SOURCES, TOOL_ACTION_LABELS, CONFIG_TOOL_SOURCES, CONFIG_TOOL_ACTION_LABELS, INTEGRATION_SOURCES, TOOL_SOURCE_RANK, } from './constants/tools';
23
- export type { ToolAction, SourceIcon, IconComp } from './constants/tools';
24
- export { AGENT_EDITOR_STYLE } from './constants/editorStyle';
25
- export { buildAgentMentionItems, editorDocToInstructions, instructionsToEditorHtml, toolSourceLabel, appTypeLabel, } from './utils/mentionSerialization';
26
- export { SOURCE_ICONS, sourceIcon, renderSourceIcon, GENERIC_SOURCE_ICON, } from './utils/sourceIcons';
27
- export { buildToolActions } from './utils/toolActions';
28
- export { partitionSources, isUnconnectedSource } from './utils/sourceGrouping';
29
- export { FieldBlock, FieldLabelRow, SectionHeaderWrap, SectionBodyWrap, } from './AgentBuilder.styled';
12
+ export { ToolSource } from './constants/tools';
13
+ export { buildAgentMentionItems, editorDocToInstructions, instructionsToEditorHtml, } from './utils/mentionSerialization';
30
14
  export type { AgentBuilderProps, AgentBuilderConfig, AgentValue, AgentStatus as AgentBuilderStatus, StepKey, StepValidation, TriggerMode, AgentTriggerValue, AgentHandoverConfig, HandoverMethod, AgentTool, SubAgentRef, SubAgentDraft, IntentOption, ModelOption, RestApiToolConfig, RestApiMethod, RestApiHeader, ConfigToolConfig, ConfigToolKey, ParamField, ParamsBlob, ToolRef, CatalogTool, CustomTool, AgentChannel, AgentChannelAccount, AgentChannelSelection, AgentChannelStatus, AgentChannelType, } from './AgentBuilder.model';
@@ -1,56 +1,56 @@
1
1
  import i from "react";
2
- import { ToolSource as o, INTEGRATIONS_KEY as n } from "../constants/tools.js";
3
- import e from "../../../icons/Actions/Common actions/LinkSimpleHorizontal.js";
4
- import S from "../../../icons/Social/Channels/GoogleSheets.js";
5
- import h from "../../../icons/Social/Channels/ShipBob.js";
6
- import c from "../../../icons/Social/Channels/Kustomer.js";
7
- import p from "../../../icons/Social/Channels/Freshdesk.js";
8
- import I from "../../../icons/Social/Social/Zendesk.js";
9
- import f from "../../../icons/Social/Channels/Segment.js";
10
- import g from "../../../icons/Social/Channels/Mailchimp.js";
11
- import v from "../../../icons/Social/Channels/Attentive.js";
12
- import w from "../../../icons/Social/Channels/OmniSend.js";
13
- import s from "../../../icons/Social/Channels/Klavyio.js";
14
- import a from "../../../icons/Social/Channels/Aftership.js";
15
- import l from "../../../icons/Social/Social/SlackIcon.js";
16
- import d from "../../../icons/Informational/Communication/Email.js";
17
- import k from "../../../icons/BIK AI specific/Webhook.js";
2
+ import { INTEGRATIONS_KEY as n, ToolSource as o } from "../constants/tools.js";
3
+ import e from "../../../icons/Social/Channels/GoogleSheets.js";
4
+ import S from "../../../icons/Social/Channels/ShipBob.js";
5
+ import h from "../../../icons/Social/Channels/Kustomer.js";
6
+ import c from "../../../icons/Social/Channels/Freshdesk.js";
7
+ import p from "../../../icons/Social/Social/Zendesk.js";
8
+ import I from "../../../icons/Social/Channels/Segment.js";
9
+ import f from "../../../icons/Social/Channels/Mailchimp.js";
10
+ import g from "../../../icons/Social/Channels/Attentive.js";
11
+ import v from "../../../icons/Social/Channels/OmniSend.js";
12
+ import w from "../../../icons/Social/Channels/Klavyio.js";
13
+ import s from "../../../icons/Social/Channels/Aftership.js";
14
+ import a from "../../../icons/Social/Social/SlackIcon.js";
15
+ import l from "../../../icons/Informational/Communication/Email.js";
16
+ import d from "../../../icons/BIK AI specific/Webhook.js";
18
17
  import t from "../../../icons/Informational/Identity/PuzzlePiece.js";
19
- import E from "../../../icons/Social/Social/Gorgias.js";
20
- import u from "../../../icons/Social/Channels/Skio.js";
21
- import O from "../../../icons/Social/Channels/ShipStation.js";
22
- import G from "../../../icons/Social/Social/BigCommerce.js";
23
- import N from "../../../icons/Social/Channels/ShopifyBrand.js";
24
- import A from "../../../icons/Social/Channels/ManifestGlass.js";
18
+ import k from "../../../icons/Social/Social/Gorgias.js";
19
+ import E from "../../../icons/Social/Channels/Skio.js";
20
+ import u from "../../../icons/Social/Channels/ShipStation.js";
21
+ import O from "../../../icons/Social/Social/BigCommerce.js";
22
+ import G from "../../../icons/Social/Channels/ShopifyBrand.js";
23
+ import N from "../../../icons/Social/Channels/ManifestGlass.js";
24
+ import A from "../../../icons/Actions/Common actions/LinkSimpleHorizontal.js";
25
25
  const C = {
26
- [o.Manifest]: { Icon: A, w: 24, h: 24 },
27
- [o.Shopify]: { Icon: N, w: 24, h: 24 },
28
- [o.Bigcommerce]: { Icon: G, w: 20, h: 20 },
29
- [o.Shipstation]: { Icon: O, w: 22, h: 22 },
30
- [o.Skio]: { Icon: u, w: 20, h: 20 },
31
- [o.Gorgias]: { Icon: E, w: 20, h: 20 },
26
+ [o.Manifest]: { Icon: N, w: 24, h: 24 },
27
+ [o.Shopify]: { Icon: G, w: 24, h: 24 },
28
+ [o.Bigcommerce]: { Icon: O, w: 20, h: 20 },
29
+ [o.Shipstation]: { Icon: u, w: 22, h: 22 },
30
+ [o.Skio]: { Icon: E, w: 20, h: 20 },
31
+ [o.Gorgias]: { Icon: k, w: 20, h: 20 },
32
32
  [o.Integration]: { Icon: t, w: 20, h: 20 },
33
- [o.RestApi]: { Icon: k, w: 20, h: 20 },
34
- [o.EmailHandover]: { Icon: d, w: 20, h: 20 },
35
- [o.Slack]: { Icon: l, w: 20, h: 20 },
33
+ [o.RestApi]: { Icon: d, w: 20, h: 20 },
34
+ [o.EmailHandover]: { Icon: l, w: 20, h: 20 },
35
+ [o.Slack]: { Icon: a, w: 20, h: 20 },
36
36
  // Standard-contract vendors — brand glyphs from the shared icon set.
37
- [o.Aftership]: { Icon: a, w: 20, h: 20 },
38
- [o.Klaviyo]: { Icon: s, w: 20, h: 20 },
39
- [o.Omnisend]: { Icon: w, w: 20, h: 20 },
40
- [o.Attentive]: { Icon: v, w: 20, h: 20 },
41
- [o.Mailchimp]: { Icon: g, w: 20, h: 20 },
42
- [o.Segment]: { Icon: f, w: 20, h: 20 },
43
- [o.Zendesk]: { Icon: I, w: 20, h: 20 },
44
- [o.Freshdesk]: { Icon: p, w: 20, h: 20 },
45
- [o.Kustomer]: { Icon: c, w: 20, h: 20 },
46
- [o.Shipbob]: { Icon: h, w: 20, h: 20 },
47
- [o.GoogleSheets]: { Icon: S, w: 20, h: 20 }
37
+ [o.Aftership]: { Icon: s, w: 20, h: 20 },
38
+ [o.Klaviyo]: { Icon: w, w: 20, h: 20 },
39
+ [o.Omnisend]: { Icon: v, w: 20, h: 20 },
40
+ [o.Attentive]: { Icon: g, w: 20, h: 20 },
41
+ [o.Mailchimp]: { Icon: f, w: 20, h: 20 },
42
+ [o.Segment]: { Icon: I, w: 20, h: 20 },
43
+ [o.Zendesk]: { Icon: p, w: 20, h: 20 },
44
+ [o.Freshdesk]: { Icon: c, w: 20, h: 20 },
45
+ [o.Kustomer]: { Icon: h, w: 20, h: 20 },
46
+ [o.Shipbob]: { Icon: S, w: 20, h: 20 },
47
+ [o.GoogleSheets]: { Icon: e, w: 20, h: 20 }
48
48
  }, R = {
49
49
  Icon: t,
50
50
  w: 20,
51
51
  h: 20
52
52
  }, _ = {
53
- Icon: e,
53
+ Icon: A,
54
54
  w: 20,
55
55
  h: 20
56
56
  }, oo = (r) => {
@@ -1,7 +1,7 @@
1
- import { TOOL_ACTION_SOURCES as T, CONFIG_TOOL_SOURCES as o, TOOL_ACTION_LABELS as a, TOOL_SOURCE_LABELS as i, CONFIG_TOOL_ACTION_LABELS as A } from "../constants/tools.js";
1
+ import { TOOL_ACTION_SOURCES as T, TOOL_ACTION_LABELS as o, TOOL_SOURCE_LABELS as a, CONFIG_TOOL_SOURCES as i, CONFIG_TOOL_ACTION_LABELS as A } from "../constants/tools.js";
2
2
  import { SOURCE_ICONS as E } from "./sourceIcons.js";
3
3
  const f = (L, t, S, l) => T.flatMap((O) => {
4
- const _ = o[O], C = {
4
+ const _ = i[O], C = {
5
5
  source: O,
6
6
  icon: E[O],
7
7
  connected: S?.[O],
@@ -15,7 +15,7 @@ const f = (L, t, S, l) => T.flatMap((O) => {
15
15
  })) : [
16
16
  {
17
17
  ...C,
18
- label: a[O] ?? i[O],
18
+ label: o[O] ?? a[O],
19
19
  onSelect: () => t(O)
20
20
  }
21
21
  ];