@@ -75,6 +75,78 @@ func mapLocalProjectedUsageResponse(result *wailsapp.LocalProjectedUsageResponse
7575 }
7676}
7777
78+ func mapCodexFeatureConfigSnapshot (result * wailsapp.CodexFeatureConfigSnapshot ) * CodexFeatureConfigSnapshot {
79+ if result == nil {
80+ return & CodexFeatureConfigSnapshot {
81+ Definitions : []CodexFeatureDefinition {},
82+ Values : map [string ]bool {},
83+ UnknownValues : map [string ]bool {},
84+ Warnings : []string {},
85+ }
86+ }
87+
88+ definitions := make ([]CodexFeatureDefinition , 0 , len (result .Definitions ))
89+ for _ , definition := range result .Definitions {
90+ definitions = append (definitions , CodexFeatureDefinition {
91+ Key : definition .Key ,
92+ Description : definition .Description ,
93+ Stage : definition .Stage ,
94+ DefaultEnabled : definition .DefaultEnabled ,
95+ CanonicalKey : definition .CanonicalKey ,
96+ LegacyAlias : definition .LegacyAlias ,
97+ })
98+ }
99+
100+ return & CodexFeatureConfigSnapshot {
101+ CodexHomePath : result .CodexHomePath ,
102+ ConfigPath : result .ConfigPath ,
103+ Exists : result .Exists ,
104+ Definitions : definitions ,
105+ Values : cloneBoolMap (result .Values ),
106+ UnknownValues : cloneBoolMap (result .UnknownValues ),
107+ Raw : result .Raw ,
108+ Warnings : append ([]string (nil ), result .Warnings ... ),
109+ }
110+ }
111+
112+ func mapCodexFeatureConfigPreview (result * wailsapp.CodexFeatureConfigPreview ) * CodexFeatureConfigPreview {
113+ if result == nil {
114+ return & CodexFeatureConfigPreview {
115+ Changes : []CodexFeatureConfigChange {},
116+ Warnings : []string {},
117+ }
118+ }
119+
120+ changes := make ([]CodexFeatureConfigChange , 0 , len (result .Changes ))
121+ for _ , change := range result .Changes {
122+ changes = append (changes , CodexFeatureConfigChange {
123+ Key : change .Key ,
124+ Type : change .Type ,
125+ PreviousEnabled : change .PreviousEnabled ,
126+ NextEnabled : change .NextEnabled ,
127+ })
128+ }
129+
130+ return & CodexFeatureConfigPreview {
131+ ConfigPath : result .ConfigPath ,
132+ WillCreate : result .WillCreate ,
133+ Changes : changes ,
134+ Preview : result .Preview ,
135+ Warnings : append ([]string (nil ), result .Warnings ... ),
136+ }
137+ }
138+
139+ func cloneBoolMap (source map [string ]bool ) map [string ]bool {
140+ if len (source ) == 0 {
141+ return map [string ]bool {}
142+ }
143+ cloned := make (map [string ]bool , len (source ))
144+ for key , value := range source {
145+ cloned [key ] = value
146+ }
147+ return cloned
148+ }
149+
78150func mapSessionManagementSnapshot (result * wailsapp.SessionManagementSnapshot ) * SessionManagementSnapshot {
79151 if result == nil {
80152 return & SessionManagementSnapshot {
0 commit comments