@kuntur/a2a-carbon-chat-adapter 0.1.3 → 0.1.5
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/index.cjs +69 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +69 -48
- package/dist/index.js.map +1 -1
- package/dist/styles/index.css +9 -0
- package/package.json +1 -1
- package/dist/server.d.cts +0 -40
- package/dist/server.d.ts +0 -40
package/dist/index.js
CHANGED
|
@@ -1888,39 +1888,10 @@ function A2AChat({
|
|
|
1888
1888
|
setCurrentFormRequest(null);
|
|
1889
1889
|
setPendingTaskId(null);
|
|
1890
1890
|
}, []);
|
|
1891
|
-
const
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
hasContentMaxWidth: true
|
|
1896
|
-
},
|
|
1897
|
-
header: {
|
|
1898
|
-
title: agent?.name ?? "AI Assistant",
|
|
1899
|
-
icons: {
|
|
1900
|
-
agent: agent?.iconUrl ?? "/bot.svg"
|
|
1901
|
-
}
|
|
1902
|
-
},
|
|
1903
|
-
input: {
|
|
1904
|
-
placeholder: "Type a message..."
|
|
1905
|
-
},
|
|
1906
|
-
messaging: {
|
|
1907
|
-
customSendMessage: async (request, options, instance) => {
|
|
1908
|
-
instanceRef.current = instance;
|
|
1909
|
-
const text = request?.input?.text;
|
|
1910
|
-
if (text) {
|
|
1911
|
-
await handleSendMessage(text);
|
|
1912
|
-
}
|
|
1913
|
-
},
|
|
1914
|
-
skipWelcome: true
|
|
1915
|
-
},
|
|
1916
|
-
userDefinedResponses: {
|
|
1917
|
-
text_with_citations: renderCustomResponse,
|
|
1918
|
-
sources_list: renderCustomResponse,
|
|
1919
|
-
error: renderCustomResponse
|
|
1920
|
-
}
|
|
1921
|
-
}),
|
|
1922
|
-
[agent, layout, handleSendMessage, renderCustomResponse]
|
|
1923
|
-
);
|
|
1891
|
+
const handleAfterRender = useCallback((instance) => {
|
|
1892
|
+
instanceRef.current = instance;
|
|
1893
|
+
console.log("[A2AChat] Chat instance ready");
|
|
1894
|
+
}, []);
|
|
1924
1895
|
if (!agent) {
|
|
1925
1896
|
return /* @__PURE__ */ jsx("div", { className: `a2a-chat a2a-chat--error ${className}`, children: /* @__PURE__ */ jsx("p", { children: "No agent configured. Provide `agent`, `agentId`, or `agentUrl` prop." }) });
|
|
1926
1897
|
}
|
|
@@ -1938,25 +1909,75 @@ function A2AChat({
|
|
|
1938
1909
|
) });
|
|
1939
1910
|
if (layout === "float" && ChatContainer) {
|
|
1940
1911
|
return /* @__PURE__ */ jsxs("div", { className: `a2a-chat a2a-chat--float ${className}`, children: [
|
|
1941
|
-
/* @__PURE__ */ jsx(
|
|
1912
|
+
/* @__PURE__ */ jsx(
|
|
1913
|
+
ChatContainer,
|
|
1914
|
+
{
|
|
1915
|
+
...{
|
|
1916
|
+
debug: false,
|
|
1917
|
+
aiEnabled: true,
|
|
1918
|
+
injectCarbonTheme: "white"
|
|
1919
|
+
},
|
|
1920
|
+
header: {
|
|
1921
|
+
title: agent?.name ?? "AI Assistant"
|
|
1922
|
+
},
|
|
1923
|
+
launcher: {
|
|
1924
|
+
isOn: true
|
|
1925
|
+
},
|
|
1926
|
+
onAfterRender: handleAfterRender,
|
|
1927
|
+
renderUserDefinedResponse: renderCustomResponse,
|
|
1928
|
+
messaging: {
|
|
1929
|
+
skipWelcome: true,
|
|
1930
|
+
customSendMessage: async (request, _options, _instance) => {
|
|
1931
|
+
const text = request?.input?.text;
|
|
1932
|
+
if (text) {
|
|
1933
|
+
await handleSendMessage(text);
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
),
|
|
1942
1939
|
formOverlay
|
|
1943
1940
|
] });
|
|
1944
1941
|
}
|
|
1945
1942
|
if (ChatCustomElement) {
|
|
1946
|
-
return /* @__PURE__ */ jsxs(
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1943
|
+
return /* @__PURE__ */ jsxs("div", { className: `a2a-chat a2a-chat--${layout} ${className}`, children: [
|
|
1944
|
+
/* @__PURE__ */ jsx(
|
|
1945
|
+
ChatCustomElement,
|
|
1946
|
+
{
|
|
1947
|
+
...{
|
|
1948
|
+
className: "a2a-chat__element",
|
|
1949
|
+
debug: false,
|
|
1950
|
+
aiEnabled: true,
|
|
1951
|
+
openChatByDefault: true,
|
|
1952
|
+
injectCarbonTheme: "white"
|
|
1953
|
+
},
|
|
1954
|
+
header: {
|
|
1955
|
+
title: agent?.name ?? "AI Assistant",
|
|
1956
|
+
showMinimize: layout !== "fullscreen"
|
|
1957
|
+
},
|
|
1958
|
+
launcher: {
|
|
1959
|
+
isOn: layout === "float"
|
|
1960
|
+
},
|
|
1961
|
+
layout: {
|
|
1962
|
+
showFrame: layout === "float",
|
|
1963
|
+
showCloseAndRestartButton: layout !== "fullscreen"
|
|
1964
|
+
},
|
|
1965
|
+
onAfterRender: handleAfterRender,
|
|
1966
|
+
renderUserDefinedResponse: renderCustomResponse,
|
|
1967
|
+
messaging: {
|
|
1968
|
+
skipWelcome: true,
|
|
1969
|
+
messageLoadingIndicatorTimeoutSecs: 0,
|
|
1970
|
+
customSendMessage: async (request, _options, _instance) => {
|
|
1971
|
+
const text = request?.input?.text;
|
|
1972
|
+
if (text) {
|
|
1973
|
+
await handleSendMessage(text);
|
|
1974
|
+
}
|
|
1975
|
+
}
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
),
|
|
1979
|
+
formOverlay
|
|
1980
|
+
] });
|
|
1960
1981
|
}
|
|
1961
1982
|
return /* @__PURE__ */ jsx("div", { className: `a2a-chat a2a-chat--loading ${className}`, children: /* @__PURE__ */ jsx("div", { className: "a2a-chat__spinner" }) });
|
|
1962
1983
|
}
|