-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.go
More file actions
278 lines (246 loc) · 8.07 KB
/
types.go
File metadata and controls
278 lines (246 loc) · 8.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
package main
import (
"encoding/json"
"github.com/gorilla/websocket"
"io/fs"
"net/http"
"sync"
)
type backendSettings struct {
CodexAppPath string `json:"codexAppPath"`
CodexExtraArgs []string `json:"codexExtraArgs"`
Language string `json:"language"`
ProviderSync bool `json:"providerSyncEnabled"`
Enhancements bool `json:"enhancementsEnabled"`
LaunchMode string `json:"launchMode"`
RelayBaseURL string `json:"relayBaseUrl"`
RelayAPIKey string `json:"relayApiKey"`
RelayProfiles []relayProfile `json:"relayProfiles"`
ActiveRelayID string `json:"activeRelayId"`
RelayTestModel string `json:"relayTestModel"`
CLIWrapperEnabled bool `json:"cliWrapperEnabled"`
CLIWrapperBaseURL string `json:"cliWrapperBaseUrl"`
CLIWrapperAPIKey string `json:"cliWrapperApiKey"`
CLIWrapperAPIKeyEnv string `json:"cliWrapperApiKeyEnv"`
}
type relayProfile struct {
ID string `json:"id"`
Name string `json:"name"`
BaseURL string `json:"baseUrl"`
APIKey string `json:"apiKey"`
ImageGenerationEnabled bool `json:"imageGenerationEnabled"`
ImageGenerationUseSeparateAPI bool `json:"imageGenerationUseSeparateApi"`
ImageGenerationBaseURL string `json:"imageGenerationBaseUrl"`
ImageGenerationAPIKey string `json:"imageGenerationApiKey"`
Protocol string `json:"protocol"`
RelayMode string `json:"relayMode"`
OfficialMixAPIKey bool `json:"officialMixApiKey"`
OfficialAuthContents string `json:"officialAuthContents"`
OfficialAccountLabel string `json:"officialAccountLabel"`
OfficialAuthUpdatedAt string `json:"officialAuthUpdatedAt"`
TestModel string `json:"testModel"`
ConfigContents string `json:"configContents"`
AuthContents string `json:"authContents"`
}
type launchStatus struct {
Status string `json:"status"`
Message string `json:"message"`
StartedAtMS uint64 `json:"started_at_ms"`
DebugPort *uint16 `json:"debug_port"`
HelperPort *uint16 `json:"helper_port"`
CodexApp *string `json:"codex_app"`
}
type launcherRuntime struct {
settings backendSettings
debugPort uint16
helper *http.Server
relay *http.Server
helperURL string
relayURL string
}
type cdpTarget struct {
ID string `json:"id"`
Type string `json:"type"`
URL string `json:"url"`
Title string `json:"title"`
WebSocketDebuggerURL string `json:"webSocketDebuggerUrl"`
}
type cdpResponse struct {
ID int64 `json:"id,omitempty"`
Method string `json:"method,omitempty"`
Params json.RawMessage `json:"params,omitempty"`
Result json.RawMessage `json:"result,omitempty"`
Error *cdpError `json:"error,omitempty"`
}
type cdpError struct {
Code int `json:"code"`
Message string `json:"message"`
}
type bridgePayload struct {
ID string `json:"id"`
Path string `json:"path"`
Payload json.RawMessage `json:"payload"`
}
type userScriptInventory struct {
Enabled bool `json:"enabled"`
BuiltinDir string `json:"builtin_dir"`
UserDir string `json:"user_dir"`
Scripts []userScriptInventoryItem `json:"scripts"`
Error string `json:"error,omitempty"`
}
type userScriptInventoryItem struct {
Key string `json:"key"`
Name string `json:"name"`
Source string `json:"source"`
Enabled bool `json:"enabled"`
Status string `json:"status"`
Error string `json:"error"`
MarketID string `json:"market_id,omitempty"`
Version string `json:"version,omitempty"`
Installed bool `json:"installed,omitempty"`
SourceURL string `json:"source_url,omitempty"`
Homepage string `json:"homepage,omitempty"`
}
type userScriptConfig struct {
Enabled bool `json:"enabled"`
Scripts map[string]bool `json:"scripts"`
Market map[string]marketScriptInstall `json:"market,omitempty"`
}
type marketScriptInstall struct {
ID string `json:"id"`
Name string `json:"name"`
Version string `json:"version"`
ScriptURL string `json:"script_url"`
Homepage string `json:"homepage"`
InstalledAt string `json:"installed_at"`
}
type providerSyncResult struct {
Status string `json:"syncStatus"`
Message string `json:"syncMessage"`
TargetProvider string `json:"targetProvider"`
BackupDir *string `json:"backupDir"`
ChangedSessionFiles int `json:"changedSessionFiles"`
SQLiteRowsUpdated int `json:"sqliteRowsUpdated"`
}
type codexConfigRepairResult struct {
Status string
Message string
BackupPath *string
PluginCount int
MarketplaceCount int
MCPServerCount int
GoalsEnabled bool
PluginConfigChanged bool
GoalsConfigChanged bool
}
type codexConfigRepairOptions struct {
Plugins bool
Goals bool
}
type pluginEnableSpec struct {
Name string
Marketplace string
}
type marketplaceSpec struct {
Name string
Source string
}
type sessionChange struct {
Path string
OriginalFirstLine string
NextFirstLine string
Separator string
ThreadID string
CWD string
HasUserEvent bool
RewriteNeeded bool
}
type marketManifest struct {
Version uint64 `json:"version"`
UpdatedAt string `json:"updated_at"`
Scripts []marketScript `json:"scripts"`
}
type marketScript struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Version string `json:"version"`
Author string `json:"author"`
Tags []string `json:"tags"`
Homepage string `json:"homepage"`
ScriptURL string `json:"script_url"`
SHA256 string `json:"sha256"`
}
type ccsProviderImport struct {
SourceID string `json:"sourceId"`
Name string `json:"name"`
BaseURL string `json:"baseUrl"`
APIKey string `json:"apiKey"`
Protocol string `json:"protocol"`
ConfigContents string `json:"configContents"`
AuthContents string `json:"authContents"`
}
type codexAppMirrorRelease struct {
TagName string `json:"tag_name"`
Name string `json:"name"`
HTMLURL string `json:"html_url"`
PublishedAt string `json:"published_at"`
Assets []codexAppMirrorAsset `json:"assets"`
}
type codexAppMirrorAsset struct {
Name string `json:"name"`
BrowserDownloadURL string `json:"browser_download_url"`
Size int64 `json:"size"`
ContentType string `json:"content_type"`
}
type codexToolsRelease struct {
TagName string `json:"tag_name"`
Name string `json:"name"`
HTMLURL string `json:"html_url"`
PublishedAt string `json:"published_at"`
Assets []codexAppMirrorAsset `json:"assets"`
}
type launchRequest struct {
appPath string
debugPort uint16
helperPort uint16
restart bool
}
type relayRouteDecision struct {
useImageAPI bool
body []byte
route string
reason string
keySource string
strippedImageTool bool
}
type cdpSession struct {
conn *websocket.Conn
handler func(string, json.RawMessage) map[string]any
nextID int64
pending map[int64]chan cdpResponse
mu sync.Mutex
writeMu sync.Mutex
}
type server struct {
root string
dist string
distFS fs.FS
}
type watcherInstallPlan struct {
LauncherPath string
Arguments string
RunValue string
ShortcutPath string
}
type authStatus struct {
Authenticated bool
Source string
AccountLabel string
}
type configStatus struct {
Configured bool
RequiresOpenAIAuth bool
HasBearerToken bool
ConfigPath string
}