codex-plus-patcher 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -2
- package/package.json +2 -2
- package/src/cli.js +53 -0
- package/src/core/asar.js +29 -0
- package/src/core/patch-engine.js +12 -1
- package/src/patches/26.616.41845-4198.js +31 -670
- package/src/patches/26.616.51431-4212.js +31 -742
- package/src/patches/26.616.71553-4265.js +31 -0
- package/src/patches/index.js +2 -1
- package/src/patches/lib/common-patches.js +606 -0
- package/src/patches/lib/host-hooks.js +24 -0
- package/src/patches/lib/make-patch-set.js +14 -0
- package/src/patches/lib/replace.js +17 -0
- package/src/runtime/assets.js +27 -0
- package/src/runtime/plugins/aboutMetadata.js +93 -0
- package/src/runtime/plugins/diagnosticErrors.js +43 -0
- package/src/runtime/plugins/nestedRepositories.js +448 -0
- package/src/runtime/plugins/projectColors.js +153 -0
- package/src/runtime/plugins/sidebarNameBlur.js +28 -0
- package/src/runtime/plugins/userBubbleColors.js +134 -0
- package/src/runtime/runtime.js +363 -0
- package/src/runtime/worker.js +228 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const { buildCodexPlusPatchSet } = require("./lib/common-patches");
|
|
2
|
+
|
|
3
|
+
module.exports = buildCodexPlusPatchSet({
|
|
4
|
+
"id": "codex-26.616.71553-4265",
|
|
5
|
+
"codexVersion": "26.616.71553",
|
|
6
|
+
"bundleVersion": "4265",
|
|
7
|
+
"asarSha256": "5bbeadcd13b66985a5dfe6ffef208fbb24628838e3dca724209e8a321083a17c",
|
|
8
|
+
"files": {
|
|
9
|
+
"main": ".vite/build/main-cC-d0ezP.js",
|
|
10
|
+
"appMain": "webview/assets/app-main-DzXBOHD4.js",
|
|
11
|
+
"appShell": "webview/assets/app-shell-0b-x_r3Z.js",
|
|
12
|
+
"errorBoundary": "webview/assets/error-boundary-BOla93vo.js",
|
|
13
|
+
"generalSettings": "webview/assets/general-settings-U7DFIZBC.js",
|
|
14
|
+
"sidebarProjectHoverCardSourceRows": "webview/assets/sidebar-project-hover-card-source-rows-DtE7St1r.js",
|
|
15
|
+
"threadSidePanelTabs": "webview/assets/thread-side-panel-tabs-CLuB2SaS.js",
|
|
16
|
+
"userMessageAttachments": "webview/assets/user-message-attachments-5G1ZKim-.js",
|
|
17
|
+
"composer": "webview/assets/composer-DlMDPaCL.js",
|
|
18
|
+
"localTaskRow": "webview/assets/local-task-row-CoPNn6SW.js",
|
|
19
|
+
"keyboardShortcutsSearchInput": "webview/assets/keyboard-shortcuts-search-input-C1dmntOi.js",
|
|
20
|
+
"src": "src-l0hbMZ-p.js",
|
|
21
|
+
"sidebarThreadKeys": "sidebar-thread-keys-Ch_amVKz.js",
|
|
22
|
+
"sidebarThreadRowSignals": "sidebar-thread-row-signals-ZqNv-_WT.js",
|
|
23
|
+
"branchPickerDropdownContent": "git-branch-picker-dropdown-content-tZj3VhUw.js",
|
|
24
|
+
"electronMenuShortcuts": "webview/assets/electron-menu-shortcuts-j6UKqTX5.js"
|
|
25
|
+
},
|
|
26
|
+
"anchors": {
|
|
27
|
+
"composerProjectImports": "}from\"./thread-context-inputs-B6tQCr7t.js\";",
|
|
28
|
+
"composerProjectStyleCaller": "Rl=(0,Q.jsx)(_n,{onOpen:()=>{Uc.prepare(),X.toggleContextSuggestions()}});return",
|
|
29
|
+
"composerProjectAccentCaller": "):(0,Q.jsxs)(ah,{className:A,externalFooterVariant:k,inert:Y,isDragActive:Po,layout:Fl,onDragEnter:Ml?void 0:sl,onDragOver:Ml?void 0:dl,onDragLeave:Ml?void 0:ll,onDrop:Ml?void 0:fl,children:"
|
|
30
|
+
}
|
|
31
|
+
});
|
package/src/patches/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
const codex_26_616_71553_4265 = require("./26.616.71553-4265");
|
|
1
2
|
const codex_26_616_41845_4198 = require("./26.616.41845-4198");
|
|
2
3
|
const codex_26_616_51431_4212 = require("./26.616.51431-4212");
|
|
3
4
|
|
|
4
|
-
const patchSets = [codex_26_616_51431_4212, codex_26_616_41845_4198];
|
|
5
|
+
const patchSets = [codex_26_616_71553_4265, codex_26_616_51431_4212, codex_26_616_41845_4198];
|
|
5
6
|
|
|
6
7
|
module.exports = {
|
|
7
8
|
patchSets,
|
|
@@ -0,0 +1,606 @@
|
|
|
1
|
+
const { codexPlusRuntimeAssets } = require("../../runtime/assets");
|
|
2
|
+
const { replaceOnce } = require("./replace");
|
|
3
|
+
const { makePatchSet } = require("./make-patch-set");
|
|
4
|
+
|
|
5
|
+
function buildCodexPlusPatchSet(config) {
|
|
6
|
+
const oldTitle = "<title>Codex</title>";
|
|
7
|
+
const newTitle = '<title>Codex Plus</title><script src="./assets/codex-plus/runtime.js"></script>';
|
|
8
|
+
const titleFile = "webview/index.html";
|
|
9
|
+
const workerFile = ".vite/build/worker.js";
|
|
10
|
+
const files = config.files;
|
|
11
|
+
const anchors = config.anchors;
|
|
12
|
+
const mainFile = files.main;
|
|
13
|
+
const appMainFile = files.appMain;
|
|
14
|
+
const appShellFile = files.appShell;
|
|
15
|
+
const errorBoundaryFile = files.errorBoundary;
|
|
16
|
+
const generalSettingsFile = files.generalSettings;
|
|
17
|
+
const sidebarProjectHoverCardSourceRowsFile = files.sidebarProjectHoverCardSourceRows;
|
|
18
|
+
const threadSidePanelTabsFile = files.threadSidePanelTabs;
|
|
19
|
+
const userMessageAttachmentsFile = files.userMessageAttachments;
|
|
20
|
+
const composerFile = files.composer;
|
|
21
|
+
const localTaskRowFile = files.localTaskRow;
|
|
22
|
+
const electronMenuShortcutsFile = files.electronMenuShortcuts;
|
|
23
|
+
const keyboardShortcutsSearchInputFile = files.keyboardShortcutsSearchInput;
|
|
24
|
+
const srcFile = files.src;
|
|
25
|
+
const sidebarThreadKeysFile = files.sidebarThreadKeys;
|
|
26
|
+
const sidebarThreadRowSignalsFile = files.sidebarThreadRowSignals;
|
|
27
|
+
const branchPickerDropdownContentFile = files.branchPickerDropdownContent;
|
|
28
|
+
|
|
29
|
+
function codexPlusWorkerHelpers() {
|
|
30
|
+
return `
|
|
31
|
+
const CPXWorkerBridge=require(\"./codex-plus-worker.js\");function CPX_traceRequest(e){return CPXWorkerBridge.traceRequest(e)}async function CPX_repositoryTargets(e,t,n,r){return CPXWorkerBridge.repositoryTargets(e,t,n,r,(i,a)=>pae(e.getWorktreeRepositoryForRoot(i,n),a))}function CPX_isReadOnlyBranchRequest(e,t){return CPXWorkerBridge.isReadOnlyBranchRequest(e,t)}`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function patchTitle(text) {
|
|
35
|
+
return replaceOnce(text, oldTitle, newTitle, `${oldTitle} in ${titleFile}`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function patchAboutDialog(text, context = {}) {
|
|
39
|
+
const aboutContext = {
|
|
40
|
+
patcherRepoUrl: context.patcherRepoUrl || "https://github.com/michaelw/codex-plus-patcher",
|
|
41
|
+
patcherGitSha: context.patcherGitSha || "unknown",
|
|
42
|
+
sourceAsarSha256: context.sourceAsarSha256 || "unknown",
|
|
43
|
+
appliedPatches: context.appliedPatches || [],
|
|
44
|
+
};
|
|
45
|
+
let patched = replaceOnce(
|
|
46
|
+
text,
|
|
47
|
+
"let i=a.app.getName(),o=a.app.getVersion()",
|
|
48
|
+
`let CPXAbout=require("./codex-plus-aboutMetadata.js").aboutPayload(${JSON.stringify(aboutContext)}),i=CPXAbout.appDisplayName,o=a.app.getVersion()`,
|
|
49
|
+
"about dialog app name anchor",
|
|
50
|
+
);
|
|
51
|
+
patched = replaceOnce(
|
|
52
|
+
patched,
|
|
53
|
+
"function V0(e){return[]}",
|
|
54
|
+
"function V0(e){return CPXAbout.buildInfoLines}",
|
|
55
|
+
"about dialog build information anchor",
|
|
56
|
+
);
|
|
57
|
+
patched = replaceOnce(
|
|
58
|
+
patched,
|
|
59
|
+
"K0({appDisplayName:i,buildInfoLabel:g,buildInfoText:v,iconDataUrl:f.htmlIconDataUrl,isDark:b,okLabel:m,title:p})",
|
|
60
|
+
"K0({appDisplayName:i,buildInfoLabel:g,buildInfoText:v,codexPlusDisclaimerHeading:CPXAbout.disclaimerHeading,codexPlusDisclaimerBody:CPXAbout.disclaimerBody,iconDataUrl:f.htmlIconDataUrl,isDark:b,okLabel:m,title:p})",
|
|
61
|
+
"about dialog renderer call anchor",
|
|
62
|
+
);
|
|
63
|
+
patched = replaceOnce(
|
|
64
|
+
patched,
|
|
65
|
+
"function K0({appDisplayName:e,buildInfoLabel:t,buildInfoText:n,iconDataUrl:r,isDark:i,okLabel:a,title:o}){let s=r==null?``:",
|
|
66
|
+
"function K0({appDisplayName:e,buildInfoLabel:t,buildInfoText:n,codexPlusDisclaimerHeading:D,codexPlusDisclaimerBody:O,iconDataUrl:r,isDark:i,okLabel:a,title:o}){let CPXAboutMetadata=require(\"./codex-plus-aboutMetadata.js\"),q=CPXAboutMetadata.disclaimerMarkup({escape:zz.default,heading:D,body:O}),s=r==null?``:",
|
|
67
|
+
"about dialog renderer signature anchor",
|
|
68
|
+
);
|
|
69
|
+
patched = replaceOnce(
|
|
70
|
+
patched,
|
|
71
|
+
" .build-info {\n width: 100%;\n margin: 0;\n line-height: 1.45;",
|
|
72
|
+
"${CPXAboutMetadata.disclaimerStyles()}\n\n .build-info {\n width: 100%;\n margin: 0;\n line-height: 1.45;",
|
|
73
|
+
"about dialog disclaimer styles anchor",
|
|
74
|
+
);
|
|
75
|
+
patched = replaceOnce(
|
|
76
|
+
patched,
|
|
77
|
+
" color: var(--muted-text);\n white-space: pre-wrap;",
|
|
78
|
+
" color: var(--muted-text);\n text-align: left;\n white-space: pre-wrap;",
|
|
79
|
+
"about dialog build info left align anchor",
|
|
80
|
+
);
|
|
81
|
+
patched = replaceOnce(
|
|
82
|
+
patched,
|
|
83
|
+
" .app-name,\n .build-info,\n .copyright {",
|
|
84
|
+
" .app-name,\n .codex-plus-disclaimer,\n .build-info,\n .copyright {",
|
|
85
|
+
"about dialog selectable disclaimer anchor",
|
|
86
|
+
);
|
|
87
|
+
return replaceOnce(
|
|
88
|
+
patched,
|
|
89
|
+
' <div class="app-name" id="app-name">${(0,zz.default)(e)}</div>\n <pre class="build-info" aria-label="${(0,zz.default)(t)}">${(0,zz.default)(n)}</pre>',
|
|
90
|
+
' <div class="app-name" id="app-name">${(0,zz.default)(e)}</div>\n ${q}\n <pre class="build-info" aria-label="${(0,zz.default)(t)}">${(0,zz.default)(n)}</pre>',
|
|
91
|
+
"about dialog disclaimer insertion anchor",
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function patchWorker(text) {
|
|
96
|
+
let patched = replaceOnce(
|
|
97
|
+
text,
|
|
98
|
+
"function pae(e,t){return e.queryClient.fetchQuery",
|
|
99
|
+
`${codexPlusWorkerHelpers()}function pae(e,t){return e.queryClient.fetchQuery`,
|
|
100
|
+
"worker helper insertion anchor",
|
|
101
|
+
);
|
|
102
|
+
patched = replaceOnce(
|
|
103
|
+
patched,
|
|
104
|
+
"case`submodule-paths`:a=X({paths:await pae(this.gitManager.getWorktreeRepositoryForRoot(e.params.root,r),t.signal)});break;",
|
|
105
|
+
"case`codex-plus-trace`:a=X(CPX_traceRequest(e.params));break;case`repository-targets`:a=X(await CPX_repositoryTargets(this.gitManager,e.params,r,t.signal));break;case`submodule-paths`:a=X({paths:await pae(this.gitManager.getWorktreeRepositoryForRoot(e.params.root,r),t.signal)});break;",
|
|
106
|
+
"repository-targets worker switch anchor",
|
|
107
|
+
);
|
|
108
|
+
patched = replaceOnce(
|
|
109
|
+
patched,
|
|
110
|
+
"function u2({requestKind:e,source:t}){return l2.has(e??``)||d2(t)}",
|
|
111
|
+
"function u2({requestKind:e,source:t}){return l2.has(e??``)||d2(t)||CPX_isReadOnlyBranchRequest(e,t)}",
|
|
112
|
+
"codex plus branch picker git allowlist anchor",
|
|
113
|
+
);
|
|
114
|
+
return replaceOnce(
|
|
115
|
+
patched,
|
|
116
|
+
"case`commit-message-diff`:case`submodule-paths`:case`cat-file`:",
|
|
117
|
+
"case`commit-message-diff`:case`codex-plus-trace`:case`repository-targets`:case`submodule-paths`:case`cat-file`:",
|
|
118
|
+
"repository-targets worker readonly method anchor",
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const codexPlusReviewHelpers = `
|
|
123
|
+
function CPXReviewMux(e){let t=e.mainReviewContent??(0,$.jsx)(of,e);return window.CodexPlus?.ui?.review?.renderBody?.({props:e,deps:{jsx:$.jsx,jsxs:$.jsxs,Fragment:$.Fragment,createElement:Q.createElement,React:Q,useStore:s,useAtom:l,routeAtom:ft,cwdAtom:Or,hostIdAtom:Dr,hostConfigAtom:kr,conversationIdAtom:jr,gitRequest:y,pathValue:B,DefaultReview:of,Button:Y,Tooltip:Ae,Icon:Je,Dropdown:yi,DropdownMenu:vi,BranchPickerDropdownContent:CPXBranchPickerDropdownContent,ReviewToolbar:dp,parseDiff:xr,DiffCard:Ma},defaultBody:t})??t}`;
|
|
124
|
+
|
|
125
|
+
const codexPlusSubrepoDiffHelpers = `
|
|
126
|
+
`;
|
|
127
|
+
|
|
128
|
+
const codexPlusDiagnosticHelpers = `
|
|
129
|
+
function CPXDiagnosticDetails(e){return window.CodexPlus?.ui?.errors?.renderDetails?.(e)??null}`;
|
|
130
|
+
|
|
131
|
+
function patchThreadSidePanelTabs(text) {
|
|
132
|
+
let patched = replaceOnce(
|
|
133
|
+
text,
|
|
134
|
+
"import{r as vi,t as yi}from\"./dropdown-CTBRoADH.js\";",
|
|
135
|
+
`import{r as vi,t as yi}from"./dropdown-CTBRoADH.js";import{t as CPXBranchPickerDropdownContent}from"./${branchPickerDropdownContentFile}";`,
|
|
136
|
+
"branch picker content import anchor",
|
|
137
|
+
);
|
|
138
|
+
patched = replaceOnce(
|
|
139
|
+
patched,
|
|
140
|
+
"function uf({cwd:e,fileEntries:t,generatedPathsReady:n,hasUnhandledAttributesFiles:r,isCappedMode:i,repositorySource:a,reviewSummarySource:o}){",
|
|
141
|
+
`${codexPlusReviewHelpers}function uf({cwd:e,fileEntries:t,generatedPathsReady:n,hasUnhandledAttributesFiles:r,isCappedMode:i,repositorySource:a,reviewSummarySource:o}){`,
|
|
142
|
+
"review host hook insertion anchor",
|
|
143
|
+
);
|
|
144
|
+
return replaceOnce(
|
|
145
|
+
patched,
|
|
146
|
+
"let s;t[1]!==a||t[2]!==r||t[3]!==i?(s=(0,$.jsx)(Tf,{diffMode:a,setTabState:r,tabState:i}),t[1]=a,t[2]=r,t[3]=i,t[4]=s):s=t[4];let c;",
|
|
147
|
+
"let s;t[1]!==a||t[2]!==r||t[3]!==i?(s=(0,$.jsx)(CPXReviewMux,{mainReviewContent:(0,$.jsx)(Tf,{diffMode:a,setTabState:r,tabState:i}),diffMode:a,setTabState:r,tabState:i}),t[1]=a,t[2]=r,t[3]=i,t[4]=s):s=t[4];let c;",
|
|
148
|
+
"review body mux anchor",
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
function patchAppShell(text) {
|
|
152
|
+
let patched = replaceOnce(
|
|
153
|
+
text,
|
|
154
|
+
"function En(e){return(0,Q.jsx)(wn,{onRetry:()=>{e.resetError()}})}",
|
|
155
|
+
`${codexPlusDiagnosticHelpers}function En(e){return(0,Q.jsx)(wn,{error:e.error,onRetry:()=>{e.resetError()}})}`,
|
|
156
|
+
"app shell error fallback prop anchor",
|
|
157
|
+
);
|
|
158
|
+
patched = replaceOnce(
|
|
159
|
+
patched,
|
|
160
|
+
"children:[r,(0,Q.jsx)(Le,{color:`secondary`,size:`default`,onClick:n,children:i})]",
|
|
161
|
+
"children:[r,CPXDiagnosticDetails({jsx:Q.jsx,error:e.error}),(0,Q.jsx)(Le,{color:`secondary`,size:`default`,onClick:n,children:i})]",
|
|
162
|
+
"app shell error detail insertion anchor",
|
|
163
|
+
);
|
|
164
|
+
patched = replaceOnce(
|
|
165
|
+
patched,
|
|
166
|
+
"return t[2]===n?a=t[3]:(a=(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col items-center justify-center gap-3 p-4 text-center text-sm text-token-text-secondary`,children:",
|
|
167
|
+
"return t[2]===n&&t[3]===e.error?a=t[4]:(a=(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col items-center justify-center gap-3 p-4 text-center text-sm text-token-text-secondary`,children:",
|
|
168
|
+
"app shell error cache condition anchor",
|
|
169
|
+
);
|
|
170
|
+
return replaceOnce(
|
|
171
|
+
patched,
|
|
172
|
+
"}),t[2]=n,t[3]=a),a}function Tn(e){return e.composedPath().some",
|
|
173
|
+
"}),t[2]=n,t[3]=e.error,t[4]=a),a}function Tn(e){return e.composedPath().some",
|
|
174
|
+
"app shell error cache assignment anchor",
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function patchErrorBoundary(text) {
|
|
179
|
+
let patched = replaceOnce(
|
|
180
|
+
text,
|
|
181
|
+
"function Xf(e){let t=(0,Vf.c)(9),{resetError:n}=e,r=ee(),i,a;",
|
|
182
|
+
`${codexPlusDiagnosticHelpers}function Xf(e){let t=(0,Vf.c)(9),{resetError:n,error:CPX_error,componentStack:CPX_componentStack}=e,r=ee(),i,a;`,
|
|
183
|
+
"webview error boundary fallback prop anchor",
|
|
184
|
+
);
|
|
185
|
+
patched = replaceOnce(
|
|
186
|
+
patched,
|
|
187
|
+
"children:[i,a,(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[o,(0,$.jsx)(m,{onClick:s,children:c})]})]",
|
|
188
|
+
"children:[i,a,CPXDiagnosticDetails({jsx:$.jsx,error:CPX_error,componentStack:CPX_componentStack}),(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[o,(0,$.jsx)(m,{onClick:s,children:c})]})]",
|
|
189
|
+
"webview error boundary detail anchor",
|
|
190
|
+
);
|
|
191
|
+
return replaceOnce(
|
|
192
|
+
patched,
|
|
193
|
+
"r=e??(e=>(0,$.jsx)(Xf,{resetError:()=>e.resetError()}));",
|
|
194
|
+
"r=e??(e=>(0,$.jsx)(Xf,{error:e.error,componentStack:e.componentStack,resetError:()=>e.resetError()}));",
|
|
195
|
+
"webview error boundary error prop anchor",
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function patchAppMainProjectColors(text) {
|
|
200
|
+
let patched = replaceOnce(
|
|
201
|
+
text,
|
|
202
|
+
"function Pk(e){let t=(0,Q.c)(45),",
|
|
203
|
+
`${codexPlusProjectColorHelpers}function Pk(e){let t=(0,Q.c)(46),`,
|
|
204
|
+
"project color app main helper insertion anchor",
|
|
205
|
+
);
|
|
206
|
+
patched = replaceOnce(
|
|
207
|
+
patched,
|
|
208
|
+
"H=Ha.sidebarProjectList({projectId:i.projectId,showAll:x})",
|
|
209
|
+
"H=Ha.sidebarProjectList({projectId:i.projectId,showAll:x})",
|
|
210
|
+
"project group color marker anchor",
|
|
211
|
+
);
|
|
212
|
+
patched = replaceOnce(
|
|
213
|
+
patched,
|
|
214
|
+
"q={onActivateGroup:V,onStartNewConversation:a,isGrouped:!0,hideRemoteHostEnvIcon:!0,hideTimestamp:l,locationId:b,floatStatusIconsRight:s,showPinActionOnHover:o}",
|
|
215
|
+
"q={onActivateGroup:V,onStartNewConversation:a,isGrouped:!0,hideRemoteHostEnvIcon:!0,hideTimestamp:l,locationId:b,floatStatusIconsRight:s,showPinActionOnHover:o,dataAttributes:CPXHostThreadRowProps(i)}",
|
|
216
|
+
"project thread row color key anchor",
|
|
217
|
+
);
|
|
218
|
+
patched = replaceOnce(
|
|
219
|
+
patched,
|
|
220
|
+
"t[19]!==V||t[20]!==s||t[21]!==l||t[22]!==b||t[23]!==o||t[24]!==a?",
|
|
221
|
+
"t[19]!==V||t[20]!==s||t[21]!==l||t[22]!==b||t[23]!==o||t[24]!==a||t[45]!==i?",
|
|
222
|
+
"project thread row color cache dependency anchor",
|
|
223
|
+
);
|
|
224
|
+
patched = replaceOnce(
|
|
225
|
+
patched,
|
|
226
|
+
"t[19]=V,t[20]=s,t[21]=l,t[22]=b,t[23]=o,t[24]=a,t[25]=q):q=t[25]",
|
|
227
|
+
"t[19]=V,t[20]=s,t[21]=l,t[22]=b,t[23]=o,t[24]=a,t[45]=i,t[25]=q):q=t[25]",
|
|
228
|
+
"project thread row color cache write anchor",
|
|
229
|
+
);
|
|
230
|
+
patched = replaceOnce(
|
|
231
|
+
patched,
|
|
232
|
+
"ie=(0,Z.jsx)(`div`,{...H,children:re})",
|
|
233
|
+
"ie=(0,Z.jsx)(`div`,{...H,children:re})",
|
|
234
|
+
"project group color render anchor",
|
|
235
|
+
);
|
|
236
|
+
patched = replaceOnce(
|
|
237
|
+
patched,
|
|
238
|
+
"O=(0,Z.jsx)(NO,{action:T,actionTooltipContent:h,actionTooltipDisabled:p,indicator:E,isMenuOpen:g,menu:D})",
|
|
239
|
+
"O=(0,Z.jsx)(NO,{action:T,actionTooltipContent:h,actionTooltipDisabled:p,indicator:E,isMenuOpen:g,menu:D})",
|
|
240
|
+
"project header action render anchor",
|
|
241
|
+
);
|
|
242
|
+
patched = replaceOnce(
|
|
243
|
+
patched,
|
|
244
|
+
"Ke=(0,Z.jsx)(Oe,{rowAttributes:ke,className:Ae,collapsed:L,contentClassName:je,",
|
|
245
|
+
"Ke=(0,Z.jsx)(Oe,{rowAttributes:{...ke,...CPXHostProjectRowProps(n)},className:Ae,collapsed:L,contentClassName:je,",
|
|
246
|
+
"project header row color attributes anchor",
|
|
247
|
+
);
|
|
248
|
+
return patched;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
function patchAppMainSidebarBlur(text) {
|
|
252
|
+
let patched = text;
|
|
253
|
+
patched = replaceOnce(
|
|
254
|
+
patched,
|
|
255
|
+
"openFolder:$y,toggleSidebar:$i,toggleTerminal:Md,",
|
|
256
|
+
"openFolder:$y,toggleSidebar:$i,codexPlusToggleSidebarNameBlur:$i,toggleTerminal:Md,",
|
|
257
|
+
"sidebar blur command icon anchor",
|
|
258
|
+
);
|
|
259
|
+
patched = replaceOnce(
|
|
260
|
+
patched,
|
|
261
|
+
"children:n.label}),t[62]=Oe,",
|
|
262
|
+
"children:(0,Z.jsx)(`span`,{\"data-codex-plus-sidebar-name\":``,children:n.label})}),t[62]=Oe,",
|
|
263
|
+
"project header sidebar blur label anchor",
|
|
264
|
+
);
|
|
265
|
+
return replaceOnce(
|
|
266
|
+
patched,
|
|
267
|
+
"children:[l,u,(0,Z.jsx)(H_,{route:a,children:C})]",
|
|
268
|
+
"children:[l,u,...(window.CodexPlus?.ui?.commands?.renderMenuItems?.({group:`suggested`,deps:{jsx:Z.jsx,MenuItem:Zy,register:Hp}})??[]),(0,Z.jsx)(H_,{route:a,children:C})]",
|
|
269
|
+
"sidebar name blur command mount anchor",
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
function patchSidebarProjectHoverCardSourceRows(text) {
|
|
274
|
+
let patched = text;
|
|
275
|
+
patched = replaceOnce(
|
|
276
|
+
patched,
|
|
277
|
+
"var En=(0,Vt.memo)(function(e){let t=(0,zt.c)(40),{threadKey:n,canPin:r,disableHoverCard:a,floatStatusIconsRight:o,isGrouped:s,hideRemoteHostEnvIcon:c,hideTimestamp:l,locationId:u,onActivateGroup:d,onStartNewConversation:f,showPinActionOnHover:p,variant:m,shortcutLabel:h,onArchiveStart:g,onArchiveSuccess:_,onArchiveError:v}=e,",
|
|
278
|
+
"var En=(0,Vt.memo)(function(e){let t=(0,zt.c)(41),{threadKey:n,canPin:r,disableHoverCard:a,floatStatusIconsRight:o,isGrouped:s,hideRemoteHostEnvIcon:c,hideTimestamp:l,locationId:u,onActivateGroup:d,onStartNewConversation:f,showPinActionOnHover:p,variant:m,shortcutLabel:h,onArchiveStart:g,onArchiveSuccess:_,onArchiveError:v,dataAttributes:CPX_rowDataAttributes}=e,",
|
|
279
|
+
"sidebar row component data attributes prop anchor",
|
|
280
|
+
);
|
|
281
|
+
patched = replaceOnce(
|
|
282
|
+
patched,
|
|
283
|
+
"t[12]!==A||t[13]!==y||t[14]!==b||t[15]!==F||t[16]!==x||t[17]!==B||t[18]!==L||t[19]!==z||t[20]!==ee||t[21]!==te||t[22]!==j||t[23]!==M||t[24]!==N||t[25]!==P||t[26]!==k||t[27]!==S||t[28]!==C||t[29]!==d||t[30]!==f||t[31]!==h||t[32]!==w||t[33]!==V||t[34]!==T?",
|
|
284
|
+
"t[12]!==A||t[13]!==y||t[14]!==b||t[15]!==F||t[16]!==x||t[17]!==B||t[18]!==L||t[19]!==z||t[20]!==ee||t[21]!==te||t[22]!==j||t[23]!==M||t[24]!==N||t[25]!==P||t[26]!==k||t[27]!==S||t[28]!==C||t[29]!==d||t[30]!==f||t[31]!==h||t[32]!==w||t[33]!==V||t[34]!==T||t[40]!==CPX_rowDataAttributes?",
|
|
285
|
+
"sidebar row component data attributes memo dependency anchor",
|
|
286
|
+
);
|
|
287
|
+
patched = replaceOnce(
|
|
288
|
+
patched,
|
|
289
|
+
"onArchiveStart:L,onArchiveSuccess:z,onArchiveError:B}",
|
|
290
|
+
"onArchiveStart:L,onArchiveSuccess:z,onArchiveError:B,dataAttributes:CPX_rowDataAttributes}",
|
|
291
|
+
"sidebar row component data attributes object anchor",
|
|
292
|
+
);
|
|
293
|
+
patched = replaceOnce(
|
|
294
|
+
patched,
|
|
295
|
+
"t[32]=w,t[33]=V,t[34]=T,t[35]=H):H=t[35]",
|
|
296
|
+
"t[32]=w,t[33]=V,t[34]=T,t[40]=CPX_rowDataAttributes,t[35]=H):H=t[35]",
|
|
297
|
+
"sidebar row component data attributes memo write anchor",
|
|
298
|
+
);
|
|
299
|
+
patched = replaceOnce(
|
|
300
|
+
patched,
|
|
301
|
+
"function On(e){let t=(0,zt.c)(121),{entry:n,isPinned:r,isAutomationRun:a,automationDisplayName:o,isActive:s,canPin:c,disableHoverCard:u,floatStatusIconsRight:f,isGrouped:p,hideRemoteHostEnvIcon:m,hideTimestamp:h,locationId:g,onActivateGroup:y,onStartNewConversation:b,showPinActionOnHover:te,variant:C,shortcutLabel:T,hoverCardHostConfig:E,hoverCardProjectId:D,hoverCardProjectLabel:A,hoverCardRepositoryLabel:j,displayCwd:M,onArchiveStart:N,onArchiveSuccess:P,onArchiveError:F}=e,",
|
|
302
|
+
"function On(e){let t=(0,zt.c)(124),{entry:n,isPinned:r,isAutomationRun:a,automationDisplayName:o,isActive:s,canPin:c,disableHoverCard:u,floatStatusIconsRight:f,isGrouped:p,hideRemoteHostEnvIcon:m,hideTimestamp:h,locationId:g,onActivateGroup:y,onStartNewConversation:b,showPinActionOnHover:te,variant:C,shortcutLabel:T,hoverCardHostConfig:E,hoverCardProjectId:D,hoverCardProjectLabel:A,hoverCardRepositoryLabel:j,displayCwd:M,onArchiveStart:N,onArchiveSuccess:P,onArchiveError:F,dataAttributes:CPX_rowDataAttributes}=e,",
|
|
303
|
+
"sidebar row dispatcher data attributes prop anchor",
|
|
304
|
+
);
|
|
305
|
+
patched = replaceOnce(
|
|
306
|
+
patched,
|
|
307
|
+
"dataAttributes:ae.sidebarThreadRow({active:s,hostId:t.hostId,id:n,kind:`pending-worktree`,pinned:r,title:t.label})",
|
|
308
|
+
"dataAttributes:window.CodexPlus?.ui?.sidebar?.mergeDataAttributes?.(ae.sidebarThreadRow({active:s,hostId:t.hostId,id:n,kind:`pending-worktree`,pinned:r,title:t.label}),CPX_rowDataAttributes)",
|
|
309
|
+
"pending worktree sidebar row data attributes merge anchor",
|
|
310
|
+
);
|
|
311
|
+
patched = replaceOnce(
|
|
312
|
+
patched,
|
|
313
|
+
"dataAttributes:ae.sidebarThreadRow({active:s,hostId:null,id:t,kind:`remote`,pinned:r,title:e.task.title??``})",
|
|
314
|
+
"dataAttributes:window.CodexPlus?.ui?.sidebar?.mergeDataAttributes?.(ae.sidebarThreadRow({active:s,hostId:null,id:t,kind:`remote`,pinned:r,title:e.task.title??``}),CPX_rowDataAttributes)",
|
|
315
|
+
"remote sidebar row data attributes merge anchor",
|
|
316
|
+
);
|
|
317
|
+
patched = replaceOnce(
|
|
318
|
+
patched,
|
|
319
|
+
"dataAttributes:ae.sidebarThreadRow({active:s,hostId:f,id:i,kind:`local`,pinned:r,title:x})",
|
|
320
|
+
"dataAttributes:window.CodexPlus?.ui?.sidebar?.mergeDataAttributes?.(ae.sidebarThreadRow({active:s,hostId:f,id:i,kind:`local`,pinned:r,title:x}),CPX_rowDataAttributes)",
|
|
321
|
+
"local sidebar row data attributes merge anchor",
|
|
322
|
+
);
|
|
323
|
+
patched = replaceOnce(
|
|
324
|
+
patched,
|
|
325
|
+
"t[22]=c,t[23]=se,t[24]=Ne,t[25]=L,t[26]=Je,t[27]=J,t[28]=oe,t[29]=V,t[30]=G,t[31]=s,t[32]=z,t[33]=r,t[34]=g,t[35]=K,t[36]=y,t[37]=P,t[38]=le,t[39]=W,t[40]=ue,t[41]=et,t[42]=H,t[43]=U,t[44]=st):st=t[44]",
|
|
326
|
+
"t[22]=c,t[23]=se,t[24]=Ne,t[25]=L,t[26]=Je,t[27]=J,t[28]=oe,t[29]=V,t[30]=G,t[31]=s,t[32]=z,t[33]=r,t[34]=g,t[35]=K,t[36]=y,t[37]=P,t[38]=le,t[39]=W,t[40]=ue,t[41]=et,t[42]=H,t[43]=U,t[121]=CPX_rowDataAttributes,t[44]=st):st=t[44]",
|
|
327
|
+
"pending worktree sidebar row data attributes memo write anchor",
|
|
328
|
+
);
|
|
329
|
+
patched = replaceOnce(
|
|
330
|
+
patched,
|
|
331
|
+
"t[45]!==c||t[46]!==Ne||t[47]!==Fe||t[48]!==L||t[49]!==Je||t[50]!==J||t[51]!==oe||t[52]!==V||t[53]!==G||t[54]!==s||t[55]!==z||t[56]!==r||t[57]!==g||t[58]!==F||t[59]!==P||t[60]!==nt||t[61]!==Q||t[62]!==We||t[63]!==W||t[64]!==Xe||t[65]!==et||t[66]!==H||t[67]!==U?",
|
|
332
|
+
"t[45]!==c||t[46]!==Ne||t[47]!==Fe||t[48]!==L||t[49]!==Je||t[50]!==J||t[51]!==oe||t[52]!==V||t[53]!==G||t[54]!==s||t[55]!==z||t[56]!==r||t[57]!==g||t[58]!==F||t[59]!==P||t[60]!==nt||t[61]!==Q||t[62]!==We||t[63]!==W||t[64]!==Xe||t[65]!==et||t[66]!==H||t[67]!==U||t[122]!==CPX_rowDataAttributes?",
|
|
333
|
+
"remote sidebar row data attributes memo dependency anchor",
|
|
334
|
+
);
|
|
335
|
+
patched = replaceOnce(
|
|
336
|
+
patched,
|
|
337
|
+
"t[63]=W,t[64]=Xe,t[65]=et,t[66]=H,t[67]=U,t[68]=ht):ht=t[68]",
|
|
338
|
+
"t[63]=W,t[64]=Xe,t[65]=et,t[66]=H,t[67]=U,t[122]=CPX_rowDataAttributes,t[68]=ht):ht=t[68]",
|
|
339
|
+
"remote sidebar row data attributes memo write anchor",
|
|
340
|
+
);
|
|
341
|
+
patched = replaceOnce(
|
|
342
|
+
patched,
|
|
343
|
+
"t[69]!==o||t[70]!==c||t[71]!==I||t[72]!==ot||t[73]!==M||t[74]!==Pe||t[75]!==Ne||t[76]!==Fe||t[77]!==L||t[78]!==Je||t[79]!==J||t[80]!==ne||t[81]!==oe||t[82]!==V||t[83]!==E||t[84]!==A||t[85]!==G||t[86]!==s||t[87]!==a||t[88]!==z||t[89]!==r||t[90]!==pe||t[91]!==fe||t[92]!==he||t[93]!==Be||t[94]!==De||t[95]!==null||t[96]!==_e||t[97]!==me||t[98]!==ge||t[99]!==g||t[100]!==y||t[101]!==F||t[102]!==P||t[103]!==nt||t[104]!==Q||t[105]!==W||t[106]!==Xe||t[107]!==et||t[108]!==H||t[109]!==be||t[110]!==U?",
|
|
344
|
+
"t[69]!==o||t[70]!==c||t[71]!==I||t[72]!==ot||t[73]!==M||t[74]!==Pe||t[75]!==Ne||t[76]!==Fe||t[77]!==L||t[78]!==Je||t[79]!==J||t[80]!==ne||t[81]!==oe||t[82]!==V||t[83]!==E||t[84]!==A||t[85]!==G||t[86]!==s||t[87]!==a||t[88]!==z||t[89]!==r||t[90]!==pe||t[91]!==fe||t[92]!==he||t[93]!==Be||t[94]!==De||t[95]!==null||t[96]!==_e||t[97]!==me||t[98]!==ge||t[99]!==g||t[100]!==y||t[101]!==F||t[102]!==P||t[103]!==nt||t[104]!==Q||t[105]!==W||t[106]!==Xe||t[107]!==et||t[108]!==H||t[109]!==be||t[110]!==U||t[123]!==CPX_rowDataAttributes?",
|
|
345
|
+
"local sidebar row data attributes memo dependency anchor",
|
|
346
|
+
);
|
|
347
|
+
patched = replaceOnce(
|
|
348
|
+
patched,
|
|
349
|
+
"t[108]=H,t[109]=be,t[110]=U,t[111]=vt):vt=t[111]",
|
|
350
|
+
"t[108]=H,t[109]=be,t[110]=U,t[123]=CPX_rowDataAttributes,t[111]=vt):vt=t[111]",
|
|
351
|
+
"local sidebar row data attributes memo write anchor",
|
|
352
|
+
);
|
|
353
|
+
patched = replaceOnce(
|
|
354
|
+
patched,
|
|
355
|
+
"t[14]!==l?.canPin||t[15]!==l?.disableHoverCard||t[16]!==l?.floatStatusIconsRight||t[17]!==l?.hideRemoteHostEnvIcon||t[18]!==l?.hideTimestamp||t[19]!==l?.isGrouped||t[20]!==l?.locationId||t[21]!==l?.onActivateGroup||t[22]!==l?.onStartNewConversation||t[23]!==l?.showPinActionOnHover||t[24]!==l?.variant||t[25]!==b?",
|
|
356
|
+
"t[14]!==l?.canPin||t[15]!==l?.disableHoverCard||t[16]!==l?.floatStatusIconsRight||t[17]!==l?.hideRemoteHostEnvIcon||t[18]!==l?.hideTimestamp||t[19]!==l?.isGrouped||t[20]!==l?.locationId||t[21]!==l?.onActivateGroup||t[22]!==l?.onStartNewConversation||t[23]!==l?.showPinActionOnHover||t[24]!==l?.variant||t[25]!==b||t[43]!==l?.dataAttributes?",
|
|
357
|
+
"thread list row options data attributes memo dependency anchor",
|
|
358
|
+
);
|
|
359
|
+
patched = replaceOnce(
|
|
360
|
+
patched,
|
|
361
|
+
"showPinActionOnHover:l?.showPinActionOnHover,variant:l?.variant,shortcutLabel:b?.get(e)}),",
|
|
362
|
+
"showPinActionOnHover:l?.showPinActionOnHover,variant:l?.variant,shortcutLabel:b?.get(e),dataAttributes:l?.dataAttributes}),",
|
|
363
|
+
"thread list row options data attributes prop anchor",
|
|
364
|
+
);
|
|
365
|
+
patched = replaceOnce(
|
|
366
|
+
patched,
|
|
367
|
+
"t[24]=l?.variant,t[25]=b,t[26]=j):j=t[26]",
|
|
368
|
+
"t[24]=l?.variant,t[25]=b,t[43]=l?.dataAttributes,t[26]=j):j=t[26]",
|
|
369
|
+
"thread list row options data attributes memo write anchor",
|
|
370
|
+
);
|
|
371
|
+
return replaceOnce(
|
|
372
|
+
patched,
|
|
373
|
+
"function Rn(e){let t=(0,zt.c)(43),",
|
|
374
|
+
"function Rn(e){let t=(0,zt.c)(44),",
|
|
375
|
+
"thread list memo cache size anchor",
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
const codexPlusProjectColorHelpers = `
|
|
380
|
+
function CPXHostProjectRowProps(e){return window.CodexPlus?.ui?.sidebar?.projectRowProps?.({project:e})}function CPXHostThreadRowProps(e){return window.CodexPlus?.ui?.sidebar?.threadRowProps?.({project:e})}function CPXHostUserBubbleProps(e){return window.CodexPlus?.ui?.message?.userBubbleProps?.(e)}function CPXHostComposerSurfaceProps(e){return window.CodexPlus?.ui?.composer?.surfaceProps?.(e)}`;
|
|
381
|
+
|
|
382
|
+
const codexPlusAppearanceSettingsHelpers = `
|
|
383
|
+
function CPXAppearanceRows(e){return window.CodexPlus?.ui?.settings?.appearance?.renderRows?.({deps:{React:X,jsx:Z.jsx,SettingRow:J,ColorInput:sn,Switch:q},variant:e})??[]}`;
|
|
384
|
+
|
|
385
|
+
function patchGeneralSettingsUserBubbleColors(text) {
|
|
386
|
+
let patched = replaceOnce(
|
|
387
|
+
text,
|
|
388
|
+
"function tn({showCodeFont:e,showTranslucentSidebarToggle:t,variant:n}){",
|
|
389
|
+
`${codexPlusAppearanceSettingsHelpers}function tn({showCodeFont:e,showTranslucentSidebarToggle:t,variant:n}){`,
|
|
390
|
+
"user bubble settings helper insertion anchor",
|
|
391
|
+
);
|
|
392
|
+
return replaceOnce(
|
|
393
|
+
patched,
|
|
394
|
+
"children:[D.map(e=>(0,Z.jsx)(J,{control:(0,Z.jsx)(sn,{ariaLabel:e.ariaLabel,value:x[e.role],onChange:t=>{k(e.role,t)}}),label:e.label,variant:`nested`},e.role)),O.map",
|
|
395
|
+
"children:[D.map(e=>(0,Z.jsx)(J,{control:(0,Z.jsx)(sn,{ariaLabel:e.ariaLabel,value:x[e.role],onChange:t=>{k(e.role,t)}}),label:e.label,variant:`nested`},e.role)),...CPXAppearanceRows(n),O.map",
|
|
396
|
+
"user bubble settings row anchor",
|
|
397
|
+
);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
const codexPlusUserBubbleHelpers = `
|
|
401
|
+
${codexPlusProjectColorHelpers}function CPX_installHostSurfaceProps(){}CPX_installHostSurfaceProps();`;
|
|
402
|
+
|
|
403
|
+
function patchUserMessageAttachmentsBubbleColors(text) {
|
|
404
|
+
let patched = replaceOnce(
|
|
405
|
+
text,
|
|
406
|
+
"var Z=i(),Q=e(n(),1),$=r();function Ue(e){",
|
|
407
|
+
`var Z=i(),Q=e(n(),1),$=r();${codexPlusUserBubbleHelpers}function Ue(e){`,
|
|
408
|
+
"user bubble helper insertion anchor",
|
|
409
|
+
);
|
|
410
|
+
patched = replaceOnce(
|
|
411
|
+
patched,
|
|
412
|
+
"Se=W?(0,$.jsx)(`div`,{className:`w-full p-px`,children:(0,$.jsx)(it,{cwd:T??null,hostId:k,initialMessage:U.trim(),onCancel:()=>{q(null)},onDraftChange:e=>{q(e)},onSubmit:ge})}):le?(0,$.jsx)(`div`,{\"data-user-message-bubble\":!0,role:H?`button`:void 0,tabIndex:0,className:D(e,`text-left focus-visible:ring-2 focus-visible:ring-token-focus-border focus-visible:outline-none`,H&&`cursor-interaction`),",
|
|
413
|
+
"Se=W?(0,$.jsx)(`div`,{className:`w-full p-px`,children:(0,$.jsx)(it,{cwd:T??null,hostId:k,initialMessage:U.trim(),onCancel:()=>{q(null)},onDraftChange:e=>{q(e)},onSubmit:ge})}):le?(0,$.jsx)(`div`,{\"data-user-message-bubble\":!0,...CPXHostUserBubbleProps({}),role:H?`button`:void 0,tabIndex:0,className:D(e,`text-left focus-visible:ring-2 focus-visible:ring-token-focus-border focus-visible:outline-none`,H&&`cursor-interaction`),",
|
|
414
|
+
"user bubble marker attribute anchor",
|
|
415
|
+
);
|
|
416
|
+
return replaceOnce(
|
|
417
|
+
patched,
|
|
418
|
+
"return(0,$.jsx)(`form`,{className:`relative flex w-full flex-col rounded-3xl bg-token-foreground/5`,onSubmit:e=>{e.preventDefault(),v()},children:",
|
|
419
|
+
"return(0,$.jsx)(`form`,{\"data-codex-plus-user-entry\":!0,className:`relative flex w-full flex-col rounded-3xl bg-token-foreground/5`,onSubmit:e=>{e.preventDefault(),v()},children:",
|
|
420
|
+
"edit user message entry marker anchor",
|
|
421
|
+
);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
function patchUserMessageAttachmentsProjectColors(text) {
|
|
425
|
+
let patched = replaceOnce(
|
|
426
|
+
text,
|
|
427
|
+
`import{Aa as x,Ta as S}from"./${srcFile}";`,
|
|
428
|
+
`import{Aa as x,Ta as S}from"./${srcFile}";import{t as CPX_localThreadKey}from"./${sidebarThreadKeysFile}";import{s as CPX_threadProjectId}from"./${sidebarThreadRowSignalsFile}";`,
|
|
429
|
+
"user bubble project assignment imports anchor",
|
|
430
|
+
);
|
|
431
|
+
patched = replaceOnce(
|
|
432
|
+
patched,
|
|
433
|
+
"hasExternalAttachments:b,commentCount:ee,onEditMessage:x,threadId:S,turnId:w,cwd:T,hostId:k}=e,M=a===void 0?!1:a,",
|
|
434
|
+
"hasExternalAttachments:b,commentCount:ee,onEditMessage:x,threadId:S,turnId:w,cwd:T,hostId:k}=e,CPX_userMessageProjectId=o(CPX_threadProjectId,S==null?null:CPX_localThreadKey(S)),M=a===void 0?!1:a,",
|
|
435
|
+
"user bubble project assignment style anchor",
|
|
436
|
+
);
|
|
437
|
+
return replaceOnce(
|
|
438
|
+
patched,
|
|
439
|
+
"\"data-user-message-bubble\":!0,...CPXHostUserBubbleProps({}),role:H?`button`:void 0,",
|
|
440
|
+
"\"data-user-message-bubble\":!0,...CPXHostUserBubbleProps({project:CPX_userMessageProjectId}),role:H?`button`:void 0,",
|
|
441
|
+
"user bubble project marker attribute anchor",
|
|
442
|
+
);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
function patchComposerBubbleColors(text) {
|
|
446
|
+
let patched = replaceOnce(
|
|
447
|
+
text,
|
|
448
|
+
"function oh(e){let t=(0,$.c)(13),",
|
|
449
|
+
`${codexPlusUserBubbleHelpers}function oh(e){let t=(0,$.c)(14),`,
|
|
450
|
+
"composer user bubble helper insertion anchor",
|
|
451
|
+
);
|
|
452
|
+
patched = replaceOnce(
|
|
453
|
+
patched,
|
|
454
|
+
"function oh(e){let t=(0,$.c)(14),{children:n,className:r,externalFooterVariant:i,inert:a,isDragActive:o,layout:s,onDragEnter:c,onDragLeave:l,onDragOver:u,onDrop:d}=e,",
|
|
455
|
+
"function oh(e){let t=(0,$.c)(14),{children:n,className:r,externalFooterVariant:i,inert:a,isDragActive:o,layout:s,onDragEnter:c,onDragLeave:l,onDragOver:u,onDrop:d,codexPlusProps:CPX_hostSurfaceProps}=e,CPX_surfaceProps=CPX_hostSurfaceProps??CPXHostComposerSurfaceProps({}),",
|
|
456
|
+
"composer host surface props anchor",
|
|
457
|
+
);
|
|
458
|
+
patched = replaceOnce(
|
|
459
|
+
patched,
|
|
460
|
+
"return t[5]!==n||t[6]!==a||t[7]!==c||t[8]!==l||t[9]!==u||t[10]!==d||t[11]!==v?(y=(0,Q.jsx)(Jt.div,{inert:a,className:v,onDragEnter:c,onDragOver:u,onDragLeave:l,onDrop:d,children:n}),t[5]=n,t[6]=a,t[7]=c,t[8]=l,t[9]=u,t[10]=d,t[11]=v,t[12]=y):y=t[12],y}",
|
|
461
|
+
"return t[5]!==n||t[6]!==a||t[7]!==c||t[8]!==l||t[9]!==u||t[10]!==d||t[11]!==v||t[12]!==CPX_surfaceProps?(y=(0,Q.jsx)(Jt.div,{inert:a,...CPX_surfaceProps,className:v,onDragEnter:c,onDragOver:u,onDragLeave:l,onDrop:d,children:n}),t[5]=n,t[6]=a,t[7]=c,t[8]=l,t[9]=u,t[10]=d,t[11]=v,t[12]=CPX_surfaceProps,t[13]=y):y=t[13],y}",
|
|
462
|
+
"composer user entry marker render anchor",
|
|
463
|
+
);
|
|
464
|
+
return patched;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
function patchComposerProjectColors(text) {
|
|
468
|
+
let patched = replaceOnce(
|
|
469
|
+
text,
|
|
470
|
+
anchors.composerProjectImports,
|
|
471
|
+
`${anchors.composerProjectImports}import{t as CPX_localThreadKey}from"./${sidebarThreadKeysFile}";import{s as CPX_threadProjectId}from"./${sidebarThreadRowSignalsFile}";`,
|
|
472
|
+
"composer project assignment imports anchor",
|
|
473
|
+
);
|
|
474
|
+
patched = replaceOnce(
|
|
475
|
+
patched,
|
|
476
|
+
anchors.composerProjectStyleCaller,
|
|
477
|
+
anchors.composerProjectStyleCaller.replace(";return", ",CPX_composerThreadProjectId=a(CPX_threadProjectId,G==null?null:CPX_localThreadKey(G)),CPX_composerSurfaceProps=CPXHostComposerSurfaceProps({project:G==null?On?{hostId:On.hostId,path:On.remotePath,projectId:kn,label:On.label??On.name}:x??void 0:CPX_composerThreadProjectId});return"),
|
|
478
|
+
"composer project style hook-safe caller anchor",
|
|
479
|
+
);
|
|
480
|
+
return replaceOnce(
|
|
481
|
+
patched,
|
|
482
|
+
anchors.composerProjectAccentCaller,
|
|
483
|
+
anchors.composerProjectAccentCaller.replace(",onDragEnter:", ",codexPlusProps:!Ge&&!Hn?CPX_composerSurfaceProps:void 0,onDragEnter:"),
|
|
484
|
+
"composer project accent style caller anchor",
|
|
485
|
+
);
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
function patchElectronMenuShortcuts(text) {
|
|
489
|
+
return replaceOnce(
|
|
490
|
+
text,
|
|
491
|
+
"{id:`toggleSidebar`,titleIntlId:`codex.command.toggleSidebar`,descriptionIntlId:`codex.commandDescription.toggleSidebar`,commandMenuGroupKey:`panels`,commandMenu:!0,electron:{menuTitle:`Toggle Sidebar`,menuTitleIntlId:`codex.commandMenuTitle.toggleSidebar`,defaultKeybindings:[{key:`CmdOrCtrl+B`}]}},{id:`toggleBottomPanel`,",
|
|
492
|
+
"{id:`toggleSidebar`,titleIntlId:`codex.command.toggleSidebar`,descriptionIntlId:`codex.commandDescription.toggleSidebar`,commandMenuGroupKey:`panels`,commandMenu:!0,electron:{menuTitle:`Toggle Sidebar`,menuTitleIntlId:`codex.commandMenuTitle.toggleSidebar`,defaultKeybindings:[{key:`CmdOrCtrl+B`}]}},...(window.CodexPlus?.ui?.commands?.commandMetadata?.()??[]),{id:`toggleBottomPanel`,",
|
|
493
|
+
"sidebar blur command palette metadata anchor",
|
|
494
|
+
);
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
function patchKeyboardShortcutsSearchInput(text) {
|
|
498
|
+
return replaceOnce(
|
|
499
|
+
text,
|
|
500
|
+
"function d(e,t){return`titleIntlId`in e?t.formatMessage(c[e.titleIntlId]):t.formatMessage(l[e.electron.menuTitleIntlId])}",
|
|
501
|
+
"function d(e,t){return`titleIntlId`in e?t.formatMessage(c[e.titleIntlId]):e.title??e.electron?.menuTitle??t.formatMessage(l[e.electron.menuTitleIntlId])}",
|
|
502
|
+
"generic command metadata title fallback anchor",
|
|
503
|
+
);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
function patchLocalTaskRow(text) {
|
|
507
|
+
let patched = replaceOnce(
|
|
508
|
+
text,
|
|
509
|
+
"function fn(e){let t=(0,K.c)(124),",
|
|
510
|
+
`${codexPlusProjectColorHelpers}function fn(e){let t=(0,K.c)(124),`,
|
|
511
|
+
"local task row project color helper insertion anchor",
|
|
512
|
+
);
|
|
513
|
+
patched = replaceOnce(
|
|
514
|
+
patched,
|
|
515
|
+
"threadSummary:Ne,dataAttributes:Fe}=e,Ie=g===void 0?!1:g,",
|
|
516
|
+
"threadSummary:Ne,dataAttributes:Fe}=e,CPX_rowDataAttributes=Fe??CPXHostProjectRowProps(Oe),Ie=g===void 0?!1:g,",
|
|
517
|
+
"local task row project assignment anchor",
|
|
518
|
+
);
|
|
519
|
+
patched = replaceOnce(
|
|
520
|
+
patched,
|
|
521
|
+
"t[87]!==Fe",
|
|
522
|
+
"t[87]!==CPX_rowDataAttributes",
|
|
523
|
+
"local task row memo dependency anchor",
|
|
524
|
+
);
|
|
525
|
+
patched = replaceOnce(
|
|
526
|
+
patched,
|
|
527
|
+
"dataAttributes:Fe,archiveAriaLabel:hn",
|
|
528
|
+
"dataAttributes:CPX_rowDataAttributes,archiveAriaLabel:hn",
|
|
529
|
+
"local task row data attributes anchor",
|
|
530
|
+
);
|
|
531
|
+
return replaceOnce(
|
|
532
|
+
patched,
|
|
533
|
+
"t[87]=Fe",
|
|
534
|
+
"t[87]=CPX_rowDataAttributes",
|
|
535
|
+
"local task row memo assignment anchor",
|
|
536
|
+
);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
return makePatchSet({
|
|
540
|
+
id: config.id,
|
|
541
|
+
codexVersion: config.codexVersion,
|
|
542
|
+
bundleVersion: config.bundleVersion,
|
|
543
|
+
asarSha256: config.asarSha256,
|
|
544
|
+
assetFiles: codexPlusRuntimeAssets(),
|
|
545
|
+
patches: [
|
|
546
|
+
{
|
|
547
|
+
id: "bundle-identity",
|
|
548
|
+
infoPlistStrings: {
|
|
549
|
+
CFBundleDisplayName: "Codex Plus",
|
|
550
|
+
CFBundleName: "Codex Plus",
|
|
551
|
+
CFBundleIdentifier: "com.openai.codex-plus",
|
|
552
|
+
},
|
|
553
|
+
fileTransforms: [[titleFile, patchTitle]],
|
|
554
|
+
},
|
|
555
|
+
...(mainFile ? [{
|
|
556
|
+
id: "about-codex-plus-metadata",
|
|
557
|
+
fileTransforms: [[mainFile, patchAboutDialog]],
|
|
558
|
+
}] : []),
|
|
559
|
+
{
|
|
560
|
+
id: "nested-repository-worker",
|
|
561
|
+
fileTransforms: [[workerFile, patchWorker]],
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
id: "multi-repository-review",
|
|
565
|
+
fileTransforms: [[threadSidePanelTabsFile, patchThreadSidePanelTabs]],
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
id: "diagnostic-error-boundary",
|
|
569
|
+
fileTransforms: [
|
|
570
|
+
[appShellFile, patchAppShell],
|
|
571
|
+
[errorBoundaryFile, patchErrorBoundary],
|
|
572
|
+
],
|
|
573
|
+
},
|
|
574
|
+
{
|
|
575
|
+
id: "user-message-bubble-colors",
|
|
576
|
+
fileTransforms: [
|
|
577
|
+
[generalSettingsFile, patchGeneralSettingsUserBubbleColors],
|
|
578
|
+
[userMessageAttachmentsFile, patchUserMessageAttachmentsBubbleColors],
|
|
579
|
+
[composerFile, patchComposerBubbleColors],
|
|
580
|
+
],
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
id: "project-colors",
|
|
584
|
+
fileTransforms: [
|
|
585
|
+
[appMainFile, patchAppMainProjectColors],
|
|
586
|
+
[sidebarProjectHoverCardSourceRowsFile, patchSidebarProjectHoverCardSourceRows],
|
|
587
|
+
[localTaskRowFile, patchLocalTaskRow],
|
|
588
|
+
[userMessageAttachmentsFile, patchUserMessageAttachmentsProjectColors],
|
|
589
|
+
[composerFile, patchComposerProjectColors],
|
|
590
|
+
],
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
id: "sidebar-name-blur",
|
|
594
|
+
fileTransforms: [
|
|
595
|
+
[appMainFile, patchAppMainSidebarBlur],
|
|
596
|
+
[electronMenuShortcutsFile, patchElectronMenuShortcuts],
|
|
597
|
+
[keyboardShortcutsSearchInputFile, patchKeyboardShortcutsSearchInput],
|
|
598
|
+
],
|
|
599
|
+
},
|
|
600
|
+
],
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
module.exports = {
|
|
605
|
+
buildCodexPlusPatchSet,
|
|
606
|
+
};
|