@bikdotai/bik-component-library 0.0.829 → 0.0.830-beta.1

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 (87) hide show
  1. package/dist/cjs/components/agent-builder/AgentBuilder.js +1 -1
  2. package/dist/cjs/components/agent-builder/AgentBuilder.js.map +1 -1
  3. package/dist/cjs/components/agent-builder/AgentBuilder.styled.js +17 -65
  4. package/dist/cjs/components/agent-builder/AgentBuilder.styled.js.map +1 -1
  5. package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js +41 -0
  6. package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js.map +1 -0
  7. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js +5 -5
  8. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  9. package/dist/cjs/components/agent-builder/components/DrawerHeaderText.js +9 -0
  10. package/dist/cjs/components/agent-builder/components/DrawerHeaderText.js.map +1 -0
  11. package/dist/cjs/components/agent-builder/components/MentionEditor.js +1 -1
  12. package/dist/cjs/components/agent-builder/components/MentionEditor.js.map +1 -1
  13. package/dist/cjs/components/agent-builder/components/MentionField.js +1 -1
  14. package/dist/cjs/components/agent-builder/components/MentionField.js.map +1 -1
  15. package/dist/cjs/components/agent-builder/components/MentionPicker.js +20 -20
  16. package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
  17. package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js +23 -0
  18. package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js.map +1 -0
  19. package/dist/cjs/components/agent-builder/components/SelectableListSection.js +5 -5
  20. package/dist/cjs/components/agent-builder/components/SelectableListSection.js.map +1 -1
  21. package/dist/cjs/components/agent-builder/components/ToolInstructionsField.js +5 -0
  22. package/dist/cjs/components/agent-builder/components/ToolInstructionsField.js.map +1 -0
  23. package/dist/cjs/components/agent-builder/constants/tools.js +2 -0
  24. package/dist/cjs/components/agent-builder/constants/tools.js.map +1 -0
  25. package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js +1 -1
  26. package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
  27. package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js +1 -1
  28. package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
  29. package/dist/cjs/components/agent-builder/utils/mentionSerialization.js +3 -3
  30. package/dist/cjs/components/agent-builder/utils/mentionSerialization.js.map +1 -1
  31. package/dist/cjs/components/agent-builder/utils/sourceIcons.js +1 -1
  32. package/dist/cjs/components/agent-builder/utils/sourceIcons.js.map +1 -1
  33. package/dist/cjs/components/side-modal/SideModal.style.js +11 -10
  34. package/dist/cjs/components/side-modal/SideModal.style.js.map +1 -1
  35. package/dist/cjs/index.js +1 -1
  36. package/dist/esm/components/agent-builder/AgentBuilder.js +100 -96
  37. package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
  38. package/dist/esm/components/agent-builder/AgentBuilder.model.d.ts +144 -1
  39. package/dist/esm/components/agent-builder/AgentBuilder.styled.d.ts +0 -21
  40. package/dist/esm/components/agent-builder/AgentBuilder.styled.js +42 -111
  41. package/dist/esm/components/agent-builder/AgentBuilder.styled.js.map +1 -1
  42. package/dist/esm/components/agent-builder/components/ConfigToolPanel.d.ts +33 -0
  43. package/dist/esm/components/agent-builder/components/ConfigToolPanel.js +242 -0
  44. package/dist/esm/components/agent-builder/components/ConfigToolPanel.js.map +1 -0
  45. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.d.ts +9 -1
  46. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +318 -219
  47. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  48. package/dist/esm/components/agent-builder/components/DrawerHeaderText.d.ts +25 -0
  49. package/dist/esm/components/agent-builder/components/DrawerHeaderText.js +32 -0
  50. package/dist/esm/components/agent-builder/components/DrawerHeaderText.js.map +1 -0
  51. package/dist/esm/components/agent-builder/components/MentionEditor.d.ts +6 -0
  52. package/dist/esm/components/agent-builder/components/MentionEditor.js +38 -30
  53. package/dist/esm/components/agent-builder/components/MentionEditor.js.map +1 -1
  54. package/dist/esm/components/agent-builder/components/MentionField.js +77 -52
  55. package/dist/esm/components/agent-builder/components/MentionField.js.map +1 -1
  56. package/dist/esm/components/agent-builder/components/MentionPicker.d.ts +7 -0
  57. package/dist/esm/components/agent-builder/components/MentionPicker.js +139 -129
  58. package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
  59. package/dist/esm/components/agent-builder/components/RestApiToolPanel.d.ts +27 -0
  60. package/dist/esm/components/agent-builder/components/RestApiToolPanel.js +267 -0
  61. package/dist/esm/components/agent-builder/components/RestApiToolPanel.js.map +1 -0
  62. package/dist/esm/components/agent-builder/components/SelectableListSection.d.ts +14 -0
  63. package/dist/esm/components/agent-builder/components/SelectableListSection.js +166 -140
  64. package/dist/esm/components/agent-builder/components/SelectableListSection.js.map +1 -1
  65. package/dist/esm/components/agent-builder/components/ToolInstructionsField.d.ts +19 -0
  66. package/dist/esm/components/agent-builder/components/ToolInstructionsField.js +66 -0
  67. package/dist/esm/components/agent-builder/components/ToolInstructionsField.js.map +1 -0
  68. package/dist/esm/components/agent-builder/constants/tools.d.ts +65 -0
  69. package/dist/esm/components/agent-builder/constants/tools.js +29 -0
  70. package/dist/esm/components/agent-builder/constants/tools.js.map +1 -0
  71. package/dist/esm/components/agent-builder/context/AgentBuilderContext.d.ts +19 -1
  72. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +169 -140
  73. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
  74. package/dist/esm/components/agent-builder/index.d.ts +2 -1
  75. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +241 -141
  76. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
  77. package/dist/esm/components/agent-builder/utils/mentionSerialization.d.ts +18 -3
  78. package/dist/esm/components/agent-builder/utils/mentionSerialization.js +81 -62
  79. package/dist/esm/components/agent-builder/utils/mentionSerialization.js.map +1 -1
  80. package/dist/esm/components/agent-builder/utils/sourceIcons.d.ts +15 -9
  81. package/dist/esm/components/agent-builder/utils/sourceIcons.js +16 -8
  82. package/dist/esm/components/agent-builder/utils/sourceIcons.js.map +1 -1
  83. package/dist/esm/components/side-modal/SideModal.style.js +1 -0
  84. package/dist/esm/components/side-modal/SideModal.style.js.map +1 -1
  85. package/dist/esm/index.js +97 -95
  86. package/dist/esm/index.js.map +1 -1
  87. package/package.json +2 -1
@@ -1,99 +1,118 @@
1
- const d = {
2
- manifest: "Manifest",
3
- shopify: "Shopify",
4
- integration: "Integration"
5
- }, m = (t, e = "Manifest") => t ? d[t] ?? t : e, k = (t) => {
6
- const e = t ? String(t) : "";
7
- return e === "BIK" ? "BIK" : e === "BSP" ? "BSP" : "Manifest";
8
- }, S = (t, e, n = "Manifest") => [
9
- ...t.map(
10
- (a) => ({
11
- id: a.tool_id,
12
- label: `${m(a.source, n)} : ${a.display_name}`,
1
+ import { TOOL_SOURCE_LABELS as m, ToolSource as l } from "../constants/tools.js";
2
+ const g = (e, t = "Manifest") => e ? m[e] ?? e : t, L = (e) => {
3
+ const t = e ? String(e) : "";
4
+ return t === "BIK" ? "BIK" : t === "BSP" ? "BSP" : "Manifest";
5
+ }, E = (e, t, n = "Manifest") => [
6
+ ...e.map(
7
+ (o) => ({
8
+ id: o.tool_id,
9
+ label: `${g(o.source, n)} : ${o.display_name}`,
13
10
  meta: {
14
11
  kind: "tool",
15
- plainLabel: a.display_name,
16
- source: a.source
12
+ plainLabel: o.display_name,
13
+ source: o.source
17
14
  }
18
15
  })
19
16
  ),
20
- ...e.map(
21
- (a) => ({
22
- id: a.id,
23
- label: `sub-agent: ${a.name}`,
24
- meta: { kind: "subagent", plainLabel: a.name }
17
+ ...t.map(
18
+ (o) => ({
19
+ id: o.id,
20
+ label: `sub-agent: ${o.name}`,
21
+ meta: { kind: "subagent", plainLabel: o.name }
25
22
  })
26
23
  )
27
- ], i = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), r = (t) => i(t).replace(/"/g, "&quot;"), c = (t, e, n) => `<span data-type="mentionAgent" class="bik-mention bik-mention--agent" data-id="${r(t)}" data-label="${r(e)}" data-kind="${r(n)}">${i(e)}</span>`, $ = (t, e, n) => c(t, e, n), g = (t) => {
28
- const e = /* @__PURE__ */ new Map();
29
- for (const n of t) {
30
- const a = n.meta;
31
- a?.kind === "tool" ? e.set(`tool:${String(n.id)}`, n) : a?.kind === "subagent" && e.set(`subagent:${String(n.id)}`, n);
24
+ ], b = (e) => e.tool_key === "send_slack_message" ? String(e.params.channelId?.value ?? "").trim() || "Send Slack message" : String(e.params.sendTo?.value ?? "").split(",").map((t) => t.trim()).filter(Boolean)[0] || "Handover to email", k = (e) => e.name || "Rest API", S = (e) => {
25
+ const t = k(e);
26
+ return {
27
+ id: e.id,
28
+ label: `${m[l.RestApi]} : ${t}`,
29
+ meta: { kind: "tool", plainLabel: t, source: l.RestApi }
30
+ };
31
+ }, f = (e) => {
32
+ const t = e.tool_key === "send_slack_message" ? l.Slack : l.EmailHandover, n = b(e);
33
+ return {
34
+ id: e.id,
35
+ label: `${m[t]} : ${n}`,
36
+ meta: { kind: "tool", plainLabel: n, source: t }
37
+ };
38
+ }, y = (e = [], t = []) => [
39
+ ...t.map(S),
40
+ ...e.map(f)
41
+ ], i = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), r = (e) => i(e).replace(/"/g, "&quot;"), u = (e, t, n) => `<span data-type="mentionAgent" class="bik-mention bik-mention--agent" data-id="${r(e)}" data-label="${r(t)}" data-kind="${r(n)}">${i(t)}</span>`, A = (e, t, n) => u(e, t, n), $ = (e) => {
42
+ const t = /* @__PURE__ */ new Map();
43
+ for (const n of e) {
44
+ const o = n.meta;
45
+ o?.kind === "tool" ? t.set(`tool:${String(n.id)}`, n) : o?.kind === "subagent" && t.set(`subagent:${String(n.id)}`, n);
32
46
  }
33
- return e;
34
- }, l = /\{\{(tool:[^}]+|subagent:[^}]+)\}\}/g, b = (t, e) => {
35
- let n = "", a = 0;
36
- l.lastIndex = 0;
37
- let o;
38
- for (; (o = l.exec(t)) !== null; ) {
39
- n += i(t.slice(a, o.index));
40
- const s = e.get(o[1]);
47
+ return t;
48
+ }, c = /\{\{(tool:[^}]+|subagent:[^}]+)\}\}/g, T = (e, t) => {
49
+ let n = "", o = 0;
50
+ c.lastIndex = 0;
51
+ let a;
52
+ for (; (a = c.exec(e)) !== null; ) {
53
+ n += i(e.slice(o, a.index));
54
+ const s = t.get(a[1]);
41
55
  if (s) {
42
56
  const p = s.meta.kind;
43
- n += c(String(s.id), s.label, p);
57
+ n += u(String(s.id), s.label, p);
44
58
  } else
45
- n += i(o[0]);
46
- a = l.lastIndex;
59
+ n += i(a[0]);
60
+ o = c.lastIndex;
47
61
  }
48
- return n += i(t.slice(a)), n.replace(/\n/g, "<br>");
49
- }, T = (t, e = []) => {
50
- if (!t)
62
+ return n += i(e.slice(o)), n.replace(/\n/g, "<br>");
63
+ }, M = (e, t = []) => {
64
+ if (!e)
51
65
  return "";
52
- const n = g(e);
53
- return t.split(/\n{2,}/).map((a) => `<p>${b(a, n)}</p>`).join("");
54
- }, f = (t, e, n) => (e ?? (n.has(t) ? "tool" : "subagent")) === "tool" ? `{{tool:${t}}}` : `{{subagent:${t}}}`, u = (t, e) => {
55
- switch (t.type) {
66
+ const n = $(t);
67
+ return e.split(/\n{2,}/).map((o) => `<p>${T(o, n)}</p>`).join("");
68
+ }, _ = (e, t, n) => (t ?? (n.has(e) ? "tool" : "subagent")) === "tool" ? `{{tool:${e}}}` : `{{subagent:${e}}}`, d = (e, t) => {
69
+ switch (e.type) {
56
70
  case "text":
57
- return t.text ?? "";
71
+ return e.text ?? "";
58
72
  case "mentionAgent":
59
73
  case "mentionTeam": {
60
- const n = t.attrs?.id;
74
+ const n = e.attrs?.id;
61
75
  if (n == null)
62
76
  return "";
63
- const a = t.attrs?.kind;
64
- return f(
77
+ const o = e.attrs?.kind;
78
+ return _(
65
79
  String(n),
66
- a == null ? null : String(a),
67
- e
80
+ o == null ? null : String(o),
81
+ t
68
82
  );
69
83
  }
70
84
  case "variable":
71
- return `{{${String(t.attrs?.variableName ?? "")}}}`;
85
+ return `{{${String(e.attrs?.variableName ?? "")}}}`;
72
86
  case "hardBreak":
73
87
  return `
74
88
  `;
75
89
  default: {
76
- const n = (t.content ?? []).map((o) => u(o, e)).join("");
77
- return ["paragraph", "heading", "listItem", "blockquote"].includes(t.type) ? `${n}
90
+ const n = (e.content ?? []).map((a) => d(a, t)).join("");
91
+ return ["paragraph", "heading", "listItem", "blockquote"].includes(e.type) ? `${n}
78
92
  ` : n;
79
93
  }
80
94
  }
81
- }, y = (t, e) => {
82
- if (!t)
95
+ }, v = (e, t) => {
96
+ if (!e)
83
97
  return "";
84
- const n = new Set(e.map((a) => a.tool_id));
85
- return u(t, n).replace(
98
+ const n = new Set(t.map((o) => o.tool_id));
99
+ return d(e, n).replace(
86
100
  /\n+$/,
87
101
  ""
88
102
  );
89
103
  };
90
104
  export {
91
- d as TOOL_SOURCE_LABELS,
92
- k as appTypeLabel,
93
- S as buildAgentMentionItems,
94
- $ as buildMentionHtml,
95
- y as editorDocToInstructions,
96
- T as instructionsToEditorHtml,
97
- m as toolSourceLabel
105
+ m as TOOL_SOURCE_LABELS,
106
+ L as appTypeLabel,
107
+ E as buildAgentMentionItems,
108
+ y as buildCustomToolMentionItems,
109
+ A as buildMentionHtml,
110
+ f as configToolMentionItem,
111
+ b as configToolName,
112
+ v as editorDocToInstructions,
113
+ M as instructionsToEditorHtml,
114
+ S as restApiMentionItem,
115
+ k as restApiToolName,
116
+ g as toolSourceLabel
98
117
  };
99
118
  //# sourceMappingURL=mentionSerialization.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mentionSerialization.js","sources":["../../../../../src/components/agent-builder/utils/mentionSerialization.ts"],"sourcesContent":["import type { ApplicationType } from '@bikdotai/bik-models/growth';\nimport { MentionItem } from '@src/editor';\nimport { AgentTool, SubAgentRef } from '../AgentBuilder.model';\n\n/**\n * Serialization helpers between the BikEditor document and the firebase\n * `instructions` string.\n *\n * Firebase stores `instructions` as PLAIN TEXT with inline reference tokens:\n * - `{{subagent:<agentId>}}` — hand-off to another agent\n * - `{{tool:<tool_id>}}` — an action the agent can call\n * - `{{<variableName>}}` — a template variable\n *\n * In the editor those references are inserted via the `@` mention menu (which we\n * populate with BOTH tools and sub-agents). Mention nodes keep their `id` in the\n * ProseMirror doc JSON (the rendered HTML drops it), so we serialize from the doc\n * JSON — not from HTML.\n */\n\nexport interface MentionKindMeta {\n\t/** Distinguishes a tool reference from a sub-agent reference. */\n\tkind: 'tool' | 'subagent';\n\t/** Plain item name (no prefix) shown in the picker dropdown rows. */\n\tplainLabel?: string;\n\t/** For tools: the source bucket (manifest / shopify / …) the picker groups by. */\n\tsource?: string;\n}\n\n/** Display labels for the known tool sources (drives picker headers + chip prefix). */\nexport const TOOL_SOURCE_LABELS: Record<string, string> = {\n\tmanifest: 'Manifest',\n\tshopify: 'Shopify',\n\tintegration: 'Integration',\n};\n\n/** Human label for a tool source; falls back to the host-app label, then the raw key. */\nexport const toolSourceLabel = (\n\tsource: string | undefined,\n\tfallback = 'Manifest',\n): string => {\n\tif (!source) {\n\t\treturn fallback;\n\t}\n\treturn TOOL_SOURCE_LABELS[source] ?? source;\n};\n\n/** Human label for the host application, used as the tool-chip prefix. */\nexport const appTypeLabel = (applicationType?: ApplicationType): string => {\n\tconst key = applicationType ? String(applicationType) : '';\n\tif (key === 'BIK') {\n\t\treturn 'BIK';\n\t}\n\tif (key === 'BSP') {\n\t\treturn 'BSP';\n\t}\n\treturn 'Manifest';\n};\n\n/**\n * Build the combined `@` mention list from the available tools + sub-agents.\n *\n * The `label` is the CHIP text shown once inserted — tools read\n * `\"<App> : <tool name>\"` (e.g. \"Manifest : Look up order\"), sub-agents read\n * `\"sub-agent: <name>\"`. `meta.plainLabel` is the un-prefixed name for the\n * picker rows, and `meta.kind` drives the `{{tool}}` / `{{subagent}}` colour.\n */\nexport const buildAgentMentionItems = (\n\ttools: AgentTool[],\n\tsubAgents: SubAgentRef[],\n\tappLabel = 'Manifest',\n): MentionItem[] => [\n\t...tools.map(\n\t\t(t): MentionItem => ({\n\t\t\tid: t.tool_id,\n\t\t\tlabel: `${toolSourceLabel(t.source, appLabel)} : ${t.display_name}`,\n\t\t\tmeta: {\n\t\t\t\tkind: 'tool',\n\t\t\t\tplainLabel: t.display_name,\n\t\t\t\tsource: t.source,\n\t\t\t},\n\t\t}),\n\t),\n\t...subAgents.map(\n\t\t(s): MentionItem => ({\n\t\t\tid: s.id,\n\t\t\tlabel: `sub-agent: ${s.name}`,\n\t\t\tmeta: { kind: 'subagent', plainLabel: s.name },\n\t\t}),\n\t),\n];\n\nconst escapeHtml = (raw: string): string =>\n\traw.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n\nconst escapeAttr = (raw: string): string =>\n\tescapeHtml(raw).replace(/\"/g, '&quot;');\n\n/**\n * The HTML for a single mention chip. Must round-trip through the TipTap mention\n * extension's `parseHTML` (`span[data-type=\"mentionAgent\"]`, reading\n * `data-id`/`data-label`/`data-kind`) — see MentionExtension.ts. `normalizeHtml`\n * is taught to keep `data-type=\"mention…\"` spans so this survives to the parser.\n */\nconst mentionSpanHtml = (id: string, label: string, kind: string): string =>\n\t`<span data-type=\"mentionAgent\" class=\"bik-mention bik-mention--agent\"` +\n\t` data-id=\"${escapeAttr(id)}\" data-label=\"${escapeAttr(label)}\"` +\n\t` data-kind=\"${escapeAttr(kind)}\">${escapeHtml(label)}</span>`;\n\n/**\n * Public: HTML for one mention chip, for inserting at the cursor (e.g. when a\n * tool / sub-agent is added from the Step-3 side panel). Round-trips through the\n * same parser path as the rehydrated chips.\n */\nexport const buildMentionHtml = (\n\tid: string,\n\tlabel: string,\n\tkind: 'tool' | 'subagent',\n): string => mentionSpanHtml(id, label, kind);\n\n/** `{{tool:<id>}}` / `{{subagent:<id>}}` → the mention item that produced them. */\nconst buildTokenLookup = (\n\tmentionItems: MentionItem[],\n): Map<string, MentionItem> => {\n\tconst byToken = new Map<string, MentionItem>();\n\tfor (const item of mentionItems) {\n\t\tconst meta = item.meta as unknown as MentionKindMeta | undefined;\n\t\t// Both tools and sub-agents are keyed by their id (a tool's id is its tool_id).\n\t\tif (meta?.kind === 'tool') {\n\t\t\tbyToken.set(`tool:${String(item.id)}`, item);\n\t\t} else if (meta?.kind === 'subagent') {\n\t\t\tbyToken.set(`subagent:${String(item.id)}`, item);\n\t\t}\n\t}\n\treturn byToken;\n};\n\n// Matches the reference tokens we render as chips. Other `{{var}}` tokens fall\n// through untouched (left as literal text for the variable decoration).\nconst REFERENCE_TOKEN = /\\{\\{(tool:[^}]+|subagent:[^}]+)\\}\\}/g;\n\n/** Escape plain text, swapping recognised reference tokens for mention spans. */\nconst inlineToHtml = (\n\tsegment: string,\n\tbyToken: Map<string, MentionItem>,\n): string => {\n\tlet out = '';\n\tlet lastIndex = 0;\n\tREFERENCE_TOKEN.lastIndex = 0;\n\tlet match: RegExpExecArray | null;\n\twhile ((match = REFERENCE_TOKEN.exec(segment)) !== null) {\n\t\tout += escapeHtml(segment.slice(lastIndex, match.index));\n\t\tconst item = byToken.get(match[1]);\n\t\tif (item) {\n\t\t\tconst kind = (item.meta as unknown as MentionKindMeta).kind;\n\t\t\tout += mentionSpanHtml(String(item.id), item.label, kind);\n\t\t} else {\n\t\t\t// Tool/sub-agent no longer in the available list → keep the raw token.\n\t\t\tout += escapeHtml(match[0]);\n\t\t}\n\t\tlastIndex = REFERENCE_TOKEN.lastIndex;\n\t}\n\tout += escapeHtml(segment.slice(lastIndex));\n\treturn out.replace(/\\n/g, '<br>');\n};\n\n/**\n * Convert the stored instructions string into HTML for `BikEditor.initialContent`.\n * `{{tool:KEY}}` / `{{subagent:ID}}` tokens are rehydrated into mention chips\n * (resolved via `mentionItems`); any other `{{…}}` token is left as literal text\n * for the editor's variable decoration. Newlines become paragraph / line breaks.\n */\nexport const instructionsToEditorHtml = (\n\ttext: string,\n\tmentionItems: MentionItem[] = [],\n): string => {\n\tif (!text) {\n\t\treturn '';\n\t}\n\tconst byToken = buildTokenLookup(mentionItems);\n\treturn text\n\t\t.split(/\\n{2,}/)\n\t\t.map((para) => `<p>${inlineToHtml(para, byToken)}</p>`)\n\t\t.join('');\n};\n\ninterface ProseMirrorNode {\n\ttype: string;\n\ttext?: string;\n\tattrs?: Record<string, unknown>;\n\tcontent?: ProseMirrorNode[];\n}\n\n/**\n * The token for a mention node. Both tools and sub-agents store their id in the\n * node, so the token value is just that id — the kind only picks the prefix. The\n * node's `kind` attr is authoritative; `toolIds` is a fallback for older content\n * saved before the kind attr existed.\n */\nconst resolveMentionToken = (\n\tid: string,\n\tkind: string | null,\n\ttoolIds: Set<string>,\n): string => {\n\tconst resolved = kind ?? (toolIds.has(id) ? 'tool' : 'subagent');\n\treturn resolved === 'tool' ? `{{tool:${id}}}` : `{{subagent:${id}}}`;\n};\n\nconst nodeToText = (node: ProseMirrorNode, toolIds: Set<string>): string => {\n\tswitch (node.type) {\n\t\tcase 'text':\n\t\t\treturn node.text ?? '';\n\t\tcase 'mentionAgent':\n\t\tcase 'mentionTeam': {\n\t\t\tconst id = node.attrs?.['id'];\n\t\t\tif (id == null) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\tconst kind = node.attrs?.['kind'];\n\t\t\treturn resolveMentionToken(\n\t\t\t\tString(id),\n\t\t\t\tkind == null ? null : String(kind),\n\t\t\t\ttoolIds,\n\t\t\t);\n\t\t}\n\t\tcase 'variable':\n\t\t\treturn `{{${String(node.attrs?.['variableName'] ?? '')}}}`;\n\t\tcase 'hardBreak':\n\t\t\treturn '\\n';\n\t\tdefault: {\n\t\t\tconst inner = (node.content ?? [])\n\t\t\t\t.map((child) => nodeToText(child, toolIds))\n\t\t\t\t.join('');\n\t\t\t// Block nodes terminate with a newline so paragraphs stay separated.\n\t\t\tconst BLOCK_NODES = ['paragraph', 'heading', 'listItem', 'blockquote'];\n\t\t\treturn BLOCK_NODES.includes(node.type) ? `${inner}\\n` : inner;\n\t\t}\n\t}\n};\n\n/**\n * Convert a BikEditor document (from `ref.getJSON()`) into the firebase\n * instructions string, replacing mention nodes with `{{subagent:<id>}}` /\n * `{{tool:<tool_id>}}` tokens.\n */\nexport const editorDocToInstructions = (\n\tdoc: Record<string, unknown> | null,\n\ttools: AgentTool[],\n): string => {\n\tif (!doc) {\n\t\treturn '';\n\t}\n\tconst toolIds = new Set(tools.map((t) => t.tool_id));\n\treturn nodeToText(doc as unknown as ProseMirrorNode, toolIds).replace(\n\t\t/\\n+$/,\n\t\t'',\n\t);\n};\n"],"names":["TOOL_SOURCE_LABELS","toolSourceLabel","source","fallback","appTypeLabel","applicationType","key","buildAgentMentionItems","tools","subAgents","appLabel","t","s","escapeHtml","raw","escapeAttr","mentionSpanHtml","id","label","kind","buildMentionHtml","buildTokenLookup","mentionItems","byToken","item","meta","REFERENCE_TOKEN","inlineToHtml","segment","out","lastIndex","match","instructionsToEditorHtml","text","para","resolveMentionToken","toolIds","nodeToText","node","inner","child","editorDocToInstructions","doc"],"mappings":"AA6BO,MAAMA,IAA6C;AAAA,EACzD,UAAU;AAAA,EACV,SAAS;AAAA,EACT,aAAa;AACd,GAGaC,IAAkB,CAC9BC,GACAC,IAAW,eAEND,IAGEF,EAAmBE,CAAM,KAAKA,IAF7BC,GAMIC,IAAe,CAACC,MAA8C;AAC1E,QAAMC,IAAMD,IAAkB,OAAOA,CAAe,IAAI;AACxD,SAAIC,MAAQ,QACJ,QAEJA,MAAQ,QACJ,QAED;AACR,GAUaC,IAAyB,CACrCC,GACAC,GACAC,IAAW,eACQ;AAAA,EACnB,GAAGF,EAAM;AAAA,IACR,CAACG,OAAoB;AAAA,MACpB,IAAIA,EAAE;AAAA,MACN,OAAO,GAAGV,EAAgBU,EAAE,QAAQD,CAAQ,CAAC,MAAMC,EAAE,YAAY;A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J,aAAO;AAAA;AAAA,IACR,SAAS;AACR,YAAMC,KAASD,EAAK,WAAW,CAAA,GAC7B,IAAI,CAACE,MAAUH,EAAWG,GAAOJ,CAAO,CAAC,EACzC,KAAK,EAAE;AAGT,aADoB,CAAC,aAAa,WAAW,YAAY,YAAY,EAClD,SAASE,EAAK,IAAI,IAAI,GAAGC,CAAK;AAAA,IAAOA;AAAA,IACzD;AAAA,EAAA;AAEF,GAOaE,IAA0B,CACtCC,GACAlC,MACY;AACZ,MAAI,CAACkC;AACJ,WAAO;AAER,QAAMN,IAAU,IAAI,IAAI5B,EAAM,IAAI,CAACG,MAAMA,EAAE,OAAO,CAAC;AACnD,SAAO0B,EAAWK,GAAmCN,CAAO,EAAE;AAAA,IAC7D;AAAA,IACA;AAAA,EAAA;AAEF;"}
1
+ {"version":3,"file":"mentionSerialization.js","sources":["../../../../../src/components/agent-builder/utils/mentionSerialization.ts"],"sourcesContent":["import type { ApplicationType } from '@bikdotai/bik-models/growth';\nimport { MentionItem } from '@src/editor';\nimport {\n\tAgentTool,\n\tConfigToolConfig,\n\tRestApiToolConfig,\n\tSubAgentRef,\n} from '../AgentBuilder.model';\nimport { TOOL_SOURCE_LABELS, ToolSource } from '../constants/tools';\n\n/**\n * Serialization helpers between the BikEditor document and the firebase\n * `instructions` string.\n *\n * Firebase stores `instructions` as PLAIN TEXT with inline reference tokens:\n * - `{{subagent:<agentId>}}` — hand-off to another agent\n * - `{{tool:<tool_id>}}` — an action the agent can call\n * - `{{<variableName>}}` — a template variable\n *\n * In the editor those references are inserted via the `@` mention menu (which we\n * populate with BOTH tools and sub-agents). Mention nodes keep their `id` in the\n * ProseMirror doc JSON (the rendered HTML drops it), so we serialize from the doc\n * JSON — not from HTML.\n */\n\nexport interface MentionKindMeta {\n\t/** Distinguishes a tool reference from a sub-agent reference. */\n\tkind: 'tool' | 'subagent';\n\t/** Plain item name (no prefix) shown in the picker dropdown rows. */\n\tplainLabel?: string;\n\t/** For tools: the source bucket (manifest / shopify / …) the picker groups by. */\n\tsource?: string;\n}\n\n// Source labels moved to constants/tools.ts; re-exported for existing importers.\nexport { TOOL_SOURCE_LABELS };\n\n/** Human label for a tool source; falls back to the host-app label, then the raw key. */\nexport const toolSourceLabel = (\n\tsource: string | undefined,\n\tfallback = 'Manifest',\n): string => {\n\tif (!source) {\n\t\treturn fallback;\n\t}\n\treturn TOOL_SOURCE_LABELS[source as ToolSource] ?? source;\n};\n\n/** Human label for the host application, used as the tool-chip prefix. */\nexport const appTypeLabel = (applicationType?: ApplicationType): string => {\n\tconst key = applicationType ? String(applicationType) : '';\n\tif (key === 'BIK') {\n\t\treturn 'BIK';\n\t}\n\tif (key === 'BSP') {\n\t\treturn 'BSP';\n\t}\n\treturn 'Manifest';\n};\n\n/**\n * Build the combined `@` mention list from the available tools + sub-agents.\n *\n * The `label` is the CHIP text shown once inserted — tools read\n * `\"<App> : <tool name>\"` (e.g. \"Manifest : Look up order\"), sub-agents read\n * `\"sub-agent: <name>\"`. `meta.plainLabel` is the un-prefixed name for the\n * picker rows, and `meta.kind` drives the `{{tool}}` / `{{subagent}}` colour.\n */\nexport const buildAgentMentionItems = (\n\ttools: AgentTool[],\n\tsubAgents: SubAgentRef[],\n\tappLabel = 'Manifest',\n): MentionItem[] => [\n\t...tools.map(\n\t\t(t): MentionItem => ({\n\t\t\tid: t.tool_id,\n\t\t\tlabel: `${toolSourceLabel(t.source, appLabel)} : ${t.display_name}`,\n\t\t\tmeta: {\n\t\t\t\tkind: 'tool',\n\t\t\t\tplainLabel: t.display_name,\n\t\t\t\tsource: t.source,\n\t\t\t},\n\t\t}),\n\t),\n\t...subAgents.map(\n\t\t(s): MentionItem => ({\n\t\t\tid: s.id,\n\t\t\tlabel: `sub-agent: ${s.name}`,\n\t\t\tmeta: { kind: 'subagent', plainLabel: s.name },\n\t\t}),\n\t),\n];\n\n/** Display name for a shared config tool: first recipient / channel, else generic. */\nexport const configToolName = (t: ConfigToolConfig): string => {\n\tif (t.tool_key === 'send_slack_message') {\n\t\treturn (\n\t\t\tString(t.params['channelId']?.value ?? '').trim() || 'Send Slack message'\n\t\t);\n\t}\n\treturn (\n\t\tString(t.params['sendTo']?.value ?? '')\n\t\t\t.split(',')\n\t\t\t.map((s) => s.trim())\n\t\t\t.filter(Boolean)[0] || 'Handover to email'\n\t);\n};\n\n/** Display name for a Rest API tool row / chip. */\nexport const restApiToolName = (t: RestApiToolConfig): string =>\n\tt.name || 'Rest API';\n\n/** The `@`-mention chip item for a Rest API tool (kind 'tool', restapi source). */\nexport const restApiMentionItem = (t: RestApiToolConfig): MentionItem => {\n\tconst name = restApiToolName(t);\n\treturn {\n\t\tid: t.id,\n\t\tlabel: `${TOOL_SOURCE_LABELS[ToolSource.RestApi]} : ${name}`,\n\t\tmeta: { kind: 'tool', plainLabel: name, source: ToolSource.RestApi },\n\t};\n};\n\n/** The `@`-mention chip item for a shared config tool (email / Slack). */\nexport const configToolMentionItem = (t: ConfigToolConfig): MentionItem => {\n\tconst source =\n\t\tt.tool_key === 'send_slack_message'\n\t\t\t? ToolSource.Slack\n\t\t\t: ToolSource.EmailHandover;\n\tconst name = configToolName(t);\n\treturn {\n\t\tid: t.id,\n\t\tlabel: `${TOOL_SOURCE_LABELS[source]} : ${name}`,\n\t\tmeta: { kind: 'tool', plainLabel: name, source },\n\t};\n};\n\n/**\n * Mention items for the inline-configured custom tools (Rest API + email / Slack)\n * so their `{{tool:<id>}}` tokens rehydrate as chips — they live on the agent\n * value, not in the catalog `availableTools`. Merge alongside\n * {@link buildAgentMentionItems} in the editor's mention list.\n */\nexport const buildCustomToolMentionItems = (\n\tconfigTools: ConfigToolConfig[] = [],\n\trestApiTools: RestApiToolConfig[] = [],\n): MentionItem[] => [\n\t...restApiTools.map(restApiMentionItem),\n\t...configTools.map(configToolMentionItem),\n];\n\nconst escapeHtml = (raw: string): string =>\n\traw.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n\nconst escapeAttr = (raw: string): string =>\n\tescapeHtml(raw).replace(/\"/g, '&quot;');\n\n/**\n * The HTML for a single mention chip. Must round-trip through the TipTap mention\n * extension's `parseHTML` (`span[data-type=\"mentionAgent\"]`, reading\n * `data-id`/`data-label`/`data-kind`) — see MentionExtension.ts. `normalizeHtml`\n * is taught to keep `data-type=\"mention…\"` spans so this survives to the parser.\n */\nconst mentionSpanHtml = (id: string, label: string, kind: string): string =>\n\t`<span data-type=\"mentionAgent\" class=\"bik-mention bik-mention--agent\"` +\n\t` data-id=\"${escapeAttr(id)}\" data-label=\"${escapeAttr(label)}\"` +\n\t` data-kind=\"${escapeAttr(kind)}\">${escapeHtml(label)}</span>`;\n\n/**\n * Public: HTML for one mention chip, for inserting at the cursor (e.g. when a\n * tool / sub-agent is added from the Step-3 side panel). Round-trips through the\n * same parser path as the rehydrated chips.\n */\nexport const buildMentionHtml = (\n\tid: string,\n\tlabel: string,\n\tkind: 'tool' | 'subagent',\n): string => mentionSpanHtml(id, label, kind);\n\n/** `{{tool:<id>}}` / `{{subagent:<id>}}` → the mention item that produced them. */\nconst buildTokenLookup = (\n\tmentionItems: MentionItem[],\n): Map<string, MentionItem> => {\n\tconst byToken = new Map<string, MentionItem>();\n\tfor (const item of mentionItems) {\n\t\tconst meta = item.meta as unknown as MentionKindMeta | undefined;\n\t\t// Both tools and sub-agents are keyed by their id (a tool's id is its tool_id).\n\t\tif (meta?.kind === 'tool') {\n\t\t\tbyToken.set(`tool:${String(item.id)}`, item);\n\t\t} else if (meta?.kind === 'subagent') {\n\t\t\tbyToken.set(`subagent:${String(item.id)}`, item);\n\t\t}\n\t}\n\treturn byToken;\n};\n\n// Matches the reference tokens we render as chips. Other `{{var}}` tokens fall\n// through untouched (left as literal text for the variable decoration).\nconst REFERENCE_TOKEN = /\\{\\{(tool:[^}]+|subagent:[^}]+)\\}\\}/g;\n\n/** Escape plain text, swapping recognised reference tokens for mention spans. */\nconst inlineToHtml = (\n\tsegment: string,\n\tbyToken: Map<string, MentionItem>,\n): string => {\n\tlet out = '';\n\tlet lastIndex = 0;\n\tREFERENCE_TOKEN.lastIndex = 0;\n\tlet match: RegExpExecArray | null;\n\twhile ((match = REFERENCE_TOKEN.exec(segment)) !== null) {\n\t\tout += escapeHtml(segment.slice(lastIndex, match.index));\n\t\tconst item = byToken.get(match[1]);\n\t\tif (item) {\n\t\t\tconst kind = (item.meta as unknown as MentionKindMeta).kind;\n\t\t\tout += mentionSpanHtml(String(item.id), item.label, kind);\n\t\t} else {\n\t\t\t// Tool/sub-agent no longer in the available list → keep the raw token.\n\t\t\tout += escapeHtml(match[0]);\n\t\t}\n\t\tlastIndex = REFERENCE_TOKEN.lastIndex;\n\t}\n\tout += escapeHtml(segment.slice(lastIndex));\n\treturn out.replace(/\\n/g, '<br>');\n};\n\n/**\n * Convert the stored instructions string into HTML for `BikEditor.initialContent`.\n * `{{tool:KEY}}` / `{{subagent:ID}}` tokens are rehydrated into mention chips\n * (resolved via `mentionItems`); any other `{{…}}` token is left as literal text\n * for the editor's variable decoration. Newlines become paragraph / line breaks.\n */\nexport const instructionsToEditorHtml = (\n\ttext: string,\n\tmentionItems: MentionItem[] = [],\n): string => {\n\tif (!text) {\n\t\treturn '';\n\t}\n\tconst byToken = buildTokenLookup(mentionItems);\n\treturn text\n\t\t.split(/\\n{2,}/)\n\t\t.map((para) => `<p>${inlineToHtml(para, byToken)}</p>`)\n\t\t.join('');\n};\n\ninterface ProseMirrorNode {\n\ttype: string;\n\ttext?: string;\n\tattrs?: Record<string, unknown>;\n\tcontent?: ProseMirrorNode[];\n}\n\n/**\n * The token for a mention node. Both tools and sub-agents store their id in the\n * node, so the token value is just that id — the kind only picks the prefix. The\n * node's `kind` attr is authoritative; `toolIds` is a fallback for older content\n * saved before the kind attr existed.\n */\nconst resolveMentionToken = (\n\tid: string,\n\tkind: string | null,\n\ttoolIds: Set<string>,\n): string => {\n\tconst resolved = kind ?? (toolIds.has(id) ? 'tool' : 'subagent');\n\treturn resolved === 'tool' ? `{{tool:${id}}}` : `{{subagent:${id}}}`;\n};\n\nconst nodeToText = (node: ProseMirrorNode, toolIds: Set<string>): string => {\n\tswitch (node.type) {\n\t\tcase 'text':\n\t\t\treturn node.text ?? '';\n\t\tcase 'mentionAgent':\n\t\tcase 'mentionTeam': {\n\t\t\tconst id = node.attrs?.['id'];\n\t\t\tif (id == null) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\tconst kind = node.attrs?.['kind'];\n\t\t\treturn resolveMentionToken(\n\t\t\t\tString(id),\n\t\t\t\tkind == null ? null : String(kind),\n\t\t\t\ttoolIds,\n\t\t\t);\n\t\t}\n\t\tcase 'variable':\n\t\t\treturn `{{${String(node.attrs?.['variableName'] ?? '')}}}`;\n\t\tcase 'hardBreak':\n\t\t\treturn '\\n';\n\t\tdefault: {\n\t\t\tconst inner = (node.content ?? [])\n\t\t\t\t.map((child) => nodeToText(child, toolIds))\n\t\t\t\t.join('');\n\t\t\t// Block nodes terminate with a newline so paragraphs stay separated.\n\t\t\tconst BLOCK_NODES = ['paragraph', 'heading', 'listItem', 'blockquote'];\n\t\t\treturn BLOCK_NODES.includes(node.type) ? `${inner}\\n` : inner;\n\t\t}\n\t}\n};\n\n/**\n * Convert a BikEditor document (from `ref.getJSON()`) into the firebase\n * instructions string, replacing mention nodes with `{{subagent:<id>}}` /\n * `{{tool:<tool_id>}}` tokens.\n */\nexport const editorDocToInstructions = (\n\tdoc: Record<string, unknown> | null,\n\ttools: AgentTool[],\n): string => {\n\tif (!doc) {\n\t\treturn '';\n\t}\n\tconst toolIds = new Set(tools.map((t) => t.tool_id));\n\treturn nodeToText(doc as unknown as ProseMirrorNode, toolIds).replace(\n\t\t/\\n+$/,\n\t\t'',\n\t);\n};\n"],"names":["toolSourceLabel","source","fallback","TOOL_SOURCE_LABELS","appTypeLabel","applicationType","key","buildAgentMentionItems","tools","subAgents","appLabel","t","s","configToolName","restApiToolName","restApiMentionItem","name","ToolSource","configToolMentionItem","buildCustomToolMentionItems","configTools","restApiTools","escapeHtml","raw","escapeAttr","mentionSpanHtml","id","label","kind","buildMentionHtml","buildTokenLookup","mentionItems","byToken","item","meta","REFERENCE_TOKEN","inlineToHtml","segment","out","lastIndex","match","instructionsToEditorHtml","text","para","resolveMentionToken","toolIds","nodeToText","node","inner","child","editorDocToInstructions","doc"],"mappings":";AAsCO,MAAMA,IAAkB,CAC9BC,GACAC,IAAW,eAEND,IAGEE,EAAmBF,CAAoB,KAAKA,IAF3CC,GAMIE,IAAe,CAACC,MAA8C;AAC1E,QAAMC,IAAMD,IAAkB,OAAOA,CAAe,IAAI;AACxD,SAAIC,MAAQ,QACJ,QAEJA,MAAQ,QACJ,QAED;AACR,GAUaC,IAAyB,CACrCC,GACAC,GACAC,IAAW,eACQ;AAAA,EACnB,GAAGF,EAAM;AAAA,IACR,CAACG,OAAoB;AAAA,MACpB,IAAIA,EAAE;AAAA,MACN,OAAO,GAAGX,EAAgBW,EAAE,QAAQD,CAAQ,CAAC,MAAMC,EAAE,YAAY;AAAA,MACjE,MAAM;AAAA,QACL,MAAM;AAAA,QACN,YAAYA,EAAE;AAAA,QACd,QAAQA,EAAE;AAAA,MAAA;AAAA,IACX;AAAA,EACD;AAAA,EAED,GAAGF,EAAU;AAAA,IACZ,CAACG,OAAoB;AAAA,MACpB,IAAIA,EAAE;AAAA,MACN,OAAO,cAAcA,EAAE,IAAI;AAAA,MAC3B,MAAM,EAAE,MAAM,YAAY,YAAYA,EAAE,KAAA;AAAA,IAAK;AAAA,EAC9C;AAEF,GAGaC,IAAiB,CAACF,MAC1BA,EAAE,aAAa,uBAEjB,OAAOA,EAAE,OAAO,WAAc,SAAS,EAAE,EAAE,KAAA,KAAU,uBAItD,OAAOA,EAAE,OAAO,QAAW,SAAS,EAAE,EACpC,MAAM,GAAG,EACT,IAAI,CAACC,MAAMA,EAAE,KAAA,CAAM,EACnB,OAAO,OAAO,EAAE,CAAC,KAAK,qBAKbE,IAAkB,CAACH,MAC/BA,EAAE,QAAQ,YAGEI,IAAqB,CAACJ,MAAsC;A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K;AAAA,IACL,KAAK,eAAe;AACnB,YAAMrB,IAAKqB,EAAK,OAAQ;AACxB,UAAIrB,KAAM;AACT,eAAO;AAER,YAAME,IAAOmB,EAAK,OAAQ;AAC1B,aAAOH;AAAA,QACN,OAAOlB,CAAE;AAAA,QACTE,KAAQ,OAAO,OAAO,OAAOA,CAAI;AAAA,QACjCiB;AAAA,MAAA;AAAA,IAEF;AAAA,IACA,KAAK;AACJ,aAAO,KAAK,OAAOE,EAAK,OAAQ,gBAAmB,EAAE,CAAC;AAAA,IACvD,KAAK;AACJ,aAAO;AAAA;AAAA,IACR,SAAS;AACR,YAAMC,KAASD,EAAK,WAAW,CAAA,GAC7B,IAAI,CAACE,MAAUH,EAAWG,GAAOJ,CAAO,CAAC,EACzC,KAAK,EAAE;AAGT,aADoB,CAAC,aAAa,WAAW,YAAY,YAAY,EAClD,SAASE,EAAK,IAAI,IAAI,GAAGC,CAAK;AAAA,IAAOA;AAAA,IACzD;AAAA,EAAA;AAEF,GAOaE,IAA0B,CACtCC,GACA3C,MACY;AACZ,MAAI,CAAC2C;AACJ,WAAO;AAER,QAAMN,IAAU,IAAI,IAAIrC,EAAM,IAAI,CAACG,MAAMA,EAAE,OAAO,CAAC;AACnD,SAAOmC,EAAWK,GAAmCN,CAAO,EAAE;AAAA,IAC7D;AAAA,IACA;AAAA,EAAA;AAEF;"}
@@ -1,13 +1,19 @@
1
1
  import { default as React } from 'react';
2
- export type IconComp = React.FunctionComponent<React.SVGAttributes<SVGElement>>;
3
- /** Brand glyph for a tool source, with its own size so each keeps its aspect ratio. */
4
- export interface SourceIcon {
5
- Icon: IconComp;
6
- w: number;
7
- h: number;
8
- }
9
- /** Per-source brand glyph — shared by the `@` picker and the Tools source buttons. */
10
- export declare const SOURCE_ICONS: Record<string, SourceIcon>;
2
+ import { ToolSource, IconComp, SourceIcon } from '../constants/tools';
3
+ export type { IconComp, SourceIcon };
4
+ /**
5
+ * Per-source brand glyph — shared by the `@` picker and the Tools source
6
+ * buttons. Partial: not every source has a glyph (e.g. `integration`), and the
7
+ * render path null-guards. Look up with {@link sourceIcon} when the key is a
8
+ * dynamic / unknown string rather than a {@link ToolSource}.
9
+ */
10
+ export declare const SOURCE_ICONS: Partial<Record<ToolSource, SourceIcon>>;
11
+ /**
12
+ * Lenient icon lookup for a source that may be a raw/dynamic string (a
13
+ * bik-models tool source, an integration key, or the picker's `'other'`
14
+ * fallback). Returns `undefined` for unknown sources.
15
+ */
16
+ export declare const sourceIcon: (source: string | undefined) => SourceIcon | undefined;
11
17
  /**
12
18
  * Render a {@link SourceIcon} at its own aspect ratio. `sizeDelta` nudges both
13
19
  * dimensions (e.g. `-4` for the smaller source-button glyph). Returns `null` when
@@ -1,15 +1,23 @@
1
1
  import e from "../../../assets/icons/ManifestGlass.svg.js";
2
- import r from "../../../assets/icons/Shopify.svg.js";
3
- import f from "react";
4
- const c = {
5
- manifest: { Icon: e, w: 24, h: 24 },
6
- shopify: { Icon: r, w: 21, h: 24 }
7
- }, p = (o, t = 0) => o ? f.createElement(o.Icon, {
2
+ import m from "../../../assets/icons/Shopify.svg.js";
3
+ import n from "react";
4
+ import { ToolSource as r } from "../constants/tools.js";
5
+ import c from "../../../icons/Informational/Files and folders/TextMessage.js";
6
+ import i from "../../../icons/Informational/Communication/Email.js";
7
+ import f from "../../../icons/BIK AI specific/Webhook.js";
8
+ const h = {
9
+ [r.Manifest]: { Icon: e, w: 24, h: 24 },
10
+ [r.Shopify]: { Icon: m, w: 21, h: 24 },
11
+ [r.RestApi]: { Icon: f, w: 20, h: 20 },
12
+ [r.EmailHandover]: { Icon: i, w: 20, h: 20 },
13
+ [r.Slack]: { Icon: c, w: 20, h: 20 }
14
+ }, v = (o) => o ? h[o] : void 0, w = (o, t = 0) => o ? n.createElement(o.Icon, {
8
15
  width: o.w + t,
9
16
  height: o.h + t
10
17
  }) : null;
11
18
  export {
12
- c as SOURCE_ICONS,
13
- p as renderSourceIcon
19
+ h as SOURCE_ICONS,
20
+ w as renderSourceIcon,
21
+ v as sourceIcon
14
22
  };
15
23
  //# sourceMappingURL=sourceIcons.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sourceIcons.js","sources":["../../../../../src/components/agent-builder/utils/sourceIcons.ts"],"sourcesContent":["import ManifestGlass from '@src/assets/icons/ManifestGlass.svg';\nimport Shopify from '@src/assets/icons/Shopify.svg';\nimport React from 'react';\n\nexport type IconComp = React.FunctionComponent<React.SVGAttributes<SVGElement>>;\n\n/** Brand glyph for a tool source, with its own size so each keeps its aspect ratio. */\nexport interface SourceIcon {\n\tIcon: IconComp;\n\tw: number;\n\th: number;\n}\n\n/** Per-source brand glyph — shared by the `@` picker and the Tools source buttons. */\nexport const SOURCE_ICONS: Record<string, SourceIcon> = {\n\tmanifest: { Icon: ManifestGlass, w: 24, h: 24 },\n\tshopify: { Icon: Shopify, w: 21, h: 24 },\n};\n\n/**\n * Render a {@link SourceIcon} at its own aspect ratio. `sizeDelta` nudges both\n * dimensions (e.g. `-4` for the smaller source-button glyph). Returns `null` when\n * no icon is supplied, so callers can drop their own `icon &&` guard.\n */\nexport const renderSourceIcon = (\n\ticon: SourceIcon | undefined,\n\tsizeDelta = 0,\n): React.ReactElement | null =>\n\ticon\n\t\t? React.createElement(icon.Icon, {\n\t\t\t\twidth: icon.w + sizeDelta,\n\t\t\t\theight: icon.h + sizeDelta,\n\t\t })\n\t\t: null;\n"],"names":["SOURCE_ICONS","ManifestGlass","Shopify","renderSourceIcon","icon","sizeDelta","React"],"mappings":";;;AAcO,MAAMA,IAA2C;AAAA,EACvD,UAAU,EAAE,MAAMC,GAAe,GAAG,IAAI,GAAG,GAAA;AAAA,EAC3C,SAAS,EAAE,MAAMC,GAAS,GAAG,IAAI,GAAG,GAAA;AACrC,GAOaC,IAAmB,CAC/BC,GACAC,IAAY,MAEZD,IACGE,EAAM,cAAcF,EAAK,MAAM;AAAA,EAC/B,OAAOA,EAAK,IAAIC;AAAA,EAChB,QAAQD,EAAK,IAAIC;AACjB,CAAC,IACD;"}
1
+ {"version":3,"file":"sourceIcons.js","sources":["../../../../../src/components/agent-builder/utils/sourceIcons.ts"],"sourcesContent":["import ManifestGlass from '@src/assets/icons/ManifestGlass.svg';\nimport Shopify from '@src/assets/icons/Shopify.svg';\nimport { Email, TextMessage, Webhook } from '@src/icons';\nimport React from 'react';\nimport { ToolSource } from '../constants/tools';\nimport type { IconComp, SourceIcon } from '../constants/tools';\n\n// The icon types live with the source enum (constants/tools) to keep the\n// dependency one-directional (util constants); re-exported here so existing\n// `from '../utils/sourceIcons'` importers keep resolving them.\nexport type { IconComp, SourceIcon };\n\n/**\n * Per-source brand glyph — shared by the `@` picker and the Tools source\n * buttons. Partial: not every source has a glyph (e.g. `integration`), and the\n * render path null-guards. Look up with {@link sourceIcon} when the key is a\n * dynamic / unknown string rather than a {@link ToolSource}.\n */\nexport const SOURCE_ICONS: Partial<Record<ToolSource, SourceIcon>> = {\n\t[ToolSource.Manifest]: { Icon: ManifestGlass, w: 24, h: 24 },\n\t[ToolSource.Shopify]: { Icon: Shopify, w: 21, h: 24 },\n\t[ToolSource.RestApi]: { Icon: Webhook as IconComp, w: 20, h: 20 },\n\t[ToolSource.EmailHandover]: { Icon: Email as IconComp, w: 20, h: 20 },\n\t[ToolSource.Slack]: { Icon: TextMessage as IconComp, w: 20, h: 20 },\n};\n\n/**\n * Lenient icon lookup for a source that may be a raw/dynamic string (a\n * bik-models tool source, an integration key, or the picker's `'other'`\n * fallback). Returns `undefined` for unknown sources.\n */\nexport const sourceIcon = (\n\tsource: string | undefined,\n): SourceIcon | undefined =>\n\tsource ? SOURCE_ICONS[source as ToolSource] : undefined;\n\n/**\n * Render a {@link SourceIcon} at its own aspect ratio. `sizeDelta` nudges both\n * dimensions (e.g. `-4` for the smaller source-button glyph). Returns `null` when\n * no icon is supplied, so callers can drop their own `icon &&` guard.\n */\nexport const renderSourceIcon = (\n\ticon: SourceIcon | undefined,\n\tsizeDelta = 0,\n): React.ReactElement | null =>\n\ticon\n\t\t? React.createElement(icon.Icon, {\n\t\t\t\twidth: icon.w + sizeDelta,\n\t\t\t\theight: icon.h + sizeDelta,\n\t\t })\n\t\t: null;\n"],"names":["SOURCE_ICONS","ToolSource","ManifestGlass","Shopify","Webhook","Email","TextMessage","sourceIcon","source","renderSourceIcon","icon","sizeDelta","React"],"mappings":";;;;;;;AAkBO,MAAMA,IAAwD;AAAA,EACpE,CAACC,EAAW,QAAQ,GAAG,EAAE,MAAMC,GAAe,GAAG,IAAI,GAAG,GAAA;AAAA,EACxD,CAACD,EAAW,OAAO,GAAG,EAAE,MAAME,GAAS,GAAG,IAAI,GAAG,GAAA;AAAA,EACjD,CAACF,EAAW,OAAO,GAAG,EAAE,MAAMG,GAAqB,GAAG,IAAI,GAAG,GAAA;AAAA,EAC7D,CAACH,EAAW,aAAa,GAAG,EAAE,MAAMI,GAAmB,GAAG,IAAI,GAAG,GAAA;AAAA,EACjE,CAACJ,EAAW,KAAK,GAAG,EAAE,MAAMK,GAAyB,GAAG,IAAI,GAAG,GAAA;AAChE,GAOaC,IAAa,CACzBC,MAEAA,IAASR,EAAaQ,CAAoB,IAAI,QAOlCC,IAAmB,CAC/BC,GACAC,IAAY,MAEZD,IACGE,EAAM,cAAcF,EAAK,MAAM;AAAA,EAC/B,OAAOA,EAAK,IAAIC;AAAA,EAChB,QAAQD,EAAK,IAAIC;AACjB,CAAC,IACD;"}
@@ -31,6 +31,7 @@ const c = t.div`
31
31
  background: ${e.surface.standard};
32
32
  padding: 0px 24px;
33
33
  border-bottom: 1px solid ${e.stroke.primary};
34
+ box-sizing: border-box;
34
35
  svg:hover {
35
36
  cursor: pointer;
36
37
  background: ${e.background.base};
@@ -1 +1 @@
1
- {"version":3,"file":"SideModal.style.js","sources":["../../../../src/components/side-modal/SideModal.style.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { COLORS } from '@src/constants/Theme';\nimport { ComponentZindex } from '@src/constants/zindex';\n\nexport const SideModalStyle = styled.div<{\n\tzIndex?: number;\n}>`\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\tz-index: ${(props) => props.zIndex || ComponentZindex.SIDE_MODAL};\n\theight: 100%;\n\twidth: 100%;\n\tbackground-color: rgba(0, 0, 0, 0.4);\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-end;\n`;\n\nexport const SideModalContainer = styled.div<{ width?: string }>`\n\theight: 100%;\n\twidth: ${(props) => props.width || '566px'};\n\tbackground: ${COLORS.surface.standard};\n\tposition: relative;\n\tdisplay: flex;\n\tflex-direction: column;\n`;\n\nexport const SideModalHeader = styled.div<{\n\theaderStyle: React.CSSProperties;\n}>`\n\twidth: 100%;\n\theight: 60px;\n\tposition: sticky;\n\ttop: 0;\n\tdisplay: flex;\n\tflex-direction: row;\n\talign-items: center;\n\tjustify-content: space-between;\n\tbackground: ${COLORS.surface.standard};\n\tpadding: 0px 24px;\n\tborder-bottom: 1px solid ${COLORS.stroke.primary};\n\tsvg:hover {\n\t\tcursor: pointer;\n\t\tbackground: ${COLORS.background.base};\n\t\tborder-radius: 4px;\n\t}\n\t${({ headerStyle }) => css`\n\t\t${Object.keys(headerStyle)\n\t\t\t.map((property) => `${property}: ${headerStyle[property]};`)\n\t\t\t.join('\\n')}\n\t`}\n`;\n\nexport const SideModalBody = styled.div<{\n\thideFooter?: boolean;\n\tbodyStyle: React.CSSProperties;\n}>`\n\toverflow-y: auto;\n\tpadding: 24px;\n\theight: ${(props) =>\n\t\tprops.hideFooter ? 'calc(100% - 60px)' : 'calc(100% - 120px)'};\n\t${({ bodyStyle }) => css`\n\t\t${Object.keys(bodyStyle)\n\t\t\t.map((property) => `${property}: ${bodyStyle[property]};`)\n\t\t\t.join('\\n')}\n\t`}\n`;\n\nexport const SideModalFooter = styled.div<{\n\tfooterDirection?: 'row' | 'row-reverse';\n\tfooterStyle: React.CSSProperties;\n}>`\n\theight: 60px;\n\twidth: 100%;\n\tposition: sticky;\n\tbottom: 0;\n\tdisplay: flex;\n\tflex-direction: ${(props) => props.footerDirection || 'row'};\n\tjustify-content: space-between;\n\talign-items: center;\n\tbackground: ${COLORS.surface.standard};\n\tborder-top: 1px solid ${COLORS.stroke.primary};\n\tpadding: 0px 24px;\n\t${({ footerStyle }) => css`\n\t\t${Object.keys(footerStyle)\n\t\t\t.map((property) => `${property}: ${footerStyle[property]};`)\n\t\t\t.join('\\n')}\n\t`}\n`;\n\nexport const FooterButtonWrapper = styled.div<{\n\tfooterDirection?: 'row' | 'row-reverse';\n}>`\n\tdisplay: flex;\n\tflex-direction: ${(props) => props.footerDirection || 'row'};\n\tgap: 8px;\n`;\n"],"names":["SideModalStyle","styled","props","ComponentZindex","SideModalContainer","COLORS","SideModalHeader","headerStyle","css","property","SideModalBody","bodyStyle","SideModalFooter","footerStyle","FooterButtonWrapper"],"mappings":";;;AAIO,MAAMA,IAAiBC,EAAO;AAAA;AAAA;AAAA;AAAA,YAMzB,CAACC,MAAUA,EAAM,UAAUC,EAAgB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASpDC,IAAqBH,EAAO;AAAA;AAAA,UAE/B,CAACC,MAAUA,EAAM,SAAS,OAAO;AAAA,eAC5BG,EAAO,QAAQ,QAAQ;AAAA;AAAA;AAAA;AAAA,GAMzBC,IAAkBL,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAWvBI,EAAO,QAAQ,QAAQ;AAAA;AAAA,4BAEVA,EAAO,OAAO,OAAO;AAAA;AAAA;AAAA,gBAGjCA,EAAO,WAAW,IAAI;AAAA;AAAA;AAAA,GAGnC,CAAC,EAAE,aAAAE,EAAA,MAAkBC;AAAA,IACpB,OAAO,KAAKD,CAAW,EACvB,IAAI,CAACE,MAAa,GAAGA,CAAQ,KAAKF,EAAYE,CAAQ,CAAC,GAAG,EAC1D,KAAK;AAAA,CAAI,CAAC;AAAA,EACZ;AAAA,GAGWC,IAAgBT,EAAO;AAAA;AAAA;AAAA,WAMzB,CAACC,MACVA,EAAM,aAAa,sBAAsB,oBAAoB;AAAA,GAC5D,CAAC,EAAE,WAAAS,EAAA,MAAgBH;AAAA,IAClB,OAAO,KAAKG,CAAS,EACrB,IAAI,CAACF,MAAa,GAAGA,CAAQ,KAAKE,EAAUF,CAAQ,CAAC,GAAG,EACxD,KAAK;AAAA,CAAI,CAAC;AAAA,EACZ;AAAA,GAGWG,IAAkBX,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBASnB,CAACC,MAAUA,EAAM,mBAAmB,KAAK;AAAA;AAAA;AAAA,eAG7CG,EAAO,QAAQ,QAAQ;AAAA,yBACbA,EAAO,OAAO,OAAO;AAAA;AAAA,GAE3C,CAAC,EAAE,aAAAQ,EAAA,MAAkBL;AAAA,IACpB,OAAO,KAAKK,CAAW,EACvB,IAAI,CAACJ,MAAa,GAAGA,CAAQ,KAAKI,EAAYJ,CAAQ,CAAC,GAAG,EAC1D,KAAK;AAAA,CAAI,CAAC;AAAA,EACZ;AAAA,GAGWK,IAAsBb,EAAO;AAAA;AAAA,mBAIvB,CAACC,MAAUA,EAAM,mBAAmB,KAAK;AAAA;AAAA;"}
1
+ {"version":3,"file":"SideModal.style.js","sources":["../../../../src/components/side-modal/SideModal.style.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { COLORS } from '@src/constants/Theme';\nimport { ComponentZindex } from '@src/constants/zindex';\n\nexport const SideModalStyle = styled.div<{\n\tzIndex?: number;\n}>`\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\tz-index: ${(props) => props.zIndex || ComponentZindex.SIDE_MODAL};\n\theight: 100%;\n\twidth: 100%;\n\tbackground-color: rgba(0, 0, 0, 0.4);\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-end;\n`;\n\nexport const SideModalContainer = styled.div<{ width?: string }>`\n\theight: 100%;\n\twidth: ${(props) => props.width || '566px'};\n\tbackground: ${COLORS.surface.standard};\n\tposition: relative;\n\tdisplay: flex;\n\tflex-direction: column;\n`;\n\nexport const SideModalHeader = styled.div<{\n\theaderStyle: React.CSSProperties;\n}>`\n\twidth: 100%;\n\theight: 60px;\n\tposition: sticky;\n\ttop: 0;\n\tdisplay: flex;\n\tflex-direction: row;\n\talign-items: center;\n\tjustify-content: space-between;\n\tbackground: ${COLORS.surface.standard};\n\tpadding: 0px 24px;\n\tborder-bottom: 1px solid ${COLORS.stroke.primary};\n\tbox-sizing: border-box;\n\tsvg:hover {\n\t\tcursor: pointer;\n\t\tbackground: ${COLORS.background.base};\n\t\tborder-radius: 4px;\n\t}\n\t${({ headerStyle }) => css`\n\t\t${Object.keys(headerStyle)\n\t\t\t.map((property) => `${property}: ${headerStyle[property]};`)\n\t\t\t.join('\\n')}\n\t`}\n`;\n\nexport const SideModalBody = styled.div<{\n\thideFooter?: boolean;\n\tbodyStyle: React.CSSProperties;\n}>`\n\toverflow-y: auto;\n\tpadding: 24px;\n\theight: ${(props) =>\n\t\tprops.hideFooter ? 'calc(100% - 60px)' : 'calc(100% - 120px)'};\n\t${({ bodyStyle }) => css`\n\t\t${Object.keys(bodyStyle)\n\t\t\t.map((property) => `${property}: ${bodyStyle[property]};`)\n\t\t\t.join('\\n')}\n\t`}\n`;\n\nexport const SideModalFooter = styled.div<{\n\tfooterDirection?: 'row' | 'row-reverse';\n\tfooterStyle: React.CSSProperties;\n}>`\n\theight: 60px;\n\twidth: 100%;\n\tposition: sticky;\n\tbottom: 0;\n\tdisplay: flex;\n\tflex-direction: ${(props) => props.footerDirection || 'row'};\n\tjustify-content: space-between;\n\talign-items: center;\n\tbackground: ${COLORS.surface.standard};\n\tborder-top: 1px solid ${COLORS.stroke.primary};\n\tpadding: 0px 24px;\n\t${({ footerStyle }) => css`\n\t\t${Object.keys(footerStyle)\n\t\t\t.map((property) => `${property}: ${footerStyle[property]};`)\n\t\t\t.join('\\n')}\n\t`}\n`;\n\nexport const FooterButtonWrapper = styled.div<{\n\tfooterDirection?: 'row' | 'row-reverse';\n}>`\n\tdisplay: flex;\n\tflex-direction: ${(props) => props.footerDirection || 'row'};\n\tgap: 8px;\n`;\n"],"names":["SideModalStyle","styled","props","ComponentZindex","SideModalContainer","COLORS","SideModalHeader","headerStyle","css","property","SideModalBody","bodyStyle","SideModalFooter","footerStyle","FooterButtonWrapper"],"mappings":";;;AAIO,MAAMA,IAAiBC,EAAO;AAAA;AAAA;AAAA;AAAA,YAMzB,CAACC,MAAUA,EAAM,UAAUC,EAAgB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASpDC,IAAqBH,EAAO;AAAA;AAAA,UAE/B,CAACC,MAAUA,EAAM,SAAS,OAAO;AAAA,eAC5BG,EAAO,QAAQ,QAAQ;AAAA;AAAA;AAAA;AAAA,GAMzBC,IAAkBL,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAWvBI,EAAO,QAAQ,QAAQ;AAAA;AAAA,4BAEVA,EAAO,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA,gBAIjCA,EAAO,WAAW,IAAI;AAAA;AAAA;AAAA,GAGnC,CAAC,EAAE,aAAAE,EAAA,MAAkBC;AAAA,IACpB,OAAO,KAAKD,CAAW,EACvB,IAAI,CAACE,MAAa,GAAGA,CAAQ,KAAKF,EAAYE,CAAQ,CAAC,GAAG,EAC1D,KAAK;AAAA,CAAI,CAAC;AAAA,EACZ;AAAA,GAGWC,IAAgBT,EAAO;AAAA;AAAA;AAAA,WAMzB,CAACC,MACVA,EAAM,aAAa,sBAAsB,oBAAoB;AAAA,GAC5D,CAAC,EAAE,WAAAS,EAAA,MAAgBH;AAAA,IAClB,OAAO,KAAKG,CAAS,EACrB,IAAI,CAACF,MAAa,GAAGA,CAAQ,KAAKE,EAAUF,CAAQ,CAAC,GAAG,EACxD,KAAK;AAAA,CAAI,CAAC;AAAA,EACZ;AAAA,GAGWG,IAAkBX,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBASnB,CAACC,MAAUA,EAAM,mBAAmB,KA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