@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.js CHANGED
@@ -5012,12 +5012,16 @@ var PromptInput = ({
5012
5012
  const formData = new FormData(form);
5013
5013
  return formData.get("message") || "";
5014
5014
  })();
5015
+ const submittedFiles = files;
5015
5016
  if (!usingProvider) {
5016
5017
  form.reset();
5018
+ } else {
5019
+ controller.textInput.clear();
5017
5020
  }
5021
+ clear();
5018
5022
  try {
5019
5023
  const convertedFiles = await Promise.all(
5020
- files.map(async (entry) => {
5024
+ submittedFiles.map(async (entry) => {
5021
5025
  const isBlob = entry.url?.startsWith("blob:");
5022
5026
  const isImage = entry.mediaType?.startsWith("image/");
5023
5027
  if (isBlob && isImage && entry.url) {
@@ -5030,22 +5034,7 @@ var PromptInput = ({
5030
5034
  return entry;
5031
5035
  })
5032
5036
  );
5033
- const result = onSubmit({ files: convertedFiles, text }, event);
5034
- if (result instanceof Promise) {
5035
- try {
5036
- await result;
5037
- clear();
5038
- if (usingProvider) {
5039
- controller.textInput.clear();
5040
- }
5041
- } catch {
5042
- }
5043
- } else {
5044
- clear();
5045
- if (usingProvider) {
5046
- controller.textInput.clear();
5047
- }
5048
- }
5037
+ await onSubmit({ files: convertedFiles, text }, event);
5049
5038
  } catch {
5050
5039
  }
5051
5040
  },
@@ -7835,6 +7824,16 @@ function TurnSummaryCard({
7835
7824
  }) })
7836
7825
  ] });
7837
7826
  }
7827
+ function TurnSummaryPending() {
7828
+ return /* @__PURE__ */ jsxs("div", { className: "mt-3 rounded border border-border bg-muted/50 px-3 py-2 text-sm", children: [
7829
+ /* @__PURE__ */ jsx("div", { className: "mb-2 text-xs font-semibold uppercase tracking-wide", children: "Summary" }),
7830
+ /* @__PURE__ */ jsx(Shimmer, { duration: 3, spread: 3, className: "mb-2 text-sm", children: "Summarizing conversation..." }),
7831
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
7832
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-3/4" }),
7833
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-2/3" })
7834
+ ] })
7835
+ ] });
7836
+ }
7838
7837
  function ArtifactRow({
7839
7838
  artifact,
7840
7839
  sessionId,
@@ -8709,7 +8708,7 @@ function SimpleAssistantGroup({
8709
8708
  /* @__PURE__ */ jsx(MessageResponse, { children: finalText }),
8710
8709
  tail?.status === "complete" && /* @__PURE__ */ jsx(TurnFeedback, { msg: tail })
8711
8710
  ] }),
8712
- effectiveTurnSummary && /* @__PURE__ */ jsx(
8711
+ effectiveTurnSummary ? /* @__PURE__ */ jsx(
8713
8712
  TurnSummaryCard,
8714
8713
  {
8715
8714
  summary: effectiveTurnSummary,
@@ -8717,6 +8716,14 @@ function SimpleAssistantGroup({
8717
8716
  messages,
8718
8717
  onFileSelect
8719
8718
  }
8719
+ ) : (
8720
+ // The harness summarizer runs after the last assistant
8721
+ // response and before ``session.complete``. Show a pending
8722
+ // placeholder during that window so users aren't surprised
8723
+ // when the Summary card pops in. Gated on the tail group +
8724
+ // a complete final answer + still-running session so the
8725
+ // placeholder doesn't show on historic turns or mid-stream.
8726
+ isTailGroup && isRunning && !!finalText && tail?.status === "complete" && /* @__PURE__ */ jsx(TurnSummaryPending, {})
8720
8727
  ),
8721
8728
  showErrorInfo && /* @__PURE__ */ jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsx(ErrorMessage, { errorInfo: tail.errorInfo, onRetry }) })
8722
8729
  ] }) });