@bikdotai/bik-component-library 0.0.831 → 0.0.832-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.
- package/dist/cjs/components/agent-builder/AgentBuilder.js +1 -1
- package/dist/cjs/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionField.js +1 -1
- package/dist/cjs/components/agent-builder/components/MentionField.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionPicker.js +11 -4
- package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/cjs/components/agent-builder/constants/tools.js +1 -1
- package/dist/cjs/components/agent-builder/constants/tools.js.map +1 -1
- package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js +1 -1
- package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
- package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js +1 -1
- package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
- package/dist/cjs/components/agent-builder/utils/toolActions.js +1 -1
- package/dist/cjs/components/agent-builder/utils/toolActions.js.map +1 -1
- package/dist/cjs/icons/Social/Channels/EmailMarketingV2.js +2 -0
- package/dist/cjs/icons/Social/Channels/EmailMarketingV2.js.map +1 -0
- package/dist/cjs/icons/Social/Channels/EmailV2.js +2 -0
- package/dist/cjs/icons/Social/Channels/EmailV2.js.map +1 -0
- package/dist/cjs/icons/Social/Channels/FacebookCommentV2.js +2 -0
- package/dist/cjs/icons/Social/Channels/FacebookCommentV2.js.map +1 -0
- package/dist/cjs/icons/Social/Channels/FacebookV2.js +2 -0
- package/dist/cjs/icons/Social/Channels/FacebookV2.js.map +1 -0
- package/dist/cjs/icons/Social/Channels/GmailV2.js +2 -0
- package/dist/cjs/icons/Social/Channels/GmailV2.js.map +1 -0
- package/dist/cjs/icons/Social/Channels/InstagramCommentV2.js +2 -0
- package/dist/cjs/icons/Social/Channels/InstagramCommentV2.js.map +1 -0
- package/dist/cjs/icons/Social/Channels/InstagramV2.js +2 -0
- package/dist/cjs/icons/Social/Channels/InstagramV2.js.map +1 -0
- package/dist/cjs/icons/Social/Channels/MessengerV2.js +2 -0
- package/dist/cjs/icons/Social/Channels/MessengerV2.js.map +1 -0
- package/dist/cjs/icons/Social/Channels/PhoneV2.js +2 -0
- package/dist/cjs/icons/Social/Channels/PhoneV2.js.map +1 -0
- package/dist/cjs/icons/Social/Channels/RcsV2.js +2 -0
- package/dist/cjs/icons/Social/Channels/RcsV2.js.map +1 -0
- package/dist/cjs/icons/Social/Channels/SmsV2.js +2 -0
- package/dist/cjs/icons/Social/Channels/SmsV2.js.map +1 -0
- package/dist/cjs/icons/Social/Channels/TaskV2.js +2 -0
- package/dist/cjs/icons/Social/Channels/TaskV2.js.map +1 -0
- package/dist/cjs/icons/Social/Channels/WebpushV2.js +2 -0
- package/dist/cjs/icons/Social/Channels/WebpushV2.js.map +1 -0
- package/dist/cjs/icons/Social/Channels/WhatsAppCallV2.js +2 -0
- package/dist/cjs/icons/Social/Channels/WhatsAppCallV2.js.map +1 -0
- package/dist/cjs/icons/Social/Channels/WhatsAppV2.js +2 -0
- package/dist/cjs/icons/Social/Channels/WhatsAppV2.js.map +1 -0
- package/dist/cjs/icons/index.js +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.js +91 -87
- package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.model.d.ts +25 -1
- package/dist/esm/components/agent-builder/components/MentionField.js +56 -44
- package/dist/esm/components/agent-builder/components/MentionField.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionPicker.js +135 -116
- package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/esm/components/agent-builder/constants/tools.d.ts +25 -1
- package/dist/esm/components/agent-builder/constants/tools.js +20 -12
- package/dist/esm/components/agent-builder/constants/tools.js.map +1 -1
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.d.ts +10 -0
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +129 -123
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +31 -28
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
- package/dist/esm/components/agent-builder/utils/toolActions.d.ts +1 -1
- package/dist/esm/components/agent-builder/utils/toolActions.js +13 -9
- package/dist/esm/components/agent-builder/utils/toolActions.js.map +1 -1
- package/dist/esm/icons/Social/Channels/EmailMarketingV2.d.ts +6 -0
- package/dist/esm/icons/Social/Channels/EmailMarketingV2.js +41 -0
- package/dist/esm/icons/Social/Channels/EmailMarketingV2.js.map +1 -0
- package/dist/esm/icons/Social/Channels/EmailV2.d.ts +6 -0
- package/dist/esm/icons/Social/Channels/EmailV2.js +30 -0
- package/dist/esm/icons/Social/Channels/EmailV2.js.map +1 -0
- package/dist/esm/icons/Social/Channels/FacebookCommentV2.d.ts +6 -0
- package/dist/esm/icons/Social/Channels/FacebookCommentV2.js +53 -0
- package/dist/esm/icons/Social/Channels/FacebookCommentV2.js.map +1 -0
- package/dist/esm/icons/Social/Channels/FacebookV2.d.ts +6 -0
- package/dist/esm/icons/Social/Channels/FacebookV2.js +28 -0
- package/dist/esm/icons/Social/Channels/FacebookV2.js.map +1 -0
- package/dist/esm/icons/Social/Channels/GmailV2.d.ts +6 -0
- package/dist/esm/icons/Social/Channels/GmailV2.js +30 -0
- package/dist/esm/icons/Social/Channels/GmailV2.js.map +1 -0
- package/dist/esm/icons/Social/Channels/InstagramCommentV2.d.ts +6 -0
- package/dist/esm/icons/Social/Channels/InstagramCommentV2.js +53 -0
- package/dist/esm/icons/Social/Channels/InstagramCommentV2.js.map +1 -0
- package/dist/esm/icons/Social/Channels/InstagramV2.d.ts +6 -0
- package/dist/esm/icons/Social/Channels/InstagramV2.js +39 -0
- package/dist/esm/icons/Social/Channels/InstagramV2.js.map +1 -0
- package/dist/esm/icons/Social/Channels/MessengerV2.d.ts +6 -0
- package/dist/esm/icons/Social/Channels/MessengerV2.js +28 -0
- package/dist/esm/icons/Social/Channels/MessengerV2.js.map +1 -0
- package/dist/esm/icons/Social/Channels/PhoneV2.d.ts +6 -0
- package/dist/esm/icons/Social/Channels/PhoneV2.js +30 -0
- package/dist/esm/icons/Social/Channels/PhoneV2.js.map +1 -0
- package/dist/esm/icons/Social/Channels/RcsV2.d.ts +6 -0
- package/dist/esm/icons/Social/Channels/RcsV2.js +30 -0
- package/dist/esm/icons/Social/Channels/RcsV2.js.map +1 -0
- package/dist/esm/icons/Social/Channels/SmsV2.d.ts +6 -0
- package/dist/esm/icons/Social/Channels/SmsV2.js +30 -0
- package/dist/esm/icons/Social/Channels/SmsV2.js.map +1 -0
- package/dist/esm/icons/Social/Channels/TaskV2.d.ts +6 -0
- package/dist/esm/icons/Social/Channels/TaskV2.js +37 -0
- package/dist/esm/icons/Social/Channels/TaskV2.js.map +1 -0
- package/dist/esm/icons/Social/Channels/WebpushV2.d.ts +6 -0
- package/dist/esm/icons/Social/Channels/WebpushV2.js +39 -0
- package/dist/esm/icons/Social/Channels/WebpushV2.js.map +1 -0
- package/dist/esm/icons/Social/Channels/WhatsAppCallV2.d.ts +6 -0
- package/dist/esm/icons/Social/Channels/WhatsAppCallV2.js +46 -0
- package/dist/esm/icons/Social/Channels/WhatsAppCallV2.js.map +1 -0
- package/dist/esm/icons/Social/Channels/WhatsAppV2.d.ts +6 -0
- package/dist/esm/icons/Social/Channels/WhatsAppV2.js +30 -0
- package/dist/esm/icons/Social/Channels/WhatsAppV2.js.map +1 -0
- package/dist/esm/icons/Social/Channels/index.d.ts +15 -0
- package/dist/esm/icons/index.d.ts +25 -25
- package/dist/esm/icons/index.js +484 -454
- package/dist/esm/icons/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { useAgentBuilderContext as
|
|
4
|
-
import { buildAgentMentionItems as
|
|
5
|
-
import { buildToolActions as
|
|
6
|
-
import { MentionEditor as
|
|
7
|
-
const
|
|
1
|
+
import { jsx as R } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as p, useCallback as g } from "react";
|
|
3
|
+
import { useAgentBuilderContext as j } from "../context/AgentBuilderContext.js";
|
|
4
|
+
import { buildAgentMentionItems as k, appTypeLabel as B, buildCustomToolMentionItems as E } from "../utils/mentionSerialization.js";
|
|
5
|
+
import { buildToolActions as L } from "../utils/toolActions.js";
|
|
6
|
+
import { MentionEditor as w } from "./MentionEditor.js";
|
|
7
|
+
const N = ({
|
|
8
8
|
fieldKey: o,
|
|
9
|
-
label:
|
|
10
|
-
placeholder:
|
|
11
|
-
maxLength:
|
|
12
|
-
minHeight:
|
|
13
|
-
...
|
|
9
|
+
label: T,
|
|
10
|
+
placeholder: b,
|
|
11
|
+
maxLength: A,
|
|
12
|
+
minHeight: d,
|
|
13
|
+
...C
|
|
14
14
|
}) => {
|
|
15
15
|
const {
|
|
16
16
|
value: t,
|
|
17
|
-
patch:
|
|
17
|
+
patch: M,
|
|
18
18
|
addReference: s,
|
|
19
19
|
availableTools: n,
|
|
20
20
|
availableSubAgents: i,
|
|
21
21
|
applicationType: r,
|
|
22
|
-
mentionResetKey:
|
|
22
|
+
mentionResetKey: f,
|
|
23
23
|
registerMentionField: a,
|
|
24
|
-
notifyMentionFocus:
|
|
25
|
-
onCreateSubAgent:
|
|
26
|
-
requestCreateSubAgent:
|
|
24
|
+
notifyMentionFocus: S,
|
|
25
|
+
onCreateSubAgent: v,
|
|
26
|
+
requestCreateSubAgent: I,
|
|
27
27
|
requestToolAction: l,
|
|
28
|
-
configToolTemplates:
|
|
29
|
-
|
|
28
|
+
configToolTemplates: c,
|
|
29
|
+
integrationStatus: m,
|
|
30
|
+
onConnectIntegration: u
|
|
31
|
+
} = j(), F = p(
|
|
30
32
|
() => [
|
|
31
|
-
...
|
|
33
|
+
...k(
|
|
32
34
|
n,
|
|
33
35
|
i,
|
|
34
|
-
|
|
36
|
+
B(r)
|
|
35
37
|
),
|
|
36
|
-
...
|
|
38
|
+
...E(t.configTools, t.restApiTools)
|
|
37
39
|
],
|
|
38
40
|
[
|
|
39
41
|
n,
|
|
@@ -42,38 +44,48 @@ const H = ({
|
|
|
42
44
|
t.configTools,
|
|
43
45
|
t.restApiTools
|
|
44
46
|
]
|
|
45
|
-
),
|
|
46
|
-
() =>
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
), x = p(
|
|
48
|
+
() => L(
|
|
49
|
+
c,
|
|
50
|
+
l,
|
|
51
|
+
m,
|
|
52
|
+
u
|
|
53
|
+
),
|
|
54
|
+
[
|
|
55
|
+
l,
|
|
56
|
+
c,
|
|
57
|
+
m,
|
|
58
|
+
u
|
|
59
|
+
]
|
|
60
|
+
), $ = g(
|
|
49
61
|
(e) => a(o, e),
|
|
50
62
|
[a, o]
|
|
51
|
-
),
|
|
52
|
-
(e,
|
|
63
|
+
), h = g(
|
|
64
|
+
(e, q) => s(e, q),
|
|
53
65
|
[s]
|
|
54
66
|
);
|
|
55
|
-
return /* @__PURE__ */
|
|
56
|
-
|
|
67
|
+
return /* @__PURE__ */ R(
|
|
68
|
+
w,
|
|
57
69
|
{
|
|
58
|
-
label:
|
|
70
|
+
label: T,
|
|
59
71
|
value: t[o] ?? "",
|
|
60
|
-
onChange: (e) =>
|
|
61
|
-
maxLength:
|
|
62
|
-
placeholder:
|
|
63
|
-
minHeight:
|
|
64
|
-
resetKey: `${t.id}:${o}:${
|
|
65
|
-
mentionItems:
|
|
72
|
+
onChange: (e) => M({ [o]: e }),
|
|
73
|
+
maxLength: A,
|
|
74
|
+
placeholder: b,
|
|
75
|
+
minHeight: d,
|
|
76
|
+
resetKey: `${t.id}:${o}:${f}`,
|
|
77
|
+
mentionItems: F,
|
|
66
78
|
tools: n,
|
|
67
|
-
onMentionSelect:
|
|
68
|
-
onFocus: () =>
|
|
69
|
-
registerInsert:
|
|
70
|
-
onCreateSubAgent:
|
|
71
|
-
toolActions:
|
|
72
|
-
"data-test":
|
|
79
|
+
onMentionSelect: h,
|
|
80
|
+
onFocus: () => S(o),
|
|
81
|
+
registerInsert: $,
|
|
82
|
+
onCreateSubAgent: v ? I : void 0,
|
|
83
|
+
toolActions: x,
|
|
84
|
+
"data-test": C["data-test"]
|
|
73
85
|
}
|
|
74
86
|
);
|
|
75
87
|
};
|
|
76
88
|
export {
|
|
77
|
-
|
|
89
|
+
N as MentionField
|
|
78
90
|
};
|
|
79
91
|
//# sourceMappingURL=MentionField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MentionField.js","sources":["../../../../../src/components/agent-builder/components/MentionField.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from 'react';\nimport { AgentValue } from '../AgentBuilder.model';\nimport { ToolAction } from '../constants/tools';\nimport {\n\tMentionFieldKey,\n\tuseAgentBuilderContext,\n} from '../context/AgentBuilderContext';\nimport {\n\tappTypeLabel,\n\tbuildAgentMentionItems,\n\tbuildCustomToolMentionItems,\n} from '../utils/mentionSerialization';\nimport { buildToolActions } from '../utils/toolActions';\nimport { MentionEditor } from './MentionEditor';\n\ninterface MentionFieldProps {\n\t/** Which AgentValue field this editor reads / writes. */\n\tfieldKey: MentionFieldKey;\n\tlabel: string;\n\tplaceholder?: string;\n\tmaxLength: number;\n\tminHeight?: string;\n\t'data-test'?: string;\n}\n\n/**\n * Context-bound {@link MentionEditor} for the builder's Step-3 Instructions /\n * Guardrails. Both `@` tools and sub-agents are offered; the field registers its\n * insert + focus with the context so side-panel adds drop a chip into whichever\n * field was last focused, and remounts on `mentionResetKey`.\n */\nexport const MentionField: React.FC<MentionFieldProps> = ({\n\tfieldKey,\n\tlabel,\n\tplaceholder,\n\tmaxLength,\n\tminHeight,\n\t...rest\n}) => {\n\tconst {\n\t\tvalue,\n\t\tpatch,\n\t\taddReference,\n\t\tavailableTools,\n\t\tavailableSubAgents,\n\t\tapplicationType,\n\t\tmentionResetKey,\n\t\tregisterMentionField,\n\t\tnotifyMentionFocus,\n\t\tonCreateSubAgent,\n\t\trequestCreateSubAgent,\n\t\trequestToolAction,\n\t\tconfigToolTemplates,\n\t} = useAgentBuilderContext();\n\n\t// Catalog tools + sub-agents, PLUS the inline custom tools (Rest API / email /\n\t// Slack) so their `{{tool:<id>}}` tokens rehydrate as chips on remount — they\n\t// live on the value, not in `availableTools`.\n\tconst mentionItems = useMemo(\n\t\t() => [\n\t\t\t...buildAgentMentionItems(\n\t\t\t\tavailableTools,\n\t\t\t\tavailableSubAgents,\n\t\t\t\tappTypeLabel(applicationType),\n\t\t\t),\n\t\t\t...buildCustomToolMentionItems(value.configTools, value.restApiTools),\n\t\t],\n\t\t[\n\t\t\tavailableTools,\n\t\t\tavailableSubAgents,\n\t\t\tapplicationType,\n\t\t\tvalue.configTools,\n\t\t\tvalue.restApiTools,\n\t\t],\n\t);\n\n\t// Built-in tool actions (Rest API / email / Slack) shown in the `@` picker's\n\t// Tools view — picking one opens its drawer (Step 3) instead of inserting text.\n\t// The shared email / Slack forms are backend-driven: each is offered only when\n\t// its template was provided.\n\tconst toolActions = useMemo<ToolAction[]>(\n\t\t()
|
|
1
|
+
{"version":3,"file":"MentionField.js","sources":["../../../../../src/components/agent-builder/components/MentionField.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from 'react';\nimport { AgentValue } from '../AgentBuilder.model';\nimport { ToolAction } from '../constants/tools';\nimport {\n\tMentionFieldKey,\n\tuseAgentBuilderContext,\n} from '../context/AgentBuilderContext';\nimport {\n\tappTypeLabel,\n\tbuildAgentMentionItems,\n\tbuildCustomToolMentionItems,\n} from '../utils/mentionSerialization';\nimport { buildToolActions } from '../utils/toolActions';\nimport { MentionEditor } from './MentionEditor';\n\ninterface MentionFieldProps {\n\t/** Which AgentValue field this editor reads / writes. */\n\tfieldKey: MentionFieldKey;\n\tlabel: string;\n\tplaceholder?: string;\n\tmaxLength: number;\n\tminHeight?: string;\n\t'data-test'?: string;\n}\n\n/**\n * Context-bound {@link MentionEditor} for the builder's Step-3 Instructions /\n * Guardrails. Both `@` tools and sub-agents are offered; the field registers its\n * insert + focus with the context so side-panel adds drop a chip into whichever\n * field was last focused, and remounts on `mentionResetKey`.\n */\nexport const MentionField: React.FC<MentionFieldProps> = ({\n\tfieldKey,\n\tlabel,\n\tplaceholder,\n\tmaxLength,\n\tminHeight,\n\t...rest\n}) => {\n\tconst {\n\t\tvalue,\n\t\tpatch,\n\t\taddReference,\n\t\tavailableTools,\n\t\tavailableSubAgents,\n\t\tapplicationType,\n\t\tmentionResetKey,\n\t\tregisterMentionField,\n\t\tnotifyMentionFocus,\n\t\tonCreateSubAgent,\n\t\trequestCreateSubAgent,\n\t\trequestToolAction,\n\t\tconfigToolTemplates,\n\t\tintegrationStatus,\n\t\tonConnectIntegration,\n\t} = useAgentBuilderContext();\n\n\t// Catalog tools + sub-agents, PLUS the inline custom tools (Rest API / email /\n\t// Slack) so their `{{tool:<id>}}` tokens rehydrate as chips on remount — they\n\t// live on the value, not in `availableTools`.\n\tconst mentionItems = useMemo(\n\t\t() => [\n\t\t\t...buildAgentMentionItems(\n\t\t\t\tavailableTools,\n\t\t\t\tavailableSubAgents,\n\t\t\t\tappTypeLabel(applicationType),\n\t\t\t),\n\t\t\t...buildCustomToolMentionItems(value.configTools, value.restApiTools),\n\t\t],\n\t\t[\n\t\t\tavailableTools,\n\t\t\tavailableSubAgents,\n\t\t\tapplicationType,\n\t\t\tvalue.configTools,\n\t\t\tvalue.restApiTools,\n\t\t],\n\t);\n\n\t// Built-in tool actions (Rest API / email / Slack) shown in the `@` picker's\n\t// Tools view — picking one opens its drawer (Step 3) instead of inserting text.\n\t// The shared email / Slack forms are backend-driven: each is offered only when\n\t// its template was provided.\n\tconst toolActions = useMemo<ToolAction[]>(\n\t\t() =>\n\t\t\tbuildToolActions(\n\t\t\t\tconfigToolTemplates,\n\t\t\t\trequestToolAction,\n\t\t\t\tintegrationStatus,\n\t\t\t\tonConnectIntegration,\n\t\t\t),\n\t\t[\n\t\t\trequestToolAction,\n\t\t\tconfigToolTemplates,\n\t\t\tintegrationStatus,\n\t\t\tonConnectIntegration,\n\t\t],\n\t);\n\n\tconst registerInsert = useCallback(\n\t\t(fn: Parameters<typeof registerMentionField>[1]) =>\n\t\t\tregisterMentionField(fieldKey, fn),\n\t\t[registerMentionField, fieldKey],\n\t);\n\n\t// Route through the context's ref-backed `addReference`: BikEditor captures\n\t// this handler at mount, so reading `value.tools` here would keep only the last\n\t// pick. `addReference` always appends against the latest lists.\n\tconst onMentionSelect = useCallback(\n\t\t(kind: 'tool' | 'subagent', id: string) => addReference(kind, id),\n\t\t[addReference],\n\t);\n\n\treturn (\n\t\t<MentionEditor\n\t\t\tlabel={label}\n\t\t\tvalue={(value[fieldKey] as string | undefined) ?? ''}\n\t\t\tonChange={(text) => patch({ [fieldKey]: text } as Partial<AgentValue>)}\n\t\t\tmaxLength={maxLength}\n\t\t\tplaceholder={placeholder}\n\t\t\tminHeight={minHeight}\n\t\t\tresetKey={`${value.id}:${fieldKey}:${mentionResetKey}`}\n\t\t\tmentionItems={mentionItems}\n\t\t\ttools={availableTools}\n\t\t\tonMentionSelect={onMentionSelect}\n\t\t\tonFocus={() => notifyMentionFocus(fieldKey)}\n\t\t\tregisterInsert={registerInsert}\n\t\t\tonCreateSubAgent={onCreateSubAgent ? requestCreateSubAgent : undefined}\n\t\t\ttoolActions={toolActions}\n\t\t\tdata-test={rest['data-test']}\n\t\t/>\n\t);\n};\n"],"names":["MentionField","fieldKey","label","placeholder","maxLength","minHeight","rest","value","patch","addReference","availableTools","availableSubAgents","applicationType","mentionResetKey","registerMentionField","notifyMentionFocus","onCreateSubAgent","requestCreateSubAgent","requestToolAction","configToolTemplates","integrationStatus","onConnectIntegration","useAgentBuilderContext","mentionItems","useMemo","buildAgentMentionItems","appTypeLabel","buildCustomToolMentionItems","toolActions","buildToolActions","registerInsert","useCallback","fn","onMentionSelect","kind","id","jsx","MentionEditor","text"],"mappings":";;;;;;AA+BO,MAAMA,IAA4C,CAAC;AAAA,EACzD,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACJ,MAAM;AACL,QAAM;AAAA,IACL,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,cAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,sBAAAC;AAAA,EAAA,IACGC,EAAA,GAKEC,IAAeC;AAAA,IACpB,MAAM;AAAA,MACL,GAAGC;AAAA,QACFf;AAAA,QACAC;AAAA,QACAe,EAAad,CAAe;AAAA,MAAA;AAAA,MAE7B,GAAGe,EAA4BpB,EAAM,aAAaA,EAAM,YAAY;AAAA,IAAA;AAAA,IAErE;AAAA,MACCG;AAAA,MACAC;AAAA,MACAC;AAAA,MACAL,EAAM;AAAA,MACNA,EAAM;AAAA,IAAA;AAAA,EACP,GAOKqB,IAAcJ;AAAA,IACnB,MACCK;AAAA,MACCV;AAAA,MACAD;AAAA,MACAE;AAAA,MACAC;AAAA,IAAA;AAAA,IAEF;AAAA,MACCH;AAAA,MACAC;AAAA,MACAC;AAAA,MACAC;AAAA,IAAA;AAAA,EACD,GAGKS,IAAiBC;AAAA,IACtB,CAACC,MACAlB,EAAqBb,GAAU+B,CAAE;AAAA,IAClC,CAAClB,GAAsBb,CAAQ;AAAA,EAAA,GAM1BgC,IAAkBF;AAAA,IACvB,CAACG,GAA2BC,MAAe1B,EAAayB,GAAMC,CAAE;AAAA,IAChE,CAAC1B,CAAY;AAAA,EAAA;AAGd,SACC,gBAAA2B;AAAA,IAACC;AAAA,IAAA;AAAA,MACA,OAAAnC;AAAA,MACA,OAAQK,EAAMN,CAAQ,KAA4B;AAAA,MAClD,UAAU,CAACqC,MAAS9B,EAAM,EAAE,CAACP,CAAQ,GAAGqC,GAA6B;AAAA,MACrE,WAAAlC;AAAA,MACA,aAAAD;AAAA,MACA,WAAAE;AAAA,MACA,UAAU,GAAGE,EAAM,EAAE,IAAIN,CAAQ,IAAIY,CAAe;AAAA,MACpD,cAAAU;AAAA,MACA,OAAOb;AAAA,MACP,iBAAAuB;AAAA,MACA,SAAS,MAAMlB,EAAmBd,CAAQ;AAAA,MAC1C,gBAAA6B;AAAA,MACA,kBAAkBd,IAAmBC,IAAwB;AAAA,MAC7D,aAAAW;AAAA,MACA,aAAWtB,EAAK,WAAW;AAAA,IAAA;AAAA,EAAA;AAG9B;"}
|
|
@@ -1,146 +1,158 @@
|
|
|
1
|
-
import { jsxs as m, jsx as u, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { useState as
|
|
1
|
+
import { jsxs as m, jsx as u, Fragment as Q } from "react/jsx-runtime";
|
|
2
|
+
import V from "../../../assets/icons/chevronRight.svg.js";
|
|
3
|
+
import W from "../../../assets/icons/searchIcon.svg.js";
|
|
4
|
+
import X from "../../../icons/Arrows/Normal arrows/ArrowLeft.js";
|
|
5
|
+
import { useState as A, useMemo as x, useEffect as P, useRef as Y } from "react";
|
|
6
6
|
import p from "styled-components";
|
|
7
|
-
import { TitleSmall as
|
|
7
|
+
import { TitleSmall as Z, BodySecondary as K } from "../../TypographyStyle.js";
|
|
8
8
|
import { COLORS as o } from "../../../constants/Theme.js";
|
|
9
|
-
import { CATEGORIES as
|
|
10
|
-
import { toolSourceLabel as
|
|
11
|
-
import { sourceIcon as z, renderSourceIcon as
|
|
12
|
-
const y = (i) => i.meta,
|
|
9
|
+
import { CATEGORIES as H, toolSourceRank as U, CONFIG_TOOL_SOURCES as ee } from "../constants/tools.js";
|
|
10
|
+
import { toolSourceLabel as D } from "../utils/mentionSerialization.js";
|
|
11
|
+
import { sourceIcon as z, renderSourceIcon as j } from "../utils/sourceIcons.js";
|
|
12
|
+
const y = (i) => i.meta, L = (i) => y(i)?.plainLabel ?? i.label, te = "__bik_create_subagent__", we = ({
|
|
13
13
|
items: i,
|
|
14
|
-
onSelect:
|
|
14
|
+
onSelect: R,
|
|
15
15
|
registerKeyHandler: w,
|
|
16
|
-
onClose:
|
|
17
|
-
onCreateSubAgent:
|
|
18
|
-
initialSource:
|
|
19
|
-
toolActions:
|
|
16
|
+
onClose: I,
|
|
17
|
+
onCreateSubAgent: k,
|
|
18
|
+
initialSource: F,
|
|
19
|
+
toolActions: h
|
|
20
20
|
}) => {
|
|
21
|
-
const [
|
|
21
|
+
const [G, B] = A(null), [a, E] = A(F ?? null), [S, g] = A(0), [v, M] = A(""), b = x(
|
|
22
22
|
() => i.filter((e) => y(e)?.kind === "tool"),
|
|
23
23
|
[i]
|
|
24
|
-
),
|
|
24
|
+
), C = x(
|
|
25
25
|
() => i.filter((e) => y(e)?.kind === "subagent"),
|
|
26
26
|
[i]
|
|
27
|
-
), _ =
|
|
27
|
+
), _ = x(() => {
|
|
28
28
|
const e = [];
|
|
29
|
-
return
|
|
30
|
-
const
|
|
31
|
-
e.includes(
|
|
29
|
+
return b.forEach((r) => {
|
|
30
|
+
const f = y(r)?.source ?? "other";
|
|
31
|
+
e.includes(f) || e.push(f);
|
|
32
32
|
}), e;
|
|
33
|
-
}, [
|
|
33
|
+
}, [b]), O = x(
|
|
34
34
|
() => new Map(
|
|
35
|
-
(
|
|
35
|
+
(h ?? []).map((e) => [e.source, e])
|
|
36
36
|
),
|
|
37
|
-
[
|
|
38
|
-
),
|
|
39
|
-
() =>
|
|
40
|
-
(e) => e.key === "tool" ?
|
|
37
|
+
[h]
|
|
38
|
+
), $ = x(
|
|
39
|
+
() => H.filter(
|
|
40
|
+
(e) => e.key === "tool" ? b.length > 0 || (h?.length ?? 0) > 0 : C.length > 0 || !!k
|
|
41
41
|
),
|
|
42
|
-
[
|
|
43
|
-
),
|
|
42
|
+
[b.length, C.length, k, h?.length]
|
|
43
|
+
), T = $.length === 1 ? $[0].key : null, c = G ?? T, d = c ? c === "subagent" ? (
|
|
44
44
|
// Always titled — with a back arrow only when the category chooser is above.
|
|
45
45
|
{
|
|
46
46
|
title: "Sub-agent",
|
|
47
|
-
onBack:
|
|
47
|
+
onBack: T ? void 0 : () => B(null)
|
|
48
48
|
}
|
|
49
49
|
) : a ? {
|
|
50
|
-
title:
|
|
51
|
-
onBack: () =>
|
|
50
|
+
title: D(a),
|
|
51
|
+
onBack: () => E(null),
|
|
52
52
|
icon: z(a)
|
|
53
53
|
} : (
|
|
54
54
|
// Always titled — matches the Sub-agent header; back arrow only when the
|
|
55
55
|
// category chooser is above (i.e. not the sole category).
|
|
56
56
|
{
|
|
57
57
|
title: "Tools",
|
|
58
|
-
onBack:
|
|
58
|
+
onBack: T ? void 0 : () => B(null)
|
|
59
59
|
}
|
|
60
|
-
) : null,
|
|
61
|
-
if (!
|
|
62
|
-
return
|
|
60
|
+
) : null, s = x(() => {
|
|
61
|
+
if (!c)
|
|
62
|
+
return $.map((t) => ({
|
|
63
63
|
id: t.key,
|
|
64
64
|
label: t.label,
|
|
65
65
|
drillsIn: !0,
|
|
66
66
|
onActivate: () => {
|
|
67
|
-
|
|
67
|
+
B(t.key), E(null);
|
|
68
68
|
}
|
|
69
69
|
}));
|
|
70
|
-
if (
|
|
71
|
-
const t =
|
|
72
|
-
id: String(
|
|
73
|
-
label:
|
|
70
|
+
if (c === "subagent") {
|
|
71
|
+
const t = v.trim().toLowerCase(), n = C.filter((l) => !t || L(l).toLowerCase().includes(t)).map((l) => ({
|
|
72
|
+
id: String(l.id),
|
|
73
|
+
label: L(l),
|
|
74
74
|
drillsIn: !1,
|
|
75
|
-
onActivate: () =>
|
|
75
|
+
onActivate: () => R(l)
|
|
76
76
|
}));
|
|
77
|
-
return
|
|
78
|
-
id:
|
|
77
|
+
return k && n.push({
|
|
78
|
+
id: te,
|
|
79
79
|
label: "Create new",
|
|
80
80
|
drillsIn: !1,
|
|
81
81
|
isCreate: !0,
|
|
82
82
|
onActivate: () => {
|
|
83
|
-
|
|
83
|
+
I?.(), k();
|
|
84
84
|
}
|
|
85
|
-
}),
|
|
85
|
+
}), n;
|
|
86
86
|
}
|
|
87
87
|
if (!a) {
|
|
88
|
-
const t = (
|
|
89
|
-
return [..._, ...t].map((
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
88
|
+
const t = (h ?? []).map((n) => n.source).filter((n) => !_.includes(n));
|
|
89
|
+
return [..._, ...t].sort((n, l) => U(n) - U(l)).map((n) => {
|
|
90
|
+
const l = O.get(n);
|
|
91
|
+
return l?.connected === !1 ? {
|
|
92
|
+
id: n,
|
|
93
|
+
label: D(n),
|
|
94
|
+
drillsIn: !1,
|
|
95
|
+
icon: z(n) ?? l.icon,
|
|
96
|
+
rightLabel: "Connect",
|
|
97
|
+
onActivate: () => {
|
|
98
|
+
I?.(), l.onConnect?.();
|
|
99
|
+
}
|
|
100
|
+
} : {
|
|
101
|
+
id: n,
|
|
102
|
+
label: D(n),
|
|
103
|
+
drillsIn: !0,
|
|
104
|
+
icon: z(n) ?? l?.icon,
|
|
105
|
+
onActivate: () => E(n)
|
|
106
|
+
};
|
|
107
|
+
});
|
|
96
108
|
}
|
|
97
|
-
const e =
|
|
109
|
+
const e = v.trim().toLowerCase(), r = b.filter((t) => (y(t)?.source ?? "other") === a).filter((t) => !e || L(t).toLowerCase().includes(e)).map((t) => ({
|
|
98
110
|
id: String(t.id),
|
|
99
|
-
label:
|
|
111
|
+
label: L(t),
|
|
100
112
|
drillsIn: !1,
|
|
101
|
-
onActivate: () =>
|
|
102
|
-
})),
|
|
103
|
-
if (
|
|
104
|
-
const t = a in
|
|
105
|
-
|
|
113
|
+
onActivate: () => R(t)
|
|
114
|
+
})), f = O.get(a);
|
|
115
|
+
if (f) {
|
|
116
|
+
const t = a in ee;
|
|
117
|
+
r.push({
|
|
106
118
|
id: `create:${a}`,
|
|
107
|
-
label:
|
|
119
|
+
label: f.label,
|
|
108
120
|
drillsIn: !1,
|
|
109
121
|
isCreate: !t,
|
|
110
122
|
onActivate: () => {
|
|
111
|
-
|
|
123
|
+
I?.(), f.onSelect();
|
|
112
124
|
}
|
|
113
125
|
});
|
|
114
126
|
}
|
|
115
|
-
return
|
|
127
|
+
return r;
|
|
116
128
|
}, [
|
|
117
|
-
|
|
118
|
-
|
|
129
|
+
c,
|
|
130
|
+
$,
|
|
119
131
|
a,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
132
|
+
v,
|
|
133
|
+
b,
|
|
134
|
+
C,
|
|
123
135
|
_,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
136
|
+
R,
|
|
137
|
+
I,
|
|
138
|
+
k,
|
|
139
|
+
h,
|
|
128
140
|
O
|
|
129
141
|
]);
|
|
130
|
-
|
|
131
|
-
const
|
|
132
|
-
|
|
142
|
+
P(() => g(0), [c, a, v, i]), P(() => M(""), [c, a]);
|
|
143
|
+
const N = Y({ rows: s, activeIndex: S, header: d });
|
|
144
|
+
N.current = { rows: s, activeIndex: S, header: d }, P(() => {
|
|
133
145
|
if (w)
|
|
134
146
|
return w((e) => {
|
|
135
|
-
const { rows:
|
|
147
|
+
const { rows: r, activeIndex: f, header: t } = N.current;
|
|
136
148
|
switch (e.key) {
|
|
137
149
|
case "ArrowDown":
|
|
138
|
-
return
|
|
150
|
+
return r.length && g((n) => (n + 1) % r.length), !0;
|
|
139
151
|
case "ArrowUp":
|
|
140
|
-
return
|
|
152
|
+
return r.length && g((n) => (n + r.length - 1) % r.length), !0;
|
|
141
153
|
case "ArrowRight":
|
|
142
154
|
case "Enter":
|
|
143
|
-
return
|
|
155
|
+
return r[f]?.onActivate(), !0;
|
|
144
156
|
case "ArrowLeft":
|
|
145
157
|
return t?.onBack ? (t.onBack(), !0) : !1;
|
|
146
158
|
default:
|
|
@@ -148,38 +160,38 @@ const y = (i) => i.meta, B = (i) => y(i)?.plainLabel ?? i.label, ee = "__bik_cre
|
|
|
148
160
|
}
|
|
149
161
|
}), () => w(null);
|
|
150
162
|
}, [w]);
|
|
151
|
-
const
|
|
152
|
-
return /* @__PURE__ */ m(
|
|
153
|
-
|
|
154
|
-
|
|
163
|
+
const q = c ? s.length && !s[0].drillsIn ? "items" : "sources" : "categories", J = c === "tool" && !!a || c === "subagent";
|
|
164
|
+
return /* @__PURE__ */ m(ne, { className: `bik-mention-picker bik-mention-picker--${q}`, children: [
|
|
165
|
+
d && /* @__PURE__ */ m(
|
|
166
|
+
se,
|
|
155
167
|
{
|
|
156
168
|
type: "button",
|
|
157
|
-
onClick:
|
|
158
|
-
disabled: !
|
|
169
|
+
onClick: d.onBack,
|
|
170
|
+
disabled: !d.onBack,
|
|
159
171
|
style: {
|
|
160
172
|
background: o.surface.subdued,
|
|
161
|
-
cursor:
|
|
173
|
+
cursor: d.onBack ? "pointer" : "default"
|
|
162
174
|
},
|
|
163
175
|
children: [
|
|
164
|
-
|
|
165
|
-
|
|
176
|
+
d.onBack && /* @__PURE__ */ u(
|
|
177
|
+
X,
|
|
166
178
|
{
|
|
167
179
|
width: 20,
|
|
168
180
|
height: 20,
|
|
169
181
|
color: o.content.primary
|
|
170
182
|
}
|
|
171
183
|
),
|
|
172
|
-
|
|
173
|
-
/* @__PURE__ */ m(
|
|
184
|
+
d.icon && j(d.icon),
|
|
185
|
+
/* @__PURE__ */ m(Z, { children: [
|
|
174
186
|
" ",
|
|
175
|
-
|
|
187
|
+
d.title
|
|
176
188
|
] })
|
|
177
189
|
]
|
|
178
190
|
}
|
|
179
191
|
),
|
|
180
|
-
|
|
192
|
+
J && /* @__PURE__ */ m(re, { children: [
|
|
181
193
|
/* @__PURE__ */ u(
|
|
182
|
-
|
|
194
|
+
W,
|
|
183
195
|
{
|
|
184
196
|
width: 20,
|
|
185
197
|
height: 20,
|
|
@@ -187,38 +199,38 @@ const y = (i) => i.meta, B = (i) => y(i)?.plainLabel ?? i.label, ee = "__bik_cre
|
|
|
187
199
|
}
|
|
188
200
|
),
|
|
189
201
|
/* @__PURE__ */ u(
|
|
190
|
-
|
|
202
|
+
oe,
|
|
191
203
|
{
|
|
192
204
|
autoFocus: !0,
|
|
193
|
-
value:
|
|
205
|
+
value: v,
|
|
194
206
|
placeholder: "Search",
|
|
195
207
|
"data-test": "mention-picker-search",
|
|
196
|
-
onChange: (e) =>
|
|
208
|
+
onChange: (e) => M(e.target.value),
|
|
197
209
|
onKeyDown: (e) => {
|
|
198
|
-
|
|
210
|
+
s.length && (e.key === "ArrowDown" ? (e.preventDefault(), g((r) => (r + 1) % s.length)) : e.key === "ArrowUp" ? (e.preventDefault(), g((r) => (r + s.length - 1) % s.length)) : e.key === "Enter" && (e.preventDefault(), s[S]?.onActivate()));
|
|
199
211
|
}
|
|
200
212
|
}
|
|
201
213
|
)
|
|
202
214
|
] }),
|
|
203
|
-
|
|
204
|
-
|
|
215
|
+
s.length === 0 ? /* @__PURE__ */ u(de, { children: c === "subagent" ? "No sub-agents available" : "No tools available" }) : s.map((e, r) => /* @__PURE__ */ u(
|
|
216
|
+
ie,
|
|
205
217
|
{
|
|
206
218
|
type: "button",
|
|
207
|
-
$active:
|
|
208
|
-
onMouseEnter: () =>
|
|
219
|
+
$active: r === S,
|
|
220
|
+
onMouseEnter: () => g(r),
|
|
209
221
|
onClick: e.onActivate,
|
|
210
|
-
children: e.isCreate ? /* @__PURE__ */ u(
|
|
211
|
-
/* @__PURE__ */ m(
|
|
212
|
-
|
|
213
|
-
/* @__PURE__ */ u(
|
|
222
|
+
children: e.isCreate ? /* @__PURE__ */ u(ce, { children: e.label }) : /* @__PURE__ */ m(Q, { children: [
|
|
223
|
+
/* @__PURE__ */ m(ae, { children: [
|
|
224
|
+
j(e.icon),
|
|
225
|
+
/* @__PURE__ */ u(K, { color: o.content.primary, children: e.label })
|
|
214
226
|
] }),
|
|
215
|
-
e.drillsIn && /* @__PURE__ */ u(
|
|
227
|
+
e.rightLabel ? /* @__PURE__ */ u(le, { children: e.rightLabel }) : e.drillsIn && /* @__PURE__ */ u(V, { width: 12, height: 12 })
|
|
216
228
|
] })
|
|
217
229
|
},
|
|
218
230
|
e.id
|
|
219
231
|
))
|
|
220
232
|
] });
|
|
221
|
-
},
|
|
233
|
+
}, ne = p.div`
|
|
222
234
|
display: flex;
|
|
223
235
|
flex-direction: column;
|
|
224
236
|
min-width: 240px;
|
|
@@ -228,13 +240,13 @@ const y = (i) => i.meta, B = (i) => y(i)?.plainLabel ?? i.label, ee = "__bik_cre
|
|
|
228
240
|
border: 1px solid ${o.stroke.primary};
|
|
229
241
|
border-radius: 4px;
|
|
230
242
|
box-shadow: 0px -2px 8px 0px #0000001f;
|
|
231
|
-
`,
|
|
243
|
+
`, re = p.div`
|
|
232
244
|
display: flex;
|
|
233
245
|
align-items: center;
|
|
234
246
|
gap: 8px;
|
|
235
247
|
padding: 10px 12px;
|
|
236
248
|
border-bottom: 1px solid ${o.stroke.primary};
|
|
237
|
-
`,
|
|
249
|
+
`, oe = p.input`
|
|
238
250
|
flex: 1;
|
|
239
251
|
min-width: 0;
|
|
240
252
|
border: none;
|
|
@@ -247,7 +259,7 @@ const y = (i) => i.meta, B = (i) => y(i)?.plainLabel ?? i.label, ee = "__bik_cre
|
|
|
247
259
|
&::placeholder {
|
|
248
260
|
color: ${o.content.placeholder};
|
|
249
261
|
}
|
|
250
|
-
`,
|
|
262
|
+
`, ie = p.button`
|
|
251
263
|
display: flex;
|
|
252
264
|
justify-content: space-between;
|
|
253
265
|
align-items: center;
|
|
@@ -264,19 +276,26 @@ const y = (i) => i.meta, B = (i) => y(i)?.plainLabel ?? i.label, ee = "__bik_cre
|
|
|
264
276
|
&:hover {
|
|
265
277
|
background: ${o.surface.subdued};
|
|
266
278
|
}
|
|
267
|
-
`,
|
|
279
|
+
`, ae = p.div`
|
|
268
280
|
display: flex;
|
|
269
281
|
align-items: center;
|
|
270
282
|
gap: 12px;
|
|
271
283
|
min-width: 0;
|
|
272
|
-
`,
|
|
284
|
+
`, le = p.span`
|
|
285
|
+
flex-shrink: 0;
|
|
286
|
+
color: ${o.content.brand};
|
|
287
|
+
font-family: Inter;
|
|
288
|
+
font-size: 14px;
|
|
289
|
+
font-weight: 600;
|
|
290
|
+
white-space: nowrap;
|
|
291
|
+
`, ce = p.div`
|
|
273
292
|
width: 100%;
|
|
274
293
|
text-align: center;
|
|
275
294
|
color: ${o.content.brand};
|
|
276
295
|
font-family: Inter;
|
|
277
296
|
font-size: 14px;
|
|
278
297
|
font-weight: 600;
|
|
279
|
-
`,
|
|
298
|
+
`, se = p.button`
|
|
280
299
|
display: flex;
|
|
281
300
|
align-items: center;
|
|
282
301
|
padding: 12px 16px;
|
|
@@ -289,13 +308,13 @@ const y = (i) => i.meta, B = (i) => y(i)?.plainLabel ?? i.label, ee = "__bik_cre
|
|
|
289
308
|
font-weight: 600;
|
|
290
309
|
height: 48px;
|
|
291
310
|
gap: 4px;
|
|
292
|
-
`,
|
|
311
|
+
`, de = p.div`
|
|
293
312
|
padding: 12px 10px;
|
|
294
313
|
font-family: Inter;
|
|
295
314
|
font-size: 13px;
|
|
296
315
|
color: ${o.content.secondary};
|
|
297
316
|
`;
|
|
298
317
|
export {
|
|
299
|
-
|
|
318
|
+
we as MentionPicker
|
|
300
319
|
};
|
|
301
320
|
//# sourceMappingURL=MentionPicker.js.map
|