@copilotkitnext/react 0.0.15 → 0.0.17-alpha.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.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -456,13 +456,13 @@ interface ReactToolCallRenderer<T> {
|
|
|
456
456
|
}>;
|
|
457
457
|
}
|
|
458
458
|
|
|
459
|
-
type ReactFrontendTool<T extends
|
|
459
|
+
type ReactFrontendTool<T extends object = Record<string, unknown>> = FrontendTool<T> & {
|
|
460
460
|
render?: ReactToolCallRenderer<T>["render"];
|
|
461
461
|
};
|
|
462
462
|
|
|
463
|
-
declare function useFrontendTool<T extends
|
|
463
|
+
declare function useFrontendTool<T extends object = Record<string, unknown>>(tool: ReactFrontendTool<T>): void;
|
|
464
464
|
|
|
465
|
-
type ReactHumanInTheLoop<T extends
|
|
465
|
+
type ReactHumanInTheLoop<T extends object = Record<string, unknown>> = Omit<FrontendTool<T>, "handler"> & {
|
|
466
466
|
render: React__default.ComponentType<{
|
|
467
467
|
name: string;
|
|
468
468
|
description: string;
|
|
@@ -487,7 +487,7 @@ type ReactHumanInTheLoop<T extends Record<string, unknown> = Record<string, unkn
|
|
|
487
487
|
}>;
|
|
488
488
|
};
|
|
489
489
|
|
|
490
|
-
declare function useHumanInTheLoop<T extends
|
|
490
|
+
declare function useHumanInTheLoop<T extends object = Record<string, unknown>>(tool: ReactHumanInTheLoop<T>): void;
|
|
491
491
|
|
|
492
492
|
declare enum UseAgentUpdate {
|
|
493
493
|
OnMessagesChanged = "OnMessagesChanged",
|
package/dist/index.d.ts
CHANGED
|
@@ -456,13 +456,13 @@ interface ReactToolCallRenderer<T> {
|
|
|
456
456
|
}>;
|
|
457
457
|
}
|
|
458
458
|
|
|
459
|
-
type ReactFrontendTool<T extends
|
|
459
|
+
type ReactFrontendTool<T extends object = Record<string, unknown>> = FrontendTool<T> & {
|
|
460
460
|
render?: ReactToolCallRenderer<T>["render"];
|
|
461
461
|
};
|
|
462
462
|
|
|
463
|
-
declare function useFrontendTool<T extends
|
|
463
|
+
declare function useFrontendTool<T extends object = Record<string, unknown>>(tool: ReactFrontendTool<T>): void;
|
|
464
464
|
|
|
465
|
-
type ReactHumanInTheLoop<T extends
|
|
465
|
+
type ReactHumanInTheLoop<T extends object = Record<string, unknown>> = Omit<FrontendTool<T>, "handler"> & {
|
|
466
466
|
render: React__default.ComponentType<{
|
|
467
467
|
name: string;
|
|
468
468
|
description: string;
|
|
@@ -487,7 +487,7 @@ type ReactHumanInTheLoop<T extends Record<string, unknown> = Record<string, unkn
|
|
|
487
487
|
}>;
|
|
488
488
|
};
|
|
489
489
|
|
|
490
|
-
declare function useHumanInTheLoop<T extends
|
|
490
|
+
declare function useHumanInTheLoop<T extends object = Record<string, unknown>>(tool: ReactHumanInTheLoop<T>): void;
|
|
491
491
|
|
|
492
492
|
declare enum UseAgentUpdate {
|
|
493
493
|
OnMessagesChanged = "OnMessagesChanged",
|
package/dist/index.js
CHANGED
|
@@ -2279,7 +2279,8 @@ function CopilotChatAssistantMessage({
|
|
|
2279
2279
|
}
|
|
2280
2280
|
);
|
|
2281
2281
|
const hasContent = !!(message.content && message.content.trim().length > 0);
|
|
2282
|
-
const
|
|
2282
|
+
const isLatestAssistantMessage = message.role === "assistant" && messages?.[messages.length - 1]?.id === message.id;
|
|
2283
|
+
const shouldShowToolbar = toolbarVisible && hasContent && !(isRunning && isLatestAssistantMessage);
|
|
2283
2284
|
if (children) {
|
|
2284
2285
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_jsx_runtime12.Fragment, { children: children({
|
|
2285
2286
|
markdownRenderer: boundMarkdownRenderer,
|