Skip to content

Commit 1108d26

Browse files
Merge pull request #995 from devtron-labs/feat/ai-context
feat: ai context
2 parents 471deb0 + 0fae4b9 commit 1108d26

4 files changed

Lines changed: 27 additions & 7 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "1.22.0-beta-2",
3+
"version": "1.22.0-beta-4",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

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: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,31 @@ 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+
clusterId: number
68+
appType: 'devtronApp' | 'devtronHelmChart'
69+
}
70+
}
71+
| {
72+
source: AIAgentContextSourceType.RESOURCE_BROWSER_CLUSTER
73+
data: {
74+
clusterId: number
75+
clusterName: string
76+
}
77+
}
78+
5979
export interface TempAppWindowConfig {
6080
/** Whether the temporary window is open */
6181
open: boolean

0 commit comments

Comments
 (0)