codex-plus-patcher 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +198 -0
- package/README.md +121 -0
- package/package.json +33 -0
- package/src/cli.js +224 -0
- package/src/core/asar.js +90 -0
- package/src/core/patch-engine.js +219 -0
- package/src/core/plist.js +31 -0
- package/src/core/release.js +46 -0
- package/src/patches/26.616.41845-4198.js +262 -0
- package/src/patches/26.616.51431-4212.js +334 -0
- package/src/patches/index.js +8 -0
- package/src/plus/repositories.js +55 -0
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
const { parsePlusToml, unquoteTomlValue } = require("../plus/repositories");
|
|
2
|
+
|
|
3
|
+
const oldTitle = "<title>Codex</title>";
|
|
4
|
+
const newTitle = "<title>Codex Plus</title>";
|
|
5
|
+
const titleFile = "webview/index.html";
|
|
6
|
+
const workerFile = ".vite/build/worker.js";
|
|
7
|
+
const mainFile = ".vite/build/main-B6erVVHq.js";
|
|
8
|
+
const appShellFile = "webview/assets/app-shell-DCvuE1cb.js";
|
|
9
|
+
const generalSettingsFile = "webview/assets/general-settings-Bit-KX17.js";
|
|
10
|
+
const threadSidePanelTabsFile = "webview/assets/thread-side-panel-tabs-D0dd27Zf.js";
|
|
11
|
+
const userMessageAttachmentsFile = "webview/assets/user-message-attachments-CgyXEK9U.js";
|
|
12
|
+
const composerFile = "webview/assets/composer-CCuv6v-2.js";
|
|
13
|
+
|
|
14
|
+
function replaceOnce(text, oldText, newText, label) {
|
|
15
|
+
const matches = text.split(oldText).length - 1;
|
|
16
|
+
if (matches !== 1) throw new Error(`Expected one ${label}, found ${matches}`);
|
|
17
|
+
return text.replace(oldText, newText);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function functionSource(fn, newName, replacements = []) {
|
|
21
|
+
let source = fn.toString().replace(new RegExp(`function ${fn.name}`), `function ${newName}`);
|
|
22
|
+
for (const [from, to] of replacements) source = source.replaceAll(from, to);
|
|
23
|
+
return source;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function codexPlusWorkerHelpers() {
|
|
27
|
+
const unquoteSource = functionSource(unquoteTomlValue, "CPX_unquote");
|
|
28
|
+
const parseSource = functionSource(parsePlusToml, "CPX_parsePlusToml", [
|
|
29
|
+
["unquoteTomlValue", "CPX_unquote"],
|
|
30
|
+
]);
|
|
31
|
+
return `
|
|
32
|
+
function CPX_error(e){return{name:e?.name??null,code:e?.code??null,message:e?.message??String(e)}}function CPX_trace(e,t){try{let n=require(\`node:fs\`),r={ts:new Date().toISOString(),event:e,data:t??null};n.appendFileSync(\`/tmp/codex-plus-trace.log\`,\`\${JSON.stringify(r)}\\n\`)}catch{}}function CPX_traceRequest(e){return CPX_trace(e?.event??\`trace\`,e?.data??null),{ok:!0}}${unquoteSource}${parseSource}async function CPX_readPlusToml(e,t){let n=await t.platformPath(),r=n.join(e,\`.codex\`,\`plus.toml\`),i={path:r,attempted:!0,readOk:!1,bytes:0,preview:null,error:null};CPX_trace(\`plus-toml:read-start\`,{path:r});try{let e=await new Response(await t.readFile(r)).text();return i.readOk=!0,i.bytes=e.length,i.preview=e.slice(0,300),CPX_trace(\`plus-toml:read-ok\`,{path:r,bytes:i.bytes,preview:i.preview}),{text:e,debug:i}}catch(e){return i.error=CPX_error(e),CPX_trace(\`plus-toml:read-error\`,{path:r,error:i.error}),{text:null,debug:i}}}async function CPX_repositoryTargets(e,t,n,r){CPX_trace(\`repository-targets:start\`,{cwd:t?.cwd,hostId:t?.hostId});let i=[],a=await e.getStableMetadata(t.cwd,n);if(a==null){let e={main:null,repositories:[],warnings:[{type:\`main-not-git\`,path:t.cwd,message:\`Current directory is not inside a git repository.\`}],debug:{requestCwd:t.cwd,projectRoot:null}};return CPX_trace(\`repository-targets:main-not-git\`,e),e}let o={id:\`main:\${a.root}\`,kind:\`main\`,path:\`.\`,label:\`Main\`,cwd:a.root,root:a.root,commonDir:a.commonDir,valid:!0},s=await n.platformPath(),c=(await pae(e.getWorktreeRepositoryForRoot(a.root,n),r)).map(e=>({kind:\`submodule\`,path:e,label:e.split(\`/\`).filter(Boolean).pop()||e})),l=await CPX_readPlusToml(a.root,n),u=CPX_parsePlusToml(l.text),d=u.repositories.map(e=>({kind:\`configured\`,...e})),f={requestCwd:t.cwd,projectRoot:a.root,plusToml:{...l.debug,parsedRepositories:u.repositories.length,tableCount:u.tableCount,ignoredLines:u.ignoredLines.slice(0,12)},submoduleCandidates:c.map(e=>({path:e.path,label:e.label})),configuredCandidates:d.map(e=>({path:e.path,label:e.label??null})),accepted:[],skipped:[]},p=new Set,m=[];CPX_trace(\`repository-targets:parsed\`,{projectRoot:a.root,plusToml:f.plusToml,submoduleCandidates:f.submoduleCandidates,configuredCandidates:f.configuredCandidates});function h(e){i.push(e),f.skipped.push(e),CPX_trace(\`repository-targets:skip\`,e)}async function g(t){let r=t.path.trim();if(r.length===0){h({kind:t.kind,type:\`empty-path\`,path:r,message:\`Skipped empty repository path.\`});return}if(s.isAbsolute(r)||r===\`..\`||r.startsWith(\`../\`)||r.startsWith(\`..\\\\\`)){h({kind:t.kind,type:\`out-of-root\`,path:r,message:\`Skipped repository outside project root.\`});return}let c=s.normalize(s.join(a.root,r)),l=s.relative(a.root,c);if(l===\`\`||l===\`..\`||l.startsWith(\`..\${s.sep}\`)||s.isAbsolute(l)){h({kind:t.kind,type:\`out-of-root\`,path:r,resolved:c,relative:l,message:\`Skipped repository outside project root.\`});return}let u=b3(l),d=\`\${t.kind}:\${u}\`;if(p.has(u)){h({kind:t.kind,type:\`duplicate\`,path:u,message:\`Skipped duplicate repository path.\`});return}p.add(u);let g;try{g=await e.getStableMetadata(c,n)}catch(e){g=null,h({kind:t.kind,type:\`metadata-error\`,path:u,resolved:c,error:CPX_error(e),message:\`Failed to inspect repository metadata.\`});return}if(g==null){t.kind===\`configured\`&&h({kind:t.kind,type:\`non-git\`,path:u,resolved:c,message:\`Configured repository is not a git repository.\`});return}let _={id:d,kind:t.kind,path:u,label:t.label??u,cwd:c,root:g.root,commonDir:g.commonDir,valid:!0};m.push(_),f.accepted.push({kind:t.kind,path:u,cwd:c,root:g.root}),CPX_trace(\`repository-targets:accept\`,{kind:t.kind,path:u,cwd:c,root:g.root})}for(let e of c)await g(e);for(let e of d)await g(e);let _={main:o,repositories:m,warnings:i,debug:f};return CPX_trace(\`repository-targets:done\`,{repositoryCount:m.length,warningCount:i.length,accepted:f.accepted,skipped:f.skipped}),_}`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function patchTitle(text) {
|
|
36
|
+
return replaceOnce(text, oldTitle, newTitle, `${oldTitle} in ${titleFile}`);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const codexPlusDisclaimerHeading = "Disclaimer of Warranty and Limitation of Liability";
|
|
40
|
+
const codexPlusDisclaimerBody = [
|
|
41
|
+
'THIS SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. This is a modified, binary-patched demonstrator provided strictly for experimental or demonstration purposes.',
|
|
42
|
+
"The upstream developers, contributors, and maintainers assume NO responsibility or liability for any errors, malfunctions, data loss, or damages—including consequential or incidental damages—arising from the installation or use of this patched version. You use, test, or distribute this patched app at your sole and absolute risk.",
|
|
43
|
+
"The original authors and upstream suppliers are under no obligation to provide support, updates, fixes, or assistance with any issues, mess, or conflicts caused by this modified build.",
|
|
44
|
+
].join("\n\n");
|
|
45
|
+
|
|
46
|
+
function patchAboutDialog(text, context = {}) {
|
|
47
|
+
const appliedPatches = context.appliedPatches || [];
|
|
48
|
+
const lines = [
|
|
49
|
+
`Patcher: ${context.patcherRepoUrl || "https://github.com/OWNER/codex-plus-patcher"}`,
|
|
50
|
+
`Patcher commit: ${context.patcherGitSha || "unknown"}`,
|
|
51
|
+
`Source app.asar: ${context.sourceAsarSha256 || "unknown"}`,
|
|
52
|
+
"",
|
|
53
|
+
"Applied patches:",
|
|
54
|
+
...appliedPatches.map((patchId) => `- ${patchId}`),
|
|
55
|
+
];
|
|
56
|
+
let patched = replaceOnce(
|
|
57
|
+
text,
|
|
58
|
+
"let i=a.app.getName(),o=a.app.getVersion()",
|
|
59
|
+
"let i=`Codex Plus`,o=a.app.getVersion()",
|
|
60
|
+
"about dialog app name anchor",
|
|
61
|
+
);
|
|
62
|
+
patched = replaceOnce(
|
|
63
|
+
patched,
|
|
64
|
+
"function V0(e){return[]}",
|
|
65
|
+
`function V0(e){return ${JSON.stringify(lines)}}`,
|
|
66
|
+
"about dialog build information anchor",
|
|
67
|
+
);
|
|
68
|
+
patched = replaceOnce(
|
|
69
|
+
patched,
|
|
70
|
+
"K0({appDisplayName:i,buildInfoLabel:g,buildInfoText:v,iconDataUrl:f.htmlIconDataUrl,isDark:b,okLabel:m,title:p})",
|
|
71
|
+
`K0({appDisplayName:i,buildInfoLabel:g,buildInfoText:v,codexPlusDisclaimerHeading:${JSON.stringify(codexPlusDisclaimerHeading)},codexPlusDisclaimerBody:${JSON.stringify(codexPlusDisclaimerBody)},iconDataUrl:f.htmlIconDataUrl,isDark:b,okLabel:m,title:p})`,
|
|
72
|
+
"about dialog renderer call anchor",
|
|
73
|
+
);
|
|
74
|
+
patched = replaceOnce(
|
|
75
|
+
patched,
|
|
76
|
+
"function K0({appDisplayName:e,buildInfoLabel:t,buildInfoText:n,iconDataUrl:r,isDark:i,okLabel:a,title:o}){let s=r==null?``:",
|
|
77
|
+
"function K0({appDisplayName:e,buildInfoLabel:t,buildInfoText:n,codexPlusDisclaimerHeading:D,codexPlusDisclaimerBody:O,iconDataUrl:r,isDark:i,okLabel:a,title:o}){let q=D==null||O==null?``:`<section class=\"codex-plus-disclaimer\" aria-label=\"${(0,zz.default)(D)}\"><div class=\"codex-plus-disclaimer-heading\">${(0,zz.default)(D)}</div><div class=\"codex-plus-disclaimer-body\">${(0,zz.default)(O)}</div></section>`,s=r==null?``:",
|
|
78
|
+
"about dialog renderer signature anchor",
|
|
79
|
+
);
|
|
80
|
+
patched = replaceOnce(
|
|
81
|
+
patched,
|
|
82
|
+
" .build-info {\n width: 100%;\n margin: 0;\n line-height: 1.45;",
|
|
83
|
+
" .codex-plus-disclaimer {\n width: 100%;\n margin: 0 0 12px;\n color: var(--muted-text);\n text-align: left;\n font-size: 9px;\n line-height: 1.25;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n }\n\n .codex-plus-disclaimer-heading {\n margin-bottom: 4px;\n font-weight: 700;\n }\n\n .build-info {\n width: 100%;\n margin: 0;\n line-height: 1.45;",
|
|
84
|
+
"about dialog disclaimer styles anchor",
|
|
85
|
+
);
|
|
86
|
+
patched = replaceOnce(
|
|
87
|
+
patched,
|
|
88
|
+
" color: var(--muted-text);\n white-space: pre-wrap;",
|
|
89
|
+
" color: var(--muted-text);\n text-align: left;\n white-space: pre-wrap;",
|
|
90
|
+
"about dialog build info left align anchor",
|
|
91
|
+
);
|
|
92
|
+
patched = replaceOnce(
|
|
93
|
+
patched,
|
|
94
|
+
" .app-name,\n .build-info,\n .copyright {",
|
|
95
|
+
" .app-name,\n .codex-plus-disclaimer,\n .build-info,\n .copyright {",
|
|
96
|
+
"about dialog selectable disclaimer anchor",
|
|
97
|
+
);
|
|
98
|
+
return replaceOnce(
|
|
99
|
+
patched,
|
|
100
|
+
' <div class="app-name" id="app-name">${(0,zz.default)(e)}</div>\n <pre class="build-info" aria-label="${(0,zz.default)(t)}">${(0,zz.default)(n)}</pre>',
|
|
101
|
+
' <div class="app-name" id="app-name">${(0,zz.default)(e)}</div>\n ${q}\n <pre class="build-info" aria-label="${(0,zz.default)(t)}">${(0,zz.default)(n)}</pre>',
|
|
102
|
+
"about dialog disclaimer insertion anchor",
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function patchWorker(text) {
|
|
107
|
+
let patched = replaceOnce(
|
|
108
|
+
text,
|
|
109
|
+
"function pae(e,t){return e.queryClient.fetchQuery",
|
|
110
|
+
`${codexPlusWorkerHelpers()}function pae(e,t){return e.queryClient.fetchQuery`,
|
|
111
|
+
"worker helper insertion anchor",
|
|
112
|
+
);
|
|
113
|
+
patched = replaceOnce(
|
|
114
|
+
patched,
|
|
115
|
+
"case`submodule-paths`:a=X({paths:await pae(this.gitManager.getWorktreeRepositoryForRoot(e.params.root,r),t.signal)});break;",
|
|
116
|
+
"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;",
|
|
117
|
+
"repository-targets worker switch anchor",
|
|
118
|
+
);
|
|
119
|
+
patched = replaceOnce(
|
|
120
|
+
patched,
|
|
121
|
+
"function u2({requestKind:e,source:t}){return l2.has(e??``)||d2(t)}",
|
|
122
|
+
"function CPX_isReadOnlyBranchRequest(e,t){return t===`codex_plus_review`&&(e===`recent-branches`||e===`search-branches`)}function u2({requestKind:e,source:t}){return l2.has(e??``)||d2(t)||CPX_isReadOnlyBranchRequest(e,t)}",
|
|
123
|
+
"codex plus branch picker git allowlist anchor",
|
|
124
|
+
);
|
|
125
|
+
return replaceOnce(
|
|
126
|
+
patched,
|
|
127
|
+
"case`commit-message-diff`:case`submodule-paths`:case`cat-file`:",
|
|
128
|
+
"case`commit-message-diff`:case`codex-plus-trace`:case`repository-targets`:case`submodule-paths`:case`cat-file`:",
|
|
129
|
+
"repository-targets worker readonly method anchor",
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const codexPlusReviewHelpers = `
|
|
134
|
+
function CPX_repoKey(e){return e?.id??e?.cwd??e?.path??\`unknown\`}function CPX_label(e){return e?.kind===\`main\`?\`Main\`:e?.label??e?.path??\`Repository\`}function CPX_sessionKey(e,t,n){return JSON.stringify([e,t,n])}function CPXWarnings({warnings:e}){return!e||e.length===0?null:(0,$.jsx)(\`div\`,{className:\`px-3 py-2 text-xs text-token-description-foreground\`,children:e.map((e,t)=>(0,$.jsx)(\`div\`,{children:e.message??e.type??String(e)},\`\${e.type??\`warning\`}:\${e.path??t}\`))})}function CPXDebugText(e){try{return JSON.stringify(e,(e,t)=>typeof t===\`bigint\`?String(t):t,2)??\`\`}catch(t){return\`Unable to render debug object: \${t instanceof Error?t.message:String(t)}\`}}function CPXDebug({debug:e}){if(e==null)return null;let t=e.plusToml??{},n=t.readOk===!0?\`read ok\`:\`not read\`,r=String(t.parsedRepositories??0),i=CPXDebugText(e);return(0,$.jsxs)(\`details\`,{className:\`mx-3 mb-2 rounded-md border border-token-border bg-token-main-surface-secondary px-2 py-1 text-xs text-token-description-foreground\`,children:[(0,$.jsxs)(\`summary\`,{className:\`cursor-pointer select-none\`,children:[\`plus.toml debug: \`,n,\`, parsed \`,r]}),(0,$.jsx)(\`pre\`,{className:\`mt-2 max-h-72 overflow-auto whitespace-pre-wrap font-vscode-editor text-[11px] leading-4 text-token-foreground\`,children:i})]})}function CPXMainGroup({children:e,repo:t,collapsed:n,onToggle:r}){return(0,$.jsxs)(\`section\`,{className:\`border-b border-token-border-default\`,children:[(0,$.jsxs)(\`button\`,{type:\`button\`,className:\`flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-sm text-token-foreground hover:bg-token-list-hover-background\`,onClick:r,"aria-expanded":!n,children:[(0,$.jsxs)(\`span\`,{className:\`min-w-0\`,children:[(0,$.jsx)(\`span\`,{className:\`font-medium\`,children:CPX_label(t)}),(0,$.jsx)(\`span\`,{className:\`ml-2 text-xs text-token-description-foreground\`,children:t?.path??\`.\`})]}),(0,$.jsx)(\`span\`,{className:\`shrink-0 text-xs text-token-description-foreground\`,children:n?\`Show\`:\`Hide\`})]}),n?null:e]})}function CPXBranchPicker({repo:e,hostConfig:t,baseBranch:n,setBaseBranch:r}){let[i,a]=(0,Q.useState)(!1),[o,s]=(0,Q.useState)([]),[c,l]=(0,Q.useState)(!1),[u,d]=(0,Q.useState)(null),[f,m]=(0,Q.useState)(\`\`),[h,g]=(0,Q.useState)([]),[_,v]=(0,Q.useState)(!1),[A0,b]=(0,Q.useState)(null),x=(n??\`\`).trim(),S=()=>{let n=new AbortController;l(!0),d(null),y(\`git\`).request({method:\`recent-branches\`,params:{root:e.root,limit:100,hostConfig:t,operationSource:\`codex_plus_review\`},signal:n.signal}).then(e=>{s(e?.branches??[])}).catch(e=>{n.signal.aborted||d(e instanceof Error?e.message:String(e))}).finally(()=>{n.signal.aborted||l(!1)});return n};(0,Q.useEffect)(()=>{if(!i)return;let e=S();return()=>e.abort()},[i,e.root,t.id]);(0,Q.useEffect)(()=>{if(!i)return;let n=f.trim();if(n.length===0){g([]),b(null),v(!1);return}let r=new AbortController,A=setTimeout(()=>{v(!0),b(null),y(\`git\`).request({method:\`search-branches\`,params:{root:e.root,query:n,limit:50,hostConfig:t,operationSource:\`codex_plus_review\`},signal:r.signal}).then(e=>{g(e?.branches??[])}).catch(e=>{r.signal.aborted||b(e instanceof Error?e.message:String(e))}).finally(()=>{r.signal.aborted||v(!1)})},250);return()=>{clearTimeout(A),r.abort()}},[i,f,e.root,t.id]);let C=x.length>0?x:\`Unstaged\`,w=x.length>0?null:\`Working tree changes\`,T=(0,$.jsxs)(Y,{type:\`button\`,color:x.length>0?\`ghostActive\`:\`ghost\`,size:\`toolbar\`,className:\`max-w-44 min-w-0 shrink-0 border-token-border px-1.5\`,children:[(0,$.jsx)(\`span\`,{className:\`min-w-0 truncate\`,children:C}),(0,$.jsx)(Je,{className:\`icon-2xs text-token-input-placeholder-foreground\`})]}),E=(0,$.jsx)(Ae,{tooltipContent:w??\`Base branch: \${C}\`,children:T}),D=(0,$.jsx)(CPXBranchPickerDropdownContent,{branches:o,selectedBranch:x,disabled:!1,isError:u!=null,isLoading:c,isSearchError:A0!=null,isSearchLoading:_,onClose:()=>a(!1),onRetry:S,onRetrySearch:()=>m(f),onSearchQueryChange:m,onSelectBranch:e=>{r(e),a(!1)},searchedBranches:h,searchQuery:f}),O=x.length>0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(vi.Separator,{}),(0,$.jsx)(vi.Item,{onSelect:()=>{r(\`\`),a(!1)},children:\`Show unstaged changes\`})]}):null;return(0,$.jsx)(yi,{align:\`end\`,contentWidth:\`menu\`,open:i,onOpenChange:a,triggerButton:E,children:(0,$.jsxs)($.Fragment,{children:[D,O]})})}function CPXRepoPatchGroup({repo:e,hostConfig:t,hostId:n,conversationId:r,baseBranch:i,setBaseBranch:a,collapsed:o,setCollapsed:s}){let[c,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(!1),[f,m]=(0,Q.useState)(null),[h,g]=(0,Q.useState)(null);(0,Q.useEffect)(()=>{let r=!1,A=new AbortController;l(null),m(null),d(!0),y(\`git\`).request({method:\`current-branch\`,params:{root:e.root,hostConfig:t,operationSource:\`codex_plus_review\`},signal:A.signal}).then(e=>{r||g(e?.branch??null)}).catch(e=>{r||g(null)});let C=(i??\`\`).trim(),D=C.length>0?\`branch\`:\`unstaged\`;y(\`git\`).request({method:\`review-patch\`,params:{cwd:B(e.cwd),source:D,operationSource:\`codex_plus_review\`,hostConfig:t,...C.length>0?{baseBranch:C}:{}},signal:A.signal}).then(e=>{if(r)return;let t=e?.diff?.type===\`success\`?(e.diff.unifiedDiff??e.diff.diff??\`\`):\`\`;l(t.trim().length>0?t:null)}).catch(e=>{r||m(e instanceof Error?e.message:String(e))}).finally(()=>{r||d(!1)});return()=>{r=!0,A.abort()}},[e.cwd,e.root,t.id,i]);let _=CPX_label(e),v=e.path??\`\`,A0=(i??\`\`).trim(),b=f??(u?\`Loading diff...\`:c==null?\`No changes\`:c);return(0,$.jsxs)(\`section\`,{className:\`border-b border-token-border-default\`,children:[(0,$.jsxs)(\`div\`,{className:\`flex min-w-0 items-center gap-2 px-3 py-2\`,children:[(0,$.jsxs)(\`button\`,{type:\`button\`,className:\`min-w-0 flex-1 text-left hover:bg-token-list-hover-background\`,onClick:()=>s(!o),"aria-expanded":!o,children:[(0,$.jsx)(\`div\`,{className:\`truncate text-sm font-medium text-token-foreground\`,children:_}),(0,$.jsx)(\`div\`,{className:\`truncate text-xs text-token-description-foreground\`,children:[e.kind,v,h?\` - \${h}\`:\`\`].filter(Boolean).join(\` / \`)})]}),(0,$.jsx)(CPXBranchPicker,{repo:e,hostConfig:t,baseBranch:i,setBaseBranch:a}),(0,$.jsx)(dp,{conversationId:r,cwd:e.cwd,hostId:n,codexWorktree:!1,surface:\`review-toolbar\`,reviewToolbarCompact:!0},e.id)]}),o?null:(0,$.jsx)(\`pre\`,{className:\`mx-3 mb-3 max-h-[520px] overflow-auto whitespace-pre-wrap rounded-md border border-token-border bg-token-main-surface-secondary p-3 font-vscode-editor text-xs leading-5 text-token-foreground\`,children:b})]})}function CPXReviewMux(e){let t=s(ft),n=l(Or),r=l(Dr),i=l(kr),a=l(jr),o=t.value.routeKind===\`local-thread\`?t.value.conversationId:null,[c,u]=(0,Q.useState)(null),[d,f]=(0,Q.useState)(()=>new Map),[m,h]=(0,Q.useState)(()=>new Map),p=e.mainReviewContent,g=(0,Q.useMemo)(()=>p??(0,$.jsx)(of,e),[p,e.diffRefs,e.diffMode,e.isCappedMode,e.reviewDiffMetrics,e.showReviewGitActions]);(0,Q.useEffect)(()=>{if(n==null||i==null){u(null);return}let e=!1,t=new AbortController;y(\`git\`).request({method:\`repository-targets\`,params:{cwd:B(n),hostId:r,hostConfig:i,operationSource:\`codex_plus_review\`},signal:t.signal}).then(t=>{e||u(t)}).catch(t=>{u({main:null,repositories:[],warnings:[{type:\`load-error\`,message:t instanceof Error?t.message:String(t)}]})});return()=>{e=!0,t.abort()}},[n,r,i?.id]);let _=c?.main??(n==null?null:{id:\`main:\${n}\`,kind:\`main\`,path:\`.\`,label:\`Main\`,cwd:n}),v=_,A0=c?.repositories??[],b=[v,...A0].filter(Boolean);if(_==null||b.length<=1&&(!c?.warnings||c.warnings.length===0)&&c?.debug==null)return g;let x=CPX_sessionKey(r,o,n),S=e=>\`\${x}:\${CPX_repoKey(e)}\`,C=e=>d.get(S(e))===!0,w=(e,t)=>f(n=>{let r=new Map(n);return t?r.set(S(e),!0):r.delete(S(e)),r}),T=(e,t)=>h(n=>{let r=new Map(n);return r.set(S(e),t),r});return(0,$.jsxs)(\`div\`,{className:\`flex flex-col\`,children:[(0,$.jsx)(\`div\`,{className:\`px-3 py-1 text-[11px] font-medium uppercase tracking-wide text-token-description-foreground\`,children:\`Codex Plus repositories\`}),(0,$.jsx)(CPXWarnings,{warnings:c?.warnings??[]}),(0,$.jsx)(CPXDebug,{debug:c?.debug}),_?(0,$.jsx)(CPXMainGroup,{repo:_,collapsed:C(_),onToggle:()=>w(_,!C(_)),children:g},CPX_repoKey(_)):g,A0.map(e=>(0,$.jsx)(CPXRepoPatchGroup,{repo:e,hostConfig:i,hostId:r,conversationId:o,baseBranch:m.get(S(e))??\`\`,setBaseBranch:t=>T(e,t),collapsed:C(e),setCollapsed:t=>w(e,t)},CPX_repoKey(e)))]})}`;
|
|
135
|
+
|
|
136
|
+
const codexPlusSubrepoDiffHelpers = `
|
|
137
|
+
function CPXPlainDiff({text:e}){return(0,$.jsx)(\`pre\`,{className:\`mx-3 mb-3 max-h-[520px] overflow-auto whitespace-pre-wrap rounded-md border border-token-border bg-token-main-surface-secondary p-3 font-vscode-editor text-xs leading-5 text-token-foreground\`,children:e})}function CPXRepoDiffBody({cwd:e,hostConfig:t,conversationId:n,diffMode:r,diffText:i,statusText:a,error:o,isLoading:s}){if(o!=null||s||i==null)return(0,$.jsx)(CPXPlainDiff,{text:a});let c;try{c=xr(i)}catch(e){let t=e instanceof Error?e.message:String(e);return(0,$.jsx)(CPXPlainDiff,{text:\`Unable to parse diff: \${t}\\n\\n\${i}\`})}return c==null||c.length===0?(0,$.jsx)(CPXPlainDiff,{text:a}):(0,$.jsx)(\`div\`,{className:\`mx-3 mb-3 flex flex-col gap-2\`,children:c.map((a,o)=>(0,Q.createElement)(Ma,{key:\`\${a.metadata?.newPath??a.metadata?.oldPath??o}:\${o}\`,containerClassName:\`codex-review-diff-card extension:rounded-lg\`,conversationId:n??void 0,cwd:B(e),defaultOpen:!0,diff:a,diffViewWrap:!0,expandScope:\`review\`,fullContentNextFallbackToDisk:!0,headerVariant:\`full-review\`,hostConfig:t,hunkActionsVariant:\`unstaged\`,hunkSeparators:a.metadata?.additionLines?\`line-info\`:\`metadata\`,roundedCorners:!1,showFileActions:!1,showHunkActions:!1,stickyHeader:!1,viewType:r??\`unified\`}))})}`;
|
|
138
|
+
|
|
139
|
+
function patchThreadSidePanelTabs(text) {
|
|
140
|
+
let patched = replaceOnce(
|
|
141
|
+
text,
|
|
142
|
+
"import{r as vi,t as yi}from\"./dropdown-CTBRoADH.js\";",
|
|
143
|
+
"import{r as vi,t as yi}from\"./dropdown-CTBRoADH.js\";import{t as CPXBranchPickerDropdownContent}from\"./git-branch-picker-dropdown-content-Ch_voM6R.js\";",
|
|
144
|
+
"branch picker content import anchor",
|
|
145
|
+
);
|
|
146
|
+
patched = replaceOnce(
|
|
147
|
+
patched,
|
|
148
|
+
"function uf({cwd:e,fileEntries:t,generatedPathsReady:n,hasUnhandledAttributesFiles:r,isCappedMode:i,repositorySource:a,reviewSummarySource:o}){",
|
|
149
|
+
`${codexPlusSubrepoDiffHelpers}${codexPlusReviewHelpers}function uf({cwd:e,fileEntries:t,generatedPathsReady:n,hasUnhandledAttributesFiles:r,isCappedMode:i,repositorySource:a,reviewSummarySource:o}){`,
|
|
150
|
+
"review helpers insertion anchor",
|
|
151
|
+
);
|
|
152
|
+
patched = replaceOnce(
|
|
153
|
+
patched,
|
|
154
|
+
"function CPXRepoPatchGroup({repo:e,hostConfig:t,hostId:n,conversationId:r,baseBranch:i,setBaseBranch:a,collapsed:o,setCollapsed:s}){",
|
|
155
|
+
"function CPXRepoPatchGroup({repo:e,hostConfig:t,hostId:n,conversationId:r,diffMode:A1,baseBranch:i,setBaseBranch:a,collapsed:o,setCollapsed:s}){",
|
|
156
|
+
"subrepo diff mode prop anchor",
|
|
157
|
+
);
|
|
158
|
+
patched = replaceOnce(
|
|
159
|
+
patched,
|
|
160
|
+
"o?null:(0,$.jsx)(`pre`,{className:`mx-3 mb-3 max-h-[520px] overflow-auto whitespace-pre-wrap rounded-md border border-token-border bg-token-main-surface-secondary p-3 font-vscode-editor text-xs leading-5 text-token-foreground`,children:b})",
|
|
161
|
+
"o?null:(0,$.jsx)(CPXRepoDiffBody,{cwd:e.cwd,hostConfig:t,conversationId:r,diffMode:A1,diffText:c,statusText:b,error:f,isLoading:u})",
|
|
162
|
+
"subrepo highlighted diff body anchor",
|
|
163
|
+
);
|
|
164
|
+
patched = replaceOnce(
|
|
165
|
+
patched,
|
|
166
|
+
"CPXRepoPatchGroup,{repo:e,hostConfig:i,hostId:r,conversationId:o,baseBranch:m.get(S(e))??``",
|
|
167
|
+
"CPXRepoPatchGroup,{repo:e,hostConfig:i,hostId:r,conversationId:o,diffMode:a,baseBranch:m.get(S(e))??``",
|
|
168
|
+
"subrepo diff mode caller anchor",
|
|
169
|
+
);
|
|
170
|
+
patched = replaceOnce(
|
|
171
|
+
patched,
|
|
172
|
+
"className:`mx-3 mb-3 flex flex-col gap-2`",
|
|
173
|
+
"className:`mx-3 mb-3 flex min-w-0 max-w-none flex-col gap-2`",
|
|
174
|
+
"subrepo diff body width anchor",
|
|
175
|
+
);
|
|
176
|
+
patched = replaceOnce(
|
|
177
|
+
patched,
|
|
178
|
+
"children:c.map((a,o)=>(0,Q.createElement)(Ma,{key:`${a.metadata?.newPath??a.metadata?.oldPath??o}:${o}`,containerClassName:`codex-review-diff-card extension:rounded-lg`",
|
|
179
|
+
"children:c.map((a,o)=>(0,Q.createElement)(Ma,{key:`${a.metadata?.newPath??a.metadata?.oldPath??o}:${o}`,containerClassName:`codex-review-diff-card extension:rounded-lg w-full max-w-none`",
|
|
180
|
+
"subrepo diff card width anchor",
|
|
181
|
+
);
|
|
182
|
+
patched = replaceOnce(
|
|
183
|
+
patched,
|
|
184
|
+
"return(0,$.jsxs)(`div`,{className:`flex flex-col`,children:[(0,$.jsx)(`div`,{className:`px-3 py-1 text-[11px] font-medium uppercase tracking-wide text-token-description-foreground`,children:`Codex Plus repositories`})",
|
|
185
|
+
"return(0,$.jsxs)(`div`,{className:`flex h-full min-h-0 w-full min-w-0 flex-1 flex-col overflow-x-hidden overflow-y-auto`,children:[(0,$.jsx)(`div`,{className:`px-3 py-1 text-[11px] font-medium uppercase tracking-wide text-token-description-foreground`,children:`Codex Plus repositories`})",
|
|
186
|
+
"review mux scroll container anchor",
|
|
187
|
+
);
|
|
188
|
+
return replaceOnce(
|
|
189
|
+
patched,
|
|
190
|
+
"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;",
|
|
191
|
+
"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})}),t[1]=a,t[2]=r,t[3]=i,t[4]=s):s=t[4];let c;",
|
|
192
|
+
"review body mux anchor",
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function patchAppShell(text) {
|
|
197
|
+
let patched = replaceOnce(
|
|
198
|
+
text,
|
|
199
|
+
"function En(e){return(0,Q.jsx)(wn,{onRetry:()=>{e.resetError()}})}",
|
|
200
|
+
"function En(e){return(0,Q.jsx)(wn,{error:e.error,onRetry:()=>{e.resetError()}})}",
|
|
201
|
+
"app shell error fallback prop anchor",
|
|
202
|
+
);
|
|
203
|
+
patched = replaceOnce(
|
|
204
|
+
patched,
|
|
205
|
+
"children:[r,(0,Q.jsx)(Le,{color:`secondary`,size:`default`,onClick:n,children:i})]",
|
|
206
|
+
"children:[r,(0,Q.jsx)(`pre`,{className:`max-h-80 max-w-full overflow-auto whitespace-pre-wrap rounded-md border border-token-border bg-token-main-surface-secondary p-2 text-left font-vscode-editor text-[11px] leading-4 text-token-text-primary`,children:e.error?.stack??e.error?.message??String(e.error??``)}),(0,Q.jsx)(Le,{color:`secondary`,size:`default`,onClick:n,children:i})]",
|
|
207
|
+
"app shell error detail insertion anchor",
|
|
208
|
+
);
|
|
209
|
+
patched = replaceOnce(
|
|
210
|
+
patched,
|
|
211
|
+
"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:",
|
|
212
|
+
"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:",
|
|
213
|
+
"app shell error cache condition anchor",
|
|
214
|
+
);
|
|
215
|
+
return replaceOnce(
|
|
216
|
+
patched,
|
|
217
|
+
"}),t[2]=n,t[3]=a),a}function Tn(e){return e.composedPath().some",
|
|
218
|
+
"}),t[2]=n,t[3]=e.error,t[4]=a),a}function Tn(e){return e.composedPath().some",
|
|
219
|
+
"app shell error cache assignment anchor",
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
const codexPlusUserBubbleSettingsHelpers = `
|
|
224
|
+
const CPX_USER_BUBBLE_COLORS_KEY=\`codex-plus:user-message-bubble-colors\`,CPX_USER_BUBBLE_COLORS_EVENT=\`codex-plus:user-message-bubble-colors-change\`;function CPX_isUserBubbleColor(e){return typeof e===\`string\`&&/^#[0-9a-fA-F]{6}$/.test(e)}function CPX_defaultUserBubbleColor(e){return e===\`dark\`?\`#2f2f2f\`:\`#f2f2f2\`}function CPX_isStoredUserBubbleColor(e,t){return CPX_isUserBubbleColor(t)&&t.toLowerCase()!==CPX_defaultUserBubbleColor(e)}function CPX_readUserBubbleColors(){try{let e=JSON.parse(localStorage.getItem(CPX_USER_BUBBLE_COLORS_KEY)??\`{}\`)??{};return{light:CPX_isStoredUserBubbleColor(\`light\`,e.light)?e.light:\`\`,dark:CPX_isStoredUserBubbleColor(\`dark\`,e.dark)?e.dark:\`\`}}catch{return{light:\`\`,dark:\`\`}}}function CPX_writeUserBubbleColor(e,t){let n=CPX_readUserBubbleColors();CPX_isStoredUserBubbleColor(e,t)?n[e]=t:delete n[e],localStorage.setItem(CPX_USER_BUBBLE_COLORS_KEY,JSON.stringify(n)),window.dispatchEvent(new CustomEvent(CPX_USER_BUBBLE_COLORS_EVENT,{detail:n}))}function CPXUserBubbleColorRow({variant:e,label:t,ariaLabel:n}){let[r,i]=(0,X.useState)(()=>CPX_readUserBubbleColors()[e]||CPX_defaultUserBubbleColor(e));return(0,X.useEffect)(()=>{let t=()=>i(CPX_readUserBubbleColors()[e]||CPX_defaultUserBubbleColor(e));return window.addEventListener(CPX_USER_BUBBLE_COLORS_EVENT,t),()=>window.removeEventListener(CPX_USER_BUBBLE_COLORS_EVENT,t)},[e]),(0,Z.jsx)(J,{control:(0,Z.jsx)(sn,{ariaLabel:n,value:r,onChange:t=>{i(t),CPX_writeUserBubbleColor(e,t)}}),label:t,variant:\`nested\`})}
|
|
225
|
+
`;
|
|
226
|
+
|
|
227
|
+
function patchGeneralSettings(text) {
|
|
228
|
+
let patched = replaceOnce(
|
|
229
|
+
text,
|
|
230
|
+
"function tn({showCodeFont:e,showTranslucentSidebarToggle:t,variant:n}){",
|
|
231
|
+
`${codexPlusUserBubbleSettingsHelpers}function tn({showCodeFont:e,showTranslucentSidebarToggle:t,variant:n}){`,
|
|
232
|
+
"user bubble settings helper insertion anchor",
|
|
233
|
+
);
|
|
234
|
+
patched = replaceOnce(
|
|
235
|
+
patched,
|
|
236
|
+
"chromeThemeCodeFont:{id:`settings.general.appearance.chromeTheme.codeFontFamily.short`,defaultMessage:`Code font`,description:`Short label for the code font input`},pointerCursors:",
|
|
237
|
+
"chromeThemeCodeFont:{id:`settings.general.appearance.chromeTheme.codeFontFamily.short`,defaultMessage:`Code font`,description:`Short label for the code font input`},userBubble:{id:`settings.general.appearance.userMessageBubble.short`,defaultMessage:`User bubble`,description:`Short label for the user message bubble color input`},pointerCursors:",
|
|
238
|
+
"user bubble settings message anchor",
|
|
239
|
+
);
|
|
240
|
+
patched = replaceOnce(
|
|
241
|
+
patched,
|
|
242
|
+
"let r=a(s),i=N(),o=i.formatMessage(Q.chromeThemeAccent),c=i.formatMessage(Q.chromeThemeBackground),l=i.formatMessage(Q.chromeThemeForeground),u=i.formatMessage(Q.chromeThemeContrast),d=i.formatMessage(Q.chromeThemeTranslucentSidebar),",
|
|
243
|
+
"let r=a(s),i=N(),o=i.formatMessage(Q.chromeThemeAccent),c=i.formatMessage(Q.chromeThemeBackground),l=i.formatMessage(Q.chromeThemeForeground),CPX_userBubbleLabel=i.formatMessage(Q.userBubble),u=i.formatMessage(Q.chromeThemeContrast),d=i.formatMessage(Q.chromeThemeTranslucentSidebar),",
|
|
244
|
+
"user bubble settings label anchor",
|
|
245
|
+
);
|
|
246
|
+
return replaceOnce(
|
|
247
|
+
patched,
|
|
248
|
+
"children:[D.map(e=>(0,Z.jsx)(J,{control:(0,Z.jsx)(sn,{ariaLabel:e.ariaLabel,value:x[e.role],onChange:t=>{k(e.role,t)}}),label:e.label,variant:`nested`},e.role)),O.map",
|
|
249
|
+
"children:[D.map(e=>(0,Z.jsx)(J,{control:(0,Z.jsx)(sn,{ariaLabel:e.ariaLabel,value:x[e.role],onChange:t=>{k(e.role,t)}}),label:e.label,variant:`nested`},e.role)),(0,Z.jsx)(CPXUserBubbleColorRow,{variant:n,label:CPX_userBubbleLabel,ariaLabel:i.formatMessage({id:`settings.general.appearance.userMessageBubble`,defaultMessage:`{variant} user message bubble color`,description:`Aria label for the user message bubble color input in appearance settings`},{variant:S})}),O.map",
|
|
250
|
+
"user bubble settings row anchor",
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
const codexPlusUserBubbleHelpers = `
|
|
255
|
+
const CPX_USER_BUBBLE_COLORS_KEY=\`codex-plus:user-message-bubble-colors\`,CPX_USER_BUBBLE_COLORS_EVENT=\`codex-plus:user-message-bubble-colors-change\`;function CPX_isUserBubbleColor(e){return typeof e===\`string\`&&/^#[0-9a-fA-F]{6}$/.test(e)}function CPX_defaultUserBubbleColor(e){return e===\`dark\`?\`#2f2f2f\`:\`#f2f2f2\`}function CPX_isStoredUserBubbleColor(e,t){return CPX_isUserBubbleColor(t)&&t.toLowerCase()!==CPX_defaultUserBubbleColor(e)}function CPX_readUserBubbleColors(){try{let e=JSON.parse(localStorage.getItem(CPX_USER_BUBBLE_COLORS_KEY)??\`{}\`)??{};return{light:CPX_isStoredUserBubbleColor(\`light\`,e.light)?e.light:null,dark:CPX_isStoredUserBubbleColor(\`dark\`,e.dark)?e.dark:null}}catch{return{light:null,dark:null}}}function CPX_userBubbleTextColor(e){let t=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16),i=e=>{let t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)},a=.2126*i(t)+.7152*i(n)+.0722*i(r);return a>.46?\`#111111\`:\`#ffffff\`}function CPX_setUserBubbleVars(){let e=CPX_readUserBubbleColors(),t=document.documentElement;for(let n of[\`light\`,\`dark\`]){let r=e[n];r==null?(t.style.removeProperty(\`--codex-plus-user-bubble-\${n}-bg\`),t.style.removeProperty(\`--codex-plus-user-bubble-\${n}-fg\`)):(t.style.setProperty(\`--codex-plus-user-bubble-\${n}-bg\`,r),t.style.setProperty(\`--codex-plus-user-bubble-\${n}-fg\`,CPX_userBubbleTextColor(r)))}}function CPX_installUserBubbleColors(){if(typeof document===\`undefined\`)return;let e=\`codex-plus-user-bubble-colors\`;document.getElementById(e)==null&&document.head?.appendChild(Object.assign(document.createElement(\`style\`),{id:e,textContent:\`:root:not(.dark):not(.electron-dark) :is([data-codex-plus-user-bubble],[data-codex-plus-user-entry]){background-color:var(--codex-plus-user-bubble-light-bg);color:var(--codex-plus-user-bubble-light-fg)}:root:not(.dark):not(.electron-dark) [data-codex-plus-user-entry] :is(.ProseMirror,.ProseMirror *,textarea,[contenteditable="true"],[data-placeholder]),:root:not(.dark):not(.electron-dark) [data-codex-plus-user-entry] :is(button:not([class*="bg-token-foreground"]),[role="button"]:not([class*="bg-token-foreground"]),button:not([class*="bg-token-foreground"]) svg,[role="button"]:not([class*="bg-token-foreground"]) svg,[class*="text-token-foreground"],[class*="text-token-description-foreground"],[class*="text-token-input-placeholder-foreground"]){color:var(--codex-plus-user-bubble-light-fg)}:root:not(.dark):not(.electron-dark) [data-codex-plus-user-entry] :is([data-placeholder],[class*="text-token-input-placeholder-foreground"])::before,:root:not(.dark):not(.electron-dark) [data-codex-plus-user-entry] :is([data-placeholder],[class*="text-token-input-placeholder-foreground"])::after,:root:not(.dark):not(.electron-dark) [data-codex-plus-user-entry] :is(input,textarea,[contenteditable="true"],[class*="placeholder:text-token-input-placeholder-foreground"])::placeholder{color:var(--codex-plus-user-bubble-light-fg)}:root.dark :is([data-codex-plus-user-bubble],[data-codex-plus-user-entry]),:root.electron-dark :is([data-codex-plus-user-bubble],[data-codex-plus-user-entry]){background-color:var(--codex-plus-user-bubble-dark-bg);color:var(--codex-plus-user-bubble-dark-fg)}:root.dark [data-codex-plus-user-entry] :is(.ProseMirror,.ProseMirror *,textarea,[contenteditable="true"],[data-placeholder]),:root.electron-dark [data-codex-plus-user-entry] :is(.ProseMirror,.ProseMirror *,textarea,[contenteditable="true"],[data-placeholder]),:root.dark [data-codex-plus-user-entry] :is(button:not([class*="bg-token-foreground"]),[role="button"]:not([class*="bg-token-foreground"]),button:not([class*="bg-token-foreground"]) svg,[role="button"]:not([class*="bg-token-foreground"]) svg,[class*="text-token-foreground"],[class*="text-token-description-foreground"],[class*="text-token-input-placeholder-foreground"]),:root.electron-dark [data-codex-plus-user-entry] :is(button:not([class*="bg-token-foreground"]),[role="button"]:not([class*="bg-token-foreground"]),button:not([class*="bg-token-foreground"]) svg,[role="button"]:not([class*="bg-token-foreground"]) svg,[class*="text-token-foreground"],[class*="text-token-description-foreground"],[class*="text-token-input-placeholder-foreground"]){color:var(--codex-plus-user-bubble-dark-fg)}:root.dark [data-codex-plus-user-entry] :is([data-placeholder],[class*="text-token-input-placeholder-foreground"])::before,:root.dark [data-codex-plus-user-entry] :is([data-placeholder],[class*="text-token-input-placeholder-foreground"])::after,:root.dark [data-codex-plus-user-entry] :is(input,textarea,[contenteditable="true"],[class*="placeholder:text-token-input-placeholder-foreground"])::placeholder,:root.electron-dark [data-codex-plus-user-entry] :is([data-placeholder],[class*="text-token-input-placeholder-foreground"])::before,:root.electron-dark [data-codex-plus-user-entry] :is([data-placeholder],[class*="text-token-input-placeholder-foreground"])::after,:root.electron-dark [data-codex-plus-user-entry] :is(input,textarea,[contenteditable="true"],[class*="placeholder:text-token-input-placeholder-foreground"])::placeholder{color:var(--codex-plus-user-bubble-dark-fg)}\`})),CPX_setUserBubbleVars(),window.addEventListener(CPX_USER_BUBBLE_COLORS_EVENT,CPX_setUserBubbleVars)}CPX_installUserBubbleColors();
|
|
256
|
+
`;
|
|
257
|
+
|
|
258
|
+
function patchUserMessageAttachments(text) {
|
|
259
|
+
let patched = replaceOnce(
|
|
260
|
+
text,
|
|
261
|
+
"var Z=i(),Q=e(n(),1),$=r();function Ue(e){",
|
|
262
|
+
`var Z=i(),Q=e(n(),1),$=r();${codexPlusUserBubbleHelpers}function Ue(e){`,
|
|
263
|
+
"user bubble helper insertion anchor",
|
|
264
|
+
);
|
|
265
|
+
patched = replaceOnce(
|
|
266
|
+
patched,
|
|
267
|
+
"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`),",
|
|
268
|
+
"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,\"data-codex-plus-user-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`),",
|
|
269
|
+
"user bubble marker attribute anchor",
|
|
270
|
+
);
|
|
271
|
+
return replaceOnce(
|
|
272
|
+
patched,
|
|
273
|
+
"return(0,$.jsx)(`form`,{className:`relative flex w-full flex-col rounded-3xl bg-token-foreground/5`,onSubmit:e=>{e.preventDefault(),v()},children:",
|
|
274
|
+
"return(0,$.jsx)(`form`,{\"data-codex-plus-user-entry\":!0,className:`relative flex w-full flex-col rounded-3xl bg-token-foreground/5`,onSubmit:e=>{e.preventDefault(),v()},children:",
|
|
275
|
+
"edit user message entry marker anchor",
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
function patchComposer(text) {
|
|
280
|
+
let patched = replaceOnce(
|
|
281
|
+
text,
|
|
282
|
+
"function oh(e){let t=(0,$.c)(13),",
|
|
283
|
+
`${codexPlusUserBubbleHelpers}function oh(e){let t=(0,$.c)(13),`,
|
|
284
|
+
"composer user bubble helper insertion anchor",
|
|
285
|
+
);
|
|
286
|
+
return replaceOnce(
|
|
287
|
+
patched,
|
|
288
|
+
"(0,Q.jsx)(Jt.div,{inert:a,className:v,onDragEnter:c,onDragOver:u,onDragLeave:l,onDrop:d,children:n})",
|
|
289
|
+
"(0,Q.jsx)(Jt.div,{inert:a,\"data-codex-plus-user-entry\":!0,className:v,onDragEnter:c,onDragOver:u,onDragLeave:l,onDrop:d,children:n})",
|
|
290
|
+
"composer user entry marker anchor",
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
module.exports = {
|
|
295
|
+
id: "codex-26.616.51431-4212",
|
|
296
|
+
codexVersion: "26.616.51431",
|
|
297
|
+
bundleVersion: "4212",
|
|
298
|
+
asarSha256: "7964ba848dfbe8fb6a6e149f4b2d74865956eb2f9e75b17211d01deb61f9b230",
|
|
299
|
+
patches: [
|
|
300
|
+
{
|
|
301
|
+
id: "bundle-identity",
|
|
302
|
+
infoPlistStrings: {
|
|
303
|
+
CFBundleDisplayName: "Codex Plus",
|
|
304
|
+
CFBundleName: "Codex Plus",
|
|
305
|
+
CFBundleIdentifier: "com.openai.codex-plus",
|
|
306
|
+
},
|
|
307
|
+
fileTransforms: [[titleFile, patchTitle]],
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
id: "about-codex-plus-metadata",
|
|
311
|
+
fileTransforms: [[mainFile, patchAboutDialog]],
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
id: "nested-repository-worker",
|
|
315
|
+
fileTransforms: [[workerFile, patchWorker]],
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
id: "multi-repository-review",
|
|
319
|
+
fileTransforms: [[threadSidePanelTabsFile, patchThreadSidePanelTabs]],
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
id: "diagnostic-error-boundary",
|
|
323
|
+
fileTransforms: [[appShellFile, patchAppShell]],
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
id: "user-message-bubble-colors",
|
|
327
|
+
fileTransforms: [
|
|
328
|
+
[generalSettingsFile, patchGeneralSettings],
|
|
329
|
+
[userMessageAttachmentsFile, patchUserMessageAttachments],
|
|
330
|
+
[composerFile, patchComposer],
|
|
331
|
+
],
|
|
332
|
+
},
|
|
333
|
+
],
|
|
334
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
function unquoteTomlValue(value) {
|
|
2
|
+
const trimmed = value.trim();
|
|
3
|
+
if (
|
|
4
|
+
(trimmed.startsWith('"') && trimmed.endsWith('"')) ||
|
|
5
|
+
(trimmed.startsWith("'") && trimmed.endsWith("'"))
|
|
6
|
+
) {
|
|
7
|
+
return trimmed.slice(1, -1).replace(/\\(["\\])/g, "$1");
|
|
8
|
+
}
|
|
9
|
+
return trimmed;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function parsePlusToml(text) {
|
|
13
|
+
const repositories = [];
|
|
14
|
+
const ignoredLines = [];
|
|
15
|
+
let current = null;
|
|
16
|
+
|
|
17
|
+
if (text == null) {
|
|
18
|
+
return { repositories, tableCount: 0, ignoredLines };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let lineNumber = 0;
|
|
22
|
+
for (const rawLine of text.split(/\r?\n/)) {
|
|
23
|
+
lineNumber += 1;
|
|
24
|
+
const line = rawLine.replace(/#.*$/g, "").trim();
|
|
25
|
+
if (line.length === 0) continue;
|
|
26
|
+
if (line === "[[repositories]]") {
|
|
27
|
+
current = {};
|
|
28
|
+
repositories.push(current);
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const match = /^([A-Za-z0-9_-]+)\s*=\s*(.+)$/.exec(line);
|
|
33
|
+
if (match && current) current[match[1]] = unquoteTomlValue(match[2]);
|
|
34
|
+
else ignoredLines.push({ line: lineNumber, text: rawLine.slice(0, 160) });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
repositories: repositories
|
|
39
|
+
.filter((entry) => typeof entry.path === "string" && entry.path.trim().length > 0)
|
|
40
|
+
.map((entry) => ({
|
|
41
|
+
path: entry.path.trim(),
|
|
42
|
+
label:
|
|
43
|
+
typeof entry.label === "string" && entry.label.trim().length > 0
|
|
44
|
+
? entry.label.trim()
|
|
45
|
+
: undefined,
|
|
46
|
+
})),
|
|
47
|
+
tableCount: repositories.length,
|
|
48
|
+
ignoredLines,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
module.exports = {
|
|
53
|
+
parsePlusToml,
|
|
54
|
+
unquoteTomlValue,
|
|
55
|
+
};
|