-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtypes.go
More file actions
435 lines (395 loc) · 17.2 KB
/
Copy pathtypes.go
File metadata and controls
435 lines (395 loc) · 17.2 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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
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"`
ProviderSyncSavedProviders []string `json:"providerSyncSavedProviders"`
ProviderSyncManualProviders []string `json:"providerSyncManualProviders"`
ProviderSyncLastSelectedProvider string `json:"providerSyncLastSelectedProvider"`
RelayProfilesEnabled bool `json:"relayProfilesEnabled"`
CCSLinkEnabled bool `json:"ccsLinkEnabled"`
Enhancements bool `json:"enhancementsEnabled"`
CodexAppPluginEntryUnlock bool `json:"codexAppPluginEntryUnlock"`
CodexAppForcePluginInstall bool `json:"codexAppForcePluginInstall"`
CodexAppModelWhitelistUnlock bool `json:"codexAppModelWhitelistUnlock"`
CodexAppSessionDelete bool `json:"codexAppSessionDelete"`
CodexAppMarkdownExport bool `json:"codexAppMarkdownExport"`
CodexAppPasteFix bool `json:"codexAppPasteFix"`
CodexAppForceChineseLocale bool `json:"codexAppForceChineseLocale"`
CodexAppFastStartup bool `json:"codexAppFastStartup"`
CodexAppProjectMove bool `json:"codexAppProjectMove"`
CodexAppConversationTimeline bool `json:"codexAppConversationTimeline"`
CodexAppThreadIDBadge bool `json:"codexAppThreadIdBadge"`
CodexAppConversationView bool `json:"codexAppConversationView"`
CodexAppThreadScrollRestore bool `json:"codexAppThreadScrollRestore"`
CodexAppZedRemoteOpen bool `json:"codexAppZedRemoteOpen"`
CodexAppUpstreamWorktreeCreate bool `json:"codexAppUpstreamWorktreeCreate"`
CodexAppNativeMenuPlacement bool `json:"codexAppNativeMenuPlacement"`
CodexAppNativeMenuLocalization bool `json:"codexAppNativeMenuLocalization"`
CodexAppServiceTierControls bool `json:"codexAppServiceTierControls"`
ComputerUseGuardEnabled bool `json:"computerUseGuardEnabled"`
ZedRemoteOpenStrategy string `json:"zedRemoteOpenStrategy"`
ZedRemoteProjectRegistryEnabled bool `json:"zedRemoteProjectRegistryEnabled"`
ZedRemoteSyncToZedSettings bool `json:"zedRemoteSyncToZedSettings"`
CodexAppImageOverlayEnabled bool `json:"codexAppImageOverlayEnabled"`
CodexAppImageOverlayPath string `json:"codexAppImageOverlayPath"`
CodexAppImageOverlayOpacity int `json:"codexAppImageOverlayOpacity"`
CodexGoalsEnabled bool `json:"codexGoalsEnabled"`
MobileControlEnabled bool `json:"mobileControlEnabled"`
MobileControlRelayURL string `json:"mobileControlRelayUrl"`
MobileControlRoom string `json:"mobileControlRoom"`
MobileControlKey string `json:"mobileControlKey"`
OnboardingCompleted bool `json:"onboardingCompleted"`
OnboardingCompletedAt string `json:"onboardingCompletedAt"`
OnboardingCompletedPlatform string `json:"onboardingCompletedPlatform"`
LaunchMode string `json:"launchMode"`
RelayBaseURL string `json:"relayBaseUrl"`
RelayAPIKey string `json:"relayApiKey"`
RelayProfiles []relayProfile `json:"relayProfiles"`
RelayCommonConfigContents string `json:"relayCommonConfigContents"`
RelayContextConfigContents string `json:"relayContextConfigContents"`
ActiveRelayID string `json:"activeRelayId"`
AggregateRelayProfiles []aggregateRelayProfile `json:"aggregateRelayProfiles"`
ActiveAggregateRelayID string `json:"activeAggregateRelayId"`
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"`
LinkedCCSProviderID string `json:"linkedCcsProviderId"`
Name string `json:"name"`
Model string `json:"model"`
BaseURL string `json:"baseUrl"`
UpstreamBaseURL string `json:"upstreamBaseUrl"`
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"`
UseCommonConfig bool `json:"useCommonConfig"`
ContextSelection relayContextSelection `json:"contextSelection"`
ContextSelectionInitialized bool `json:"contextSelectionInitialized"`
ContextWindow string `json:"contextWindow"`
AutoCompactLimit string `json:"autoCompactLimit"`
ModelInsertMode string `json:"modelInsertMode"`
ModelList string `json:"modelList"`
ModelWindows string `json:"modelWindows"`
UserAgent string `json:"userAgent"`
ProxyEnabled bool `json:"proxyEnabled"`
ProxyURL string `json:"proxyUrl"`
}
type aggregateRelayProfile struct {
ID string `json:"id"`
Name string `json:"name"`
Strategy string `json:"strategy"`
Members []aggregateRelayMember `json:"members"`
}
type aggregateRelayMember struct {
RelayID string `json:"relayId"`
Weight int `json:"weight"`
}
type relayContextSelection struct {
MCPServers []string `json:"mcpServers"`
Skills []string `json:"skills"`
Plugins []string `json:"plugins"`
}
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"`
Detail map[string]any `json:"detail,omitempty"`
}
type launcherRuntime struct {
settingsMu sync.RWMutex
settings backendSettings
debugPort uint16
codexAppPath string
helper *http.Server
relay *http.Server
mobileHost *mobileRelayHostRuntime
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"`
Partial bool `json:"partial"`
RollbackStatus string `json:"rollbackStatus,omitempty"`
}
type codexConfigRepairResult struct {
Status string
Message string
BackupPath *string
PluginCount int
MarketplaceCount int
MCPServerCount int
MarketplaceRefreshStatus string
MarketplaceRefreshSummary string
MarketplaceRefreshError string
GoalsEnabled bool
PluginConfigChanged bool
GoalsConfigChanged bool
}
type codexConfigRepairOptions struct {
Plugins bool
Goals bool
RefreshMarketplaces bool
}
type pluginEnableSpec struct {
Name string
Marketplace string
}
type marketplaceSpec struct {
Name string
Source string
}
type computerUseStatus struct {
Platform string `json:"platform"`
Supported bool `json:"supported"`
CodexHome string `json:"codexHome"`
EnvEnabled bool `json:"envEnabled"`
ProcessEnv string `json:"processEnv"`
UserEnv string `json:"userEnv"`
MarketplaceRoot string `json:"marketplaceRoot"`
MarketplaceManifestPath string `json:"marketplaceManifestPath"`
MarketplacePluginPath string `json:"marketplacePluginPath"`
MarketplaceReady bool `json:"marketplaceReady"`
MarketplaceManifest bool `json:"marketplaceManifest"`
MarketplacePlugin bool `json:"marketplacePlugin"`
CacheLatest bool `json:"cacheLatest"`
CacheLatestPath string `json:"cacheLatestPath"`
CacheVersion string `json:"cacheVersion"`
ConfigReady bool `json:"configReady"`
ConfigPath string `json:"configPath"`
ConfigMarketplace bool `json:"configMarketplace"`
ConfigPlugin bool `json:"configPlugin"`
ConfigNodeRepl bool `json:"configNodeRepl"`
ConfigWindows bool `json:"configWindows"`
HelperTransport bool `json:"helperTransport"`
HelperTransportPath string `json:"helperTransportPath"`
BackupPath *string `json:"backupPath,omitempty"`
AllReady bool `json:"allReady"`
}
type skillMCPBackupInfo struct {
ID string `json:"id"`
CreatedAt string `json:"createdAt"`
Label string `json:"label"`
Path string `json:"path"`
HasSkills bool `json:"hasSkills"`
HasPluginCache bool `json:"hasPluginCache"`
HasBundledMarket bool `json:"hasBundledMarket"`
HasConfigSnapshot bool `json:"hasConfigSnapshot"`
ConfigSnapshotBytes int64 `json:"configSnapshotBytes"`
SizeBytes int64 `json:"sizeBytes"`
RestoreSourceBackup string `json:"restoreSourceBackup,omitempty"`
RestoreConfigBackup string `json:"restoreConfigBackup,omitempty"`
}
type sessionChange struct {
Path string
OriginalFirstLine string
NextFirstLine string
Separator string
ThreadID string
CWD string
Source string
Title string
FirstUserMessage string
Preview string
CreatedAt int64
UpdatedAt int64
CreatedAtMs int64
UpdatedAtMs int64
Archived bool
CLIVersion string
Model string
ReasoningEffort string
SandboxPolicy string
ApprovalMode 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 providerImportRequest struct {
Name string `json:"name"`
BaseURL string `json:"baseUrl"`
APIKey string `json:"apiKey"`
WireAPI string `json:"wireApi"`
RelayMode string `json:"relayMode"`
ConfigContents string `json:"configContents"`
AuthContents string `json:"authContents"`
}
type providerImportResult struct {
Imported bool `json:"imported"`
ProfileID string `json:"profileId"`
ProfileName string `json:"profileName"`
}
type releaseAsset 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 []releaseAsset `json:"assets"`
}
type launchRequest struct {
appPath string
debugPort uint16
helperPort uint16
restart bool
}
type launcherSingleInstanceLock interface {
release()
fallbackPath() string
}
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
conversationHistoryRepairMu sync.Mutex
conversationHistoryRepairTask *conversationHistoryRepairTask
}
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
}