fix: address code review findings
This commit is contained in:
@@ -29,6 +29,8 @@ export type ProjectedChatMessage = {
|
|||||||
const toolStateFromResult = (status: AgentMessagePart & { readonly type: "tool-result" }): ToolState =>
|
const toolStateFromResult = (status: AgentMessagePart & { readonly type: "tool-result" }): ToolState =>
|
||||||
status.result.status === "failure" ? "error" : "success";
|
status.result.status === "failure" ? "error" : "success";
|
||||||
|
|
||||||
|
const WORKFLOW_START_TOOL = "startPreparedReportRun";
|
||||||
|
|
||||||
const projectPart = (part: AgentMessagePart): ProjectedChatPart | null => {
|
const projectPart = (part: AgentMessagePart): ProjectedChatPart | null => {
|
||||||
switch (part.type) {
|
switch (part.type) {
|
||||||
case "text":
|
case "text":
|
||||||
@@ -36,10 +38,10 @@ const projectPart = (part: AgentMessagePart): ProjectedChatPart | null => {
|
|||||||
case "tool-call":
|
case "tool-call":
|
||||||
return {
|
return {
|
||||||
kind: "tool",
|
kind: "tool",
|
||||||
label: part.call.name === "startPreparedReportRun" ? "Workflow operation" : "Tool call",
|
label: part.call.name === WORKFLOW_START_TOOL ? "Workflow operation" : "Tool call",
|
||||||
name: part.call.name,
|
name: part.call.name,
|
||||||
state: "pending",
|
state: "pending",
|
||||||
defaultOpen: part.call.name === "startPreparedReportRun",
|
defaultOpen: part.call.name === WORKFLOW_START_TOOL,
|
||||||
input: part.call.input,
|
input: part.call.input,
|
||||||
};
|
};
|
||||||
case "tool-result":
|
case "tool-result":
|
||||||
|
|||||||
@@ -1296,9 +1296,6 @@
|
|||||||
opacity: 0.55;
|
opacity: 0.55;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Source-owned AI Elements-style primitives. These classes intentionally mirror
|
|
||||||
conversation/message/tool concepts so a future AI SDK driver can reuse the
|
|
||||||
same surface without changing the demo timeline state model. */
|
|
||||||
.operator-chat .ai-chat-conversation {
|
.operator-chat .ai-chat-conversation {
|
||||||
display: flex;
|
display: flex;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user