Skip to content

Commit b408b71

Browse files
authored
use widget for chat to edit (#1995)
* use-widget-in-chat-to-edit * use-widget-in-chat-to-edit * use-widget-in-chat-to-edit * Apply suggestion from @anubra266 * Apply suggestion from @anubra266 * fix toolname * Refactor Copilot components for improved readability and functionality - Updated IkpTool component to use a functional component syntax for better clarity. - Enhanced parseToolOutputForRelations function to utilize flatMap for cleaner data extraction. - Introduced ApprovalButtons component to streamline approval button rendering in ToolApproval. - Replaced setConversationId with resetPlaygroundConversationId in ChatWidget and Playground components for consistency in state management. - Added playgroundConversationId to agent state for better tracking of conversation IDs.
1 parent 7847ae1 commit b408b71

File tree

12 files changed

+110
-776
lines changed

12 files changed

+110
-776
lines changed

agents-manage-ui/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@
114114
"react-resizable-panels": "^3.0.6",
115115
"react-runner": "^1.0.5",
116116
"recharts": "2.15.4",
117-
"remark-supersub": "^1.0.0",
118117
"shiki": "^3.20.0",
119118
"sonner": "^2.0.6",
120119
"streamdown": "^1.4.0",

agents-manage-ui/src/components/agent/copilot/copilot-chat.tsx

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { useOAuthLogin } from '@/hooks/use-oauth-login';
1313
import { sentry } from '@/lib/sentry';
1414
import { css } from '@/lib/utils';
1515
import { generateId } from '@/lib/utils/id-utils';
16-
import { IkpMessage } from './message-parts/message';
16+
import { IkpTool } from './message-parts/message';
1717

1818
interface CopilotChatProps {
1919
agentId?: string;
@@ -206,25 +206,17 @@ export function CopilotChat({ agentId, tenantId, projectId, refreshAgentGraph }:
206206
aiChatSettings={{
207207
aiAssistantName: 'Agent Editor',
208208
components: {
209-
...(IkpMessage
210-
? {
211-
IkpMessage: (props: any) =>
212-
IkpMessage({
213-
...props,
214-
copilotAgentId: PUBLIC_INKEEP_COPILOT_AGENT_ID,
215-
copilotProjectId: PUBLIC_INKEEP_COPILOT_PROJECT_ID,
216-
copilotTenantId: PUBLIC_INKEEP_COPILOT_TENANT_ID,
217-
apiUrl: PUBLIC_INKEEP_AGENTS_API_URL,
218-
targetTenantId: tenantId,
219-
targetProjectId: projectId,
220-
targetAgentId: agentId,
221-
onOAuthLogin: handleOAuthLogin,
222-
refreshAgentGraph: refreshAgentGraph,
223-
cookieHeader: cookieHeader,
224-
copilotToken: copilotToken,
225-
}),
226-
}
227-
: {}),
209+
IkpTool(props) {
210+
return (
211+
<IkpTool
212+
{...props}
213+
targetTenantId={tenantId}
214+
targetProjectId={projectId}
215+
onOAuthLogin={handleOAuthLogin}
216+
refreshAgentGraph={refreshAgentGraph}
217+
/>
218+
);
219+
},
228220
},
229221
conversationId,
230222
chatFunctionsRef,

agents-manage-ui/src/components/agent/copilot/message-parts/citation-badge.tsx

Lines changed: 0 additions & 45 deletions
This file was deleted.

agents-manage-ui/src/components/agent/copilot/message-parts/citations.tsx

Lines changed: 0 additions & 51 deletions
This file was deleted.

agents-manage-ui/src/components/agent/copilot/message-parts/inline-event.tsx

Lines changed: 0 additions & 104 deletions
This file was deleted.

0 commit comments

Comments
 (0)