@invergent/agent-chat-react 2.1.6 → 2.1.7
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 +25 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -18
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -5281,12 +5281,16 @@ var PromptInput = ({
|
|
|
5281
5281
|
const formData = new FormData(form);
|
|
5282
5282
|
return formData.get("message") || "";
|
|
5283
5283
|
})();
|
|
5284
|
+
const submittedFiles = files;
|
|
5284
5285
|
if (!usingProvider) {
|
|
5285
5286
|
form.reset();
|
|
5287
|
+
} else {
|
|
5288
|
+
controller.textInput.clear();
|
|
5286
5289
|
}
|
|
5290
|
+
clear();
|
|
5287
5291
|
try {
|
|
5288
5292
|
const convertedFiles = await Promise.all(
|
|
5289
|
-
|
|
5293
|
+
submittedFiles.map(async (entry) => {
|
|
5290
5294
|
const isBlob = entry.url?.startsWith("blob:");
|
|
5291
5295
|
const isImage = entry.mediaType?.startsWith("image/");
|
|
5292
5296
|
if (isBlob && isImage && entry.url) {
|
|
@@ -5299,22 +5303,7 @@ var PromptInput = ({
|
|
|
5299
5303
|
return entry;
|
|
5300
5304
|
})
|
|
5301
5305
|
);
|
|
5302
|
-
|
|
5303
|
-
if (result instanceof Promise) {
|
|
5304
|
-
try {
|
|
5305
|
-
await result;
|
|
5306
|
-
clear();
|
|
5307
|
-
if (usingProvider) {
|
|
5308
|
-
controller.textInput.clear();
|
|
5309
|
-
}
|
|
5310
|
-
} catch {
|
|
5311
|
-
}
|
|
5312
|
-
} else {
|
|
5313
|
-
clear();
|
|
5314
|
-
if (usingProvider) {
|
|
5315
|
-
controller.textInput.clear();
|
|
5316
|
-
}
|
|
5317
|
-
}
|
|
5306
|
+
await onSubmit({ files: convertedFiles, text }, event);
|
|
5318
5307
|
} catch {
|
|
5319
5308
|
}
|
|
5320
5309
|
},
|
|
@@ -8130,6 +8119,16 @@ function TurnSummaryCard({
|
|
|
8130
8119
|
}) })
|
|
8131
8120
|
] });
|
|
8132
8121
|
}
|
|
8122
|
+
function TurnSummaryPending() {
|
|
8123
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 rounded border border-border bg-muted/50 px-3 py-2 text-sm", children: [
|
|
8124
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-2 text-xs font-semibold uppercase tracking-wide", children: "Summary" }),
|
|
8125
|
+
/* @__PURE__ */ jsxRuntime.jsx(Shimmer, { duration: 3, spread: 3, className: "mb-2 text-sm", children: "Summarizing conversation..." }),
|
|
8126
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
8127
|
+
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-3 w-3/4" }),
|
|
8128
|
+
/* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-3 w-2/3" })
|
|
8129
|
+
] })
|
|
8130
|
+
] });
|
|
8131
|
+
}
|
|
8133
8132
|
function ArtifactRow({
|
|
8134
8133
|
artifact,
|
|
8135
8134
|
sessionId,
|
|
@@ -9007,7 +9006,7 @@ function SimpleAssistantGroup({
|
|
|
9007
9006
|
/* @__PURE__ */ jsxRuntime.jsx(MessageResponse, { children: finalText }),
|
|
9008
9007
|
tail?.status === "complete" && /* @__PURE__ */ jsxRuntime.jsx(TurnFeedback, { msg: tail })
|
|
9009
9008
|
] }),
|
|
9010
|
-
effectiveTurnSummary
|
|
9009
|
+
effectiveTurnSummary ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
9011
9010
|
TurnSummaryCard,
|
|
9012
9011
|
{
|
|
9013
9012
|
summary: effectiveTurnSummary,
|
|
@@ -9015,6 +9014,14 @@ function SimpleAssistantGroup({
|
|
|
9015
9014
|
messages,
|
|
9016
9015
|
onFileSelect
|
|
9017
9016
|
}
|
|
9017
|
+
) : (
|
|
9018
|
+
// The harness summarizer runs after the last assistant
|
|
9019
|
+
// response and before ``session.complete``. Show a pending
|
|
9020
|
+
// placeholder during that window so users aren't surprised
|
|
9021
|
+
// when the Summary card pops in. Gated on the tail group +
|
|
9022
|
+
// a complete final answer + still-running session so the
|
|
9023
|
+
// placeholder doesn't show on historic turns or mid-stream.
|
|
9024
|
+
isTailGroup && isRunning && !!finalText && tail?.status === "complete" && /* @__PURE__ */ jsxRuntime.jsx(TurnSummaryPending, {})
|
|
9018
9025
|
),
|
|
9019
9026
|
showErrorInfo && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsxRuntime.jsx(ErrorMessage, { errorInfo: tail.errorInfo, onRetry }) })
|
|
9020
9027
|
] }) });
|