@box/box-ai-content-answers 0.116.1 → 0.117.0
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.
|
@@ -1,69 +1,78 @@
|
|
|
1
|
-
import { FilterChip as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { FilterChip as n, Popover as s, Status as C, SmallList as m } from "@box/blueprint-web";
|
|
2
|
+
import { useLocalStorageAIAgents as I, AI_AGENTS_LOCAL_STORAGE_KEY as E } from "@box/box-ai-agent-selector";
|
|
3
|
+
import { useState as N, useCallback as G, useEffect as v } from "react";
|
|
4
|
+
import { useIntl as O } from "react-intl";
|
|
5
|
+
import { useAgents as T, useAgentsDispatch as x } from "../../contexts/AgentsContext.js";
|
|
6
|
+
import { LOGGER_BASE_CONFIG as y, LOGGER_ACTION_CLICK as z } from "../common/constants.js";
|
|
7
|
+
import f from "./messages.js";
|
|
8
|
+
import { jsx as t, jsxs as L } from "react/jsx-runtime";
|
|
9
|
+
import '../../../../styles/agent-selector.css';const R = "_agentSelector_avzc4_1", b = "_agentStatus_avzc4_5", K = "_agentList_avzc4_19", P = "_agentListItem_avzc4_19", o = {
|
|
10
|
+
agentSelector: R,
|
|
11
|
+
agentStatus: b,
|
|
12
|
+
agentList: K,
|
|
13
|
+
agentListItem: P
|
|
14
|
+
}, Y = ({
|
|
15
|
+
onSelectAgent: a,
|
|
15
16
|
recordAction: r
|
|
16
17
|
}) => {
|
|
17
18
|
const {
|
|
18
|
-
formatMessage:
|
|
19
|
-
} =
|
|
20
|
-
agents:
|
|
21
|
-
selectedAgent:
|
|
22
|
-
} =
|
|
23
|
-
|
|
19
|
+
formatMessage: g
|
|
20
|
+
} = O(), {
|
|
21
|
+
agents: i,
|
|
22
|
+
selectedAgent: p
|
|
23
|
+
} = T(), [d, c] = I(E), l = x(), [u, _] = N(!1), S = g(f.selectAgent), h = G((e) => {
|
|
24
|
+
_(!1), l({
|
|
24
25
|
type: "SELECT_AGENT",
|
|
25
|
-
agentName:
|
|
26
|
-
}), r && r({
|
|
27
|
-
...
|
|
28
|
-
action:
|
|
26
|
+
agentName: e.name
|
|
27
|
+
}), c(e.id), r && r({
|
|
28
|
+
...y,
|
|
29
|
+
action: z,
|
|
29
30
|
target: "agentSelector",
|
|
30
31
|
data: {
|
|
31
|
-
agentSelected:
|
|
32
|
+
agentSelected: e.name
|
|
32
33
|
}
|
|
33
|
-
}),
|
|
34
|
-
}, [
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
}), a && a(e);
|
|
35
|
+
}, [l, a, r, c]);
|
|
36
|
+
return v(() => {
|
|
37
|
+
if (d) {
|
|
38
|
+
const e = i.find((A) => A.id === d);
|
|
39
|
+
e ? (l({
|
|
40
|
+
type: "SELECT_AGENT",
|
|
41
|
+
agentName: e.name
|
|
42
|
+
}), a && a(e)) : c(null);
|
|
43
|
+
}
|
|
44
|
+
}, [i]), /* @__PURE__ */ t(n.Group, {
|
|
45
|
+
className: o.agentSelector,
|
|
46
|
+
name: S,
|
|
38
47
|
type: "multiple",
|
|
39
|
-
children: /* @__PURE__ */
|
|
48
|
+
children: /* @__PURE__ */ L(s.Root, {
|
|
40
49
|
modal: !1,
|
|
41
|
-
onOpenChange:
|
|
42
|
-
open:
|
|
43
|
-
children: [/* @__PURE__ */
|
|
44
|
-
children: /* @__PURE__ */
|
|
50
|
+
onOpenChange: _,
|
|
51
|
+
open: u,
|
|
52
|
+
children: [/* @__PURE__ */ t(s.Trigger, {
|
|
53
|
+
children: /* @__PURE__ */ L(n.TriggerChip, {
|
|
45
54
|
value: "trigger-chip",
|
|
46
|
-
children: [/* @__PURE__ */
|
|
47
|
-
className:
|
|
55
|
+
children: [/* @__PURE__ */ t(C, {
|
|
56
|
+
className: o.agentStatus,
|
|
48
57
|
colorIndex: 0,
|
|
49
|
-
text:
|
|
50
|
-
}), /* @__PURE__ */
|
|
51
|
-
children:
|
|
52
|
-
}), /* @__PURE__ */
|
|
58
|
+
text: g(f.agent)
|
|
59
|
+
}), /* @__PURE__ */ t(n.Label, {
|
|
60
|
+
children: p.name
|
|
61
|
+
}), /* @__PURE__ */ t(n.DropdownIndicator, {})]
|
|
53
62
|
})
|
|
54
|
-
}), /* @__PURE__ */
|
|
55
|
-
children: /* @__PURE__ */
|
|
56
|
-
children: /* @__PURE__ */
|
|
57
|
-
className:
|
|
58
|
-
selectedKeys: [
|
|
59
|
-
children:
|
|
60
|
-
className:
|
|
61
|
-
id:
|
|
62
|
-
onAction: () =>
|
|
63
|
-
children: /* @__PURE__ */
|
|
64
|
-
children:
|
|
63
|
+
}), /* @__PURE__ */ t(s.ContentContainer, {
|
|
64
|
+
children: /* @__PURE__ */ t(s.MainContent, {
|
|
65
|
+
children: /* @__PURE__ */ t(m, {
|
|
66
|
+
className: o.agentList,
|
|
67
|
+
selectedKeys: [p.name],
|
|
68
|
+
children: i.map((e) => /* @__PURE__ */ t(m.Item, {
|
|
69
|
+
className: o.agentListItem,
|
|
70
|
+
id: e.name,
|
|
71
|
+
onAction: () => h(e),
|
|
72
|
+
children: /* @__PURE__ */ t(m.Header, {
|
|
73
|
+
children: e.name
|
|
65
74
|
})
|
|
66
|
-
},
|
|
75
|
+
}, e.name))
|
|
67
76
|
})
|
|
68
77
|
})
|
|
69
78
|
})]
|
|
@@ -71,5 +80,5 @@ import '../../../../styles/agent-selector.css';const A = "_agentSelector_avzc4_1
|
|
|
71
80
|
});
|
|
72
81
|
};
|
|
73
82
|
export {
|
|
74
|
-
|
|
83
|
+
Y as AgentSelector
|
|
75
84
|
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
const a = (
|
|
1
|
+
const a = (e) => ({
|
|
2
2
|
ask: {
|
|
3
3
|
type: "ai_agent_ask",
|
|
4
4
|
longText: {
|
|
5
|
-
model:
|
|
5
|
+
model: e
|
|
6
6
|
},
|
|
7
7
|
longTextMulti: {
|
|
8
|
-
model:
|
|
8
|
+
model: e
|
|
9
9
|
},
|
|
10
10
|
basicText: {
|
|
11
|
-
model:
|
|
11
|
+
model: e
|
|
12
12
|
},
|
|
13
13
|
basicTextMulti: {
|
|
14
|
-
model:
|
|
14
|
+
model: e
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
}),
|
|
17
|
+
}), t = (e, _ = null, n = !1) => ({
|
|
18
18
|
id: _,
|
|
19
|
-
name:
|
|
20
|
-
config: _ ? a(_) : null,
|
|
19
|
+
name: e,
|
|
20
|
+
config: _ && _ !== "0" ? a(_) : null,
|
|
21
21
|
isDefault: n,
|
|
22
22
|
isEnterpriseDefault: n,
|
|
23
23
|
isSelected: n
|
|
24
|
-
}), i = [
|
|
24
|
+
}), i = [t("Box (default)", "0", !0), t("Box (gpt-3.5-turbo)", "azure__openai__gpt_3_5_turbo_16k"), t("Box (gpt-4o)", "openai__gpt_4o_2024_05_13"), t("Box (gemini 1.5 flash", "google__gemini_1_5_flash_001"), t("Box (gemini 1.5 pro)", "google__gemini_1_5_pro_001"), t("Box (gemini 2.0 flash)", "google__gemini_2_0_flash_exp"), t("Box (claude 3 sonnet)", "aws__claude_3_sonnet"), t("Box (claude 3.5 sonnet)", "aws__claude_3_5_sonnet"), t("Box (claude 3 haiku)", "aws__claude_3_haiku"), t("Box (titan text lite)", "aws__titan_text_lite"), t("Box (titan text express)", "aws__titan_text_express")], o = {
|
|
25
25
|
agents: i,
|
|
26
|
-
selectedAgent: i.find((
|
|
26
|
+
selectedAgent: i.find((e) => e.isSelected)
|
|
27
27
|
};
|
|
28
28
|
export {
|
|
29
29
|
i as agentList,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/box-ai-content-answers",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.117.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@box/blueprint-web": "^7.8.0",
|
|
6
6
|
"@box/blueprint-web-assets": "^4.35.0",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@box/babel-plugin-target-attributes": "1.3.0",
|
|
19
|
-
"@box/blueprint-web": "^11.0
|
|
19
|
+
"@box/blueprint-web": "^11.1.0",
|
|
20
20
|
"@box/blueprint-web-assets": "^4.40.0",
|
|
21
|
-
"@box/box-ai-agent-selector": "^0.
|
|
22
|
-
"@box/item-icon": "^0.9.
|
|
21
|
+
"@box/box-ai-agent-selector": "^0.38.0",
|
|
22
|
+
"@box/item-icon": "^0.9.114",
|
|
23
23
|
"@box/storybook-utils": "^0.9.2",
|
|
24
24
|
"@testing-library/react": "^15.0.6",
|
|
25
25
|
"react": "^18.3.0",
|