From 455dc299795fbf87c5d02bc9b9d5eb546efcbc08 Mon Sep 17 00:00:00 2001 From: Kevinzzz Date: Thu, 15 Oct 2026 17:27:13 +0800 Subject: [PATCH 1/7] feat(zcode-context): add marketplace icon A context window in brackets, filled row by row in the panel's own category colours (system, tool schemas, conversation, tool results), with the unused part of each row left as a track. --- assets/zcode-context/icon.png | Bin 0 -> 6880 bytes marketplace.json | 1 + 2 files changed, 1 insertion(+) create mode 100644 assets/zcode-context/icon.png diff --git a/assets/zcode-context/icon.png b/assets/zcode-context/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f4eafe2187e93b02f17d84cb3453f514e0f419e1 GIT binary patch literal 6880 zcmb7JXFwBMx1CS}p~MD)NV%dkDGGv!6a&hoBTWP$AiYQ^(xe0t#0C}&O*$e1(g_^` zC?J9$HA?TD5G3@JH{yNw-S_K$U;a$y%-QGcIs2To*Ix73P+yasm6sI&0CufEHH-j& z4*W|8K!06=c-0F4fHy}=X2H!gX|cz$Q|)p)s}VZ)q5MhT z8LSqhv1gcaZ!=ZtDK4P6|1OSvYTh9}_zzW=QtXvGMsJP+eAOcIuRW@(4MpXa*VY!G zXfmcNFvpy~|G@aAdC(fsz>Lds0uj3QgdE9@%{2tg*z_S@7pV?#GtYsI79J{g;Z%P8vh1OcDFbmL9`8Af2u zdGlloBI7jYv#0_8qXR|1dn=_BgwA9b563m22HG0z93!%l86iL?oj6OAmT+ ztea3`ajxrDxp6o((5q+0t;Rr`=qp(k19wr$%ct^duv&L|*}@c}HRNC4IwRiUz#0ah zw^fRN{KY$wPVkz#`i1}f8@(ar8~<4T@vrSDqwUz)Z(_pLBqFrSe*LUQ#r{QPtZCe) zS0`}%bVJ+QQW^S*JJYm_*DP`Zr{3j?FLQIoh%$o@Pv*eF<|g|dLxF42%mnq=kShw; z9T;@fn$CD0PeGOB&CQkCy9~#k_&{gN)L5c8UpMl$-DURMEyu1e$v)Qlih|%S@J=Vb z%6>@GTYQxr80CKm;H#Im9&p(aNZOQf-s4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ETx-eLT zM8|o>{T80DhrG=49G2`ZuqwMCH@W-7AuY)*+VnuFZX22fqmFztyD{>#OPN|Gq4M_4 zfhRVvMJB-gR_&%~>sdTZ`0YGE!(}Dc%zxV*+DSW<( zx#>Uom|!P0ZRH6#g6#1?KslflzYpVoH{*Y5Zs?zAXbk=5gkfecOPJaIR%ZXZX~EtB aPBhNkwh75KzeA${_|v+ouThAw3I89!tSnam literal 0 HcmV?d00001 diff --git a/marketplace.json b/marketplace.json index f93bb0a8..5ad1802d 100644 --- a/marketplace.json +++ b/marketplace.json @@ -1153,6 +1153,7 @@ "url": "https://github.com/Kevinzzz6" }, "category": "developer-tools", + "icon": "https://cdn-zcode.z.ai/zcode/official-plugin/assets/zcode-context/icon.png", "keywords": [ "context", "tokens", From 786514c70c4fedd29bd015ef621a1e1fa41aba41 Mon Sep 17 00:00:00 2001 From: Kevinzzz Date: Fri, 16 Oct 2026 11:41:31 +0800 Subject: [PATCH 2/7] feat(zcode-context): update listing to 0.3.10 - Bump version to 0.3.10 (retention banner above the overview, dismissed permanently once closed). - Point the description at opening the Context panel and enabling full Model I/O retention; add a homepage link to the README section. - Drop examplePrompts: the plugin's tools are app-only, so the model cannot answer them. --- .../zcode-context/.zcode-plugin/plugin.json | 11 +++++----- marketplace.json | 21 ++++++------------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/external_plugins/zcode-context/.zcode-plugin/plugin.json b/external_plugins/zcode-context/.zcode-plugin/plugin.json index c659b92d..57b032d5 100644 --- a/external_plugins/zcode-context/.zcode-plugin/plugin.json +++ b/external_plugins/zcode-context/.zcode-plugin/plugin.json @@ -1,10 +1,10 @@ { "name": "zcode-context", - "version": "0.3.9", - "description": "只读查看会话用量、模型输入组成、请求差异和压缩事件。", + "version": "0.3.10", + "description": "只读查看会话用量、模型输入组成、请求差异和压缩事件。装好后点右上角「切换面板」,在会话侧边栏打开「上下文」面板;建议同时在「设置 → 通用」打开「完整保留模型 I/O」——默认记录会丢弃更早的请求,且无法事后恢复。", "description_i18n": { - "en": "Read-only session usage, model input composition, request differences and compaction events.", - "zh-CN": "只读查看会话用量、模型输入组成、请求差异和压缩事件。" + "en": "Read-only session usage, model input composition, request differences and compaction events. After installing, open the Context panel from the session sidebar (top-right panel switcher); also turn on full Model I/O retention in Settings → General — the default recording drops older requests and cannot recover them later.", + "zh-CN": "只读查看会话用量、模型输入组成、请求差异和压缩事件。装好后点右上角「切换面板」,在会话侧边栏打开「上下文」面板;建议同时在「设置 → 通用」打开「完整保留模型 I/O」——默认记录会丢弃更早的请求,且无法事后恢复。" }, "author": { "name": "Kevinzzz6" @@ -52,5 +52,6 @@ "availability": "session" } ] - } + }, + "homepage": "https://github.com/Kevinzzz6/zcode-context#默认记录与完整保留" } diff --git a/marketplace.json b/marketplace.json index 5ad1802d..24a625a0 100644 --- a/marketplace.json +++ b/marketplace.json @@ -1142,12 +1142,13 @@ { "name": "zcode-context", "source": "./external_plugins/zcode-context", - "description": "Read-only session usage, model input composition, request differences and compaction events.", + "description": "Read-only session usage, model input composition, request differences and compaction events. After installing, open the Context panel from the session sidebar (top-right panel switcher); also turn on full Model I/O retention in Settings → General — the default recording drops older requests and cannot recover them later.", "description_i18n": { - "en": "Read-only session usage, model input composition, request differences and compaction events.", - "zh-CN": "只读查看会话用量、模型输入组成、请求差异和压缩事件。" + "en": "Read-only session usage, model input composition, request differences and compaction events. After installing, open the Context panel from the session sidebar (top-right panel switcher); also turn on full Model I/O retention in Settings → General — the default recording drops older requests and cannot recover them later.", + "zh-CN": "只读查看会话用量、模型输入组成、请求差异和压缩事件。装好后点右上角「切换面板」,在会话侧边栏打开「上下文」面板;建议同时在「设置 → 通用」打开「完整保留模型 I/O」——默认记录会丢弃更早的请求,且无法事后恢复。" }, - "version": "0.3.9", + "homepage": "https://github.com/Kevinzzz6/zcode-context#默认记录与完整保留", + "version": "0.3.10", "author": { "name": "Kevinzzz6", "url": "https://github.com/Kevinzzz6" @@ -1160,17 +1161,7 @@ "usage", "session", "mcp" - ], - "examplePrompts": [ - "Show the context composition of this session and which category takes the most room", - "What did the last compaction summarize away?" - ], - "examplePrompts_i18n": { - "zh-CN": [ - "看看这个会话的上下文组成,哪一类内容占得最多", - "上一次压缩摘要掉了哪些内容?" - ] - } + ] } ] } From b177e78a015371a2df811ab8e0a5640aa34114f8 Mon Sep 17 00:00:00 2001 From: Kevinzzz Date: Fri, 16 Oct 2026 12:03:16 +0800 Subject: [PATCH 3/7] feat(zcode-context): sync plugin source to 0.3.10 The listing was bumped to 0.3.10 but the vendored source stayed at 0.3.9, which fails the catalog's source/install version check and would ship without the retention banner. Bring over the banner (dismissed for good once closed) and the version strings from the upstream 0.3.10 release. --- ui-plugins/zcode-context/package.json | 2 +- ui-plugins/zcode-context/src/server.mjs | 2 +- ui-plugins/zcode-context/ui/app.mjs | 7 +++++-- ui-plugins/zcode-context/ui/components.mjs | 12 ++++++++++-- ui-plugins/zcode-context/ui/i18n.mjs | 4 +++- ui-plugins/zcode-context/ui/styles.css | 1 + 6 files changed, 21 insertions(+), 7 deletions(-) diff --git a/ui-plugins/zcode-context/package.json b/ui-plugins/zcode-context/package.json index 9b0834f2..973e345c 100644 --- a/ui-plugins/zcode-context/package.json +++ b/ui-plugins/zcode-context/package.json @@ -1,6 +1,6 @@ { "name": "zcode-context", - "version": "0.3.9", + "version": "0.3.10", "private": true, "type": "module", "license": "MIT", diff --git a/ui-plugins/zcode-context/src/server.mjs b/ui-plugins/zcode-context/src/server.mjs index 320eb6ff..0b35a5aa 100644 --- a/ui-plugins/zcode-context/src/server.mjs +++ b/ui-plugins/zcode-context/src/server.mjs @@ -9,7 +9,7 @@ import { createReader } from "./data/reader.mjs"; const HTML_URI = "ui://zcode-context/panel.html"; const reader = createReader(() => new Worker(new URL("./worker.mjs", import.meta.url), { workerData: { paths: resolveDataPaths() }, resourceLimits: { maxOldGenerationSizeMb: 256 } })); export function createContextServer() { - const server = new McpServer({name:"zcode-context",version:"0.3.9"}); + const server = new McpServer({name:"zcode-context",version:"0.3.10"}); server.registerResource("context_panel", HTML_URI, { mimeType:"text/html;profile=mcp-app", _meta:{ui:{csp:{connectDomains:[],resourceDomains:[]}}} }, async () => ({contents:[{uri:HTML_URI,mimeType:"text/html;profile=mcp-app",text:await readFile(new URL("./context.html",import.meta.url),"utf8")}]}) diff --git a/ui-plugins/zcode-context/ui/app.mjs b/ui-plugins/zcode-context/ui/app.mjs index d149775b..37bbca13 100644 --- a/ui-plugins/zcode-context/ui/app.mjs +++ b/ui-plugins/zcode-context/ui/app.mjs @@ -4,7 +4,9 @@ import { translator, ORDER } from "./i18n.mjs"; import { renderApp, isAgent, CHUNK, layoutTrend, highlight, anchors, olderUnloaded, BOUNDARY, eventId, expandedRoles } from "./components.mjs"; import { demoCall } from "./demo.mjs"; const root=document.getElementById("root"); -const INFO={name:"zcode-context",version:"0.3.9"}; +const INFO={name:"zcode-context",version:"0.3.10"}; +const RETENTION_KEY="zcode-context:retention-dismissed"; +let retentionDismissed=false;try{retentionDismissed=localStorage.getItem(RETENTION_KEY)==="1";}catch{} const demo=new URLSearchParams(location.search).get("demo")==="1"; let app=null,t=translator(),view=initialView(),boundSession=null,overview=null,items=[],hasOlder=false,historyPage=0; let detail=null,content=null,more={},notice=null,busy=false,activeLoads=0; @@ -47,7 +49,7 @@ function render(background=false) { const y=window.scrollY,agents=items.filter(isAgent),index=agents.findIndex(x=>x.key===view.selectedKey); const selected=items.find(x=>x.key===view.selectedKey)??(detail?.summary?.key===view.selectedKey?detail.summary:null); const newerCount=index>=0?agents.length-1-index:selected?agents.filter(x=>x.startedAt>selected.startedAt).length:0; - root.replaceChildren(renderApp({t,view,lens:lens(view),version:INFO.version,overview,items,selected,detail,content,more,eventDetails,hasOlder,notice,busy,demo,latestKey:latestKey(),newerCount,session:boundSession,actions})); + root.replaceChildren(renderApp({t,view,lens:lens(view),version:INFO.version,overview,items,selected,detail,content,more,eventDetails,hasOlder,notice,busy,demo,latestKey:latestKey(),newerCount,session:boundSession,actions,retentionDismissed})); for(const el of root.querySelectorAll("[data-scroll]")) { const saved=scrolls.get(el.dataset.scroll);if(!saved)continue; el.scrollTop=saved[1];el.scrollLeft=keepRightEdge&&el.dataset.scroll==="trend"?el.scrollWidth-keepRightEdge:saved[0]; @@ -352,6 +354,7 @@ const actions={ view={...view,eventKinds:next.length&&next.lengtha.dismissRetention(),{class:"icon-btn",id:"retention-dismiss",title:t("dismiss"),ariaLabel:t("dismiss")}))); +} function toolbar(ctx) { const {t,view,items,actions:a}=ctx,bar=node("div",{class:"toolbar"}); diff --git a/ui-plugins/zcode-context/ui/i18n.mjs b/ui-plugins/zcode-context/ui/i18n.mjs index 10778e02..def859fe 100644 --- a/ui-plugins/zcode-context/ui/i18n.mjs +++ b/ui-plugins/zcode-context/ui/i18n.mjs @@ -13,7 +13,9 @@ const messages={ unrecorded:["更早消息(未记录)","Earlier messages (not recorded)"], unrecordedTip:["实际输入减去已记录部分的估算;这部分内容没有被记录,无法查看或按类别拆分","Actual input minus the recorded estimate; this content was not recorded and cannot be viewed or split by category"], actualOnly:["记录不完整,只能显示实际输入的变化,无法按类别拆分","Partial record: only the change in actual input is known, not per category"], - partialHint:["这条记录只保留了最近 {n} 条消息(共 {total} 条),更早的内容无法查看,变化也无法按类别对比。在 ZCode「设置 → 通用」打开「完整保留模型 I/O」后,之后的请求会记录完整内容。","This record keeps only the latest {n} of {total} messages, so earlier content cannot be viewed or compared by category. Turn on complete Model I/O retention in ZCode Settings → General to record full input for later requests."],vsPrevious:["较上一步","vs previous"],notComparable:["无法对比","Not comparable"], + partialHint:["这条记录只保留了最近 {n} 条消息(共 {total} 条),更早的内容无法查看,变化也无法按类别对比。在 ZCode「设置 → 通用」打开「完整保留模型 I/O」后,之后的请求会记录完整内容。","This record keeps only the latest {n} of {total} messages, so earlier content cannot be viewed or compared by category. Turn on complete Model I/O retention in ZCode Settings → General to record full input for later requests."], + retentionBanner:["ZCode 默认只记录每个请求末尾的一段消息和之后的增量,更早的部分不会被记录;更早会话的记录文件也会定期清理,丢失的内容无法事后恢复。建议在「设置 → 通用」打开「完整保留模型 I/O」,之后的请求才会完整记录。","By default ZCode records only a trailing window of each request's messages plus later deltas, so earlier content is never recorded; older sessions' record files are also pruned and what is dropped cannot be recovered later. Consider turning on full Model I/O retention in Settings → General so later requests are recorded in full."], + dismiss:["知道了","Dismiss"],vsPrevious:["较上一步","vs previous"],notComparable:["无法对比","Not comparable"], actualIn:["实际输入","Actual in"],output:["输出","Output"],cache:["缓存","Cache"], briefTurn:["本轮","Turn"],briefInput:["输入","In"],briefReply:["回复","Reply"],noInputs:["(无新增)","(nothing new)"],moreItems:["还有 {n} 项","+{n} more"], briefTurnTip:["这一轮开场时用户发送的消息;同一轮的每一步都显示这一条","The message that opened this turn; every step of the turn shows it"], diff --git a/ui-plugins/zcode-context/ui/styles.css b/ui-plugins/zcode-context/ui/styles.css index c3c70e02..facfa50f 100644 --- a/ui-plugins/zcode-context/ui/styles.css +++ b/ui-plugins/zcode-context/ui/styles.css @@ -127,6 +127,7 @@ html[lang^=zh] .brief-label{width:28px} .mini-select{height:24px;border:1px solid var(--border);border-radius:6px;background:var(--bg);font-size:11.5px;padding:0 4px;max-width:160px} .note{margin:0 0 8px;padding:6px 9px;border-radius:7px;background:var(--bg2);color:var(--muted);font-size:11.5px;display:flex;align-items:center;gap:8px;flex-wrap:wrap} .el-body .note{margin:0} +.retention>.note{margin:0;align-items:flex-start} .pad{margin:6px 10px;font-size:12px} .categories{display:flex;flex-direction:column;gap:6px} .category{border:1px solid var(--border);border-radius:9px;overflow:hidden} From f140757773fb3b44b08d896101d645bb7944fcac Mon Sep 17 00:00:00 2001 From: Kevinzzz Date: Fri, 16 Oct 2026 12:17:03 +0800 Subject: [PATCH 4/7] fix(zcode-context): keep the accent button readable in dark mode The accent is the host's info text colour, which is light in dark mode, so the white label on the "back to latest" button disappeared. Use the page background for the label instead. --- ui-plugins/zcode-context/ui/styles.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-plugins/zcode-context/ui/styles.css b/ui-plugins/zcode-context/ui/styles.css index facfa50f..8218e7c6 100644 --- a/ui-plugins/zcode-context/ui/styles.css +++ b/ui-plugins/zcode-context/ui/styles.css @@ -29,7 +29,7 @@ h1,h2,h3{margin:0} .btn:hover:not(:disabled){background:var(--bg2)}.btn:disabled{opacity:.4} .btn.small{height:24px;padding:0 8px;font-size:11.5px} .btn.ghost{border-color:transparent;background:transparent;color:var(--muted)}.btn.ghost:hover:not(:disabled){color:var(--fg)} -.btn.accent{border-color:transparent;background:var(--accent);color:#fff;font-weight:600}.btn.accent:hover{background:var(--accent);filter:brightness(1.05)} +.btn.accent{border-color:transparent;background:var(--accent);color:var(--bg);font-weight:600}.btn.accent:hover{background:var(--accent);filter:brightness(1.05)} .btn.on{border-color:var(--accent);color:var(--accent)} .pinned,.notice{display:flex;align-items:center;gap:8px;padding:6px 6px 6px 10px;border-radius:9px;font-size:12px} From fe39a913075e79bac79e0674bbe8eac525eeb153 Mon Sep 17 00:00:00 2001 From: Kevinzzz Date: Fri, 16 Oct 2026 12:24:57 +0800 Subject: [PATCH 5/7] fix: preserve upstream marketplace formatting --- marketplace.json | 48 ++++++++++++------------------------------------ 1 file changed, 12 insertions(+), 36 deletions(-) diff --git a/marketplace.json b/marketplace.json index f7afb5e1..fd20dc07 100644 --- a/marketplace.json +++ b/marketplace.json @@ -790,9 +790,7 @@ }, { "name": "blender", - "componentTypes": [ - "ui" - ], + "componentTypes": ["ui"], "displayName": "Blender", "displayName_i18n": { "en": "Blender", @@ -813,9 +811,7 @@ }, { "name": "excalidraw", - "componentTypes": [ - "ui" - ], + "componentTypes": ["ui"], "displayName": "Excalidraw", "displayName_i18n": { "en": "Excalidraw", @@ -836,9 +832,7 @@ }, { "name": "openpencil", - "componentTypes": [ - "ui" - ], + "componentTypes": ["ui"], "displayName": "OpenPencil", "displayName_i18n": { "en": "OpenPencil", @@ -861,9 +855,7 @@ "name": "photocraft", "icon": "https://cdn-zcode.z.ai/zcode/official-plugin/assets/photocraft/icon.png", "source": "./external_plugins/photocraft", - "componentTypes": [ - "ui" - ], + "componentTypes": ["ui"], "displayName": "PhotoCraft", "displayName_i18n": { "en": "PhotoCraft", @@ -890,9 +882,7 @@ "name": "vectorcraft", "icon": "https://cdn-zcode.z.ai/zcode/official-plugin/assets/vectorcraft/icon.png", "source": "./external_plugins/vectorcraft", - "componentTypes": [ - "ui" - ], + "componentTypes": ["ui"], "displayName": "VectorCraft", "displayName_i18n": { "en": "VectorCraft", @@ -919,9 +909,7 @@ "name": "pdfcraft", "icon": "https://cdn-zcode.z.ai/zcode/official-plugin/assets/pdfcraft/icon.png", "source": "./external_plugins/pdfcraft", - "componentTypes": [ - "ui" - ], + "componentTypes": ["ui"], "displayName": "PdfCraft", "displayName_i18n": { "en": "PdfCraft", @@ -948,9 +936,7 @@ "name": "designcraft", "icon": "https://cdn-zcode.z.ai/zcode/official-plugin/assets/designcraft/icon.png", "source": "./external_plugins/designcraft", - "componentTypes": [ - "ui" - ], + "componentTypes": ["ui"], "displayName": "DesignCraft", "displayName_i18n": { "en": "DesignCraft", @@ -977,9 +963,7 @@ "name": "wordcraft", "icon": "https://cdn-zcode.z.ai/zcode/official-plugin/assets/wordcraft/icon.png", "source": "./external_plugins/wordcraft", - "componentTypes": [ - "ui" - ], + "componentTypes": ["ui"], "displayName": "WordCraft", "displayName_i18n": { "en": "WordCraft", @@ -1006,9 +990,7 @@ "name": "gridcraft", "icon": "https://cdn-zcode.z.ai/zcode/official-plugin/assets/gridcraft/icon.png", "source": "./external_plugins/gridcraft", - "componentTypes": [ - "ui" - ], + "componentTypes": ["ui"], "displayName": "GridCraft", "displayName_i18n": { "en": "GridCraft", @@ -1035,9 +1017,7 @@ "name": "deckcraft", "icon": "https://cdn-zcode.z.ai/zcode/official-plugin/assets/deckcraft/icon.png", "source": "./external_plugins/deckcraft", - "componentTypes": [ - "ui" - ], + "componentTypes": ["ui"], "displayName": "DeckCraft", "displayName_i18n": { "en": "DeckCraft", @@ -1064,9 +1044,7 @@ "name": "cadcraft", "icon": "https://cdn-zcode.z.ai/zcode/official-plugin/assets/cadcraft/icon.png", "source": "./external_plugins/cadcraft", - "componentTypes": [ - "ui" - ], + "componentTypes": ["ui"], "displayName": "CADCraft", "displayName_i18n": { "en": "CADCraft", @@ -1093,9 +1071,7 @@ "name": "soundcraft", "icon": "https://cdn-zcode.z.ai/zcode/official-plugin/assets/soundcraft/icon.png", "source": "./external_plugins/soundcraft", - "componentTypes": [ - "ui" - ], + "componentTypes": ["ui"], "displayName": "SoundCraft", "displayName_i18n": { "en": "SoundCraft", From 941b5b1ab73419cc70af59a31f8cafa15e5cde57 Mon Sep 17 00:00:00 2001 From: Kevinzzz Date: Fri, 16 Oct 2026 12:35:45 +0800 Subject: [PATCH 6/7] fix(zcode-context): clean lint warnings and document retention --- external_plugins/zcode-context/README.md | 10 +++++++++- external_plugins/zcode-context/README_CN.md | 10 +++++++++- ui-plugins/zcode-context/ui/components.mjs | 6 +++--- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/external_plugins/zcode-context/README.md b/external_plugins/zcode-context/README.md index 167f91e0..27a43521 100644 --- a/external_plugins/zcode-context/README.md +++ b/external_plugins/zcode-context/README.md @@ -27,7 +27,15 @@ Clicking an event opens the exact item it brought into the context; a compaction ## Install -Install from the ZCode plugin marketplace, then enable **zcode-context**. A **Context** side pane becomes available for sessions in local workspaces. +Install from the ZCode plugin marketplace, then enable **zcode-context**. In a local workspace session, use the top-right panel switcher to open **Context** in the session sidebar. + +## Recording and retention + +For complete future request inputs, enable **full Model I/O retention** in **Settings → General**. Default recording keeps only a trailing portion of each request's messages plus later deltas, and older session record files are periodically pruned. Missing historical content cannot be recovered by enabling the setting later. + +The overview shows a reminder about this setting. Closing it saves the dismissal in local storage; the reminder does not detect whether full retention is already enabled. + +Full retention does not remove the plugin's own reading and cache limits. When first loading a record file, the plugin reads only its last 24 MiB and keeps a bounded request cache. A history-window notice can therefore remain even when newer requests are fully recorded; check each request's completeness indicator to distinguish incomplete input from unloaded history. ## Components diff --git a/external_plugins/zcode-context/README_CN.md b/external_plugins/zcode-context/README_CN.md index 681de82b..3a507ae1 100644 --- a/external_plugins/zcode-context/README_CN.md +++ b/external_plugins/zcode-context/README_CN.md @@ -27,7 +27,15 @@ ## 安装 -在 ZCode 插件市场安装并启用 **zcode-context**,本地工作区的会话即可使用「上下文」侧栏面板。 +在 ZCode 插件市场安装并启用 **zcode-context**。进入本地工作区的会话后,点击右上角「切换面板」,在会话侧边栏打开「上下文」。 + +## 记录与保留 + +建议在「设置 → 通用」开启「完整保留模型 I/O」,让之后的请求完整记录输入。默认记录只保留每个请求末尾的一段消息及之后的增量,更早会话的记录文件也会定期清理。开启设置无法补回历史上没有记录或已经清理的内容。 + +概览上方会显示相关提醒。点击关闭后,关闭状态保存在本地存储中;这条提醒不会检测你是否已经开启完整保留。 + +完整保留不会解除插件自身的读取和缓存限制。首次加载记录文件时,插件只读取末尾 24 MiB,并仅缓存一定范围的请求。因此,即使新的请求已经完整记录,历史读取范围的提示仍可能存在;请结合每条请求的完整性标记,区分「请求输入没有记录全」和「更早的历史没有加载」。 ## 组件 diff --git a/ui-plugins/zcode-context/ui/components.mjs b/ui-plugins/zcode-context/ui/components.mjs index 3a26c11e..85145709 100644 --- a/ui-plugins/zcode-context/ui/components.mjs +++ b/ui-plugins/zcode-context/ui/components.mjs @@ -195,7 +195,7 @@ function noticeBar(ctx) { } function summaryCard(ctx) { - const {t,view,selected:s,detail:d,actions:a,latestKey}=ctx; + const {t,view,selected:s,actions:a,latestKey}=ctx; if(!s)return null; const buckets=bucketsOf(s),sum=buckets.reduce((n,x)=>n+x.estimatedTokens,0)||1; const live=view.follow&&view.selectedKey===latestKey; @@ -611,9 +611,9 @@ function bodyText(ctx,c) { return el; } function bodyFoot(ctx,c) { - const {t,view,actions:a}=ctx,p=view.open,parts=Math.ceil(c.totalChars/CHUNK),part=Math.floor(c.offset/CHUNK)+1; + const {t,view,actions:a}=ctx,p=view.open,parts=Math.ceil(c.totalChars/CHUNK); const keys=e=>{ - if(e.key==="Enter"){e.preventDefault();e.shiftKey?a.prevMatch():a.nextMatch();} + if(e.key==="Enter"){e.preventDefault();if(e.shiftKey)a.prevMatch();else a.nextMatch();} else if(e.key==="Escape"&&e.target.value){e.preventDefault();e.target.value="";a.bodySearch("");} }; const position=p.matchIndex>=0&&c.matchCount?t("matchOf",{i:p.matchIndex+1,n:full(c.matchCount)}):t("matches",{n:full(c.matchCount)}); From 9f91a70ba5a8bb5c5ab05c65112e2e786011f298 Mon Sep 17 00:00:00 2001 From: Kevinzzz Date: Fri, 16 Oct 2026 12:52:12 +0800 Subject: [PATCH 7/7] docs(zcode-context): acknowledge dsh-context design reference --- external_plugins/zcode-context/README.md | 4 ++++ external_plugins/zcode-context/README_CN.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/external_plugins/zcode-context/README.md b/external_plugins/zcode-context/README.md index 27a43521..75b77c48 100644 --- a/external_plugins/zcode-context/README.md +++ b/external_plugins/zcode-context/README.md @@ -63,6 +63,10 @@ The plugin reads ZCode CLI's local records only — the session database (`db/db Source lives in [`ui-plugins/zcode-context/`](../../ui-plugins/zcode-context). Build with `pnpm install` and `pnpm build` from the repository root; tests run with `node --test test/*.test.mjs`. Upstream project: . +## Acknowledgements + +UI and interaction design draws on [dsh-context](https://github.com/bowenliang123/dsh-context), reimplemented for ZCode. Thanks to its author for sharing the project. + ## License [MIT](./LICENSE) diff --git a/external_plugins/zcode-context/README_CN.md b/external_plugins/zcode-context/README_CN.md index 3a507ae1..c1973566 100644 --- a/external_plugins/zcode-context/README_CN.md +++ b/external_plugins/zcode-context/README_CN.md @@ -63,6 +63,10 @@ 源码位于 [`ui-plugins/zcode-context/`](../../ui-plugins/zcode-context)。在仓库根目录执行 `pnpm install` 和 `pnpm build` 构建;测试用 `node --test test/*.test.mjs` 运行。上游项目:。 +## 致谢 + +界面与交互设计参考了 [dsh-context](https://github.com/bowenliang123/dsh-context),并针对 ZCode 重新实现。感谢原作者开源分享。 + ## 许可证 [MIT](./LICENSE)