Repository navigation
feat(cc-widgets): wire AI summary workflows #750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rsarika
wants to merge
18
commits into
webex:next
Choose a base branch
from
rsarika:codex/ai-summary-widget-integration
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+9,267
−366
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
ff0880b
feat(cc-store): add AI summary lifecycle
rsarika bf6d1fd
feat(cc-components): add AI summary presentation
rsarika 57dfea3
feat(cc-widgets): wire AI summary workflows
rsarika c8a3b29
fix(cc-store): simplify AI summary handling
rsarika 9821155
refactor(cc-store): retain SDK AI summary payloads
rsarika c75883b
refactor(cc-store): update summary content in store
rsarika 5b31f07
refactor(cc-store): retain SDK summary response records
rsarika c082890
refactor(cc-store): read SDK summary flags directly
rsarika 79b8573
refactor(cc-store): rely on SDK summary enablement
rsarika 199f875
refactor(cc-store): simplify summary event handling
rsarika 8727856
refactor(cc-store): inline summary state operations
rsarika f3f75bb
refactor(cc-store): inline summary selector and use published SDK
rsarika 762dcba
fix(cc-components): integrate simplified AI summary store
rsarika fcab674
fix(cc-widgets): align summaries with simplified store
rsarika 1d6eb17
refactor(cc-components): simplify AI summary presentation
rsarika 28135ae
refactor(cc-components): reuse assistant presentation primitives
rsarika 9b24639
refactor(cc-widgets): simplify AI summary integration
rsarika 783afb6
refactor(cc-task): trim AI summary integration scaffolding
rsarika File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| import {useCallback, useEffect, useMemo, useRef, useState} from 'react'; | ||
| import store from '@webex/cc-store'; | ||
| import type {RealTimeAssistPayload} from '@webex/cc-store'; | ||
| import store, {getAISummarySurface} from '@webex/cc-store'; | ||
| import type {ITask, RealTimeAssistPayload} from '@webex/cc-store'; | ||
| import type { | ||
| AIAssistantActionEvent, | ||
| AIAssistantChatEntry, | ||
| AIAssistantChromeState, | ||
| AIAssistantReceiverSummary, | ||
| AIAssistantRequestStatus, | ||
| } from '@webex/cc-components'; | ||
| import { | ||
|
|
@@ -298,4 +299,27 @@ export const useAiAssistant = (input: UseAiAssistantInput) => { | |
| return useMemo(() => ({...chrome, ...realTimeAssist}), [chrome, realTimeAssist]); | ||
| }; | ||
|
|
||
| /** The receiving agent's consult/transfer summary, pushed by the backend for the task's interaction. */ | ||
| export const getReceiverSummary = (task?: ITask): AIAssistantReceiverSummary | undefined => { | ||
| const interactionId = task?.data.interactionId; | ||
| const entry = interactionId ? store.aiSummaries[interactionId]?.receiver : undefined; | ||
| const surface = getAISummarySurface(entry); | ||
| const branchKey = `mid-call:receiver:${interactionId}`; | ||
| if (surface === 'content' && entry.content.adaptiveCard) { | ||
| return { | ||
| surface, | ||
| branchKey, | ||
| content: entry.content, | ||
| contentRevision: entry.revision, | ||
| selectedFeedback: entry.response.feedback, | ||
| feedbackPending: Boolean(entry.feedbackPending), | ||
| recordReceiverSummaryCopied: (expectedRevision) => | ||
| store.recordAISummaryCopied('receiver', expectedRevision, task), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Methods which we are invoking from store can just be placed in this file itself if they have no dependency on SDK |
||
| setReceiverSummaryFeedback: (feedback, expectedRevision) => | ||
| void store.setReceiverSummaryFeedback(feedback, expectedRevision, task), | ||
| }; | ||
| } | ||
| return surface === 'unavailable' || surface === 'generic-error' ? {surface, branchKey} : undefined; | ||
| }; | ||
|
|
||
| export {REAL_TIME_ASSIST_FLAG}; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: Use more specific name which at least helps us identify that this entry object is nothing but actually summary data something like summaryData or summary itself