codex-plus-patcher 0.7.0 → 0.7.1

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.
@@ -7,11 +7,12 @@ const { mermaidDiagramHook } = require("./hooks/mermaid");
7
7
  const { messageComposerHook } = require("./hooks/message-composer");
8
8
  const { nativeMainHook } = require("./hooks/native-main");
9
9
  const { reviewHook } = require("./hooks/review");
10
- const { projectColorHook, sidebarMergeDataAttributes } = require("./hooks/sidebar");
10
+ const { projectColorHook } = require("./hooks/sidebar");
11
11
  const { appearanceSettingsHook, commandMenuItemsExpression } = require("./hooks/settings-commands");
12
12
  const { threadHeaderHook } = require("./hooks/thread-header");
13
13
  const { workerHook } = require("./hooks/worker");
14
14
  const {
15
+ patchHomeProjectDropdownProjectSelectorShortcut,
15
16
  patchLocalActiveWorkspaceRootDropdownProjectSelectorShortcut,
16
17
  patchRunCommandProjectSelectorShortcut,
17
18
  } = require("./project-selector-shortcut-patch");
@@ -30,7 +31,6 @@ function buildCodexPlusPatchSet(config) {
30
31
  const appShellFile = files.appShell;
31
32
  const errorBoundaryFile = files.errorBoundary;
32
33
  const generalSettingsFile = files.generalSettings;
33
- const sidebarProjectHoverCardSourceRowsFile = files.sidebarProjectHoverCardSourceRows;
34
34
  const headerFile = files.header;
35
35
  const threadPageHeaderFile = files.threadPageHeader;
36
36
  const localConversationPageFile = files.localConversationPage;
@@ -40,11 +40,13 @@ function buildCodexPlusPatchSet(config) {
40
40
  const userMessageAttachmentsFile = files.userMessageAttachments;
41
41
  const composerFile = files.composer;
42
42
  const localActiveWorkspaceRootDropdownFile = files.localActiveWorkspaceRootDropdown;
43
+ const homeProjectDropdownFile = files.homeProjectDropdown;
43
44
  const runCommandFile = files.runCommand;
44
45
  const localTaskRowFile = files.localTaskRow;
45
46
  const mermaidDiagramShellFile = files.mermaidDiagramShell;
46
47
  const electronMenuShortcutsFile = files.electronMenuShortcuts;
47
48
  const keyboardShortcutsSearchInputFile = files.keyboardShortcutsSearchInput;
49
+ const statsigStartupFile = files.statsigStartup;
48
50
  const srcFile = files.src;
49
51
  const sidebarThreadKeysFile = files.sidebarThreadKeys;
50
52
  const sidebarThreadRowSignalsFile = files.sidebarThreadRowSignals;
@@ -54,6 +56,15 @@ function patchTitle(text) {
54
56
  return replaceOnce(text, oldTitle, newTitle, `${oldTitle} in ${titleFile}`);
55
57
  }
56
58
 
59
+ function patchDevModeStatsigFallback(text) {
60
+ return replaceOnce(
61
+ text,
62
+ "function Ske(e){let t=(0,J1.c)(27),{auth:n,appVersion:r,currentAccount:i,hostBuildFlavor:a,plan:o,statsigClientKey:s,systemName:c,systemVersion:l,children:u}=e,d=o===void 0?null:o,f=s===void 0?F1:s,p,m,h;if",
63
+ "function Ske(e){let t=(0,J1.c)(27),{auth:n,appVersion:r,currentAccount:i,hostBuildFlavor:a,plan:o,statsigClientKey:s,systemName:c,systemVersion:l,children:u}=e,d=o===void 0?null:o,f=s===void 0?F1:s,p,m,h;if(window.__CodexPlusRuntimeConfig?.devModeStatsigFallback)return u;if",
64
+ "dev mode statsig fallback anchor",
65
+ );
66
+ }
67
+
57
68
  function patchAboutDialog(text, context = {}) {
58
69
  const aboutContext = {
59
70
  patcherRepoUrl: context.patcherRepoUrl || "https://github.com/michaelw/codex-plus-patcher",
@@ -61,6 +72,58 @@ function patchAboutDialog(text, context = {}) {
61
72
  sourceAsarSha256: context.sourceAsarSha256 || "unknown",
62
73
  appliedPatches: context.appliedPatches || [],
63
74
  };
75
+ if (text.includes("function Q4({appDisplayName:e,buildInfoLabel:t,buildInfoText:n,iconDataUrl:r,isDark:i,okLabel:a,title:o})")) {
76
+ let patched = replaceOnce(
77
+ text,
78
+ "let i=a.app.getName(),o=a.app.getVersion()",
79
+ `let CPXAbout=${aboutMetadataRequire()}.aboutPayload(${JSON.stringify(aboutContext)}),i=CPXAbout.appDisplayName,o=a.app.getVersion()`,
80
+ "about dialog app name anchor",
81
+ );
82
+ patched = replaceOnce(
83
+ patched,
84
+ "g=d.formatMessage({messageId:I4,defaultMessage:L4}),_=q4(o),v=_.length===0?h:[h,``,..._].join(`\n`),",
85
+ "g=d.formatMessage({messageId:I4,defaultMessage:L4}),_=CPXAbout.buildInfoLines,v=_.length===0?h:[h,``,..._].join(`\n`),",
86
+ "about dialog build information anchor",
87
+ );
88
+ patched = replaceOnce(
89
+ patched,
90
+ "Q4({appDisplayName:i,buildInfoLabel:g,buildInfoText:v,iconDataUrl:f.htmlIconDataUrl,isDark:b,okLabel:m,title:p})",
91
+ "Q4({appDisplayName:i,buildInfoLabel:g,buildInfoText:v,codexPlusDisclaimerHeading:CPXAbout.disclaimerHeading,codexPlusDisclaimerBody:CPXAbout.disclaimerBody,iconDataUrl:f.htmlIconDataUrl,isDark:b,okLabel:m,title:p})",
92
+ "about dialog renderer call anchor",
93
+ );
94
+ patched = replaceOnce(
95
+ patched,
96
+ "function Q4({appDisplayName:e,buildInfoLabel:t,buildInfoText:n,iconDataUrl:r,isDark:i,okLabel:a,title:o}){let s=r==null?``:",
97
+ "function Q4({appDisplayName:e,buildInfoLabel:t,buildInfoText:n,codexPlusDisclaimerHeading:D,codexPlusDisclaimerBody:O,iconDataUrl:r,isDark:i,okLabel:a,title:o}){let CPXAboutMetadata=" +
98
+ aboutMetadataRequire() +
99
+ ",q=CPXAboutMetadata.disclaimerMarkup({escape:sV.default,heading:D,body:O}),s=r==null?``:",
100
+ "about dialog renderer signature anchor",
101
+ );
102
+ patched = replaceOnce(
103
+ patched,
104
+ " .build-info {\n width: 100%;\n margin: 0;\n line-height: 1.45;",
105
+ "${CPXAboutMetadata.disclaimerStyles()}\n\n .build-info {\n width: 100%;\n margin: 0;\n line-height: 1.45;",
106
+ "about dialog disclaimer styles anchor",
107
+ );
108
+ patched = replaceOnce(
109
+ patched,
110
+ " color: var(--muted-text);\n white-space: pre-wrap;",
111
+ " color: var(--muted-text);\n text-align: left;\n white-space: pre-wrap;",
112
+ "about dialog build info left align anchor",
113
+ );
114
+ patched = replaceOnce(
115
+ patched,
116
+ " .app-name,\n .build-info,\n .copyright {",
117
+ " .app-name,\n .codex-plus-disclaimer,\n .build-info,\n .copyright {",
118
+ "about dialog selectable disclaimer anchor",
119
+ );
120
+ return replaceOnce(
121
+ patched,
122
+ ' <div class="app-name" id="app-name">${(0,sV.default)(e)}</div>\n <pre class="build-info" aria-label="${(0,sV.default)(t)}">${(0,sV.default)(n)}</pre>',
123
+ ' <div class="app-name" id="app-name">${(0,sV.default)(e)}</div>\n ${q}\n <pre class="build-info" aria-label="${(0,sV.default)(t)}">${(0,sV.default)(n)}</pre>',
124
+ "about dialog disclaimer insertion anchor",
125
+ );
126
+ }
64
127
  let patched = replaceOnce(
65
128
  text,
66
129
  "let i=a.app.getName(),o=a.app.getVersion()",
@@ -114,6 +177,32 @@ function patchAboutDialog(text, context = {}) {
114
177
  }
115
178
 
116
179
  function patchWorker(text) {
180
+ if (text.includes("function yae(e,t){return e.queryClient.fetchQuery")) {
181
+ let patched = replaceOnce(
182
+ text,
183
+ "var d2=gG(`git`),",
184
+ 'const CPXW=require("./codex-plus-worker.js"),CPXT=e=>CPXW.traceRequest(e),CPXR=(e,t,n,r)=>CPXW.repositoryTargetsFromHost(e,t,n,r,yae),CPXB=e=>CPXW.isReadOnlyBranchRequest(e?.requestKind,e?.source);var d2=gG(`git`),',
185
+ "worker helper insertion anchor",
186
+ );
187
+ patched = replaceOnce(
188
+ patched,
189
+ "if(!Z0(y)&&!t2(n))return",
190
+ "if(!Z0(y)&&!CPXB(y)&&!t2(n))return",
191
+ "codex plus branch picker git allowlist anchor",
192
+ );
193
+ patched = replaceOnce(
194
+ patched,
195
+ "case`commit-message-diff`:a=X(await o7(nae(e.params.cwd,e.params.includeUnstaged,this.gitManager,r),t.signal));break;case`submodule-paths`:a=X({paths:await yae(this.gitManager.getWorktreeRepositoryForRoot(e.params.root,r),t.signal)});break;",
196
+ "case`commit-message-diff`:a=X(await o7(nae(e.params.cwd,e.params.includeUnstaged,this.gitManager,r),t.signal));break;case`codex-plus-trace`:a=X(CPXT(e.params));break;case`repository-targets`:a=X(await CPXR(this.gitManager,e.params,r,t.signal));break;case`submodule-paths`:a=X({paths:await yae(this.gitManager.getWorktreeRepositoryForRoot(e.params.root,r),t.signal)});break;",
197
+ "repository-targets worker switch anchor",
198
+ );
199
+ return replaceOnce(
200
+ patched,
201
+ "case`review-patch`:case`commit-message-diff`:case`submodule-paths`:case`cat-file`:",
202
+ "case`review-patch`:case`commit-message-diff`:case`codex-plus-trace`:case`repository-targets`:case`submodule-paths`:case`cat-file`:",
203
+ "repository-targets worker readonly method anchor",
204
+ );
205
+ }
117
206
  let patched = replaceOnce(
118
207
  text,
119
208
  "function pae(e,t){return e.queryClient.fetchQuery",
@@ -141,6 +230,20 @@ function patchWorker(text) {
141
230
  }
142
231
 
143
232
  function patchThreadSidePanelTabs(text) {
233
+ if (text.includes("function oDn(e){let t=(0,sDn.c)(14),{expandedActionsPortalTarget:n,setTabState:r,tabState:i}=e")) {
234
+ let patched = replaceOnce(
235
+ text,
236
+ "function oDn(e){let t=(0,sDn.c)(14),{expandedActionsPortalTarget:n,setTabState:r,tabState:i}=e",
237
+ `${reviewHook("[JX,typeof PJ!==`undefined`?PJ:null,Kn,Nn,Xd,SA,CA,wA,null,Fe,Ue,cxn,null,null,null,null,null,null,null,typeof yA!==`undefined`?yA:null,typeof Gcn!==`undefined`?Gcn:null]")}function oDn(e){let t=(0,sDn.c)(14),{expandedActionsPortalTarget:n,setTabState:r,tabState:i}=e`,
238
+ "review host hook insertion anchor",
239
+ );
240
+ return replaceOnce(
241
+ patched,
242
+ "let s;t[1]!==a||t[2]!==r||t[3]!==i?(s=(0,JX.jsx)(cxn,{diffMode:a,setTabState:r,tabState:i}),t[1]=a,t[2]=r,t[3]=i,t[4]=s):s=t[4];let c;",
243
+ "let s;t[1]!==a||t[2]!==r||t[3]!==i?(s=(0,JX.jsx)(CPXRM,{mainReviewContent:(0,JX.jsx)(cxn,{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;",
244
+ "review body mux anchor",
245
+ );
246
+ }
144
247
  let patched = replaceOnce(
145
248
  text,
146
249
  "import{r as vi,t as yi}from\"./dropdown-CTBRoADH.js\";",
@@ -161,6 +264,26 @@ function patchThreadSidePanelTabs(text) {
161
264
  );
162
265
  }
163
266
  function patchAppShell(text) {
267
+ if (text.includes("function xdn(e){let t=(0,Cdn.c)(4),{onRetry:n}=e")) {
268
+ let patched = replaceOnce(
269
+ text,
270
+ "function xdn(e){let t=(0,Cdn.c)(4),{onRetry:n}=e",
271
+ `${diagnosticDetailsHook()}function xdn(e){let t=(0,Cdn.c)(4),{onRetry:n,error:CPX_error}=e`,
272
+ "app shell error fallback prop anchor",
273
+ );
274
+ patched = replaceOnce(
275
+ patched,
276
+ "children:[r,(0,NK.jsx)(Ud,{color:`secondary`,size:`default`,onClick:n,children:i})]",
277
+ "children:[r,CPXDiagnosticDetails({jsx:NK.jsx,error:CPX_error}),(0,NK.jsx)(Ud,{color:`secondary`,size:`default`,onClick:n,children:i})]",
278
+ "app shell error detail insertion anchor",
279
+ );
280
+ return replaceOnce(
281
+ patched,
282
+ "fallback:e=>(0,NK.jsx)(xdn,{onRetry:()=>{e.resetError()}})",
283
+ "fallback:e=>(0,NK.jsx)(xdn,{error:e.error,onRetry:()=>{e.resetError()}})",
284
+ "app shell boundary error prop anchor",
285
+ );
286
+ }
164
287
  let patched = replaceOnce(
165
288
  text,
166
289
  "function En(e){return(0,Q.jsx)(wn,{onRetry:()=>{e.resetError()}})}",
@@ -173,21 +296,16 @@ function patchAppShell(text) {
173
296
  "children:[r,CPXDiagnosticDetails({jsx:Q.jsx,error:e.error}),(0,Q.jsx)(Le,{color:`secondary`,size:`default`,onClick:n,children:i})]",
174
297
  "app shell error detail insertion anchor",
175
298
  );
176
- patched = replaceOnce(
177
- patched,
178
- "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:",
179
- "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:",
180
- "app shell error cache condition anchor",
181
- );
182
- return replaceOnce(
183
- patched,
184
- "}),t[2]=n,t[3]=a),a}function Tn(e){return e.composedPath().some",
185
- "}),t[2]=n,t[3]=e.error,t[4]=a),a}function Tn(e){return e.composedPath().some",
186
- "app shell error cache assignment anchor",
187
- );
299
+ return patched;
188
300
  }
189
301
 
190
302
  function patchErrorBoundary(text) {
303
+ if (
304
+ !text.includes("function Xf(e){let t=(0,Vf.c)(9),{resetError:n}=e,r=ee(),i,a;") &&
305
+ text.includes("function xdn(e){let t=(0,Cdn.c)(")
306
+ ) {
307
+ return text;
308
+ }
191
309
  let patched = replaceOnce(
192
310
  text,
193
311
  "function Xf(e){let t=(0,Vf.c)(9),{resetError:n}=e,r=ee(),i,a;",
@@ -209,58 +327,62 @@ function patchErrorBoundary(text) {
209
327
  }
210
328
 
211
329
  function patchAppMainProjectColors(text) {
330
+ if (text.includes("function gg(e){let t=(0,Rg.c)(44),{threadKeys:n,")) {
331
+ let patched = replaceOnce(
332
+ text,
333
+ "function gg(e){let t=(0,Rg.c)(44),",
334
+ `${projectColorHook()}function gg(e){let t=(0,Rg.c)(44),`,
335
+ "project color app main helper insertion anchor",
336
+ );
337
+ patched = replaceOnce(
338
+ patched,
339
+ "X=(0,$.jsx)(`div`,{...H,children:ne})",
340
+ "X=(0,$.jsx)(`div`,{...H,...CPXPR(a),children:ne})",
341
+ "project group color render anchor",
342
+ );
343
+ return replaceOnce(
344
+ patched,
345
+ "(te=(0,Fh.jsxs)(`div`,{...v,...O,ref:n,className:j,role:`button`,tabIndex:M,",
346
+ "(te=(0,Fh.jsxs)(`div`,{...v,...O,...CPXPR({projectId:_,label:p}),ref:n,className:j,role:`button`,tabIndex:M,",
347
+ "current project header row color attributes anchor",
348
+ );
349
+ }
212
350
  let patched = replaceOnce(
213
351
  text,
214
352
  "function Pk(e){let t=(0,Q.c)(45),",
215
- `${projectColorHook()}function Pk(e){let t=(0,Q.c)(46),`,
353
+ `${projectColorHook()}function Pk(e){let t=(0,Q.c)(45),`,
216
354
  "project color app main helper insertion anchor",
217
355
  );
218
356
  patched = replaceOnce(
219
357
  patched,
220
- "H=Ha.sidebarProjectList({projectId:i.projectId,showAll:x})",
221
- "H=Ha.sidebarProjectList({projectId:i.projectId,showAll:x})",
222
- "project group color marker anchor",
223
- );
224
- patched = replaceOnce(
225
- patched,
226
- "q={onActivateGroup:V,onStartNewConversation:a,isGrouped:!0,hideRemoteHostEnvIcon:!0,hideTimestamp:l,locationId:b,floatStatusIconsRight:s,showPinActionOnHover:o}",
227
- "q={onActivateGroup:V,onStartNewConversation:a,isGrouped:!0,hideRemoteHostEnvIcon:!0,hideTimestamp:l,locationId:b,floatStatusIconsRight:s,showPinActionOnHover:o,dataAttributes:CPXTR(i)}",
228
- "project thread row color key anchor",
229
- );
230
- patched = replaceOnce(
231
- patched,
232
- "t[19]!==V||t[20]!==s||t[21]!==l||t[22]!==b||t[23]!==o||t[24]!==a?",
233
- "t[19]!==V||t[20]!==s||t[21]!==l||t[22]!==b||t[23]!==o||t[24]!==a||t[45]!==i?",
234
- "project thread row color cache dependency anchor",
235
- );
236
- patched = replaceOnce(
237
- patched,
238
- "t[19]=V,t[20]=s,t[21]=l,t[22]=b,t[23]=o,t[24]=a,t[25]=q):q=t[25]",
239
- "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]",
240
- "project thread row color cache write anchor",
241
- );
242
- patched = replaceOnce(
243
- patched,
244
- "ie=(0,Z.jsx)(`div`,{...H,children:re})",
245
358
  "ie=(0,Z.jsx)(`div`,{...H,children:re})",
359
+ "ie=(0,Z.jsx)(`div`,{...H,...CPXPR(i),children:re})",
246
360
  "project group color render anchor",
247
361
  );
248
- patched = replaceOnce(
249
- patched,
250
- "O=(0,Z.jsx)(NO,{action:T,actionTooltipContent:h,actionTooltipDisabled:p,indicator:E,isMenuOpen:g,menu:D})",
251
- "O=(0,Z.jsx)(NO,{action:T,actionTooltipContent:h,actionTooltipDisabled:p,indicator:E,isMenuOpen:g,menu:D})",
252
- "project header action render anchor",
253
- );
254
362
  patched = replaceOnce(
255
363
  patched,
256
364
  "Ke=(0,Z.jsx)(Oe,{rowAttributes:ke,className:Ae,collapsed:L,contentClassName:je,",
257
365
  "Ke=(0,Z.jsx)(Oe,{rowAttributes:{...ke,...CPXPR(n)},className:Ae,collapsed:L,contentClassName:je,",
258
366
  "project header row color attributes anchor",
259
367
  );
368
+ patched = replaceOnce(
369
+ patched,
370
+ "(te=(0,Fh.jsxs)(`div`,{...v,...O,ref:n,className:j,role:`button`,tabIndex:M,",
371
+ "(te=(0,Fh.jsxs)(`div`,{...v,...O,...CPXPR({projectId:_,label:p}),ref:n,className:j,role:`button`,tabIndex:M,",
372
+ "current project header row color attributes anchor",
373
+ );
260
374
  return patched;
261
375
  }
262
376
 
263
377
  function patchAppMainSidebarBlur(text) {
378
+ if (!text.includes("openFolder:$y,toggleSidebar:$i,toggleTerminal:Md,")) {
379
+ return replaceOnce(
380
+ text,
381
+ "se=(0,$.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2 whitespace-nowrap`,children:(0,$.jsx)(lg,{label:O,labelEnd:ae,labelTooltipContent:oe})})",
382
+ "se=(0,$.jsx)(`span`,{\"data-codex-plus-sidebar-name\":``,className:`flex min-w-0 flex-1 items-center gap-2 whitespace-nowrap`,children:(0,$.jsx)(lg,{label:O,labelEnd:ae,labelTooltipContent:oe})})",
383
+ "project header sidebar blur label anchor",
384
+ );
385
+ }
264
386
  let patched = text;
265
387
  patched = replaceOnce(
266
388
  patched,
@@ -282,113 +404,21 @@ function patchAppMainSidebarBlur(text) {
282
404
  );
283
405
  }
284
406
 
285
- function patchSidebarProjectHoverCardSourceRows(text) {
286
- let patched = text;
287
- patched = replaceOnce(
288
- patched,
289
- "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,",
290
- "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,",
291
- "sidebar row component data attributes prop anchor",
292
- );
293
- patched = replaceOnce(
294
- patched,
295
- "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?",
296
- "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?",
297
- "sidebar row component data attributes memo dependency anchor",
298
- );
299
- patched = replaceOnce(
300
- patched,
301
- "onArchiveStart:L,onArchiveSuccess:z,onArchiveError:B}",
302
- "onArchiveStart:L,onArchiveSuccess:z,onArchiveError:B,dataAttributes:CPX_rowDataAttributes}",
303
- "sidebar row component data attributes object anchor",
304
- );
305
- patched = replaceOnce(
306
- patched,
307
- "t[32]=w,t[33]=V,t[34]=T,t[35]=H):H=t[35]",
308
- "t[32]=w,t[33]=V,t[34]=T,t[40]=CPX_rowDataAttributes,t[35]=H):H=t[35]",
309
- "sidebar row component data attributes memo write anchor",
310
- );
311
- patched = replaceOnce(
312
- patched,
313
- "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,",
314
- "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,",
315
- "sidebar row dispatcher data attributes prop anchor",
316
- );
317
- patched = replaceOnce(
318
- patched,
319
- "dataAttributes:ae.sidebarThreadRow({active:s,hostId:t.hostId,id:n,kind:`pending-worktree`,pinned:r,title:t.label})",
320
- `dataAttributes:${sidebarMergeDataAttributes("ae.sidebarThreadRow({active:s,hostId:t.hostId,id:n,kind:`pending-worktree`,pinned:r,title:t.label})", "CPX_rowDataAttributes")}`,
321
- "pending worktree sidebar row data attributes merge anchor",
322
- );
323
- patched = replaceOnce(
324
- patched,
325
- "dataAttributes:ae.sidebarThreadRow({active:s,hostId:null,id:t,kind:`remote`,pinned:r,title:e.task.title??``})",
326
- `dataAttributes:${sidebarMergeDataAttributes("ae.sidebarThreadRow({active:s,hostId:null,id:t,kind:`remote`,pinned:r,title:e.task.title??``})", "CPX_rowDataAttributes")}`,
327
- "remote sidebar row data attributes merge anchor",
328
- );
329
- patched = replaceOnce(
330
- patched,
331
- "dataAttributes:ae.sidebarThreadRow({active:s,hostId:f,id:i,kind:`local`,pinned:r,title:x})",
332
- `dataAttributes:${sidebarMergeDataAttributes("ae.sidebarThreadRow({active:s,hostId:f,id:i,kind:`local`,pinned:r,title:x})", "CPX_rowDataAttributes")}`,
333
- "local sidebar row data attributes merge anchor",
334
- );
335
- patched = replaceOnce(
336
- patched,
337
- "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]",
338
- "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]",
339
- "pending worktree sidebar row data attributes memo write anchor",
340
- );
341
- patched = replaceOnce(
342
- patched,
343
- "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?",
344
- "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?",
345
- "remote sidebar row data attributes memo dependency anchor",
346
- );
347
- patched = replaceOnce(
348
- patched,
349
- "t[63]=W,t[64]=Xe,t[65]=et,t[66]=H,t[67]=U,t[68]=ht):ht=t[68]",
350
- "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]",
351
- "remote sidebar row data attributes memo write anchor",
352
- );
353
- patched = replaceOnce(
354
- patched,
355
- "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?",
356
- "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?",
357
- "local sidebar row data attributes memo dependency anchor",
358
- );
359
- patched = replaceOnce(
360
- patched,
361
- "t[108]=H,t[109]=be,t[110]=U,t[111]=vt):vt=t[111]",
362
- "t[108]=H,t[109]=be,t[110]=U,t[123]=CPX_rowDataAttributes,t[111]=vt):vt=t[111]",
363
- "local sidebar row data attributes memo write anchor",
364
- );
365
- patched = replaceOnce(
366
- patched,
367
- "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?",
368
- "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?",
369
- "thread list row options data attributes memo dependency anchor",
370
- );
371
- patched = replaceOnce(
372
- patched,
373
- "showPinActionOnHover:l?.showPinActionOnHover,variant:l?.variant,shortcutLabel:b?.get(e)}),",
374
- "showPinActionOnHover:l?.showPinActionOnHover,variant:l?.variant,shortcutLabel:b?.get(e),dataAttributes:l?.dataAttributes}),",
375
- "thread list row options data attributes prop anchor",
376
- );
377
- patched = replaceOnce(
378
- patched,
379
- "t[24]=l?.variant,t[25]=b,t[26]=j):j=t[26]",
380
- "t[24]=l?.variant,t[25]=b,t[43]=l?.dataAttributes,t[26]=j):j=t[26]",
381
- "thread list row options data attributes memo write anchor",
382
- );
383
- return replaceOnce(
384
- patched,
385
- "function Rn(e){let t=(0,zt.c)(43),",
386
- "function Rn(e){let t=(0,zt.c)(44),",
387
- "thread list memo cache size anchor",
388
- );
389
- }
390
-
391
407
  function patchHeader(text) {
408
+ if (text.includes("function Jn(e){let t=(0,$n.c)(66),")) {
409
+ let patched = replaceOnce(
410
+ text,
411
+ "function Jn(e){let t=(0,$n.c)(66),",
412
+ `${threadHeaderHook()}function Jn(e){let t=(0,$n.c)(66),`,
413
+ "thread header accessory helper insertion anchor",
414
+ );
415
+ return replaceOnce(
416
+ patched,
417
+ "let x;t[35]!==c||t[36]!==g||t[37]!==i?(x=(0,$.jsx)(`div`,{className:`mr-3 line-clamp-1 flex min-w-0 flex-1 items-center gap-1 truncate`,style:{viewTransitionName:`header-title`},children:i?(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,$.jsx)(Qn,{onClick:c}),(0,$.jsx)(q,{color:`ghostActive`,type:`button`,onClick:u,className:`min-w-0 flex-1 truncate !px-0 !py-0 text-left text-sm text-token-foreground hover:!bg-transparent hover:opacity-80 electron:font-medium`,children:(0,$.jsx)(`span`,{className:`truncate`,children:i})})]}):(0,$.jsx)(`span`,{className:`text-token-description-foreground`,children:(0,$.jsx)(Zn,{mergedTasks:g,onBack:c,showBackButton:!0})})}),t[35]=c,t[36]=g,t[37]=i,t[38]=x):x=t[38];",
418
+ "let CPX_headerContext={cwd:null,hostId:null,header:{surface:`header`,titleText:typeof i==`string`?i:null}},CPX_headerAccessories=CPXThreadHeaderAccessories({context:CPX_headerContext,deps:{jsx:$.jsx,jsxs:$.jsxs,Tooltip:me}});let x;t[35]!==c||t[36]!==g||t[37]!==i?(x=(0,$.jsx)(`div`,{className:`mr-3 line-clamp-1 flex min-w-0 flex-1 items-center gap-1 truncate`,style:{viewTransitionName:`header-title`},children:i?(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,$.jsx)(Qn,{onClick:c}),(0,$.jsx)(q,{color:`ghostActive`,type:`button`,onClick:u,className:`min-w-0 flex-1 truncate !px-0 !py-0 text-left text-sm text-token-foreground hover:!bg-transparent hover:opacity-80 electron:font-medium`,children:(0,$.jsx)(`span`,{className:`truncate`,children:i})}),CPX_headerAccessories]}):(0,$.jsx)(`span`,{className:`text-token-description-foreground`,children:(0,$.jsx)(Zn,{mergedTasks:g,onBack:c,showBackButton:!0})})}),t[35]=c,t[36]=g,t[37]=i,t[38]=x):x=t[38];",
419
+ "thread header accessory render anchor",
420
+ );
421
+ }
392
422
  let patched = replaceOnce(
393
423
  text,
394
424
  `import{Z as r,a as i,s as a}from"./app-scope-CWE-zIhQ.js";`,
@@ -410,21 +440,15 @@ function patchHeader(text) {
410
440
  patched = replaceOnce(
411
441
  patched,
412
442
  "function lt(e){let t=(0,Z.c)(68),",
413
- `${threadHeaderHook()}function lt(e){let t=(0,Z.c)(72),`,
443
+ `${threadHeaderHook()}function lt(e){let t=(0,Z.c)(68),`,
414
444
  "thread header accessory helper insertion anchor",
415
445
  );
416
446
  patched = replaceOnce(
417
447
  patched,
418
448
  "let C;t[36]!==c||t[37]!==g||t[38]!==i?(C=(0,Q.jsx)(`div`,{className:`mr-3 line-clamp-1 flex min-w-0 flex-1 items-center gap-1 truncate`,style:{viewTransitionName:`header-title`},children:i?(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,Q.jsx)(mt,{onClick:c}),(0,Q.jsx)(x,{color:`ghostActive`,type:`button`,onClick:u,className:`min-w-0 flex-1 truncate !px-0 !py-0 text-left text-sm text-token-foreground hover:!bg-transparent hover:opacity-80 electron:font-medium`,children:(0,Q.jsx)(`span`,{className:`truncate`,children:i})})]}):(0,Q.jsx)(`span`,{className:`text-token-description-foreground`,children:(0,Q.jsx)(pt,{mergedTasks:g,onBack:c,showBackButton:!0})})}),t[36]=c,t[37]=g,t[38]=i,t[39]=C):C=t[39];",
419
- "let CPX_headerContext={cwd:CPX_readAtom(CPX_headerCwd),hostId:CPX_readAtom(CPX_headerHostId)},CPX_headerAccessories=CPXThreadHeaderAccessories({context:CPX_headerContext,deps:{jsx:Q.jsx,jsxs:Q.jsxs,Tooltip:CPX_Tooltip}});let C;t[36]!==c||t[37]!==g||t[38]!==i||t[68]!==CPX_headerAccessories?(C=(0,Q.jsx)(`div`,{className:`mr-3 line-clamp-1 flex min-w-0 flex-1 items-center gap-1 truncate`,style:{viewTransitionName:`header-title`},children:i?(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,Q.jsx)(mt,{onClick:c}),(0,Q.jsx)(x,{color:`ghostActive`,type:`button`,onClick:u,className:`min-w-0 flex-1 truncate !px-0 !py-0 text-left text-sm text-token-foreground hover:!bg-transparent hover:opacity-80 electron:font-medium`,children:(0,Q.jsx)(`span`,{className:`truncate`,children:i})}),CPX_headerAccessories]}):(0,Q.jsx)(`span`,{className:`text-token-description-foreground`,children:(0,Q.jsx)(pt,{mergedTasks:g,onBack:c,showBackButton:!0})})}),t[36]=c,t[37]=g,t[38]=i,t[68]=CPX_headerAccessories,t[39]=C):C=t[39];",
449
+ "let CPX_headerContext={cwd:CPX_readAtom(CPX_headerCwd),hostId:CPX_readAtom(CPX_headerHostId)},CPX_headerAccessories=CPXThreadHeaderAccessories({context:CPX_headerContext,deps:{jsx:Q.jsx,jsxs:Q.jsxs,Tooltip:CPX_Tooltip}});let C;t[36]!==c||t[37]!==g||t[38]!==i?(C=(0,Q.jsx)(`div`,{className:`mr-3 line-clamp-1 flex min-w-0 flex-1 items-center gap-1 truncate`,style:{viewTransitionName:`header-title`},children:i?(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,Q.jsx)(mt,{onClick:c}),(0,Q.jsx)(x,{color:`ghostActive`,type:`button`,onClick:u,className:`min-w-0 flex-1 truncate !px-0 !py-0 text-left text-sm text-token-foreground hover:!bg-transparent hover:opacity-80 electron:font-medium`,children:(0,Q.jsx)(`span`,{className:`truncate`,children:i})}),CPX_headerAccessories]}):(0,Q.jsx)(`span`,{className:`text-token-description-foreground`,children:(0,Q.jsx)(pt,{mergedTasks:g,onBack:c,showBackButton:!0})})}),t[36]=c,t[37]=g,t[38]=i,t[39]=C):C=t[39];",
420
450
  "thread header accessory render anchor",
421
451
  );
422
- patched = replaceOnce(
423
- patched,
424
- "t[53]!==A||t[54]!==b||t[55]!==S||t[56]!==C?(M=(0,Q.jsxs)(`div`,{className:b,children:[S,C,A]}),t[53]=A,t[54]=b,t[55]=S,t[56]=C,t[57]=M):M=t[57]",
425
- "t[53]!==A||t[54]!==b||t[55]!==S||t[56]!==C?(M=(0,Q.jsxs)(`div`,{className:b,children:[S,C,A]}),t[53]=A,t[54]=b,t[55]=S,t[56]=C,t[57]=M):M=t[57]",
426
- "thread header accessory mount anchor",
427
- );
428
452
  return patched;
429
453
  }
430
454
 
@@ -433,47 +457,87 @@ function patchThreadPageHeader(text) {
433
457
  patched = replaceOnce(
434
458
  patched,
435
459
  "function c(e){let t=(0,o.c)(21),",
436
- `${threadHeaderHook()}function c(e){let t=(0,o.c)(24),`,
460
+ `${threadHeaderHook()}function c(e){let t=(0,o.c)(21),`,
437
461
  "thread page header helper insertion anchor",
438
462
  );
439
463
  patched = replaceOnce(
440
464
  patched,
441
- "let t=(0,o.c)(24),{start:c,startActions:l,env:u,secondary:d,trailing:f,hostConfig:p}=e,m;",
442
- "let t=(0,o.c)(24),{start:c,startActions:l,env:u,secondary:d,trailing:f,hostConfig:p,cwd:CPX_headerCwd}=e,CPX_headerContext={cwd:CPX_headerCwd,hostId:p?.id??null,header:{env:u,hostDisplayName:p?.display_name??null,startText:typeof c==`string`?c:null,secondaryText:typeof d==`string`?d:null,hasTrailing:f!=null}},CPX_headerAccessories=CPXThreadHeaderAccessories({context:CPX_headerContext,deps:{jsx:s.jsx,jsxs:s.jsxs}}),m;",
465
+ "let t=(0,o.c)(21),{start:c,startActions:l,env:u,secondary:d,trailing:f,hostConfig:p}=e,m;",
466
+ "let t=(0,o.c)(21),{start:c,startActions:l,env:u,secondary:d,trailing:f,hostConfig:p,cwd:CPX_headerCwd}=e,CPX_headerContext={cwd:CPX_headerCwd,hostId:p?.id??null,header:{env:u,hostDisplayName:p?.display_name??null,startText:typeof c==`string`?c:null,secondaryText:typeof d==`string`?d:null,hasTrailing:f!=null}},CPX_headerAccessories=CPXThreadHeaderAccessories({context:CPX_headerContext,deps:{jsx:s.jsx,jsxs:s.jsxs}}),m;",
443
467
  "thread page header accessory render anchor",
444
468
  );
445
469
  patched = replaceOnce(
446
470
  patched,
447
471
  "t[8]!==l||t[9]!==v||t[10]!==y||t[11]!==b?(x=(0,s.jsxs)(`div`,{className:`text-md flex min-w-0 items-center gap-2 truncate text-base electron:font-medium`,children:[v,y,b,l]}),t[8]=l,t[9]=v,t[10]=y,t[11]=b,t[12]=x):x=t[12]",
448
- "t[8]!==l||t[9]!==v||t[10]!==y||t[11]!==b||t[21]!==CPX_headerAccessories?(x=(0,s.jsxs)(`div`,{className:`text-md flex min-w-0 items-center gap-2 truncate text-base electron:font-medium`,children:[v,y,b,CPX_headerAccessories,l]}),t[8]=l,t[9]=v,t[10]=y,t[11]=b,t[21]=CPX_headerAccessories,t[12]=x):x=t[12]",
472
+ "t[8]!==l||t[9]!==v||t[10]!==y||t[11]!==b?(x=(0,s.jsxs)(`div`,{className:`text-md flex min-w-0 items-center gap-2 truncate text-base electron:font-medium`,children:[v,y,b,CPX_headerAccessories,l]}),t[8]=l,t[9]=v,t[10]=y,t[11]=b,t[12]=x):x=t[12]",
449
473
  "thread page header accessory mount anchor",
450
474
  );
451
475
  return patched;
452
476
  }
453
477
 
454
478
  function patchLocalConversationPageHeader(text) {
479
+ if (text.includes("function mi(e){let t=(0,U.c)(32),")) {
480
+ let patched = replaceOnce(
481
+ text,
482
+ "function mi(e){let t=(0,U.c)(32),",
483
+ `${threadHeaderHook()}function mi(e){let t=(0,U.c)(32),`,
484
+ "local conversation header helper insertion anchor",
485
+ );
486
+ patched = replaceOnce(
487
+ patched,
488
+ "let t=(0,U.c)(32),{conversationId:n,getConversationMarkdown:r,markdownParentConversationId:i,projectIcon:a,projectHoverCardContent:s,projectName:c,title:l,titleSuffix:u,cwd:d,canPin:f,hideForkActions:p}=e,g=f===void 0?!0:f,_=N(),v=h(),y;",
489
+ "let t=(0,U.c)(32),{conversationId:n,getConversationMarkdown:r,markdownParentConversationId:i,projectIcon:a,projectHoverCardContent:s,projectName:c,title:l,titleSuffix:u,cwd:d,canPin:f,hideForkActions:p}=e,CPX_headerContext={cwd:d,hostId:null,header:{surface:`local-conversation`,titleText:typeof l==`string`?l:null,projectName:c??null}},CPX_headerAccessories=CPXThreadHeaderAccessories({context:CPX_headerContext,deps:{jsx:W.jsx,jsxs:W.jsxs,Tooltip:wt}}),g=f===void 0?!0:f,_=N(),v=h(),y;",
490
+ "local conversation header accessory render anchor",
491
+ );
492
+ patched = replaceOnce(
493
+ patched,
494
+ "let O;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(O=null,t[26]=O):O=t[26];",
495
+ "let O=CPX_headerAccessories;",
496
+ "local conversation header accessory slot anchor",
497
+ );
498
+ return replaceOnce(
499
+ patched,
500
+ "let k;return t[27]!==C||t[28]!==T||t[29]!==E||t[30]!==D?(k=(0,W.jsx)(`div`,{className:`draggable grid w-full min-w-0 grid-cols-[minmax(0,1fr)] items-center gap-x-4 electron:h-toolbar extension:py-row-y`,children:(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 truncate text-base electron:font-medium`,children:[C,T,E,D,O]})}),t[27]=C,t[28]=T,t[29]=E,t[30]=D,t[31]=k):k=t[31],k}",
501
+ "let k;return t[27]!==C||t[28]!==T||t[29]!==E||t[30]!==D?(k=(0,W.jsx)(`div`,{className:`draggable grid w-full min-w-0 grid-cols-[minmax(0,1fr)] items-center gap-x-4 electron:h-toolbar extension:py-row-y`,children:(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 truncate text-base electron:font-medium`,children:[C,T,E,D,O]})}),t[27]=C,t[28]=T,t[29]=E,t[30]=D,t[31]=k):k=t[31],k}",
502
+ "local conversation header accessory mount anchor",
503
+ );
504
+ }
455
505
  let patched = replaceOnce(
456
506
  text,
457
507
  "function Tt(e){let t=(0,Y.c)(42),",
458
- `${threadHeaderHook()}function Tt(e){let t=(0,Y.c)(45),`,
508
+ `${threadHeaderHook()}function Tt(e){let t=(0,Y.c)(42),`,
459
509
  "local conversation header helper insertion anchor",
460
510
  );
461
511
  patched = replaceOnce(
462
512
  patched,
463
- "let t=(0,Y.c)(45),{conversationId:n,getConversationMarkdown:r,markdownParentConversationId:a,title:o,titleSuffix:s,cwd:c,canPin:l,hideProjectMetadata:d,hideForkActions:f}=e,p=l===void 0?!0:l,m=d===void 0?!1:d,h=A(),g;",
464
- "let t=(0,Y.c)(45),{conversationId:n,getConversationMarkdown:r,markdownParentConversationId:a,title:o,titleSuffix:s,cwd:c,canPin:l,hideProjectMetadata:d,hideForkActions:f}=e,CPX_headerContext={cwd:c,hostId:u(i(O,n)).id,header:{surface:`local-conversation`,titleText:typeof o==`string`?o:null}},CPX_headerAccessories=CPXThreadHeaderAccessories({context:CPX_headerContext,deps:{jsx:Z.jsx,jsxs:Z.jsxs}}),p=l===void 0?!0:l,m=d===void 0?!1:d,h=A(),g;",
513
+ "let t=(0,Y.c)(42),{conversationId:n,getConversationMarkdown:r,markdownParentConversationId:a,title:o,titleSuffix:s,cwd:c,canPin:l,hideProjectMetadata:d,hideForkActions:f}=e,p=l===void 0?!0:l,m=d===void 0?!1:d,h=A(),g;",
514
+ "let t=(0,Y.c)(42),{conversationId:n,getConversationMarkdown:r,markdownParentConversationId:a,title:o,titleSuffix:s,cwd:c,canPin:l,hideProjectMetadata:d,hideForkActions:f}=e,CPX_headerContext={cwd:c,hostId:u(i(O,n)).id,header:{surface:`local-conversation`,titleText:typeof o==`string`?o:null}},CPX_headerAccessories=CPXThreadHeaderAccessories({context:CPX_headerContext,deps:{jsx:Z.jsx,jsxs:Z.jsxs}}),p=l===void 0?!0:l,m=d===void 0?!1:d,h=A(),g;",
465
515
  "local conversation header accessory render anchor",
466
516
  );
467
517
  patched = replaceOnce(
468
518
  patched,
469
519
  "t[38]!==F||t[39]!==I||t[40]!==L?(z=(0,Z.jsx)(`div`,{className:`draggable grid w-full min-w-0 grid-cols-[minmax(0,1fr)] items-center gap-x-4 electron:h-toolbar extension:py-row-y`,children:(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 truncate text-base electron:font-medium`,children:[F,I,L,R]})}),t[38]=F,t[39]=I,t[40]=L,t[41]=z):z=t[41]",
470
- "t[38]!==F||t[39]!==I||t[40]!==L||t[42]!==CPX_headerAccessories?(z=(0,Z.jsx)(`div`,{className:`draggable grid w-full min-w-0 grid-cols-[minmax(0,1fr)] items-center gap-x-4 electron:h-toolbar extension:py-row-y`,children:(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 truncate text-base electron:font-medium`,children:[F,I,L,CPX_headerAccessories,R]})}),t[38]=F,t[39]=I,t[40]=L,t[42]=CPX_headerAccessories,t[41]=z):z=t[41]",
520
+ "t[38]!==F||t[39]!==I||t[40]!==L?(z=(0,Z.jsx)(`div`,{className:`draggable grid w-full min-w-0 grid-cols-[minmax(0,1fr)] items-center gap-x-4 electron:h-toolbar extension:py-row-y`,children:(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 truncate text-base electron:font-medium`,children:[F,I,L,CPX_headerAccessories,R]})}),t[38]=F,t[39]=I,t[40]=L,t[41]=z):z=t[41]",
471
521
  "local conversation header accessory mount anchor",
472
522
  );
473
523
  return patched;
474
524
  }
475
525
 
476
526
  function patchGeneralSettingsUserBubbleColors(text) {
527
+ if (text.includes("function Lr({showCodeFont:e,showTranslucentSidebarToggle:t,variant:n}){")) {
528
+ let patched = replaceOnce(
529
+ text,
530
+ "function Lr({showCodeFont:e,showTranslucentSidebarToggle:t,variant:n}){",
531
+ `${appearanceSettingsHook("{React:ti,jsx:J.jsx,SettingRow:L,ColorInput:Hr,Switch:Ze}")}function Lr({showCodeFont:e,showTranslucentSidebarToggle:t,variant:n}){`,
532
+ "user bubble settings helper insertion anchor",
533
+ );
534
+ return replaceOnce(
535
+ patched,
536
+ "children:[T.map(e=>(0,J.jsx)(L,{control:(0,J.jsx)(Hr,{ariaLabel:e.ariaLabel,value:y[e.role],onChange:t=>{k(e.role,t)}}),label:e.label,variant:`nested`},e.role)),E.map",
537
+ "children:[T.map(e=>(0,J.jsx)(L,{control:(0,J.jsx)(Hr,{ariaLabel:e.ariaLabel,value:y[e.role],onChange:t=>{k(e.role,t)}}),label:e.label,variant:`nested`},e.role)),...CPXAppearanceRows(n),E.map",
538
+ "user bubble settings row anchor",
539
+ );
540
+ }
477
541
  let patched = replaceOnce(
478
542
  text,
479
543
  "function tn({showCodeFont:e,showTranslucentSidebarToggle:t,variant:n}){",
@@ -489,6 +553,26 @@ function patchGeneralSettingsUserBubbleColors(text) {
489
553
  }
490
554
 
491
555
  function patchUserMessageAttachmentsBubbleColors(text) {
556
+ if (text.includes("function qVn({cwd:e,hostId:t,initialMessage:n,onCancel:r,onDraftChange:i,onSubmit:a}){")) {
557
+ let patched = replaceOnce(
558
+ text,
559
+ "function qVn({cwd:e,hostId:t,initialMessage:n,onCancel:r,onDraftChange:i,onSubmit:a}){",
560
+ `${messageComposerHook()}function qVn({cwd:e,hostId:t,initialMessage:n,onCancel:r,onDraftChange:i,onSubmit:a}){`,
561
+ "user bubble helper insertion anchor",
562
+ );
563
+ patched = replaceOnce(
564
+ patched,
565
+ "return(0,b1.jsx)(`form`,{className:`relative flex w-full flex-col rounded-3xl bg-token-foreground/5`,onSubmit:e=>{e.preventDefault(),v()},children:",
566
+ "return(0,b1.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:",
567
+ "edit user message entry marker anchor",
568
+ );
569
+ return replaceOnce(
570
+ patched,
571
+ "me=B?(0,S1.jsx)(`div`,{className:`w-full p-px`,children:(0,S1.jsx)(qVn,{cwd:x??null,hostId:S,initialMessage:z.trim(),onCancel:()=>{ie(null)},onDraftChange:e=>{ie(e)},onSubmit:oe})}):G?(0,S1.jsx)(`div`,{\"data-user-message-bubble\":!0,role:I?`button`:void 0,tabIndex:0,className:Y(e,`text-left focus-visible:ring-2 focus-visible:ring-token-focus-border focus-visible:outline-none`,I&&`cursor-interaction`),",
572
+ "me=B?(0,S1.jsx)(`div`,{className:`w-full p-px`,children:(0,S1.jsx)(qVn,{cwd:x??null,hostId:S,initialMessage:z.trim(),onCancel:()=>{ie(null)},onDraftChange:e=>{ie(e)},onSubmit:oe})}):G?(0,S1.jsx)(`div`,{\"data-user-message-bubble\":!0,...CPXBubbleProps({}),role:I?`button`:void 0,tabIndex:0,className:Y(e,`text-left focus-visible:ring-2 focus-visible:ring-token-focus-border focus-visible:outline-none`,I&&`cursor-interaction`),",
573
+ "user bubble marker attribute anchor",
574
+ );
575
+ }
492
576
  let patched = replaceOnce(
493
577
  text,
494
578
  "var Z=i(),Q=e(n(),1),$=r();function Ue(e){",
@@ -510,6 +594,14 @@ function patchUserMessageAttachmentsBubbleColors(text) {
510
594
  }
511
595
 
512
596
  function patchUserMessageAttachmentsProjectColors(text) {
597
+ if (text.includes("\"data-user-message-bubble\":!0,...CPXBubbleProps({}),role:I?`button`:void 0,")) {
598
+ return replaceOnce(
599
+ text,
600
+ "\"data-user-message-bubble\":!0,...CPXBubbleProps({}),role:I?`button`:void 0,",
601
+ "\"data-user-message-bubble\":!0,...CPXBubbleProps({project:{cwd:x,hostId:S}}),role:I?`button`:void 0,",
602
+ "user bubble project marker attribute anchor",
603
+ );
604
+ }
513
605
  let patched = replaceOnce(
514
606
  text,
515
607
  `import{Aa as x,Ta as S}from"./${srcFile}";`,
@@ -531,28 +623,63 @@ function patchUserMessageAttachmentsProjectColors(text) {
531
623
  }
532
624
 
533
625
  function patchComposerBubbleColors(text) {
626
+ if (text.includes("function Wbe(e){let t=(0,gW.c)(13),")) {
627
+ let patched = replaceOnce(
628
+ text,
629
+ "function Wbe(e){let t=(0,gW.c)(13),",
630
+ `${messageComposerHook()}function Wbe(e){let t=(0,gW.c)(13),`,
631
+ "composer user bubble helper insertion anchor",
632
+ );
633
+ patched = replaceOnce(
634
+ patched,
635
+ "function Wbe(e){let t=(0,gW.c)(13),{children:n,className:r,externalFooterVariant:i,inert:a,isDragActive:o,layout:s,onDragEnter:c,onDragLeave:l,onDragOver:u,onDrop:d}=e,",
636
+ "function Wbe(e){let t=(0,gW.c)(13),{children:n,className:r,externalFooterVariant:i,inert:a,isDragActive:o,layout:s,onDragEnter:c,onDragLeave:l,onDragOver:u,onDrop:d,codexPlusProps:CPX_surfaceProps}=e,CPX_resolvedSurfaceProps=CPX_surfaceProps??CPXSurfaceProps({}),",
637
+ "composer host surface props anchor",
638
+ );
639
+ return replaceOnce(
640
+ patched,
641
+ "return t[5]!==n||t[6]!==a||t[7]!==c||t[8]!==l||t[9]!==u||t[10]!==d||t[11]!==v?(y=(0,_W.jsx)(Su.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}",
642
+ "return t[5]!==n||t[6]!==a||t[7]!==c||t[8]!==l||t[9]!==u||t[10]!==d||t[11]!==v?(y=(0,_W.jsx)(Su.div,{inert:a,...CPX_resolvedSurfaceProps,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}",
643
+ "composer user entry marker render anchor",
644
+ );
645
+ }
534
646
  let patched = replaceOnce(
535
647
  text,
536
648
  "function oh(e){let t=(0,$.c)(13),",
537
- `${messageComposerHook()}function oh(e){let t=(0,$.c)(14),`,
649
+ `${messageComposerHook()}function oh(e){let t=(0,$.c)(13),`,
538
650
  "composer user bubble helper insertion anchor",
539
651
  );
540
652
  patched = replaceOnce(
541
653
  patched,
542
- "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,",
543
- "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??CPXSurfaceProps({}),",
654
+ "function oh(e){let t=(0,$.c)(13),{children:n,className:r,externalFooterVariant:i,inert:a,isDragActive:o,layout:s,onDragEnter:c,onDragLeave:l,onDragOver:u,onDrop:d}=e,",
655
+ "function oh(e){let t=(0,$.c)(13),{children:n,className:r,externalFooterVariant:i,inert:a,isDragActive:o,layout:s,onDragEnter:c,onDragLeave:l,onDragOver:u,onDrop:d,codexPlusProps:CPX_surfaceProps}=e,CPX_resolvedSurfaceProps=CPX_surfaceProps??CPXSurfaceProps({}),",
544
656
  "composer host surface props anchor",
545
657
  );
546
658
  patched = replaceOnce(
547
659
  patched,
548
660
  "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}",
549
- "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}",
661
+ "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,...CPX_resolvedSurfaceProps,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}",
550
662
  "composer user entry marker render anchor",
551
663
  );
552
664
  return patched;
553
665
  }
554
666
 
555
667
  function patchComposerProjectColors(text) {
668
+ if (text.includes("function Wbe(e){let t=(0,gW.c)(13),") && text.includes("CPX_resolvedSurfaceProps=CPX_surfaceProps??CPXSurfaceProps({})")) {
669
+ let patched = text;
670
+ patched = replaceOnce(
671
+ patched,
672
+ anchors.composerProjectStyleCaller,
673
+ anchors.composerProjectStyleCaller.replace(";return", ",CPX_composerSurfaceProps=CPXSurfaceProps({project:{cwd:ln??an,hostId:$n}});return"),
674
+ "composer project style hook-safe caller anchor",
675
+ );
676
+ return replaceOnce(
677
+ patched,
678
+ "(0,PY.jsx)(sEe,{className:w,externalFooterVariant:C,hasDropTargetPortal:As,",
679
+ "(0,PY.jsx)(sEe,{key:CPX_composerSurfaceProps?.[`data-codex-plus-project-color`]??``,className:w,externalFooterVariant:C,codexPlusProps:CPX_composerSurfaceProps,hasDropTargetPortal:As,",
680
+ "composer project accent style caller anchor",
681
+ );
682
+ }
556
683
  let patched = replaceOnce(
557
684
  text,
558
685
  anchors.composerProjectImports,
@@ -568,7 +695,7 @@ function patchComposerProjectColors(text) {
568
695
  return replaceOnce(
569
696
  patched,
570
697
  anchors.composerProjectAccentCaller,
571
- anchors.composerProjectAccentCaller.replace(",onDragEnter:", ",codexPlusProps:!Ge&&!Hn?CPX_composerSurfaceProps:void 0,onDragEnter:"),
698
+ anchors.composerProjectAccentCaller.replace(",onDragEnter:", ",key:CPX_composerSurfaceProps?.[`data-codex-plus-project-color`]??``,codexPlusProps:!Ge&&!Hn?CPX_composerSurfaceProps:void 0,onDragEnter:"),
572
699
  "composer project accent style caller anchor",
573
700
  );
574
701
  }
@@ -577,12 +704,20 @@ function patchElectronMenuShortcuts(text) {
577
704
  return replaceOnce(
578
705
  text,
579
706
  "{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`,",
580
- "{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:`codexPlus.focusProjectSelector`,title:`Focus project selector`,description:`Focus or open the new chat project selector`,commandMenuGroupKey:`workspace`,commandMenu:!0,electron:{menuTitle:`Focus project selector`,defaultKeybindings:[{key:`CmdOrCtrl+.`}]}},...(window.CodexPlus?.ui?.commands?.commandMetadata?.()?.filter?.(e=>e.id!==`codexPlus.focusProjectSelector`)??[]),{id:`toggleBottomPanel`,",
707
+ "{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:`codexPlus.focusProjectSelector`,title:`Focus project selector`,description:`Focus or open the new chat project selector`,commandMenuGroupKey:`workspace`,commandMenu:!0,electron:{menuTitle:`Focus project selector`,defaultKeybindings:[{key:`CmdOrCtrl+.`}]}},{id:`codexPlusToggleSidebarNameBlur`,title:`Toggle sidebar blur`,description:`Blur or show sidebar chat and project names`,commandMenuGroupKey:`panels`,commandMenu:!0,electron:{menuTitle:`Toggle sidebar blur`,defaultKeybindings:[]}},...(globalThis.CodexPlus?.ui?.commands?.commandMetadata?.()?.filter?.(e=>e.id!==`codexPlus.focusProjectSelector`&&e.id!==`codexPlusToggleSidebarNameBlur`)??[]),{id:`toggleBottomPanel`,",
581
708
  "sidebar blur command palette metadata anchor",
582
709
  );
583
710
  }
584
711
 
585
712
  function patchKeyboardShortcutsSearchInput(text) {
713
+ if (text.includes("function Kke(e,t){return`titleIntlId`in e?")) {
714
+ return replaceOnce(
715
+ text,
716
+ "function Kke(e,t){return`titleIntlId`in e?S0(C0,e.titleIntlId)?t.formatMessage(C0[e.titleIntlId]):``:t.formatMessage(w0[e.electron.menuTitleIntlId])}",
717
+ "function Kke(e,t){return`titleIntlId`in e?S0(C0,e.titleIntlId)?t.formatMessage(C0[e.titleIntlId]):``:e.title??e.electron?.menuTitle??t.formatMessage(w0[e.electron.menuTitleIntlId])}",
718
+ "generic command metadata title fallback anchor",
719
+ );
720
+ }
586
721
  return replaceOnce(
587
722
  text,
588
723
  "function d(e,t){return`titleIntlId`in e?t.formatMessage(c[e.titleIntlId]):t.formatMessage(l[e.electron.menuTitleIntlId])}",
@@ -591,7 +726,31 @@ function patchKeyboardShortcutsSearchInput(text) {
591
726
  );
592
727
  }
593
728
 
729
+ function patchCommandMenuRuntimeCommands(text) {
730
+ return replaceOnce(
731
+ text,
732
+ "let M=j,N;t[11]===o?N=t[12]:",
733
+ "let M=[...j,...(globalThis.CodexPlus?.ui?.commands?.commandMetadata?.()?.filter?.(e=>!j.some(t=>t.id===e.id))??[])],N;t[11]===o?N=t[12]:",
734
+ "command menu runtime command metadata anchor",
735
+ );
736
+ }
737
+
594
738
  function patchLocalTaskRow(text) {
739
+ if (text.includes("function _p(e){let t=(0,yp.c)(134),")) {
740
+ let patched = replaceOnce(
741
+ text,
742
+ "function _p(e){let t=(0,yp.c)(134),",
743
+ `${projectColorHook()}function _p(e){let t=(0,yp.c)(134),`,
744
+ "local task row project color helper insertion anchor",
745
+ );
746
+ patched = replaceOnce(
747
+ patched,
748
+ "threadSummary:le,dataAttributes:ue}=e,de=c===void 0?!1:c,",
749
+ "threadSummary:le,dataAttributes:ue=CPXPR({projectId:oe,label:se,path:r,cwd:r,hostId:R?.id})}=e,de=c===void 0?!1:c,",
750
+ "local task row project assignment anchor",
751
+ );
752
+ return patched;
753
+ }
595
754
  let patched = replaceOnce(
596
755
  text,
597
756
  "function fn(e){let t=(0,K.c)(124),",
@@ -601,30 +760,27 @@ function patchLocalTaskRow(text) {
601
760
  patched = replaceOnce(
602
761
  patched,
603
762
  "threadSummary:Ne,dataAttributes:Fe}=e,Ie=g===void 0?!1:g,",
604
- "threadSummary:Ne,dataAttributes:Fe}=e,CPX_rowDataAttributes=Fe??CPXPR(Oe),Ie=g===void 0?!1:g,",
763
+ "threadSummary:Ne,dataAttributes:Fe=CPXPR(Oe)}=e,Ie=g===void 0?!1:g,",
605
764
  "local task row project assignment anchor",
606
765
  );
607
- patched = replaceOnce(
608
- patched,
609
- "t[87]!==Fe",
610
- "t[87]!==CPX_rowDataAttributes",
611
- "local task row memo dependency anchor",
612
- );
613
- patched = replaceOnce(
614
- patched,
615
- "dataAttributes:Fe,archiveAriaLabel:hn",
616
- "dataAttributes:CPX_rowDataAttributes,archiveAriaLabel:hn",
617
- "local task row data attributes anchor",
618
- );
619
- return replaceOnce(
620
- patched,
621
- "t[87]=Fe",
622
- "t[87]=CPX_rowDataAttributes",
623
- "local task row memo assignment anchor",
624
- );
766
+ return patched;
625
767
  }
626
768
 
627
769
  function patchMermaidDiagramShell(text) {
770
+ if (text.includes("function or({blockRef:e,code:t,isCodeFenceOpen:n,isDark:r,isVisible:i,onError:a,onRendered:o,renderKey:s}){")) {
771
+ let patched = replaceOnce(
772
+ text,
773
+ "function or({blockRef:e,code:t,isCodeFenceOpen:n,isDark:r,isVisible:i,onError:a,onRendered:o,renderKey:s}){",
774
+ `${mermaidDiagramHook()}function or({blockRef:e,code:t,isCodeFenceOpen:n,isDark:r,isVisible:i,onError:a,onRendered:o,renderKey:s}){`,
775
+ "mermaid diagram shell helper insertion anchor",
776
+ );
777
+ return replaceOnce(
778
+ patched,
779
+ "(0,X.jsx)(`div`,{ref:u,className:re(vr,!i&&`invisible`,m?`max-h-[var(--markdown-wide-block-max-height)] overflow-auto`:`overflow-x-auto`),\"aria-hidden\":!i||void 0,",
780
+ "(0,X.jsx)(`div`,{ref:u,...CPXMermaidDiagramProps({code:t}),className:re(vr,!i&&`invisible`,m?`max-h-[var(--markdown-wide-block-max-height)] overflow-auto`:`overflow-x-auto`),\"aria-hidden\":!i||void 0,",
781
+ "mermaid diagram shell host props anchor",
782
+ );
783
+ }
628
784
  let patched = replaceOnce(
629
785
  text,
630
786
  "function d(e){let t=(0,s.c)(18),{Renderer:n,className:r,code:i,fallback:d,isCodeFenceOpen:f,wideBlockKind:p}=e,",
@@ -649,6 +805,20 @@ function patchPreloadNativeBridge(text) {
649
805
  }
650
806
 
651
807
  function patchMainNativeBridge(text) {
808
+ if (text.includes("function y4(e){let{") && text.includes("G2(l,k),V2(k);let A=!1;")) {
809
+ let patched = replaceOnce(
810
+ text,
811
+ "function y4(e){let{",
812
+ `${nativeMainHook()}function y4(e){let{`,
813
+ "codex plus native main helper insertion anchor",
814
+ );
815
+ return replaceOnce(
816
+ patched,
817
+ "G2(l,k),V2(k);let A=!1;",
818
+ "G2(l,k),V2(k),CPXNative.registerNativeRequest({isTrustedIpcEvent:k});let A=!1;",
819
+ "codex plus native main registration anchor",
820
+ );
821
+ }
652
822
  let patched = replaceOnce(
653
823
  text,
654
824
  "function z1(e){return a.ipcMain.handle(Tl,async(t,n)=>{",
@@ -676,6 +846,14 @@ function patchMainMenuDiagnostics(text) {
676
846
  "He,We,...CPXNative.templateItems(`view-menu`),{type:`separator`}",
677
847
  "codex plus view menu template items anchor",
678
848
  );
849
+ if (patched.includes("fe.refreshApplicationMenu(),w(`application menu refreshed`,A),")) {
850
+ return replaceOnce(
851
+ patched,
852
+ "fe.refreshApplicationMenu(),w(`application menu refreshed`,A),",
853
+ "CPXNative.setRefreshApplicationMenu(()=>fe.refreshApplicationMenu()),fe.refreshApplicationMenu(),CPXNative.logMenuDiagnostics(),w(`application menu refreshed`,A),",
854
+ "codex plus menu diagnostics refresh anchor",
855
+ );
856
+ }
679
857
  return replaceOnce(
680
858
  patched,
681
859
  "me.refreshApplicationMenu(),w(`application menu refreshed`,A),",
@@ -689,7 +867,7 @@ return makePatchSet({
689
867
  codexVersion: config.codexVersion,
690
868
  bundleVersion: config.bundleVersion,
691
869
  asarSha256: config.asarSha256,
692
- assetFiles: codexPlusRuntimeAssets(),
870
+ assetFiles: codexPlusRuntimeAssets(config.runtimeConfig),
693
871
  patches: [
694
872
  {
695
873
  id: "bundle-identity",
@@ -731,7 +909,6 @@ return makePatchSet({
731
909
  id: "project-colors",
732
910
  fileTransforms: [
733
911
  [appMainFile, patchAppMainProjectColors],
734
- [sidebarProjectHoverCardSourceRowsFile, patchSidebarProjectHoverCardSourceRows],
735
912
  [localTaskRowFile, patchLocalTaskRow],
736
913
  [userMessageAttachmentsFile, patchUserMessageAttachmentsProjectColors],
737
914
  [composerFile, patchComposerProjectColors],
@@ -751,15 +928,21 @@ return makePatchSet({
751
928
  [appMainFile, patchAppMainSidebarBlur],
752
929
  [electronMenuShortcutsFile, patchElectronMenuShortcuts],
753
930
  [keyboardShortcutsSearchInputFile, patchKeyboardShortcutsSearchInput],
931
+ [keyboardShortcutsSearchInputFile, patchCommandMenuRuntimeCommands],
754
932
  ],
755
933
  },
756
934
  {
757
935
  id: "project-selector-shortcut",
758
936
  fileTransforms: [
759
937
  [localActiveWorkspaceRootDropdownFile, patchLocalActiveWorkspaceRootDropdownProjectSelectorShortcut],
938
+ ...(homeProjectDropdownFile ? [[homeProjectDropdownFile, patchHomeProjectDropdownProjectSelectorShortcut]] : []),
760
939
  [runCommandFile, patchRunCommandProjectSelectorShortcut],
761
940
  ],
762
941
  },
942
+ ...(statsigStartupFile ? [{
943
+ id: "dev-mode-statsig-fallback",
944
+ fileTransforms: [[statsigStartupFile, patchDevModeStatsigFallback]],
945
+ }] : []),
763
946
  ...(mainFile ? [{
764
947
  id: "codex-plus-native-bridge",
765
948
  fileTransforms: [