codex-plus-patcher 0.5.0 → 0.7.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.
Files changed (48) hide show
  1. package/README.md +12 -1
  2. package/package.json +5 -2
  3. package/src/cli.js +97 -0
  4. package/src/patches/26.616.41845-4198.js +2 -0
  5. package/src/patches/26.616.51431-4212.js +2 -0
  6. package/src/patches/26.616.71553-4265.js +6 -0
  7. package/src/patches/26.616.81150-4306.js +7 -0
  8. package/src/patches/lib/common-patches.js +175 -58
  9. package/src/patches/lib/hooks/about.js +7 -0
  10. package/src/patches/lib/hooks/diagnostics.js +7 -0
  11. package/src/patches/lib/hooks/mermaid.js +7 -0
  12. package/src/patches/lib/hooks/message-composer.js +7 -0
  13. package/src/patches/lib/hooks/native-main.js +7 -0
  14. package/src/patches/lib/hooks/project-selector.js +12 -0
  15. package/src/patches/lib/hooks/review.js +7 -0
  16. package/src/patches/lib/hooks/settings-commands.js +12 -0
  17. package/src/patches/lib/hooks/sidebar.js +12 -0
  18. package/src/patches/lib/hooks/thread-header.js +7 -0
  19. package/src/patches/lib/hooks/worker.js +7 -0
  20. package/src/patches/lib/project-selector-shortcut-patch.js +55 -0
  21. package/src/runtime/api/about.js +16 -0
  22. package/src/runtime/api/commands.js +85 -0
  23. package/src/runtime/api/composer.js +14 -0
  24. package/src/runtime/api/diagnostics.js +38 -0
  25. package/src/runtime/api/errors.js +20 -0
  26. package/src/runtime/api/index.js +79 -0
  27. package/src/runtime/api/mermaid.js +14 -0
  28. package/src/runtime/api/message.js +14 -0
  29. package/src/runtime/api/modules.js +57 -0
  30. package/src/runtime/api/native.js +14 -0
  31. package/src/runtime/api/patches.js +31 -0
  32. package/src/runtime/api/review.js +20 -0
  33. package/src/runtime/api/settings.js +76 -0
  34. package/src/runtime/api/sidebar.js +24 -0
  35. package/src/runtime/api/styles.js +28 -0
  36. package/src/runtime/api/threadHeader.js +41 -0
  37. package/src/runtime/assets.js +58 -13
  38. package/src/runtime/host/messageComposer.js +16 -0
  39. package/src/runtime/host/nativeMain.js +159 -0
  40. package/src/runtime/host/projectSelector.js +58 -0
  41. package/src/runtime/host/review.js +62 -0
  42. package/src/runtime/host/sidebar.js +21 -0
  43. package/src/runtime/host/threadHeader.js +9 -0
  44. package/src/runtime/{worker.js → host/worker.js} +7 -0
  45. package/src/runtime/plugins/devTools.js +33 -0
  46. package/src/runtime/plugins/projectPathHeader.js +116 -0
  47. package/src/runtime/plugins/projectSelectorShortcut.js +207 -0
  48. package/src/runtime/runtime.js +22 -355
@@ -1,6 +1,20 @@
1
1
  const { codexPlusRuntimeAssets } = require("../../runtime/assets");
2
2
  const { replaceOnce } = require("./replace");
3
3
  const { makePatchSet } = require("./make-patch-set");
4
+ const { aboutMetadataRequire } = require("./hooks/about");
5
+ const { diagnosticDetailsHook } = require("./hooks/diagnostics");
6
+ const { mermaidDiagramHook } = require("./hooks/mermaid");
7
+ const { messageComposerHook } = require("./hooks/message-composer");
8
+ const { nativeMainHook } = require("./hooks/native-main");
9
+ const { reviewHook } = require("./hooks/review");
10
+ const { projectColorHook, sidebarMergeDataAttributes } = require("./hooks/sidebar");
11
+ const { appearanceSettingsHook, commandMenuItemsExpression } = require("./hooks/settings-commands");
12
+ const { threadHeaderHook } = require("./hooks/thread-header");
13
+ const { workerHook } = require("./hooks/worker");
14
+ const {
15
+ patchLocalActiveWorkspaceRootDropdownProjectSelectorShortcut,
16
+ patchRunCommandProjectSelectorShortcut,
17
+ } = require("./project-selector-shortcut-patch");
4
18
 
5
19
  function buildCodexPlusPatchSet(config) {
6
20
  const oldTitle = "<title>Codex</title>";
@@ -11,14 +25,22 @@ function buildCodexPlusPatchSet(config) {
11
25
  const files = config.files;
12
26
  const anchors = config.anchors;
13
27
  const mainFile = files.main;
28
+ const electronCommandSourceFile = files.electronCommandSource;
14
29
  const appMainFile = files.appMain;
15
30
  const appShellFile = files.appShell;
16
31
  const errorBoundaryFile = files.errorBoundary;
17
32
  const generalSettingsFile = files.generalSettings;
18
33
  const sidebarProjectHoverCardSourceRowsFile = files.sidebarProjectHoverCardSourceRows;
34
+ const headerFile = files.header;
35
+ const threadPageHeaderFile = files.threadPageHeader;
36
+ const localConversationPageFile = files.localConversationPage;
37
+ const threadContextFile = files.threadContext;
38
+ const threadContextImportFile = threadContextFile?.split("/").pop();
19
39
  const threadSidePanelTabsFile = files.threadSidePanelTabs;
20
40
  const userMessageAttachmentsFile = files.userMessageAttachments;
21
41
  const composerFile = files.composer;
42
+ const localActiveWorkspaceRootDropdownFile = files.localActiveWorkspaceRootDropdown;
43
+ const runCommandFile = files.runCommand;
22
44
  const localTaskRowFile = files.localTaskRow;
23
45
  const mermaidDiagramShellFile = files.mermaidDiagramShell;
24
46
  const electronMenuShortcutsFile = files.electronMenuShortcuts;
@@ -28,11 +50,6 @@ function buildCodexPlusPatchSet(config) {
28
50
  const sidebarThreadRowSignalsFile = files.sidebarThreadRowSignals;
29
51
  const branchPickerDropdownContentFile = files.branchPickerDropdownContent;
30
52
 
31
- function codexPlusWorkerHelpers() {
32
- return `
33
- 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)}`;
34
- }
35
-
36
53
  function patchTitle(text) {
37
54
  return replaceOnce(text, oldTitle, newTitle, `${oldTitle} in ${titleFile}`);
38
55
  }
@@ -47,7 +64,7 @@ function patchAboutDialog(text, context = {}) {
47
64
  let patched = replaceOnce(
48
65
  text,
49
66
  "let i=a.app.getName(),o=a.app.getVersion()",
50
- `let CPXAbout=require("./codex-plus-aboutMetadata.js").aboutPayload(${JSON.stringify(aboutContext)}),i=CPXAbout.appDisplayName,o=a.app.getVersion()`,
67
+ `let CPXAbout=${aboutMetadataRequire()}.aboutPayload(${JSON.stringify(aboutContext)}),i=CPXAbout.appDisplayName,o=a.app.getVersion()`,
51
68
  "about dialog app name anchor",
52
69
  );
53
70
  patched = replaceOnce(
@@ -65,7 +82,9 @@ function patchAboutDialog(text, context = {}) {
65
82
  patched = replaceOnce(
66
83
  patched,
67
84
  "function K0({appDisplayName:e,buildInfoLabel:t,buildInfoText:n,iconDataUrl:r,isDark:i,okLabel:a,title:o}){let s=r==null?``:",
68
- "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?``:",
85
+ "function K0({appDisplayName:e,buildInfoLabel:t,buildInfoText:n,codexPlusDisclaimerHeading:D,codexPlusDisclaimerBody:O,iconDataUrl:r,isDark:i,okLabel:a,title:o}){let CPXAboutMetadata=" +
86
+ aboutMetadataRequire() +
87
+ ",q=CPXAboutMetadata.disclaimerMarkup({escape:zz.default,heading:D,body:O}),s=r==null?``:",
69
88
  "about dialog renderer signature anchor",
70
89
  );
71
90
  patched = replaceOnce(
@@ -98,19 +117,19 @@ function patchWorker(text) {
98
117
  let patched = replaceOnce(
99
118
  text,
100
119
  "function pae(e,t){return e.queryClient.fetchQuery",
101
- `${codexPlusWorkerHelpers()}function pae(e,t){return e.queryClient.fetchQuery`,
120
+ `${workerHook()}function pae(e,t){return e.queryClient.fetchQuery`,
102
121
  "worker helper insertion anchor",
103
122
  );
104
123
  patched = replaceOnce(
105
124
  patched,
106
125
  "case`submodule-paths`:a=X({paths:await pae(this.gitManager.getWorktreeRepositoryForRoot(e.params.root,r),t.signal)});break;",
107
- "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;",
126
+ "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 pae(this.gitManager.getWorktreeRepositoryForRoot(e.params.root,r),t.signal)});break;",
108
127
  "repository-targets worker switch anchor",
109
128
  );
110
129
  patched = replaceOnce(
111
130
  patched,
112
131
  "function u2({requestKind:e,source:t}){return l2.has(e??``)||d2(t)}",
113
- "function u2({requestKind:e,source:t}){return l2.has(e??``)||d2(t)||CPX_isReadOnlyBranchRequest(e,t)}",
132
+ "function u2({requestKind:e,source:t}){return l2.has(e??``)||d2(t)||CPXB(e,t)}",
114
133
  "codex plus branch picker git allowlist anchor",
115
134
  );
116
135
  return replaceOnce(
@@ -121,21 +140,6 @@ function patchWorker(text) {
121
140
  );
122
141
  }
123
142
 
124
- const codexPlusReviewHelpers = `
125
- 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}`;
126
-
127
- const codexPlusSubrepoDiffHelpers = `
128
- `;
129
-
130
- const codexPlusDiagnosticHelpers = `
131
- function CPXDiagnosticDetails(e){return window.CodexPlus?.ui?.errors?.renderDetails?.(e)??null}`;
132
-
133
- const codexPlusMermaidHelpers = `
134
- function CPXMermaidDiagramProps(e){return window.CodexPlus?.ui?.mermaid?.diagramProps?.(e)}`;
135
-
136
- const codexPlusNativeMainHelpers = `
137
- function CPXOpenMermaidViewer(e){let t=e?.html;if(typeof t!==\`string\`||t.length===0)return{ok:!1};let n=(0,s.join)((0,o.tmpdir)(),\`codex-plus-mermaid-\${(0,u.randomUUID)()}.html\`);(0,l.writeFileSync)(n,t,\`utf8\`);let r=new a.BrowserWindow({height:900,resizable:!0,show:!0,title:\`Mermaid diagram viewer\`,webPreferences:{contextIsolation:!0,nodeIntegration:!1,sandbox:!0},width:1400});return r.webContents.setWindowOpenHandler(e=>{try{let t=new URL(e.url);if(t.protocol===\`https:\`&&t.hostname===\`mermaid.live\`)a.shell.openExternal(e.url)}catch{}return{action:\`deny\`}}),r.on(\`closed\`,()=>{try{(0,l.unlinkSync)(n)}catch{}}),r.loadURL((0,S.pathToFileURL)(n).toString()).catch(()=>{}),{ok:!0}}function CPXRegisterNativeRequest(e){return a.ipcMain.handle(\`codex_plus:native-request\`,async(t,n)=>{if(!e.isTrustedIpcEvent(t))return{ok:!1};switch(n?.method){case\`mermaid/openViewer\`:return CPXOpenMermaidViewer(n.params);default:return{ok:!1}}})}`;
138
-
139
143
  function patchThreadSidePanelTabs(text) {
140
144
  let patched = replaceOnce(
141
145
  text,
@@ -146,13 +150,13 @@ function patchThreadSidePanelTabs(text) {
146
150
  patched = replaceOnce(
147
151
  patched,
148
152
  "function uf({cwd:e,fileEntries:t,generatedPathsReady:n,hasUnhandledAttributesFiles:r,isCappedMode:i,repositorySource:a,reviewSummarySource:o}){",
149
- `${codexPlusReviewHelpers}function uf({cwd:e,fileEntries:t,generatedPathsReady:n,hasUnhandledAttributesFiles:r,isCappedMode:i,repositorySource:a,reviewSummarySource:o}){`,
153
+ `${reviewHook()}function uf({cwd:e,fileEntries:t,generatedPathsReady:n,hasUnhandledAttributesFiles:r,isCappedMode:i,repositorySource:a,reviewSummarySource:o}){`,
150
154
  "review host hook insertion anchor",
151
155
  );
152
156
  return replaceOnce(
153
157
  patched,
154
158
  "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;",
155
- "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;",
159
+ "let s;t[1]!==a||t[2]!==r||t[3]!==i?(s=(0,$.jsx)(CPXRM,{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;",
156
160
  "review body mux anchor",
157
161
  );
158
162
  }
@@ -160,7 +164,7 @@ function patchAppShell(text) {
160
164
  let patched = replaceOnce(
161
165
  text,
162
166
  "function En(e){return(0,Q.jsx)(wn,{onRetry:()=>{e.resetError()}})}",
163
- `${codexPlusDiagnosticHelpers}function En(e){return(0,Q.jsx)(wn,{error:e.error,onRetry:()=>{e.resetError()}})}`,
167
+ `${diagnosticDetailsHook()}function En(e){return(0,Q.jsx)(wn,{error:e.error,onRetry:()=>{e.resetError()}})}`,
164
168
  "app shell error fallback prop anchor",
165
169
  );
166
170
  patched = replaceOnce(
@@ -187,7 +191,7 @@ function patchErrorBoundary(text) {
187
191
  let patched = replaceOnce(
188
192
  text,
189
193
  "function Xf(e){let t=(0,Vf.c)(9),{resetError:n}=e,r=ee(),i,a;",
190
- `${codexPlusDiagnosticHelpers}function Xf(e){let t=(0,Vf.c)(9),{resetError:n,error:CPX_error,componentStack:CPX_componentStack}=e,r=ee(),i,a;`,
194
+ `${diagnosticDetailsHook()}function Xf(e){let t=(0,Vf.c)(9),{resetError:n,error:CPX_error,componentStack:CPX_componentStack}=e,r=ee(),i,a;`,
191
195
  "webview error boundary fallback prop anchor",
192
196
  );
193
197
  patched = replaceOnce(
@@ -208,7 +212,7 @@ function patchAppMainProjectColors(text) {
208
212
  let patched = replaceOnce(
209
213
  text,
210
214
  "function Pk(e){let t=(0,Q.c)(45),",
211
- `${codexPlusProjectColorHelpers}function Pk(e){let t=(0,Q.c)(46),`,
215
+ `${projectColorHook()}function Pk(e){let t=(0,Q.c)(46),`,
212
216
  "project color app main helper insertion anchor",
213
217
  );
214
218
  patched = replaceOnce(
@@ -220,7 +224,7 @@ function patchAppMainProjectColors(text) {
220
224
  patched = replaceOnce(
221
225
  patched,
222
226
  "q={onActivateGroup:V,onStartNewConversation:a,isGrouped:!0,hideRemoteHostEnvIcon:!0,hideTimestamp:l,locationId:b,floatStatusIconsRight:s,showPinActionOnHover:o}",
223
- "q={onActivateGroup:V,onStartNewConversation:a,isGrouped:!0,hideRemoteHostEnvIcon:!0,hideTimestamp:l,locationId:b,floatStatusIconsRight:s,showPinActionOnHover:o,dataAttributes:CPXHostThreadRowProps(i)}",
227
+ "q={onActivateGroup:V,onStartNewConversation:a,isGrouped:!0,hideRemoteHostEnvIcon:!0,hideTimestamp:l,locationId:b,floatStatusIconsRight:s,showPinActionOnHover:o,dataAttributes:CPXTR(i)}",
224
228
  "project thread row color key anchor",
225
229
  );
226
230
  patched = replaceOnce(
@@ -250,7 +254,7 @@ function patchAppMainProjectColors(text) {
250
254
  patched = replaceOnce(
251
255
  patched,
252
256
  "Ke=(0,Z.jsx)(Oe,{rowAttributes:ke,className:Ae,collapsed:L,contentClassName:je,",
253
- "Ke=(0,Z.jsx)(Oe,{rowAttributes:{...ke,...CPXHostProjectRowProps(n)},className:Ae,collapsed:L,contentClassName:je,",
257
+ "Ke=(0,Z.jsx)(Oe,{rowAttributes:{...ke,...CPXPR(n)},className:Ae,collapsed:L,contentClassName:je,",
254
258
  "project header row color attributes anchor",
255
259
  );
256
260
  return patched;
@@ -273,7 +277,7 @@ function patchAppMainSidebarBlur(text) {
273
277
  return replaceOnce(
274
278
  patched,
275
279
  "children:[l,u,(0,Z.jsx)(H_,{route:a,children:C})]",
276
- "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})]",
280
+ `children:[l,u,...(${commandMenuItemsExpression("suggested", "Z.jsx", "Zy", "Hp")}),(0,Z.jsx)(H_,{route:a,children:C})]`,
277
281
  "sidebar name blur command mount anchor",
278
282
  );
279
283
  }
@@ -313,19 +317,19 @@ function patchSidebarProjectHoverCardSourceRows(text) {
313
317
  patched = replaceOnce(
314
318
  patched,
315
319
  "dataAttributes:ae.sidebarThreadRow({active:s,hostId:t.hostId,id:n,kind:`pending-worktree`,pinned:r,title:t.label})",
316
- "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)",
320
+ `dataAttributes:${sidebarMergeDataAttributes("ae.sidebarThreadRow({active:s,hostId:t.hostId,id:n,kind:`pending-worktree`,pinned:r,title:t.label})", "CPX_rowDataAttributes")}`,
317
321
  "pending worktree sidebar row data attributes merge anchor",
318
322
  );
319
323
  patched = replaceOnce(
320
324
  patched,
321
325
  "dataAttributes:ae.sidebarThreadRow({active:s,hostId:null,id:t,kind:`remote`,pinned:r,title:e.task.title??``})",
322
- "dataAttributes:window.CodexPlus?.ui?.sidebar?.mergeDataAttributes?.(ae.sidebarThreadRow({active:s,hostId:null,id:t,kind:`remote`,pinned:r,title:e.task.title??``}),CPX_rowDataAttributes)",
326
+ `dataAttributes:${sidebarMergeDataAttributes("ae.sidebarThreadRow({active:s,hostId:null,id:t,kind:`remote`,pinned:r,title:e.task.title??``})", "CPX_rowDataAttributes")}`,
323
327
  "remote sidebar row data attributes merge anchor",
324
328
  );
325
329
  patched = replaceOnce(
326
330
  patched,
327
331
  "dataAttributes:ae.sidebarThreadRow({active:s,hostId:f,id:i,kind:`local`,pinned:r,title:x})",
328
- "dataAttributes:window.CodexPlus?.ui?.sidebar?.mergeDataAttributes?.(ae.sidebarThreadRow({active:s,hostId:f,id:i,kind:`local`,pinned:r,title:x}),CPX_rowDataAttributes)",
332
+ `dataAttributes:${sidebarMergeDataAttributes("ae.sidebarThreadRow({active:s,hostId:f,id:i,kind:`local`,pinned:r,title:x})", "CPX_rowDataAttributes")}`,
329
333
  "local sidebar row data attributes merge anchor",
330
334
  );
331
335
  patched = replaceOnce(
@@ -384,17 +388,96 @@ function patchSidebarProjectHoverCardSourceRows(text) {
384
388
  );
385
389
  }
386
390
 
387
- const codexPlusProjectColorHelpers = `
388
- 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)}`;
391
+ function patchHeader(text) {
392
+ let patched = replaceOnce(
393
+ text,
394
+ `import{Z as r,a as i,s as a}from"./app-scope-CWE-zIhQ.js";`,
395
+ `import{Z as r,a as i,a as CPX_readAtom,s as a}from"./app-scope-CWE-zIhQ.js";`,
396
+ "thread header atom reader alias import anchor",
397
+ );
398
+ patched = replaceOnce(
399
+ patched,
400
+ `import{t as ee}from"./tooltip-B-u9JAuV.js";`,
401
+ `import{t as ee,t as CPX_Tooltip}from"./tooltip-B-u9JAuV.js";`,
402
+ "thread header tooltip alias import anchor",
403
+ );
404
+ patched = replaceOnce(
405
+ patched,
406
+ `import{t as _e}from"./dock-DAmmeMut.js";`,
407
+ `import{t as _e}from"./dock-DAmmeMut.js";import{n as CPX_headerCwd,i as CPX_headerHostId}from"./${threadContextImportFile}";`,
408
+ "thread header context import anchor",
409
+ );
410
+ patched = replaceOnce(
411
+ patched,
412
+ "function lt(e){let t=(0,Z.c)(68),",
413
+ `${threadHeaderHook()}function lt(e){let t=(0,Z.c)(72),`,
414
+ "thread header accessory helper insertion anchor",
415
+ );
416
+ patched = replaceOnce(
417
+ patched,
418
+ "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];",
420
+ "thread header accessory render anchor",
421
+ );
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
+ return patched;
429
+ }
430
+
431
+ function patchThreadPageHeader(text) {
432
+ let patched = text;
433
+ patched = replaceOnce(
434
+ patched,
435
+ "function c(e){let t=(0,o.c)(21),",
436
+ `${threadHeaderHook()}function c(e){let t=(0,o.c)(24),`,
437
+ "thread page header helper insertion anchor",
438
+ );
439
+ patched = replaceOnce(
440
+ 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;",
443
+ "thread page header accessory render anchor",
444
+ );
445
+ patched = replaceOnce(
446
+ patched,
447
+ "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]",
449
+ "thread page header accessory mount anchor",
450
+ );
451
+ return patched;
452
+ }
389
453
 
390
- const codexPlusAppearanceSettingsHelpers = `
391
- function CPXAppearanceRows(e){return window.CodexPlus?.ui?.settings?.appearance?.renderRows?.({deps:{React:X,jsx:Z.jsx,SettingRow:J,ColorInput:sn,Switch:q},variant:e})??[]}`;
454
+ function patchLocalConversationPageHeader(text) {
455
+ let patched = replaceOnce(
456
+ text,
457
+ "function Tt(e){let t=(0,Y.c)(42),",
458
+ `${threadHeaderHook()}function Tt(e){let t=(0,Y.c)(45),`,
459
+ "local conversation header helper insertion anchor",
460
+ );
461
+ patched = replaceOnce(
462
+ 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;",
465
+ "local conversation header accessory render anchor",
466
+ );
467
+ patched = replaceOnce(
468
+ patched,
469
+ "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]",
471
+ "local conversation header accessory mount anchor",
472
+ );
473
+ return patched;
474
+ }
392
475
 
393
476
  function patchGeneralSettingsUserBubbleColors(text) {
394
477
  let patched = replaceOnce(
395
478
  text,
396
479
  "function tn({showCodeFont:e,showTranslucentSidebarToggle:t,variant:n}){",
397
- `${codexPlusAppearanceSettingsHelpers}function tn({showCodeFont:e,showTranslucentSidebarToggle:t,variant:n}){`,
480
+ `${appearanceSettingsHook()}function tn({showCodeFont:e,showTranslucentSidebarToggle:t,variant:n}){`,
398
481
  "user bubble settings helper insertion anchor",
399
482
  );
400
483
  return replaceOnce(
@@ -405,20 +488,17 @@ function patchGeneralSettingsUserBubbleColors(text) {
405
488
  );
406
489
  }
407
490
 
408
- const codexPlusUserBubbleHelpers = `
409
- ${codexPlusProjectColorHelpers}function CPX_installHostSurfaceProps(){}CPX_installHostSurfaceProps();`;
410
-
411
491
  function patchUserMessageAttachmentsBubbleColors(text) {
412
492
  let patched = replaceOnce(
413
493
  text,
414
494
  "var Z=i(),Q=e(n(),1),$=r();function Ue(e){",
415
- `var Z=i(),Q=e(n(),1),$=r();${codexPlusUserBubbleHelpers}function Ue(e){`,
495
+ `var Z=i(),Q=e(n(),1),$=r();${messageComposerHook()}function Ue(e){`,
416
496
  "user bubble helper insertion anchor",
417
497
  );
418
498
  patched = replaceOnce(
419
499
  patched,
420
500
  "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`),",
421
- "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`),",
501
+ "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,...CPXBubbleProps({}),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`),",
422
502
  "user bubble marker attribute anchor",
423
503
  );
424
504
  return replaceOnce(
@@ -444,8 +524,8 @@ function patchUserMessageAttachmentsProjectColors(text) {
444
524
  );
445
525
  return replaceOnce(
446
526
  patched,
447
- "\"data-user-message-bubble\":!0,...CPXHostUserBubbleProps({}),role:H?`button`:void 0,",
448
- "\"data-user-message-bubble\":!0,...CPXHostUserBubbleProps({project:CPX_userMessageProjectId}),role:H?`button`:void 0,",
527
+ "\"data-user-message-bubble\":!0,...CPXBubbleProps({}),role:H?`button`:void 0,",
528
+ "\"data-user-message-bubble\":!0,...CPXBubbleProps({project:CPX_userMessageProjectId}),role:H?`button`:void 0,",
449
529
  "user bubble project marker attribute anchor",
450
530
  );
451
531
  }
@@ -454,13 +534,13 @@ function patchComposerBubbleColors(text) {
454
534
  let patched = replaceOnce(
455
535
  text,
456
536
  "function oh(e){let t=(0,$.c)(13),",
457
- `${codexPlusUserBubbleHelpers}function oh(e){let t=(0,$.c)(14),`,
537
+ `${messageComposerHook()}function oh(e){let t=(0,$.c)(14),`,
458
538
  "composer user bubble helper insertion anchor",
459
539
  );
460
540
  patched = replaceOnce(
461
541
  patched,
462
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,",
463
- "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({}),",
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({}),",
464
544
  "composer host surface props anchor",
465
545
  );
466
546
  patched = replaceOnce(
@@ -482,7 +562,7 @@ function patchComposerProjectColors(text) {
482
562
  patched = replaceOnce(
483
563
  patched,
484
564
  anchors.composerProjectStyleCaller,
485
- 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"),
565
+ anchors.composerProjectStyleCaller.replace(";return", ",CPX_composerThreadProjectId=a(CPX_threadProjectId,G==null?null:CPX_localThreadKey(G)),CPX_composerSurfaceProps=CPXSurfaceProps({project:G==null?On?{hostId:On.hostId,path:On.remotePath,projectId:kn,label:On.label??On.name}:x??void 0:CPX_composerThreadProjectId});return"),
486
566
  "composer project style hook-safe caller anchor",
487
567
  );
488
568
  return replaceOnce(
@@ -497,7 +577,7 @@ function patchElectronMenuShortcuts(text) {
497
577
  return replaceOnce(
498
578
  text,
499
579
  "{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`,",
500
- "{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`,",
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`,",
501
581
  "sidebar blur command palette metadata anchor",
502
582
  );
503
583
  }
@@ -515,13 +595,13 @@ function patchLocalTaskRow(text) {
515
595
  let patched = replaceOnce(
516
596
  text,
517
597
  "function fn(e){let t=(0,K.c)(124),",
518
- `${codexPlusProjectColorHelpers}function fn(e){let t=(0,K.c)(124),`,
598
+ `${projectColorHook()}function fn(e){let t=(0,K.c)(124),`,
519
599
  "local task row project color helper insertion anchor",
520
600
  );
521
601
  patched = replaceOnce(
522
602
  patched,
523
603
  "threadSummary:Ne,dataAttributes:Fe}=e,Ie=g===void 0?!1:g,",
524
- "threadSummary:Ne,dataAttributes:Fe}=e,CPX_rowDataAttributes=Fe??CPXHostProjectRowProps(Oe),Ie=g===void 0?!1:g,",
604
+ "threadSummary:Ne,dataAttributes:Fe}=e,CPX_rowDataAttributes=Fe??CPXPR(Oe),Ie=g===void 0?!1:g,",
525
605
  "local task row project assignment anchor",
526
606
  );
527
607
  patched = replaceOnce(
@@ -548,7 +628,7 @@ function patchMermaidDiagramShell(text) {
548
628
  let patched = replaceOnce(
549
629
  text,
550
630
  "function d(e){let t=(0,s.c)(18),{Renderer:n,className:r,code:i,fallback:d,isCodeFenceOpen:f,wideBlockKind:p}=e,",
551
- `${codexPlusMermaidHelpers}function d(e){let t=(0,s.c)(18),{Renderer:n,className:r,code:i,fallback:d,isCodeFenceOpen:f,wideBlockKind:p}=e,`,
631
+ `${mermaidDiagramHook()}function d(e){let t=(0,s.c)(18),{Renderer:n,className:r,code:i,fallback:d,isCodeFenceOpen:f,wideBlockKind:p}=e,`,
552
632
  "mermaid diagram shell helper insertion anchor",
553
633
  );
554
634
  return replaceOnce(
@@ -572,17 +652,38 @@ function patchMainNativeBridge(text) {
572
652
  let patched = replaceOnce(
573
653
  text,
574
654
  "function z1(e){return a.ipcMain.handle(Tl,async(t,n)=>{",
575
- `${codexPlusNativeMainHelpers}function z1(e){return a.ipcMain.handle(Tl,async(t,n)=>{`,
655
+ `${nativeMainHook()}function z1(e){return a.ipcMain.handle(Tl,async(t,n)=>{`,
576
656
  "codex plus native main helper insertion anchor",
577
657
  );
578
658
  return replaceOnce(
579
659
  patched,
580
660
  "v0({buildFlavor:i,getContextForWebContents:N.getContextForWebContents,isTrustedIpcEvent:te,usesOwlAppShell:y}),a.ipcMain.on(kl,",
581
- "v0({buildFlavor:i,getContextForWebContents:N.getContextForWebContents,isTrustedIpcEvent:te,usesOwlAppShell:y}),CPXRegisterNativeRequest({isTrustedIpcEvent:te}),a.ipcMain.on(kl,",
661
+ "v0({buildFlavor:i,getContextForWebContents:N.getContextForWebContents,isTrustedIpcEvent:te,usesOwlAppShell:y}),CPXNative.registerNativeRequest({isTrustedIpcEvent:te}),a.ipcMain.on(kl,",
582
662
  "codex plus native main registration anchor",
583
663
  );
584
664
  }
585
665
 
666
+ function patchMainMenuDiagnostics(text) {
667
+ let patched = replaceOnce(
668
+ text,
669
+ "He={...b(`toggleSidePanel`),click:async()=>{let e=await y();e&&_.sendMessageToWindow(e,{type:`toggle-diff-panel`})}},Ue=",
670
+ "He={...b(`toggleSidePanel`),click:async()=>{let e=await y();e&&_.sendMessageToWindow(e,{type:`toggle-diff-panel`})}},Ue=",
671
+ "codex plus menu template helper presence anchor",
672
+ );
673
+ patched = replaceOnce(
674
+ patched,
675
+ "He,We,{type:`separator`}",
676
+ "He,We,...CPXNative.templateItems(`view-menu`),{type:`separator`}",
677
+ "codex plus view menu template items anchor",
678
+ );
679
+ return replaceOnce(
680
+ patched,
681
+ "me.refreshApplicationMenu(),w(`application menu refreshed`,A),",
682
+ "CPXNative.setRefreshApplicationMenu(()=>me.refreshApplicationMenu()),me.refreshApplicationMenu(),CPXNative.logMenuDiagnostics(),w(`application menu refreshed`,A),",
683
+ "codex plus menu diagnostics refresh anchor",
684
+ );
685
+ }
686
+
586
687
  return makePatchSet({
587
688
  id: config.id,
588
689
  codexVersion: config.codexVersion,
@@ -636,6 +737,14 @@ return makePatchSet({
636
737
  [composerFile, patchComposerProjectColors],
637
738
  ],
638
739
  },
740
+ ...(headerFile ? [{
741
+ id: "project-path-header",
742
+ fileTransforms: [
743
+ [headerFile, patchHeader],
744
+ ...(threadPageHeaderFile ? [[threadPageHeaderFile, patchThreadPageHeader]] : []),
745
+ ...(localConversationPageFile ? [[localConversationPageFile, patchLocalConversationPageHeader]] : []),
746
+ ],
747
+ }] : []),
639
748
  {
640
749
  id: "sidebar-name-blur",
641
750
  fileTransforms: [
@@ -644,11 +753,19 @@ return makePatchSet({
644
753
  [keyboardShortcutsSearchInputFile, patchKeyboardShortcutsSearchInput],
645
754
  ],
646
755
  },
647
- ...(mermaidDiagramShellFile ? [{
756
+ {
757
+ id: "project-selector-shortcut",
758
+ fileTransforms: [
759
+ [localActiveWorkspaceRootDropdownFile, patchLocalActiveWorkspaceRootDropdownProjectSelectorShortcut],
760
+ [runCommandFile, patchRunCommandProjectSelectorShortcut],
761
+ ],
762
+ },
763
+ ...(mainFile ? [{
648
764
  id: "codex-plus-native-bridge",
649
765
  fileTransforms: [
650
766
  [preloadFile, patchPreloadNativeBridge],
651
767
  [mainFile, patchMainNativeBridge],
768
+ ...(electronCommandSourceFile ? [[mainFile, patchMainMenuDiagnostics]] : []),
652
769
  ],
653
770
  }] : []),
654
771
  ...(mermaidDiagramShellFile ? [{
@@ -0,0 +1,7 @@
1
+ function aboutMetadataRequire() {
2
+ return 'require("./codex-plus-aboutMetadata.js")';
3
+ }
4
+
5
+ module.exports = {
6
+ aboutMetadataRequire,
7
+ };
@@ -0,0 +1,7 @@
1
+ function diagnosticDetailsHook() {
2
+ return "function CPXDiagnosticDetails(e){return window.CodexPlus?.ui?.errors?.renderDetails?.(e)??null}";
3
+ }
4
+
5
+ module.exports = {
6
+ diagnosticDetailsHook,
7
+ };
@@ -0,0 +1,7 @@
1
+ function mermaidDiagramHook() {
2
+ return "function CPXMermaidDiagramProps(e){return window.CodexPlus?.ui?.mermaid?.diagramProps?.(e)}";
3
+ }
4
+
5
+ module.exports = {
6
+ mermaidDiagramHook,
7
+ };
@@ -0,0 +1,7 @@
1
+ function messageComposerHook() {
2
+ return "let CPXMC=window.CodexPlusHost.adapters.messageComposer,CPXBubbleProps=e=>CPXMC.userBubbleProps(e),CPXSurfaceProps=e=>CPXMC.composerSurfaceProps(e);";
3
+ }
4
+
5
+ module.exports = {
6
+ messageComposerHook,
7
+ };
@@ -0,0 +1,7 @@
1
+ function nativeMainHook() {
2
+ return 'let CPXNative=require("./codex-plus-native-main.js").create({electron:a});';
3
+ }
4
+
5
+ module.exports = {
6
+ nativeMainHook,
7
+ };
@@ -0,0 +1,12 @@
1
+ function projectSelectorSearchHook() {
2
+ return "let CPXP=window.CodexPlusHost.adapters.projectSelector;";
3
+ }
4
+
5
+ function projectSelectorTriggerHook() {
6
+ return "function CPXPST(e,t){return CPXP.trigger(e,t,Me)}";
7
+ }
8
+
9
+ module.exports = {
10
+ projectSelectorSearchHook,
11
+ projectSelectorTriggerHook,
12
+ };
@@ -0,0 +1,7 @@
1
+ function reviewHook() {
2
+ return "let CPXR=window.CodexPlusHost.adapters.review,CPXRM=e=>CPXR.renderBodyFromHost(e,[$,Q,s,l,ft,Or,Dr,kr,jr,y,B,of,Y,Ae,Je,yi,vi,CPXBranchPickerDropdownContent,dp,xr,Ma]);";
3
+ }
4
+
5
+ module.exports = {
6
+ reviewHook,
7
+ };
@@ -0,0 +1,12 @@
1
+ function appearanceSettingsHook() {
2
+ return "function CPXAppearanceRows(e){return window.CodexPlus?.ui?.settings?.appearance?.renderRows?.({deps:{React:X,jsx:Z.jsx,SettingRow:J,ColorInput:sn,Switch:q},variant:e})??[]}";
3
+ }
4
+
5
+ function commandMenuItemsExpression(group, jsx, menuItem, register) {
6
+ return `window.CodexPlus?.ui?.commands?.renderMenuItems?.({group:\`${group}\`,deps:{jsx:${jsx},MenuItem:${menuItem},register:${register}}})??[]`;
7
+ }
8
+
9
+ module.exports = {
10
+ appearanceSettingsHook,
11
+ commandMenuItemsExpression,
12
+ };
@@ -0,0 +1,12 @@
1
+ function projectColorHook() {
2
+ return "let CPXS=window.CodexPlusHost.adapters.sidebar,CPXPR=e=>CPXS.projectRowProps(e),CPXTR=e=>CPXS.threadRowProps(e);";
3
+ }
4
+
5
+ function sidebarMergeDataAttributes(baseExpression, extraExpression) {
6
+ return `window.CodexPlusHost.adapters.sidebar.mergeThreadRowAttributes(${baseExpression},${extraExpression})`;
7
+ }
8
+
9
+ module.exports = {
10
+ projectColorHook,
11
+ sidebarMergeDataAttributes,
12
+ };
@@ -0,0 +1,7 @@
1
+ function threadHeaderHook() {
2
+ return "let CPXTH=window.CodexPlusHost.adapters.threadHeader;function CPXThreadHeaderAccessories(e){return CPXTH.accessories(e.context,e.deps)}";
3
+ }
4
+
5
+ module.exports = {
6
+ threadHeaderHook,
7
+ };
@@ -0,0 +1,7 @@
1
+ function workerHook() {
2
+ return 'const CPXW=require("./codex-plus-worker.js"),CPXT=e=>CPXW.traceRequest(e),CPXR=(e,t,n,r)=>CPXW.repositoryTargetsFromHost(e,t,n,r,pae),CPXB=(e,t)=>CPXW.isReadOnlyBranchRequest(e,t);';
3
+ }
4
+
5
+ module.exports = {
6
+ workerHook,
7
+ };