minecodex 1.0.82 → 1.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.
@@ -0,0 +1,127 @@
1
+ // 与宿主共享语言;只翻译界面文案,保留用户标题、提示词和批注原文。
2
+ let locale = "en";
3
+ export function getLocale() {
4
+ return locale;
5
+ }
6
+ export function setLocale(value) {
7
+ const next = String(value ?? "").toLowerCase().startsWith("zh") ? "zh-CN" : "en";
8
+ if (next === locale) return false;
9
+ locale = next;
10
+ return true;
11
+ }
12
+ const zh = {
13
+ "Images": "图片",
14
+ "Images · Codex": "图片 · Codex",
15
+ "Show sidebar": "显示侧边栏",
16
+ "Refresh images": "刷新图片",
17
+ "Image library controls": "图片库控制",
18
+ "All images": "全部图片",
19
+ "Filter images by source": "按来源筛选图片",
20
+ "Grid columns": "网格列数",
21
+ "Group images by Thread": "按任务分组图片",
22
+ "Group by Thread": "按任务分组",
23
+ "No images yet": "暂无图片",
24
+ "Generate an image in any Task and it will appear here automatically.": "在任意任务中生成图片后,图片会自动显示在这里。",
25
+ "Generated images": "生成的图片",
26
+ "Generated image": "生成的图片",
27
+ "Image details": "图片详情",
28
+ "Close image details": "关闭图片详情",
29
+ "Close": "关闭",
30
+ "Image editor": "图片编辑器",
31
+ "Comment": "批注",
32
+ "Remove": "移除",
33
+ "Resize": "调整尺寸",
34
+ "Brush size": "画笔大小",
35
+ "Generation prompt": "生成提示词",
36
+ "Copy generation prompt": "复制生成提示词",
37
+ "Copy prompt": "复制提示词",
38
+ "Select an image to view its prompt.": "选择图片以查看生成提示词。",
39
+ "Information": "信息",
40
+ "Project": "项目",
41
+ "Thread": "任务",
42
+ "Created": "创建时间",
43
+ "Dimensions": "尺寸",
44
+ "File size": "文件大小",
45
+ "Open Thread": "打开任务",
46
+ "This Thread has been archived and can’t be opened.": "此任务已归档,无法打开。",
47
+ "Save as": "另存为",
48
+ "Original file": "原始文件",
49
+ "Work": "工作任务",
50
+ "Chat": "聊天",
51
+ "Chats": "聊天",
52
+ "Untitled chat": "未命名聊天",
53
+ "Untitled task": "未命名任务",
54
+ "Untitled work": "未命名工作任务",
55
+ "Could not load image sources": "无法加载图片来源",
56
+ "No images in this Thread": "此任务中暂无图片",
57
+ "Return to the library and choose another Thread.": "返回图片库并选择其他任务。",
58
+ "Choose another source or generate a new image in this Task.": "选择其他来源,或在此任务中生成新图片。",
59
+ "Could not load images": "无法加载图片",
60
+ "Could not check for new images": "无法检查新图片",
61
+ "This ChatGPT conversation cannot be opened from Images.": "无法从图片库打开此 ChatGPT 对话。",
62
+ "Open Thread unavailable: this Thread has been archived": "无法打开任务:此任务已归档",
63
+ "Open conversation unavailable": "无法打开对话",
64
+ "Original": "原始尺寸",
65
+ "Prompt is not available for this image.": "此图片暂无生成提示词。",
66
+ "Loading generation prompt…": "正在加载生成提示词…",
67
+ "Could not load image details": "无法加载图片详情",
68
+ "Prompt could not be loaded.": "无法加载提示词。",
69
+ "Could not refresh images": "无法刷新图片",
70
+ "Image refresh is already in progress.": "正在刷新图片。",
71
+ "Images refreshed.": "图片已刷新。",
72
+ "Prompt could not be copied.": "无法复制提示词。",
73
+ "Prompt copied": "提示词已复制",
74
+ "Copied": "已复制",
75
+ "Prompt copied.": "提示词已复制。",
76
+ "Saving…": "正在保存…",
77
+ "Could not save image": "无法保存图片",
78
+ "Saved": "已保存",
79
+ "Image saved.": "图片已保存。",
80
+ "Square": "正方形",
81
+ "Portrait": "竖幅",
82
+ "Story": "竖屏",
83
+ "Landscape": "横幅",
84
+ "Widescreen": "宽屏",
85
+ "Image editing is available inside Codex only.": "请在 Codex 中使用图片编辑。",
86
+ "Codex did not respond to the image edit request.": "Codex 未响应图片编辑请求。",
87
+ "Codex could not start the image edit.": "Codex 无法开始图片编辑。",
88
+ "The original image is not ready.": "原图尚未就绪。",
89
+ "Add at least one comment before sending.": "请至少添加一条批注后再发送。",
90
+ "Could not prepare the image edit.": "无法准备图片编辑。",
91
+ "Click on the image to add comments": "点击图片添加批注",
92
+ "Brush over what you want to remove": "涂抹要移除的区域",
93
+ "Send": "发送",
94
+ "Cancel": "取消",
95
+ "Undo": "撤销",
96
+ "Redo": "重做",
97
+ "Zoom to fit": "缩放至适合大小",
98
+ "Edit comment": "编辑批注",
99
+ "Delete comment": "删除批注",
100
+ "Save": "保存",
101
+ "Add comment": "添加批注",
102
+ "Add a comment…": "添加批注…",
103
+ "{source} · {count} images": "{source} · {count} 张图片",
104
+ "Open image from {source}, created {date}": "打开来自{source}的图片,创建于{date}",
105
+ "Open {title}, {count} images": "打开{title},共 {count} 张图片",
106
+ "{count} image": "{count} 张图片",
107
+ "{count} images": "{count} 张图片",
108
+ "No images in {source}": "{source}中暂无图片",
109
+ "{count} comment": "{count} 条批注",
110
+ "{count} comments": "{count} 条批注",
111
+ "Edit comment {number}": "编辑批注 {number}"
112
+ };
113
+ export function t(message, values = {}) {
114
+ const translated = locale === "zh-CN" ? zh[message] ?? message : message;
115
+ return translated.replace(/\{(\w+)\}/g, (match, key) => values[key] ?? match);
116
+ }
117
+ export function translateDocument(document) {
118
+ document.documentElement.lang = locale;
119
+ for (const element of document.querySelectorAll("[data-i18n]")) {
120
+ element.textContent = t(element.dataset.i18n);
121
+ }
122
+ for (const attribute of ["aria-label", "title", "placeholder"]) {
123
+ for (const element of document.querySelectorAll(`[data-i18n-${attribute}]`)) {
124
+ element.setAttribute(attribute, t(element.getAttribute(`data-i18n-${attribute}`)));
125
+ }
126
+ }
127
+ }
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>Images · Codex</title>
6
+ <title data-i18n="Images · Codex">Images · Codex</title>
7
7
  <link rel="stylesheet" href="/styles.css" />
8
8
  </head>
9
9
  <body>
@@ -11,14 +11,14 @@
11
11
  <section class="library-pane">
12
12
  <header class="library-header">
13
13
  <div class="identity">
14
- <button class="icon-button sidebar-open-button" type="button" aria-label="Show sidebar" title="Show sidebar" hidden>
14
+ <button class="icon-button sidebar-open-button" type="button" aria-label="Show sidebar" data-i18n-aria-label="Show sidebar" title="Show sidebar" data-i18n-title="Show sidebar" hidden>
15
15
  <svg class="sidebar-toggle-icon" viewBox="0 0 20 20" aria-hidden="true">
16
16
  <path d="M6.83496 3.99992C6.38353 4.00411 6.01421 4.0122 5.69824 4.03801C5.31232 4.06954 5.03904 4.12266 4.82227 4.20012L4.62207 4.28606C4.18264 4.50996 3.81498 4.85035 3.55859 5.26848L3.45605 5.45207C3.33013 5.69922 3.25006 6.01354 3.20801 6.52824C3.16533 7.05065 3.16504 7.71885 3.16504 8.66301V11.3271C3.16504 12.2712 3.16533 12.9394 3.20801 13.4618C3.25006 13.9766 3.33013 14.2909 3.45605 14.538L3.55859 14.7216C3.81498 15.1397 4.18266 15.4801 4.62207 15.704L4.82227 15.79C5.03904 15.8674 5.31234 15.9205 5.69824 15.9521C6.01398 15.9779 6.383 15.986 6.83398 15.9902L6.83496 3.99992ZM18.165 11.3271C18.165 12.2493 18.1653 12.9811 18.1172 13.5702C18.0745 14.0924 17.9916 14.5472 17.8125 14.9648L17.7295 15.1415C17.394 15.8 16.8834 16.3511 16.2568 16.7353L15.9814 16.8896C15.5157 17.1268 15.0069 17.2285 14.4102 17.2773C13.821 17.3254 13.0893 17.3251 12.167 17.3251H7.83301C6.91071 17.3251 6.17898 17.3254 5.58984 17.2773C5.06757 17.2346 4.61294 17.1508 4.19531 16.9716L4.01855 16.8896C3.36014 16.5541 2.80898 16.0434 2.4248 15.4169L2.27051 15.1415C2.03328 14.6758 1.93158 14.167 1.88281 13.5702C1.83468 12.9811 1.83496 12.2493 1.83496 11.3271V8.66301C1.83496 7.74072 1.83468 7.00898 1.88281 6.41985C1.93157 5.82309 2.03329 5.31432 2.27051 4.84856L2.4248 4.57317C2.80898 3.94666 3.36012 3.436 4.01855 3.10051L4.19531 3.0175C4.61285 2.83843 5.06771 2.75548 5.58984 2.71281C6.17898 2.66468 6.91071 2.66496 7.83301 2.66496H12.167C13.0893 2.66496 13.821 2.66468 14.4102 2.71281C15.0069 2.76157 15.5157 2.86329 15.9814 3.10051L16.2568 3.25481C16.8833 3.63898 17.394 4.19012 17.7295 4.84856L17.8125 5.02531C17.9916 5.44285 18.0745 5.89771 18.1172 6.41985C18.1653 7.00898 18.165 7.74072 18.165 8.66301V11.3271ZM8.16406 15.995H12.167C13.1112 15.995 13.7794 15.9947 14.3018 15.9521C14.8164 15.91 15.1308 15.8299 15.3779 15.704L15.5615 15.6015C15.9797 15.3451 16.32 14.9774 16.5439 14.538L16.6299 14.3378C16.7074 14.121 16.7605 13.8478 16.792 13.4618C16.8347 12.9394 16.835 12.2712 16.835 11.3271V8.66301C16.835 7.71885 16.8347 7.05065 16.792 6.52824C16.7605 6.14232 16.7073 5.86904 16.6299 5.65227L16.5439 5.45207C16.32 5.01264 15.9796 4.64498 15.5615 4.3886L15.3779 4.28606C15.1308 4.16013 14.8165 4.08006 14.3018 4.03801C13.7794 3.99533 13.1112 3.99504 12.167 3.99504H8.16406C8.16407 3.99667 8.16504 3.99829 8.16504 3.99992L8.16406 15.995Z"></path>
17
17
  </svg>
18
18
  </button>
19
- <h1>Images</h1>
19
+ <h1 data-i18n="Images">Images</h1>
20
20
  </div>
21
- <button class="icon-button rescan-button" type="button" aria-label="Refresh images" title="Refresh images">
21
+ <button class="icon-button rescan-button" type="button" aria-label="Refresh images" data-i18n-aria-label="Refresh images" title="Refresh images" data-i18n-title="Refresh images">
22
22
  <svg class="lucide refresh-icon" viewBox="0 0 24 24" aria-hidden="true">
23
23
  <path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"></path>
24
24
  <path d="M21 3v5h-5"></path>
@@ -31,7 +31,7 @@
31
31
  </button>
32
32
  </header>
33
33
 
34
- <nav class="library-toolbar" aria-label="Image library controls">
34
+ <nav class="library-toolbar" aria-label="Image library controls" data-i18n-aria-label="Image library controls">
35
35
  <div class="source-filter">
36
36
  <button
37
37
  class="toolbar-button source-filter-button"
@@ -41,17 +41,17 @@
41
41
  aria-expanded="false"
42
42
  >
43
43
  <span class="filter-source-icon" aria-hidden="true"></span>
44
- <span class="filter-label">All images</span>
44
+ <span class="filter-label" data-i18n="All images">All images</span>
45
45
  <span class="filter-count" aria-live="polite">…</span>
46
46
  <svg class="lucide filter-chevron" viewBox="0 0 24 24" aria-hidden="true">
47
47
  <path d="m6 9 6 6 6-6"></path>
48
48
  </svg>
49
49
  </button>
50
- <div class="source-menu" id="source-menu" role="listbox" aria-label="Filter images by source" hidden></div>
50
+ <div class="source-menu" id="source-menu" role="listbox" aria-label="Filter images by source" data-i18n-aria-label="Filter images by source" hidden></div>
51
51
  </div>
52
52
 
53
53
  <div class="toolbar-actions">
54
- <div class="density-control" title="Grid columns">
54
+ <div class="density-control" title="Grid columns" data-i18n-title="Grid columns">
55
55
  <svg class="lucide density-icon" viewBox="0 0 24 24" aria-hidden="true">
56
56
  <rect width="7" height="7" x="3" y="3" rx="1"></rect>
57
57
  <rect width="7" height="7" x="14" y="3" rx="1"></rect>
@@ -65,7 +65,7 @@
65
65
  max="6"
66
66
  step="1"
67
67
  value="3"
68
- aria-label="Grid columns"
68
+ aria-label="Grid columns" data-i18n-aria-label="Grid columns"
69
69
  />
70
70
  <output class="density-button-value" aria-live="polite">3</output>
71
71
  </div>
@@ -74,8 +74,8 @@
74
74
  class="icon-button group-button"
75
75
  type="button"
76
76
  aria-pressed="false"
77
- aria-label="Group images by Thread"
78
- title="Group by Thread"
77
+ aria-label="Group images by Thread" data-i18n-aria-label="Group images by Thread"
78
+ title="Group by Thread" data-i18n-title="Group by Thread"
79
79
  >
80
80
  <svg class="lucide" viewBox="0 0 24 24" aria-hidden="true">
81
81
  <path d="m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z"></path>
@@ -88,11 +88,11 @@
88
88
 
89
89
  <div class="library-scroll">
90
90
  <section class="empty-state" hidden>
91
- <h2>No images yet</h2>
92
- <p>Generate an image in any Task and it will appear here automatically.</p>
91
+ <h2 data-i18n="No images yet">No images yet</h2>
92
+ <p data-i18n="Generate an image in any Task and it will appear here automatically.">Generate an image in any Task and it will appear here automatically.</p>
93
93
  </section>
94
94
 
95
- <section class="image-grid" aria-label="Generated images"></section>
95
+ <section class="image-grid" aria-label="Generated images" data-i18n-aria-label="Generated images"></section>
96
96
  <div class="page-sentinel" aria-hidden="true" hidden></div>
97
97
  </div>
98
98
  </section>
@@ -109,8 +109,8 @@
109
109
  >
110
110
  <div class="drawer-surface">
111
111
  <header class="drawer-header">
112
- <h2 id="drawer-title">Image details</h2>
113
- <button class="icon-button drawer-close" type="button" aria-label="Close image details" title="Close">
112
+ <h2 id="drawer-title" data-i18n="Image details">Image details</h2>
113
+ <button class="icon-button drawer-close" type="button" aria-label="Close image details" data-i18n-aria-label="Close image details" title="Close" data-i18n-title="Close">
114
114
  <svg class="lucide" viewBox="0 0 24 24" aria-hidden="true">
115
115
  <path d="M18 6 6 18"></path>
116
116
  <path d="m6 6 12 12"></path>
@@ -119,13 +119,13 @@
119
119
  </header>
120
120
 
121
121
  <div class="drawer-scroll">
122
- <section class="image-editor" aria-label="Image editor">
122
+ <section class="image-editor" aria-label="Image editor" data-i18n-aria-label="Image editor">
123
123
  <div class="image-editor-controls" hidden>
124
124
  <div class="image-editor-toolbar">
125
125
  <div class="image-edit-actions" data-edit-actions>
126
- <button type="button" class="image-edit-action" data-edit-action="comment"><svg viewBox="0 0 20 20" data-native-image-icon="comment" aria-hidden="true"><path d="M10.02 6.70483C9.66589 6.70516 9.37778 6.9928 9.37778 7.34698V9.36292H7.36187C7.00755 9.36292 6.71983 9.65081 6.71973 10.005C6.71973 10.3595 7.00749 10.6473 7.36187 10.6473H9.37778V12.6644C9.37812 13.0184 9.666 13.3061 10.02 13.3065C10.3742 13.3065 10.6619 13.0186 10.6621 12.6644V10.6473H12.6792C13.0337 10.6473 13.3214 10.3595 13.3214 10.005C13.3213 9.65081 13.0336 9.36292 12.6792 9.36292H10.6621V7.34698C10.6621 6.9926 10.3743 6.70483 10.02 6.70483Z"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M9.9994 2.43188C5.62998 2.43188 2.02393 5.78683 2.02393 10.0003C2.02401 11.5112 2.49346 12.9166 3.29509 14.0943C3.29768 14.0982 3.29903 14.1028 3.29986 14.1051V14.1086L2.80334 16.0339C2.61585 16.7426 3.27268 17.3856 3.97781 17.1845L3.97901 17.1856L6.08567 16.5961L6.08806 16.5949H6.09164C7.24756 17.2136 8.58138 17.5676 9.9994 17.5676C14.3687 17.5676 17.9746 14.2136 17.9748 10.0003C17.9748 5.78683 14.3688 2.43188 9.9994 2.43188ZM9.9994 3.71617C13.7302 3.71617 16.6906 6.56372 16.6906 10.0003C16.6904 13.4369 13.7301 16.2845 9.9994 16.2845C8.79575 16.2845 7.66933 15.9853 6.69678 15.4645L6.6932 15.4622L6.58339 15.4109C6.3226 15.3028 6.02191 15.2753 5.72998 15.3619L4.19027 15.7928L4.54238 14.4285L4.54118 14.4273C4.64035 14.0542 4.55881 13.6756 4.36215 13.3818L4.35857 13.377L4.12224 13.0022C3.6023 12.1093 3.30829 11.087 3.30821 10.0003C3.30821 6.56372 6.26865 3.71617 9.9994 3.71617Z"></path></svg><span>Comment</span></button>
127
- <button type="button" class="image-edit-action" data-edit-action="remove"><svg viewBox="0 0 20 20" data-native-image-icon="remove" aria-hidden="true"><path d="M6.92077 0.123893C7.42924 -0.041319 7.97791 -0.0412761 8.48639 0.123893C8.80784 0.228404 9.08213 0.413537 9.36217 0.651236C9.63764 0.885089 9.95291 1.20057 10.3426 1.5903L11.1505 2.39811C11.5401 2.78778 11.8557 3.10237 12.0895 3.3778C12.3274 3.65799 12.5123 3.93273 12.6169 4.25436C12.7821 4.76279 12.782 5.31076 12.6169 5.81921C12.5123 6.14087 12.3274 6.41557 12.0895 6.69577C11.8557 6.97121 11.5402 7.28576 11.1505 7.67546L7.67546 11.1505C7.28576 11.5402 6.97122 11.8557 6.69577 12.0895C6.41557 12.3274 6.14087 12.5123 5.81921 12.6169C5.31076 12.782 4.76279 12.7821 4.25436 12.6169C3.93273 12.5123 3.65799 12.3274 3.3778 12.0895C3.10237 11.8557 2.78778 11.5401 2.39811 11.1505L1.5903 10.3426C1.20057 9.95291 0.885089 9.63764 0.651236 9.36217C0.413537 9.08213 0.228404 8.80784 0.123893 8.48639C-0.0412761 7.97791 -0.041319 7.42924 0.123893 6.92077C0.228432 6.59929 0.41349 6.32506 0.651236 6.04499C0.885121 5.76948 1.2005 5.45432 1.5903 5.06452L5.06452 1.5903C5.45432 1.2005 5.76949 0.885121 6.04499 0.651236C6.32506 0.41349 6.59929 0.228432 6.92077 0.123893ZM2.34264 5.81686C1.94043 6.21908 1.6614 6.49859 1.46217 6.73327C1.26715 6.963 1.17948 7.11482 1.13561 7.24967C1.03983 7.54445 1.03988 7.8627 1.13561 8.15749C1.17946 8.29233 1.26721 8.4442 1.46217 8.67389C1.66137 8.90854 1.94051 9.18816 2.34264 9.5903L3.15046 10.3981C3.55252 10.8002 3.83224 11.0794 4.06686 11.2786C4.29643 11.4734 4.44847 11.5605 4.58327 11.6044C4.87802 11.7001 5.19553 11.7001 5.4903 11.6044C5.62522 11.5605 5.77759 11.4737 6.00749 11.2786C6.24212 11.0794 6.52102 10.8002 6.92311 10.3981L6.95046 10.37L2.36999 5.78874L2.34264 5.81686ZM8.15749 1.13561C7.8627 1.03988 7.54445 1.03983 7.24967 1.13561C7.11482 1.17948 6.963 1.26715 6.73327 1.46217C6.49859 1.6614 6.21908 1.94043 5.81686 2.34264L3.12233 5.03639L7.70358 9.61686L10.3981 6.92311C10.8002 6.52102 11.0794 6.24212 11.2786 6.00749C11.4737 5.77759 11.5605 5.62522 11.6044 5.4903C11.7001 5.19553 11.7001 4.87802 11.6044 4.58327C11.5605 4.44847 11.4734 4.29643 11.2786 4.06686C11.0794 3.83224 10.8002 3.55252 10.3981 3.15046L9.5903 2.34264C9.18816 1.94051 8.90854 1.66137 8.67389 1.46217C8.4442 1.26721 8.29233 1.17946 8.15749 1.13561Z" transform="translate(2 2) scale(1.25)"></path></svg><span>Remove</span></button>
128
- <button type="button" class="image-edit-action" data-edit-action="resize" aria-haspopup="menu" aria-expanded="false"><svg viewBox="0 0 20 20" data-native-image-icon="resize" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.667 4.80762C15.6931 4.80779 16.5252 5.63994 16.5254 6.66602V13.333C16.5254 14.3592 15.6932 15.1912 14.667 15.1914H5.33301C4.30683 15.1912 3.47461 14.3592 3.47461 13.333V6.66602C3.47478 5.63994 4.30694 4.80779 5.33301 4.80762H14.667ZM5.33301 5.8584C4.88683 5.85857 4.52557 6.21984 4.52539 6.66602V8.99414C4.76984 8.87578 5.04327 8.80767 5.33301 8.80762H10.667C11.6931 8.80779 12.5252 9.63995 12.5254 10.666V13.333C12.5254 13.6232 12.4566 13.8969 12.3379 14.1416H14.667C15.1133 14.1414 15.4746 13.7793 15.4746 13.333V6.66602C15.4744 6.21984 15.1132 5.85857 14.667 5.8584H5.33301ZM5.33301 9.8584C4.88684 9.85857 4.52557 10.2198 4.52539 10.666V13.333C4.52539 13.7793 4.88673 14.1414 5.33301 14.1416H10.667C11.1133 14.1414 11.4746 13.7793 11.4746 13.333V10.666C11.4744 10.2198 11.1132 9.85857 10.667 9.8584H5.33301Z"></path></svg><span>Resize</span></button>
126
+ <button type="button" class="image-edit-action" data-edit-action="comment"><svg viewBox="0 0 20 20" data-native-image-icon="comment" aria-hidden="true"><path d="M10.02 6.70483C9.66589 6.70516 9.37778 6.9928 9.37778 7.34698V9.36292H7.36187C7.00755 9.36292 6.71983 9.65081 6.71973 10.005C6.71973 10.3595 7.00749 10.6473 7.36187 10.6473H9.37778V12.6644C9.37812 13.0184 9.666 13.3061 10.02 13.3065C10.3742 13.3065 10.6619 13.0186 10.6621 12.6644V10.6473H12.6792C13.0337 10.6473 13.3214 10.3595 13.3214 10.005C13.3213 9.65081 13.0336 9.36292 12.6792 9.36292H10.6621V7.34698C10.6621 6.9926 10.3743 6.70483 10.02 6.70483Z"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M9.9994 2.43188C5.62998 2.43188 2.02393 5.78683 2.02393 10.0003C2.02401 11.5112 2.49346 12.9166 3.29509 14.0943C3.29768 14.0982 3.29903 14.1028 3.29986 14.1051V14.1086L2.80334 16.0339C2.61585 16.7426 3.27268 17.3856 3.97781 17.1845L3.97901 17.1856L6.08567 16.5961L6.08806 16.5949H6.09164C7.24756 17.2136 8.58138 17.5676 9.9994 17.5676C14.3687 17.5676 17.9746 14.2136 17.9748 10.0003C17.9748 5.78683 14.3688 2.43188 9.9994 2.43188ZM9.9994 3.71617C13.7302 3.71617 16.6906 6.56372 16.6906 10.0003C16.6904 13.4369 13.7301 16.2845 9.9994 16.2845C8.79575 16.2845 7.66933 15.9853 6.69678 15.4645L6.6932 15.4622L6.58339 15.4109C6.3226 15.3028 6.02191 15.2753 5.72998 15.3619L4.19027 15.7928L4.54238 14.4285L4.54118 14.4273C4.64035 14.0542 4.55881 13.6756 4.36215 13.3818L4.35857 13.377L4.12224 13.0022C3.6023 12.1093 3.30829 11.087 3.30821 10.0003C3.30821 6.56372 6.26865 3.71617 9.9994 3.71617Z"></path></svg><span data-i18n="Comment">Comment</span></button>
127
+ <button type="button" class="image-edit-action" data-edit-action="remove"><svg viewBox="0 0 20 20" data-native-image-icon="remove" aria-hidden="true"><path d="M6.92077 0.123893C7.42924 -0.041319 7.97791 -0.0412761 8.48639 0.123893C8.80784 0.228404 9.08213 0.413537 9.36217 0.651236C9.63764 0.885089 9.95291 1.20057 10.3426 1.5903L11.1505 2.39811C11.5401 2.78778 11.8557 3.10237 12.0895 3.3778C12.3274 3.65799 12.5123 3.93273 12.6169 4.25436C12.7821 4.76279 12.782 5.31076 12.6169 5.81921C12.5123 6.14087 12.3274 6.41557 12.0895 6.69577C11.8557 6.97121 11.5402 7.28576 11.1505 7.67546L7.67546 11.1505C7.28576 11.5402 6.97122 11.8557 6.69577 12.0895C6.41557 12.3274 6.14087 12.5123 5.81921 12.6169C5.31076 12.782 4.76279 12.7821 4.25436 12.6169C3.93273 12.5123 3.65799 12.3274 3.3778 12.0895C3.10237 11.8557 2.78778 11.5401 2.39811 11.1505L1.5903 10.3426C1.20057 9.95291 0.885089 9.63764 0.651236 9.36217C0.413537 9.08213 0.228404 8.80784 0.123893 8.48639C-0.0412761 7.97791 -0.041319 7.42924 0.123893 6.92077C0.228432 6.59929 0.41349 6.32506 0.651236 6.04499C0.885121 5.76948 1.2005 5.45432 1.5903 5.06452L5.06452 1.5903C5.45432 1.2005 5.76949 0.885121 6.04499 0.651236C6.32506 0.41349 6.59929 0.228432 6.92077 0.123893ZM2.34264 5.81686C1.94043 6.21908 1.6614 6.49859 1.46217 6.73327C1.26715 6.963 1.17948 7.11482 1.13561 7.24967C1.03983 7.54445 1.03988 7.8627 1.13561 8.15749C1.17946 8.29233 1.26721 8.4442 1.46217 8.67389C1.66137 8.90854 1.94051 9.18816 2.34264 9.5903L3.15046 10.3981C3.55252 10.8002 3.83224 11.0794 4.06686 11.2786C4.29643 11.4734 4.44847 11.5605 4.58327 11.6044C4.87802 11.7001 5.19553 11.7001 5.4903 11.6044C5.62522 11.5605 5.77759 11.4737 6.00749 11.2786C6.24212 11.0794 6.52102 10.8002 6.92311 10.3981L6.95046 10.37L2.36999 5.78874L2.34264 5.81686ZM8.15749 1.13561C7.8627 1.03988 7.54445 1.03983 7.24967 1.13561C7.11482 1.17948 6.963 1.26715 6.73327 1.46217C6.49859 1.6614 6.21908 1.94043 5.81686 2.34264L3.12233 5.03639L7.70358 9.61686L10.3981 6.92311C10.8002 6.52102 11.0794 6.24212 11.2786 6.00749C11.4737 5.77759 11.5605 5.62522 11.6044 5.4903C11.7001 5.19553 11.7001 4.87802 11.6044 4.58327C11.5605 4.44847 11.4734 4.29643 11.2786 4.06686C11.0794 3.83224 10.8002 3.55252 10.3981 3.15046L9.5903 2.34264C9.18816 1.94051 8.90854 1.66137 8.67389 1.46217C8.4442 1.26721 8.29233 1.17946 8.15749 1.13561Z" transform="translate(2 2) scale(1.25)"></path></svg><span data-i18n="Remove">Remove</span></button>
128
+ <button type="button" class="image-edit-action" data-edit-action="resize" aria-haspopup="menu" aria-expanded="false"><svg viewBox="0 0 20 20" data-native-image-icon="resize" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.667 4.80762C15.6931 4.80779 16.5252 5.63994 16.5254 6.66602V13.333C16.5254 14.3592 15.6932 15.1912 14.667 15.1914H5.33301C4.30683 15.1912 3.47461 14.3592 3.47461 13.333V6.66602C3.47478 5.63994 4.30694 4.80779 5.33301 4.80762H14.667ZM5.33301 5.8584C4.88683 5.85857 4.52557 6.21984 4.52539 6.66602V8.99414C4.76984 8.87578 5.04327 8.80767 5.33301 8.80762H10.667C11.6931 8.80779 12.5252 9.63995 12.5254 10.666V13.333C12.5254 13.6232 12.4566 13.8969 12.3379 14.1416H14.667C15.1133 14.1414 15.4746 13.7793 15.4746 13.333V6.66602C15.4744 6.21984 15.1132 5.85857 14.667 5.8584H5.33301ZM5.33301 9.8584C4.88684 9.85857 4.52557 10.2198 4.52539 10.666V13.333C4.52539 13.7793 4.88673 14.1414 5.33301 14.1416H10.667C11.1133 14.1414 11.4746 13.7793 11.4746 13.333V10.666C11.4744 10.2198 11.1132 9.85857 10.667 9.8584H5.33301Z"></path></svg><span data-i18n="Resize">Resize</span></button>
129
129
  </div>
130
130
  <div class="image-edit-mode" data-edit-mode hidden></div>
131
131
  <button type="button" class="image-zoom-trigger" data-zoom-trigger aria-haspopup="menu" aria-expanded="false"><span data-zoom-value>100%</span><svg viewBox="0 0 20 20" data-zoom-chevron aria-hidden="true"><path d="m5.75 7.75 4.25 4.25 4.25-4.25"></path></svg></button>
@@ -133,13 +133,13 @@
133
133
  <div class="image-edit-menu" data-resize-menu role="menu" hidden></div>
134
134
  <div class="image-edit-menu image-zoom-menu" data-zoom-menu role="menu" hidden></div>
135
135
  </div>
136
- <figure class="drawer-figure image-editor-stage"><img alt="" decoding="async" /><canvas class="image-edit-mask" hidden></canvas><div class="image-comment-layer" hidden></div><div class="image-comment-popover" hidden></div><div class="image-brush-slider" hidden><input type="range" min="5" max="130" value="70" aria-label="Brush size" /></div></figure>
136
+ <figure class="drawer-figure image-editor-stage"><img alt="" decoding="async" /><canvas class="image-edit-mask" hidden></canvas><div class="image-comment-layer" hidden></div><div class="image-comment-popover" hidden></div><div class="image-brush-slider" hidden><input type="range" min="5" max="130" value="70" aria-label="Brush size" data-i18n-aria-label="Brush size" /></div></figure>
137
137
  </section>
138
138
 
139
139
  <section class="detail-section prompt-section">
140
140
  <div class="detail-section-heading">
141
- <h3>Generation prompt</h3>
142
- <button class="icon-button prompt-copy-button" type="button" aria-label="Copy generation prompt" title="Copy prompt" disabled>
141
+ <h3 data-i18n="Generation prompt">Generation prompt</h3>
142
+ <button class="icon-button prompt-copy-button" type="button" aria-label="Copy generation prompt" data-i18n-aria-label="Copy generation prompt" title="Copy prompt" data-i18n-title="Copy prompt" disabled>
143
143
  <svg class="lucide copy-icon" viewBox="0 0 24 24" aria-hidden="true">
144
144
  <rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect>
145
145
  <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path>
@@ -149,29 +149,29 @@
149
149
  </svg>
150
150
  </button>
151
151
  </div>
152
- <p class="drawer-prompt">Select an image to view its prompt.</p>
152
+ <p class="drawer-prompt" data-i18n="Select an image to view its prompt.">Select an image to view its prompt.</p>
153
153
  </section>
154
154
 
155
155
  <section class="detail-section">
156
- <h3>Information</h3>
156
+ <h3 data-i18n="Information">Information</h3>
157
157
  <dl class="image-information">
158
- <div class="drawer-project-row"><dt>Project</dt><dd class="drawer-project"></dd></div>
159
- <div><dt class="drawer-task-label">Thread</dt><dd class="drawer-thread"></dd></div>
160
- <div><dt>Created</dt><dd class="drawer-date"></dd></div>
161
- <div><dt>Dimensions</dt><dd class="drawer-size"></dd></div>
162
- <div><dt>File size</dt><dd class="drawer-file-size"></dd></div>
158
+ <div class="drawer-project-row"><dt data-i18n="Project">Project</dt><dd class="drawer-project"></dd></div>
159
+ <div><dt class="drawer-task-label" data-i18n="Thread">Thread</dt><dd class="drawer-thread"></dd></div>
160
+ <div><dt data-i18n="Created">Created</dt><dd class="drawer-date"></dd></div>
161
+ <div><dt data-i18n="Dimensions">Dimensions</dt><dd class="drawer-size"></dd></div>
162
+ <div><dt data-i18n="File size">File size</dt><dd class="drawer-file-size"></dd></div>
163
163
  </dl>
164
164
  </section>
165
165
  </div>
166
166
 
167
167
  <footer class="drawer-actions">
168
168
  <span class="source-action">
169
- <button class="secondary-button source-button" type="button">Open Thread</button>
170
- <span class="source-tooltip" id="archived-thread-tooltip" role="tooltip" hidden>
169
+ <button class="secondary-button source-button" type="button" data-i18n="Open Thread">Open Thread</button>
170
+ <span class="source-tooltip" id="archived-thread-tooltip" role="tooltip" hidden data-i18n="This Thread has been archived and can’t be opened.">
171
171
  This Thread has been archived and can’t be opened.
172
172
  </span>
173
173
  </span>
174
- <button class="primary-button save-button" type="button">Save as</button>
174
+ <button class="primary-button save-button" type="button" data-i18n="Save as">Save as</button>
175
175
  </footer>
176
176
  </div>
177
177
  </aside>
@@ -5,11 +5,13 @@ Codex Composer 原生模型选择器的轻量增强功能。它通过同级
5
5
 
6
6
  功能范围:
7
7
 
8
- - 把原生 Slider 左上角的 `Advanced` 改为当前模型名,并直接进入 Model 菜单;
8
+ - Codex 普通任务与 Work 沿用原生面板布局:上方思考强度、下方模型名,点击进入模型菜单;
9
9
  - 为第三方模型显示厂商图标、格式化模型名和 Provider 副文本;
10
10
  - 收藏常用 `provider/model`,保持原目录顺序;
11
11
  - 较长的模型列表保持紧凑、可滚动;
12
- - 保留 Codex 原生 reasoning Slider、Fast 闪电和真实选择状态。
12
+ - 所有模型共用 Slider,动态读取模型支持的思考档位;
13
+ - 沿用原生面板的间距、重置入口;仅实际支持 Fast 时显示闪电按钮;
14
+ - Chat/Temporary Chat 完全使用原生模型选择器,不注入增强面板或拦截模型菜单。
13
15
 
14
16
  ## 验证
15
17
 
@@ -20,10 +22,11 @@ npm test
20
22
  真实 UI 仅在隔离 profile 中验证:
21
23
 
22
24
  ```bash
23
- cd ../CodexRuntimeHost
25
+ CODEX_FEATURES_ROOT="$PWD/features" \
26
+ MINECODEX_ENABLED_FEATURES=model-slider \
24
27
  CODEX_RUNTIME_PROFILE_DIR="$HOME/.codex-model-slider/codex-profile" \
25
28
  CODEX_RUNTIME_CDP_PORT=9233 \
26
- npm start
29
+ node packages/runtime-host/src/main.mjs
27
30
  ```
28
31
 
29
32
  这是非官方 CDP / DOM Adapter 的功能声明。Codex 私有 DOM 的适配实现统一留在
@@ -3,7 +3,7 @@
3
3
  CodexNotes 是一个完全本地的 Codex 个人调用层:在当前对话右上角通过一个
4
4
  Notes Toolbar Button 快速查看 Todo、Prompts 和 Files;单个分区超过 5 条时才会
5
5
  显示 `View all`,并通过 RuntimeHost 在 Codex 原生右侧工作区打开互不重复、跟随
6
- 当前 Task 的完整 Tab;内部 capability 不可用时才回退到兼容 Tab host。
6
+ 当前 Task 的完整 Tab;内部 capability 不可用时显示明确错误。
7
7
 
8
8
  目标交互与 Codex 原生 Summary 一致:窄空间使用 `Toggle notes` Popover,
9
9
  宽空间使用 `Toggle pinned notes`,并在 `shift` / `gutter` 模式中参与对话
@@ -85,6 +85,9 @@ const STATIC_FILES = new Map([
85
85
  ["/", { file: "index.html", type: "text/html; charset=utf-8" }],
86
86
  ["/app.js", { file: "app.js", type: "text/javascript; charset=utf-8" }],
87
87
  ["/styles.css", { file: "styles.css", type: "text/css; charset=utf-8" }],
88
+ ["/i18n.mjs", { file: "i18n.mjs", type: "text/javascript; charset=utf-8" }],
89
+ ["/file-icons.mjs", { file: "file-icons.mjs", type: "text/javascript; charset=utf-8" }],
90
+ ["/todo-drag.mjs", { file: "todo-drag.mjs", type: "text/javascript; charset=utf-8" }],
88
91
  ...LUCIDE_ICON_NAMES.map((name) => [
89
92
  `/icons/${name}.svg`,
90
93
  {
@@ -178,6 +181,7 @@ function requestLocale(request) {
178
181
  }
179
182
 
180
183
  async function chooseFiles({ locale = "en" } = {}) {
184
+ if (process.platform === "win32") return chooseFilesWindows(locale);
181
185
  if (process.platform !== "darwin") {
182
186
  throw new ProductError("The system picker is currently available on macOS", {
183
187
  code: "PICKER_UNAVAILABLE",
@@ -201,6 +205,33 @@ async function chooseFiles({ locale = "en" } = {}) {
201
205
  }
202
206
  }
203
207
 
208
+ // Windows 系统文件选择器:WinForms OpenFileDialog(STA 必需)。
209
+ async function chooseFilesWindows(locale) {
210
+ const psSingleQuoted = (value) => "'" + String(value).replaceAll("'", "''") + "'";
211
+ const script = [
212
+ "[Console]::OutputEncoding = [System.Text.Encoding]::UTF8",
213
+ "Add-Type -AssemblyName System.Windows.Forms | Out-Null",
214
+ "$dialog = New-Object System.Windows.Forms.OpenFileDialog",
215
+ "$dialog.Title = " + psSingleQuoted(locale === "zh-CN" ? "选择要添加的文件" : "Choose files to add"),
216
+ "$dialog.Multiselect = $true",
217
+ "if ($dialog.ShowDialog() -eq [System.Windows.Forms.DialogResult]::OK) { $dialog.FileNames | ForEach-Object { [Console]::Out.WriteLine($_) } } else { [Console]::Out.Write('CANCELED') }",
218
+ ].join("; ");
219
+ try {
220
+ const { stdout } = await execFileAsync("powershell.exe", ["-NoProfile", "-STA", "-Command", script], {
221
+ maxBuffer: 1024 * 1024,
222
+ });
223
+ const output = String(stdout).trim();
224
+ if (output === "CANCELED") return { cancelled: true, paths: [] };
225
+ const paths = output.split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
226
+ return { cancelled: false, paths };
227
+ } catch (error) {
228
+ throw new ProductError("The system file picker could not be opened", {
229
+ code: "PICKER_FAILED",
230
+ status: 503,
231
+ });
232
+ }
233
+ }
234
+
204
235
  export async function revealFileInSystemManager(filePath, {
205
236
  platform = process.platform,
206
237
  executeFile = execFileAsync,