Skip to content

Commit 58eb6bd

Browse files
committed
chore: release v0.8.0
1 parent eb74e08 commit 58eb6bd

14 files changed

Lines changed: 86 additions & 31 deletions

File tree

.gitignore

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,21 @@ Thumbs.db
1212
Desktop.ini
1313

1414
# Local staging
15+
.serena/
1516
clone/
1617
docs/plans/
17-
docs/Files/
1818
docs/FILES_CHANGED_ABSOLUTE.md
1919

2020
CHAT_LOGS.md
2121
AGENTS.md
2222
PROJECT.md
23+
24+
# Internal docs (release-ai rules)
25+
Files/
26+
Files/PRD.md
27+
Files/SDD.md
28+
Files/RELEASE_NOTES.md
29+
Files/CHANGELOG.md
30+
Files/CHANGELOG-zh.md
31+
AI_RELEASE_RULES.md
32+
CHECKLIST.md

README-zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Codex Folding | [English](README.md)
22

3-
[![版本](https://img.shields.io/badge/版本-v0.5.0-blue.svg)](#)
3+
[![版本](https://img.shields.io/badge/版本-v0.8.0-blue.svg)](#)
44
[![VS%20Code](https://img.shields.io/badge/VS%20Code-扩展-007ACC.svg)](#)
55
[![许可证](https://img.shields.io/badge/许可证-MIT-green.svg)](LICENSE)
66

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Codex Folding | [中文说明](README-zh.md)
22

3-
[![Version](https://img.shields.io/badge/version-v0.5.0-blue.svg)](#)
3+
[![Version](https://img.shields.io/badge/version-v0.8.0-blue.svg)](#)
44
[![VS%20Code](https://img.shields.io/badge/VS%20Code-extension-007ACC.svg)](#)
55
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
66

docs/AI_OPERATOR_MANUAL.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ It folds *all pre-final process items* (thinking/tool calls/tool output/status/e
1111
- Manual (this file): `https://raw.githubusercontent.com/MaxMiksa/Codex-Folding/main/docs/AI_OPERATOR_MANUAL.md`
1212
- Install guide: `https://github.com/MaxMiksa/Codex-Folding/blob/main/docs/INSTALL_FOR_AI.md`
1313
- Uninstall guide: `https://github.com/MaxMiksa/Codex-Folding/blob/main/docs/UNINSTALL_FOR_AI.md`
14-
- Remote install script (pinned): `https://raw.githubusercontent.com/MaxMiksa/Codex-Folding/7c26207/docs/remote/codex-folding-install.mjs`
15-
- Remote uninstall script (pinned): `https://raw.githubusercontent.com/MaxMiksa/Codex-Folding/7c26207/docs/remote/codex-folding-uninstall.mjs`
16-
- If `raw.githubusercontent.com` is blocked: `https://github.com/MaxMiksa/Codex-Folding/raw/7c26207/docs/remote/codex-folding-install.mjs`
17-
- If `raw.githubusercontent.com` is blocked: `https://github.com/MaxMiksa/Codex-Folding/raw/7c26207/docs/remote/codex-folding-uninstall.mjs`
14+
- Remote install script (pinned): `https://raw.githubusercontent.com/MaxMiksa/Codex-Folding/v0.8.0/docs/remote/codex-folding-install.mjs`
15+
- Remote uninstall script (pinned): `https://raw.githubusercontent.com/MaxMiksa/Codex-Folding/v0.8.0/docs/remote/codex-folding-uninstall.mjs`
16+
- If `raw.githubusercontent.com` is blocked: `https://github.com/MaxMiksa/Codex-Folding/raw/v0.8.0/docs/remote/codex-folding-install.mjs`
17+
- If `raw.githubusercontent.com` is blocked: `https://github.com/MaxMiksa/Codex-Folding/raw/v0.8.0/docs/remote/codex-folding-uninstall.mjs`
1818

1919
## Goal / Scope (strict)
2020

@@ -62,6 +62,7 @@ Do not clone. Use the remote scripts only:
6262

6363
- Patched host file must include: `codex-workflow-collapse`
6464
- Patched webview file must include: `CODEX_WORKFLOW_FOLD_PATCH`
65+
- Patched webview file should include: `CODEX_WORKFLOW_FOLD_PATCH_V5` (fixes mapState return-shape compatibility)
6566
- Patched `zh-CN` locale file must include: `codex.workflow.label`
6667

6768
## Version mismatch strategy (required AI behavior)

docs/INSTALL_FOR_AI.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
## Canonical URLs (this is the source of truth)
88

99
- This file: `https://github.com/MaxMiksa/Codex-Folding/blob/main/docs/INSTALL_FOR_AI.md`
10-
- Remote install script (single file, pinned): `https://raw.githubusercontent.com/MaxMiksa/Codex-Folding/7c26207/docs/remote/codex-folding-install.mjs`
11-
- Remote uninstall script (single file, pinned): `https://raw.githubusercontent.com/MaxMiksa/Codex-Folding/7c26207/docs/remote/codex-folding-uninstall.mjs`
10+
- Remote install script (single file, pinned): `https://raw.githubusercontent.com/MaxMiksa/Codex-Folding/v0.8.0/docs/remote/codex-folding-install.mjs`
11+
- Remote uninstall script (single file, pinned): `https://raw.githubusercontent.com/MaxMiksa/Codex-Folding/v0.8.0/docs/remote/codex-folding-uninstall.mjs`
1212
- Manual (for user to save): `https://raw.githubusercontent.com/MaxMiksa/Codex-Folding/main/docs/AI_OPERATOR_MANUAL.md`
1313

1414
## Preconditions
@@ -29,9 +29,9 @@
2929

3030
1. Download the remote install script
3131
- Save to a temporary folder:
32-
- `Invoke-WebRequest -Uri "https://raw.githubusercontent.com/MaxMiksa/Codex-Folding/7c26207/docs/remote/codex-folding-install.mjs" -OutFile "$env:TEMP\\codex-folding-install.mjs"`
32+
- `Invoke-WebRequest -Uri "https://raw.githubusercontent.com/MaxMiksa/Codex-Folding/v0.8.0/docs/remote/codex-folding-install.mjs" -OutFile "$env:TEMP\\codex-folding-install.mjs"`
3333
- If `raw.githubusercontent.com` is blocked in the user’s network, use GitHub’s alternative raw endpoint:
34-
- `Invoke-WebRequest -Uri "https://github.com/MaxMiksa/Codex-Folding/raw/7c26207/docs/remote/codex-folding-install.mjs" -OutFile "$env:TEMP\\codex-folding-install.mjs"`
34+
- `Invoke-WebRequest -Uri "https://github.com/MaxMiksa/Codex-Folding/raw/v0.8.0/docs/remote/codex-folding-install.mjs" -OutFile "$env:TEMP\\codex-folding-install.mjs"`
3535

3636
2. Run install script (patches extension + saves manual)
3737
- `node "$env:TEMP\\codex-folding-install.mjs"`

docs/UNINSTALL_FOR_AI.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
## Canonical URLs (this is the source of truth)
66

77
- This file: `https://github.com/MaxMiksa/Codex-Folding/blob/main/docs/UNINSTALL_FOR_AI.md`
8-
- Remote uninstall script (single file, pinned): `https://raw.githubusercontent.com/MaxMiksa/Codex-Folding/7c26207/docs/remote/codex-folding-uninstall.mjs`
8+
- Remote uninstall script (single file, pinned): `https://raw.githubusercontent.com/MaxMiksa/Codex-Folding/v0.8.0/docs/remote/codex-folding-uninstall.mjs`
99
- Manual (for user to save): `https://raw.githubusercontent.com/MaxMiksa/Codex-Folding/main/docs/AI_OPERATOR_MANUAL.md`
1010

1111
## Preconditions
@@ -24,9 +24,9 @@
2424
## Steps (what to do)
2525

2626
1. Download the remote uninstall script
27-
- `Invoke-WebRequest -Uri "https://raw.githubusercontent.com/MaxMiksa/Codex-Folding/7c26207/docs/remote/codex-folding-uninstall.mjs" -OutFile "$env:TEMP\\codex-folding-uninstall.mjs"`
27+
- `Invoke-WebRequest -Uri "https://raw.githubusercontent.com/MaxMiksa/Codex-Folding/v0.8.0/docs/remote/codex-folding-uninstall.mjs" -OutFile "$env:TEMP\\codex-folding-uninstall.mjs"`
2828
- If `raw.githubusercontent.com` is blocked in the user’s network, use GitHub’s alternative raw endpoint:
29-
- `Invoke-WebRequest -Uri "https://github.com/MaxMiksa/Codex-Folding/raw/7c26207/docs/remote/codex-folding-uninstall.mjs" -OutFile "$env:TEMP\\codex-folding-uninstall.mjs"`
29+
- `Invoke-WebRequest -Uri "https://github.com/MaxMiksa/Codex-Folding/raw/v0.8.0/docs/remote/codex-folding-uninstall.mjs" -OutFile "$env:TEMP\\codex-folding-uninstall.mjs"`
3030

3131
2. Run uninstall script (restores installed extension artifacts from `*.bak`)
3232
- `node "$env:TEMP\\codex-folding-uninstall.mjs"`

docs/patch-profiles/openai.chatgpt/0.4.66-win32-x64/INJECTION_webview_index.js.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Key behaviors:
1919
(injected by the host patch, based on VS Code settings; defaults to `"collapse"` if unset/invalid)
2020

2121
Verification marker:
22-
- The patched file must contain the string: `CODEX_WORKFLOW_FOLD_PATCH`
22+
- The patched file must contain the string: `CODEX_WORKFLOW_FOLD_PATCH_V5`
2323

2424
Injected patch code is owned by this repo and can be reviewed in:
2525
- `tools/workflow-fold/patcher.mjs` (search for `CODEX_WORKFLOW_FOLD_PATCH`)

docs/patch-profiles/openai.chatgpt/0.4.66-win32-x64/MANIFEST.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"kind": "webview",
2020
"relativePath": "webview/assets/index-*.js",
2121
"backupSuffix": ".bak",
22-
"verifyIncludes": ["CODEX_WORKFLOW_FOLD_PATCH"]
22+
"verifyIncludes": ["CODEX_WORKFLOW_FOLD_PATCH_V5"]
2323
},
2424
{
2525
"kind": "i18n",

docs/remote/codex-folding-install.mjs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function patchExtensionHostJs(source) {
122122
}
123123

124124
function patchWebviewBundleJs(source) {
125-
if (source.includes("CODEX_WORKFLOW_FOLD_PATCH_V4")) return source;
125+
if (source.includes("CODEX_WORKFLOW_FOLD_PATCH_V5")) return source;
126126

127127
const exportIdx = source.lastIndexOf("export{");
128128
if (exportIdx === -1) {
@@ -134,16 +134,17 @@ function patchWebviewBundleJs(source) {
134134
/* CODEX_WORKFLOW_FOLD_PATCH_V2 */
135135
/* CODEX_WORKFLOW_FOLD_PATCH_V3 */
136136
/* CODEX_WORKFLOW_FOLD_PATCH_V4 */
137+
/* CODEX_WORKFLOW_FOLD_PATCH_V5 */
137138
function __codexWorkflowCollapseMode(){const m=globalThis.document?.querySelector('meta[name="codex-workflow-collapse"]');const v=m?.getAttribute("content")?.trim();return v==="collapse"||v==="expand"||v==="disable"?v:"collapse"}
138139
function __codexWorkflowFormatElapsed(ms){const s=Math.max(0,Math.floor(ms/1e3));const h=Math.floor(s/3600),m=Math.floor((s%3600)/60),ss=s%60;const p=n=>String(n).padStart(2,"0");if(h>0)return \`\${h}h\${p(m)}m\${p(ss)}s\`;return \`\${m}m\${p(ss)}s\`}
139140
function __codexWorkflowFoldItems(items,mode){if(mode==="disable")return items;if(!Array.isArray(items))return items;const out=[];let inTurn=!1;let children=[];let turnIndex=-1;const pushWorkflow=()=>{if(children.length===0)return;out.push({type:"workflow",id:\`workflow-\${turnIndex}\`,children,defaultCollapsed:mode==="collapse"})};for(const it of items){if(it?.type==="user-message"){inTurn=!0;turnIndex++;out.push(it);children=[];continue}if(inTurn&&it?.type==="assistant-message"){pushWorkflow();out.push(it);inTurn=!1;children=[];continue}if(inTurn)children.push(it);else out.push(it)}inTurn&&pushWorkflow();return out}
140141
const __codexOrigMapStateToLocalConversationItems=typeof mapStateToLocalConversationItems==="function"?mapStateToLocalConversationItems:null;
141-
if(__codexOrigMapStateToLocalConversationItems){mapStateToLocalConversationItems=function(rt,Ye){const items=__codexOrigMapStateToLocalConversationItems(rt,Ye);const mode=__codexWorkflowCollapseMode();if(mode==="disable")return items;if(!Array.isArray(items))return items;try{return __codexWorkflowFoldItems(items,mode)}catch(e){try{console.error("Codex Workflow fold failed (mapState):",e)}catch{}return items}}}
142+
if(__codexOrigMapStateToLocalConversationItems){try{mapStateToLocalConversationItems=function(rt,Ye){const res=__codexOrigMapStateToLocalConversationItems(rt,Ye);const mode=__codexWorkflowCollapseMode();if(mode==="disable")return res;try{if(Array.isArray(res))return __codexWorkflowFoldItems(res,mode);if(res&&Array.isArray(res.items))return{...res,items:__codexWorkflowFoldItems(res.items,mode)};if(res&&Array.isArray(res.localConversationItems))return{...res,localConversationItems:__codexWorkflowFoldItems(res.localConversationItems,mode)};if(res&&Array.isArray(res.conversationItems))return{...res,conversationItems:__codexWorkflowFoldItems(res.conversationItems,mode)};return res}catch(e){try{console.error("Codex Workflow fold failed (mapState):",e)}catch{}return res}}}catch(e){try{console.error("Codex Workflow fold failed (mapState install):",e)}catch{}}}
142143
const __codexOrigIsAgentItemStillRunning=typeof isAgentItemStillRunning==="function"?isAgentItemStillRunning:null;
143-
if(__codexOrigIsAgentItemStillRunning){isAgentItemStillRunning=function(it){if(it?.type==="workflow")return(it.children??[]).some(ch=>__codexOrigIsAgentItemStillRunning(ch));return __codexOrigIsAgentItemStillRunning(it)}}
144+
if(__codexOrigIsAgentItemStillRunning){try{isAgentItemStillRunning=function(it){if(it?.type==="workflow")return(it.children??[]).some(ch=>__codexOrigIsAgentItemStillRunning(ch));return __codexOrigIsAgentItemStillRunning(it)}}catch(e){try{console.error("Codex Workflow fold failed (isRunning install):",e)}catch{}}}
144145
function __CodexWorkflowItem(rt){const {item:it}=rt,mode=__codexWorkflowCollapseMode();if(mode==="disable")return null;const intl=useIntl();const startedAt=reactExports.useRef(Date.now());const isRunning=(it.children??[]).some(ch=>__codexOrigIsAgentItemStillRunning?__codexOrigIsAgentItemStillRunning(ch):!1);const [now,setNow]=reactExports.useState(Date.now());reactExports.useEffect(()=>{if(!isRunning)return;const id=setInterval(()=>setNow(Date.now()),1e3);return()=>clearInterval(id)},[isRunning]);const [collapsed,setCollapsed]=reactExports.useState(it.defaultCollapsed===!0);const statusLabel=isRunning?intl.formatMessage({id:"codex.workflow.status.working",defaultMessage:"Working",description:"Status shown in Workflow header when the agent is still running"}):intl.formatMessage({id:"codex.workflow.status.done",defaultMessage:"Done",description:"Status shown in Workflow header when the agent has finished"});const elapsed=__codexWorkflowFormatElapsed((isRunning?now:Date.now())-startedAt.current);const header=jsxRuntimeExports.jsx("div",{className:"flex items-center gap-1.5",children:jsxRuntimeExports.jsx("span",{className:"truncate",children:intl.formatMessage({id:"codex.workflow.label",defaultMessage:"Workflow",description:"Label for the Workflow folding header"})})});const meta=jsxRuntimeExports.jsx("span",{className:"text-token-description-foreground text-xs whitespace-nowrap",children:intl.formatMessage({id:"codex.workflow.headerSuffix",defaultMessage:"({status}, {elapsed})",description:"Suffix in Workflow header with status and elapsed time"},{status:statusLabel,elapsed})});const title=jsxRuntimeExports.jsxs("div",{className:"flex min-w-0 items-baseline gap-2",children:[header,meta]});const chevron=jsxRuntimeExports.jsx(typeof SvgChevronRight!=="undefined"?SvgChevronRight:"span",{className:clsx("icon-xs transition-transform",collapsed?"rotate-0":"rotate-90")});const action=jsxRuntimeExports.jsx("div",{className:"flex items-center",children:chevron});const expanded=!collapsed&&(it.children??[]).length>0?jsxRuntimeExports.jsx("div",{className:"border-token-border/80 border-x border-b bg-token-input-background/70 flex flex-col gap-2 px-3 py-2",children:(it.children??[]).map((ch,idx)=>jsxRuntimeExports.jsx(__codexOrigLocalConversationItemContent,{...rt,item:ch},ch?.callId??ch?.id??\`\${it.id}-\${idx}\`))}):null;return jsxRuntimeExports.jsx(InProgressFixedContentItem,{onClick:()=>setCollapsed(v=>!v),children:title,action,expandedContent:expanded})}
145146
const __codexOrigLocalConversationItemContent=typeof LocalConversationItemContent==="function"?LocalConversationItemContent:null;
146-
if(__codexOrigLocalConversationItemContent){LocalConversationItemContent=function(rt){if(rt?.item?.type==="workflow"){try{return __CodexWorkflowItem(rt)}catch(e){try{console.error("Codex Workflow fold failed (render):",e)}catch{}const it=rt?.item;return jsxRuntimeExports.jsx("div",{className:"border-token-border/80 border bg-token-input-background/70 flex flex-col gap-2 px-3 py-2",children:(it?.children??[]).map((ch,idx)=>jsxRuntimeExports.jsx(__codexOrigLocalConversationItemContent,{...rt,item:ch},ch?.callId??ch?.id??\`\${it?.id??"workflow"}-\${idx}\`))})}}return __codexOrigLocalConversationItemContent(rt)}}
147+
if(__codexOrigLocalConversationItemContent){try{LocalConversationItemContent=function(rt){if(rt?.item?.type==="workflow"){try{return __CodexWorkflowItem(rt)}catch(e){try{console.error("Codex Workflow fold failed (render):",e)}catch{}const it=rt?.item;return jsxRuntimeExports.jsx("div",{className:"border-token-border/80 border bg-token-input-background/70 flex flex-col gap-2 px-3 py-2",children:(it?.children??[]).map((ch,idx)=>jsxRuntimeExports.jsx(__codexOrigLocalConversationItemContent,{...rt,item:ch},ch?.callId??ch?.id??\`\${it?.id??"workflow"}-\${idx}\`))})}}return __codexOrigLocalConversationItemContent(rt)}}catch(e){try{console.error("Codex Workflow fold failed (render install):",e)}catch{}}}
147148
/* END CODEX_WORKFLOW_FOLD_PATCH */
148149
`;
149150

@@ -246,7 +247,7 @@ async function main() {
246247
results.push({
247248
file: webviewJs,
248249
...(await patchFile(webviewJs, patchWebviewBundleJs)),
249-
verifyIncludes: "CODEX_WORKFLOW_FOLD_PATCH",
250+
verifyIncludes: "CODEX_WORKFLOW_FOLD_PATCH_V5",
250251
});
251252
results.push({
252253
file: zhCnJs,

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
22
"name": "codex-folding",
3-
"version": "0.5.0",
3+
"version": "0.8.0",
44
"private": false,
55
"description": "Adds per-turn Workflow folding to the Codex VS Code extension (openai.chatgpt) via a safe, idempotent patch.",
66
"type": "module",
77
"license": "MIT",
88
"scripts": {
99
"test": "node --test tools/workflow-fold/patcher.test.mjs",
10+
"inspect": "node tools/workflow-fold/inspect.mjs",
1011
"apply": "node tools/workflow-fold/apply.mjs --verify",
11-
"verify": "node tools/workflow-fold/apply.mjs --dry-run --verify"
12+
"verify": "node tools/workflow-fold/apply.mjs --dry-run --verify",
13+
"uninstall": "node docs/remote/codex-folding-uninstall.mjs"
1214
}
1315
}
14-

0 commit comments

Comments
 (0)