Skip to content

Commit 868035a

Browse files
committed
feat: add AIAgentContextSourceType enum and update AIAgentContextType for enhanced AI context handling
1 parent 743c185 commit 868035a

2 files changed

Lines changed: 23 additions & 4 deletions

File tree

src/Shared/Providers/MainContextProvider/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616

1717
export * from './MainContextProvider'
1818
export type { MainContext, ReloadVersionConfigTypes, SidePanelConfig, TempAppWindowConfig } from './types'
19-
export { SidePanelTab } from './types'
19+
export { AIAgentContextSourceType, type AIAgentContextType, SidePanelTab } from './types'

src/Shared/Providers/MainContextProvider/types.ts

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,30 @@ export interface SidePanelConfig {
5151
isExpandedView?: boolean
5252
}
5353

54-
type AIAgentContextType = {
55-
path: string
56-
context: Record<string, string>
54+
export enum AIAgentContextSourceType {
55+
APP_DETAILS = 'app-details',
56+
RESOURCE_BROWSER_CLUSTER = 'resource-browser-cluster',
5757
}
5858

59+
export type AIAgentContextType =
60+
| {
61+
source: AIAgentContextSourceType.APP_DETAILS
62+
data: {
63+
appId: number
64+
envId: number
65+
appName: string
66+
envName: string
67+
appType: 'devtronApp' | 'devtronHelmChart'
68+
}
69+
}
70+
| {
71+
source: AIAgentContextSourceType.RESOURCE_BROWSER_CLUSTER
72+
data: {
73+
clusterId: number
74+
clusterName: string
75+
}
76+
}
77+
5978
export interface TempAppWindowConfig {
6079
/** Whether the temporary window is open */
6180
open: boolean

0 commit comments

Comments
 (0)