-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
71 lines (64 loc) · 2.39 KB
/
main.go
File metadata and controls
71 lines (64 loc) · 2.39 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
package main
import (
"embed"
"fmt"
"os"
"time"
)
const (
appName = "CodexTools"
silentName = "Codex++"
managerName = "Codex++ 管理工具"
silentBinary = "codextools-launcher"
managerBinary = "codextools"
version = "1.1.12"
stateDirName = ".codex-session-delete"
settingsFileName = "settings.json"
latestStatusFileName = "latest-status.json"
diagnosticLogFileName = "codex-plus.log"
relayProvider = "CodexPlusPlus"
legacyRelayProvider = "CodexPP"
localRelayProxyPort = 57323
protocolProxyBaseURL = "http://127.0.0.1:57321/v1"
scriptMarketIndexURL = "https://raw.githubusercontent.com/BigPizzaV3/CodexPlusPlusScriptMarket/main/index.json"
codexAppMirrorAPIURL = "https://api.github.com/repos/Wangnov/codex-app-mirror/releases/latest"
codexAppMirrorReleaseURL = "https://github.com/Wangnov/codex-app-mirror/releases/latest"
codexAppMirrorProjectURL = "https://github.com/Wangnov/codex-app-mirror"
codexToolsLatestAPIURL = "https://api.github.com/repos/hereww/codextools/releases/latest"
codexToolsReleaseURL = "https://github.com/hereww/codextools/releases/latest"
codexToolsProjectURL = "https://github.com/hereww/codextools"
codexOfficialInstallURL = "https://openai.com/codex/"
defaultRelayTestModel = "gpt-5-mini"
defaultAPIKeyEnvironment = "CUSTOM_OPENAI_API_KEY"
defaultLanguage = "zh-CN"
defaultGUIPath = "/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
cdpConnectTimeout = 5 * time.Second
cdpCommandTimeout = 5 * time.Second
launcherCheckInterval = 5 * time.Second
bridgeBindingName = "codexSessionDeleteV2"
defaultWatcherDebugPort = 9229
watcherRunName = "CodexPlusPlusWatcher"
watcherRunKey = `HKCU\Software\Microsoft\Windows\CurrentVersion\Run`
watcherStartupLinkName = "CodexPlusPlusWatcher.lnk"
)
var binaryRole = "manager"
//go:embed all:web/dist
var embeddedDist embed.FS
//go:embed assets/inject/renderer-inject.js
var rendererInjectScript string
type commandResult map[string]any
func main() {
var err error
if shouldRunLauncher(os.Args) {
err = runLauncher(os.Args[1:])
} else {
if defaultManagerDesktop() {
lockManagerDesktopThread()
}
err = runManager()
}
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}