@flytedan/flytebot-design-system 0.75.0 → 0.76.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.
package/dist/index.d.cts CHANGED
@@ -4288,6 +4288,8 @@ interface ChatEngine {
4288
4288
  removeQueued(id: string): void;
4289
4289
  setFeedback(id: string, value: "up" | "down"): void;
4290
4290
  reload(): Promise<void>;
4291
+ /** Re-read the thread without touching status; new server items merge in, local-only messages stay. */
4292
+ refresh(): Promise<void>;
4291
4293
  canSend: boolean;
4292
4294
  }
4293
4295
  declare const CHAT_UNAVAILABLE = "chat_unavailable";
@@ -4386,6 +4388,8 @@ interface AgentChatPanelProps {
4386
4388
  /** Show this exact thread instead of resolving one from context. Set it from
4387
4389
  * onNewThread / onSelectThread to make history switching work. */
4388
4390
  threadId?: string | null;
4391
+ /** Change it to make the panel re-read its thread, e.g. after the app adds an item to the conversation outside a chat turn. Not read on first mount. The transcript stays, a live turn is untouched. */
4392
+ reloadKey?: string | number;
4389
4393
  title?: string;
4390
4394
  subtitle?: React.ReactNode;
4391
4395
  showHeader?: boolean;
@@ -4472,7 +4476,7 @@ interface AgentChatPanelProps {
4472
4476
  * renders only when its input is supplied. A panel with no telemetry shows no
4473
4477
  * telemetry, not zeroes.
4474
4478
  */
4475
- declare function AgentChatPanel({ contextType, contextId, draftOwner, apiAdapter, threadId, title, subtitle, showHeader, headerActions, onClose, assistantName, userName, assistantAvatar, userAvatar, assistantIcon, showAvatars, markdown, maxVisibleChars, messageActions, showSteps, showThinking, emptyTitle, emptyDescription, emptyIcon, suggestions, renderEmpty, packetSchemas, packetRenderers, onApplyPacket, pendingTimeoutMs, describeWaiting, onOpenAttachment, errorCopy, placeholder, maxLength, hint, fileUploadHandler, acceptFiles, maxFileSize, largePasteThreshold, slashCommands, mentionSources, voiceHandler, initialMessage, contextUsage, sessionStats, usageLimits, models, model, onModelChange, effortLevels, effort, onEffortChange, fastMode, onFastModeChange, moreModels, threads, onSelectThread, onNewThread, onDeleteThread, surface, height, className, style, onPacket, onThreadReady, onError, onSend, onClear, onFeedback, onEditMessage, }: AgentChatPanelProps): React.JSX.Element;
4479
+ declare function AgentChatPanel({ contextType, contextId, draftOwner, apiAdapter, threadId, reloadKey, title, subtitle, showHeader, headerActions, onClose, assistantName, userName, assistantAvatar, userAvatar, assistantIcon, showAvatars, markdown, maxVisibleChars, messageActions, showSteps, showThinking, emptyTitle, emptyDescription, emptyIcon, suggestions, renderEmpty, packetSchemas, packetRenderers, onApplyPacket, pendingTimeoutMs, describeWaiting, onOpenAttachment, errorCopy, placeholder, maxLength, hint, fileUploadHandler, acceptFiles, maxFileSize, largePasteThreshold, slashCommands, mentionSources, voiceHandler, initialMessage, contextUsage, sessionStats, usageLimits, models, model, onModelChange, effortLevels, effort, onEffortChange, fastMode, onFastModeChange, moreModels, threads, onSelectThread, onNewThread, onDeleteThread, surface, height, className, style, onPacket, onThreadReady, onError, onSend, onClear, onFeedback, onEditMessage, }: AgentChatPanelProps): React.JSX.Element;
4476
4480
 
4477
4481
  /**
4478
4482
  * Staged files, the queue strip, the markdown editor, slash/mention triggers, send + stop.
package/dist/index.d.ts CHANGED
@@ -4288,6 +4288,8 @@ interface ChatEngine {
4288
4288
  removeQueued(id: string): void;
4289
4289
  setFeedback(id: string, value: "up" | "down"): void;
4290
4290
  reload(): Promise<void>;
4291
+ /** Re-read the thread without touching status; new server items merge in, local-only messages stay. */
4292
+ refresh(): Promise<void>;
4291
4293
  canSend: boolean;
4292
4294
  }
4293
4295
  declare const CHAT_UNAVAILABLE = "chat_unavailable";
@@ -4386,6 +4388,8 @@ interface AgentChatPanelProps {
4386
4388
  /** Show this exact thread instead of resolving one from context. Set it from
4387
4389
  * onNewThread / onSelectThread to make history switching work. */
4388
4390
  threadId?: string | null;
4391
+ /** Change it to make the panel re-read its thread, e.g. after the app adds an item to the conversation outside a chat turn. Not read on first mount. The transcript stays, a live turn is untouched. */
4392
+ reloadKey?: string | number;
4389
4393
  title?: string;
4390
4394
  subtitle?: React.ReactNode;
4391
4395
  showHeader?: boolean;
@@ -4472,7 +4476,7 @@ interface AgentChatPanelProps {
4472
4476
  * renders only when its input is supplied. A panel with no telemetry shows no
4473
4477
  * telemetry, not zeroes.
4474
4478
  */
4475
- declare function AgentChatPanel({ contextType, contextId, draftOwner, apiAdapter, threadId, title, subtitle, showHeader, headerActions, onClose, assistantName, userName, assistantAvatar, userAvatar, assistantIcon, showAvatars, markdown, maxVisibleChars, messageActions, showSteps, showThinking, emptyTitle, emptyDescription, emptyIcon, suggestions, renderEmpty, packetSchemas, packetRenderers, onApplyPacket, pendingTimeoutMs, describeWaiting, onOpenAttachment, errorCopy, placeholder, maxLength, hint, fileUploadHandler, acceptFiles, maxFileSize, largePasteThreshold, slashCommands, mentionSources, voiceHandler, initialMessage, contextUsage, sessionStats, usageLimits, models, model, onModelChange, effortLevels, effort, onEffortChange, fastMode, onFastModeChange, moreModels, threads, onSelectThread, onNewThread, onDeleteThread, surface, height, className, style, onPacket, onThreadReady, onError, onSend, onClear, onFeedback, onEditMessage, }: AgentChatPanelProps): React.JSX.Element;
4479
+ declare function AgentChatPanel({ contextType, contextId, draftOwner, apiAdapter, threadId, reloadKey, title, subtitle, showHeader, headerActions, onClose, assistantName, userName, assistantAvatar, userAvatar, assistantIcon, showAvatars, markdown, maxVisibleChars, messageActions, showSteps, showThinking, emptyTitle, emptyDescription, emptyIcon, suggestions, renderEmpty, packetSchemas, packetRenderers, onApplyPacket, pendingTimeoutMs, describeWaiting, onOpenAttachment, errorCopy, placeholder, maxLength, hint, fileUploadHandler, acceptFiles, maxFileSize, largePasteThreshold, slashCommands, mentionSources, voiceHandler, initialMessage, contextUsage, sessionStats, usageLimits, models, model, onModelChange, effortLevels, effort, onEffortChange, fastMode, onFastModeChange, moreModels, threads, onSelectThread, onNewThread, onDeleteThread, surface, height, className, style, onPacket, onThreadReady, onError, onSend, onClear, onFeedback, onEditMessage, }: AgentChatPanelProps): React.JSX.Element;
4476
4480
 
4477
4481
  /**
4478
4482
  * Staged files, the queue strip, the markdown editor, slash/mention triggers, send + stop.
package/dist/index.js CHANGED
@@ -13060,6 +13060,14 @@ function useChatEngine(opts) {
13060
13060
  if (!fail(err)) setStatus("ready");
13061
13061
  }
13062
13062
  }, [loadThread]);
13063
+ const refresh2 = React75.useCallback(async () => {
13064
+ if (!threadRef.current) return;
13065
+ try {
13066
+ await mergeThread();
13067
+ } catch (err) {
13068
+ fail(err);
13069
+ }
13070
+ }, [apiAdapter]);
13063
13071
  return {
13064
13072
  status,
13065
13073
  threadId,
@@ -13076,6 +13084,7 @@ function useChatEngine(opts) {
13076
13084
  removeQueued,
13077
13085
  setFeedback,
13078
13086
  reload,
13087
+ refresh: refresh2,
13079
13088
  canSend: status === "ready"
13080
13089
  };
13081
13090
  }
@@ -13892,6 +13901,7 @@ function AgentChatPanel({
13892
13901
  draftOwner,
13893
13902
  apiAdapter,
13894
13903
  threadId,
13904
+ reloadKey,
13895
13905
  /* identity + chrome */
13896
13906
  title = "Assistant",
13897
13907
  subtitle,
@@ -13984,6 +13994,13 @@ function AgentChatPanel({
13984
13994
  onClear,
13985
13995
  onFeedback
13986
13996
  });
13997
+ const { refresh: refresh2 } = engine;
13998
+ const lastReloadKey = React80.useRef(reloadKey);
13999
+ React80.useEffect(() => {
14000
+ if (lastReloadKey.current === reloadKey) return;
14001
+ lastReloadKey.current = reloadKey;
14002
+ refresh2();
14003
+ }, [reloadKey, refresh2]);
13987
14004
  const narrow = surface === "sidebar" ? panelWidth < NARROW_PANEL_WIDTH : surface === "sheet";
13988
14005
  const ctx = {
13989
14006
  assistantName,